cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

zhngzjn
Journeyman III

clGetProgramInfo() gives wrong Num_Devices ?

Hi all.

I use clGetProgramInfo like this : 

 

I have only one device, but the first line returns 4 .

And the 2nd and 3rd clGetProgramInfo()s give np[0] and bn[0] only. np[1~3] and bn[1~3]  are invalid values. If I change the 3rd param of the calls to "1", a CL_INVALID_VALUE error would occur. 

Does Anybody know why ? What does the "4" mean ?

err=clGetProgramInfo(program,CL_PROGRAM_NUM_DEVICES,NULL,NULL,&numDevices); size_t *np =new size_t[numDevices]; err=clGetProgramInfo(program,CL_PROGRAM_BINARY_SIZES,numDevices,np,NULL); char * * bn= new char * bn[numDevices]; for (int i=0;i<numDevices;i++) bn=new char [np]; err=clGetProgramInfo(program,CL_PROGRAM_BINARIES,numDevices,bn,NULL);

0 Likes
3 Replies
nou
Exemplar

it return size in bytes.

0 Likes

I don't quite understand .

Would you give me any advices on how to get program binary ?

Or any sample codes?

0 Likes

I got it .

Thanks a lot

0 Likes