parallel.gpu.CUDAKernel() not working
조회 수: 14 (최근 30일)
이전 댓글 표시
I have written the following .cu code:
__global__ void addToVector(float * pi, float c, int vecLen) {
int idx = blockIdx.x * blockDim.x + threadIdx.x;
if ( idx < vecLen ) {
pi[idx] += c;
}
}
after then I compiled it with :
nvcc -ptx code.cu //which generates a code.ptx file
The problem is that when I use above files to make kernel object, by
k = parallel.gpu.CUDAKernel('code.ptx','code.cu')
then following message occurs:
??? Error using ==> iParseToken at 266
Unsupported type in argument specification "fahad.cu".
Error in ==>
/usr/local*/Matlab/2011a/toolbox/distcomp/gpu/+parallel/+internal/+gpu/handleKernelArgs.p>iParseCPrototype at 192
Error in ==>
/usr/local/Matlab/2011a/toolbox/distcomp/gpu/+parallel/+internal/+gpu/handleKernelArgs.p>handleKernelArgs at 79
Note that there is no problem with hardware or drivers. gpuarray command works fine.
Would anybody help me in this regard !
댓글 수: 0
답변 (1개)
Edric Ellis
2011년 11월 28일
CUDAKernel is very restrictive about precisely which types of argument it accepts; in particular, it only accepts basic "C" types (and const/pointer variants). Do you have any other _global_ entry points in the .cu file that you compiled to .ptx?
댓글 수: 2
Edric Ellis
2011년 11월 29일
I'm not sure, but it looks like you're using a CUDA-4 compiler and R2011a. R2011a shipped with the CUDA 3.2 toolkit, so you might have better luck using that version of NVCC.
참고 항목
카테고리
Help Center 및 File Exchange에서 GPU Computing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!