zhngzjn

clGetProgramInfo()  gives wrong Num_Devices ?

Discussion created by zhngzjn on Jun 5, 2010
Latest reply on Jun 5, 2010 by zhngzjn

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[i]=new char [np[i]]; err=clGetProgramInfo(program,CL_PROGRAM_BINARIES,numDevices,bn,NULL);

Outcomes