Matlab and GPU Running a cuda code on matlab

Hi everyone,

I’m doing a simulation on Matlab. I wrote a kernel code on cuda and try to run in matlab. My code is like that :

global Kernel;

% Preparation of Kernel

nvcc (‘example.cu’)

Kernel = parallel.gpu.CUDAKernel(‘example.ptx’,‘example.cu’);

Kernel.ThreadBlockSize=[64 2 1];

Kernel.GridSize=

h_Array _Input = (reshape (single (samples),1,size));

d_In=gpuArray (h_Array _Input);

o=feval (Kernel,d_In,-1);

Out=gather (o);

This code is working. But I want to divide size by 2 and calculate with 2 kernel at same time becausee I have 2 gpu cores. When I generate second kernel, I lose datas of first one.

How can I run two gpu at same time?

Thanks

This is a duplicate post of The Official NVIDIA Forums | NVIDIA (moderators should delete this one)