User`s guide

9 GPU Computing
9-30
4
Before you run the kernel, set the number of threads correctly for the vectors you
want to add.
N = 128;
k.ThreadBlockSize = N;
in1 = ones(N,1,'gpuArray');
in2 = ones(N,1,'gpuArray');
result = feval(k,in1,in2);
Example with CU and PTX Files
For an example that shows how to work with CUDA, and provides CU and PTX files
for you to experiment with, see Illustrating Three Approaches to GPU Computing: The
Mandelbrot Set.