vandop
May 10, 2010, 12:23pm
1
Hi,
I’m a newbie here and I’m trying to figure out an error in my kernel, I got this log:
ptxas application ptx input, line 17; fatal : Parsing error near '.str': syntax error
ptxas fatal : Ptx assembly aborted due to errors
error : Ptx compilation failed: gpu='sm_13', device code='anonymous_jit_identity'
: Retrieving binary for 'anonymous_jit_identity', for gpu='sm_13', usage mode=''
: Considering profile 'compute_10' for gpu='sm_13' in 'anonymous_jit_identity'
: Control flags for 'anonymous_jit_identity' disable search path
: Ptx binary found for 'anonymous_jit_identity', architecture='compute_10'
: Ptx compilation for 'anonymous_jit_identity', for gpu='sm_13', ocg options=''
Here my kernel:
#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable
__kernel void OutputTest(__global char* outBuf, int sizeX, int sizeY) {
unsigned int idx = get_global_id(0);
if(idx >= sizeX)
return;
outBuf[idx*sizeX] = "Hello me\n";
}
Thank you for your help:)
The error message may not be the best one to describe the actual error. The problem is that outBut[idxsizeX] is of type ‘char’, while “Hello me\n” is of type char . This should be and error in ordinary old-school host C code as well. OpenCL it not intended to work with strings, but what you want could be achieved with something like
outBuf[idx*sizeX + 0] = 'H';
outBuf[idx*sizeX + 1] = 'e';
outBuf[idx*sizeX + 2] = 'l';
.
.
.
outBuf[idx*sizeX + 8] = '\n';
outBuf[idx*sizeX + 9] = 0;
The error message may not be the best one to describe the actual error. The problem is that outBut[idxsizeX] is of type ‘char’, while “Hello me\n” is of type char . This should be and error in ordinary old-school host C code as well. OpenCL it not intended to work with strings, but what you want could be achieved with something like
outBuf[idx*sizeX + 0] = 'H';
outBuf[idx*sizeX + 1] = 'e';
outBuf[idx*sizeX + 2] = 'l';
.
.
.
outBuf[idx*sizeX + 8] = '\n';
outBuf[idx*sizeX + 9] = 0;
Oh thank you for your help. I was fixed on multidimensional array yet, and I forget to change the way I wrote to buffer, The compile error is not very helpful its true:\
Thank you:)