This chapter demonstrated the concepts of programming in PyCUDA. It started with the development of a simple Hello, PyCUDA program using PyCUDA. The concepts of kernel definition in C or C++ and calling it from Python code and the API for accessing GPU device properties from a PyCUDA program were discussed in detail. The execution mechanism for multiple threads and blocks in a PyCUDA program was explained with a simple program. The basic structure of a PyCUDA program was described with a simple example of an array addition. The simplification of PyCUDA code was described by using directives from a driver class. The use of CUDA events to measure the performance of the PyCUDA programs was explained in detail. The functionality of the inout directive of the driver class and the gpuarray class was explained using an element-wise squaring example. The gpuarray class was used...
United States
United Kingdom
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Argentina
Austria
Belgium
Bulgaria
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
Greece
Hungary
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Singapore
Slovakia
Slovenia
South Africa
South Korea
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine