Quantitative Analysis
Parallel Processing
Numerical Analysis
C++ Multithreading
Python for Excel
Python Utilities
Services
Author

I. Introduction into GPU programming.
1. What are GPU and CUDA?
2. Selecting GPU.
3. Setting up development environment.
4. Combined use of Cuda, C++ and boost::python.
5. Debugging of boost::python binary using Visual Studio.
6. Debugging of boost::python/Cuda binary using Visual Studio.
7. Using printf in device code.
II. Exception safe dynamic memory handling in Cuda project.
III. Calculation of partial sums in parallel.
IV. Manipulation of piecewise polynomial functions in parallel.
V. Manipulation of localized piecewise polynomial functions in parallel.
Downloads. Index. Contents.

Using printf in device code.


o use the printf facility one needs to have a device of compute capability of 2.0 or higher.

Go to "Project properties"/"CUDA runtime API"/GPU and change "GPU Architecture" to sm_20.

Include the code

#if defined (__CUDA_ARCH__) && (__CUDA_ARCH__ < 200)

#define printf(f, ...) ((void)(f, __VA_ARGS__),0)

#endif

before the first call to printf in __device__ code and #include "stdio.h".

An example may be found the file "OTSProjects/ots/cuda/deviceOutput.hpp".





Downloads. Index. Contents.


















Copyright 2007