Cuda PTX kernel function boolean argument not supported?
Ältere Kommentare anzeigen
Hello,
i have a cuda kernel function:
__global__ void backprop_float(float* holo, const float* inputs, int spotn, const int holoWidth, const int holoHeight, bool addcorr)
when i try to create the kernel object in matlab:
backpropk=parallel.gpu.CUDAKernel('backprop_kernels.ptx', 'backprop_kernels.cu','backprop_float');
I get the following error:
__Error using iCheckPTXEntryAgainstCProto (line 420)
Found invalid mapping type < logical, .u8 >__
if i change the type of the last function parameter bool addcorr to int, matlab creates the kernel object succesfully.
(i use matlab r2012a, vstudio2008, cuda toolkit v4.2 card is a gtx 560ti)
2 Kommentare
Ben Tordoff
am 12 Sep. 2012
I've just tried compiling a variety of kernels for a variety of target architectures and with multiple toolkit versions. Boolean arguments always seem to get mapped to "s8" (signed 8-bit integers) for me. For example:
__global__
void myKernel(float* out, const float* in, bool flag)
becomes
.entry _Z8myKernelPfPKfb (
.param .u64 __cudaparm__Z8myKernelPfPKfb_out,
.param .u64 __cudaparm__Z8myKernelPfPKfb_in,
.param .s8 __cudaparm__Z8myKernelPfPKfb_flag)
This is the mapping that MATLAB is expecting. It looks like you are getting "u8" (unsigned 8-bit integer) as the boolean type. Could you show me the exact NVCC command you used to generate this and also add the PTX ".entry" corresponding to the CUDA function so that I can work out why you're getting this different type mapping?
Thanks.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu GPU Computing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!