CL_DEVICE_MAX_COMPUTE_UNITS on Geforce 310m!

Hello,
I have Sony Vaio VPCCW21FX laptop with Geforce 310m graphics card installed, which specs says it has 16 CUDA cores… but when I run the clGetDeviceInfo OpenCL function with the param_name CL_DEVICE_MAX_COMPUTE_UNITS, it shows that it only has 2 cores!!

That’s my code:

cl_int * err=(cl_int *)clGetDeviceInfo(devices[0],CL_DEVICE_MAX_COMPUTE_UNITS,0,0
,&nDeviceDescriptorSize);
cl_uint * maxCores = (cl_uint *)malloc(nDeviceDescriptorSize);
err=(cl_int *)clGetDeviceInfo(devices[0],CL_DEVICE_MAX_COMPUTE_UNITS,nDe
viceDescriptorSize,maxCores,0);
if(err==CL_SUCCESS)
cout<<"The maximum compute cores = "<<maxCores[0]<<endl;

where devices[0] is the ID of my GPU device…

I’m not sure why this might happen!

Hello,
I have Sony Vaio VPCCW21FX laptop with Geforce 310m graphics card installed, which specs says it has 16 CUDA cores… but when I run the clGetDeviceInfo OpenCL function with the param_name CL_DEVICE_MAX_COMPUTE_UNITS, it shows that it only has 2 cores!!

That’s my code:

cl_int * err=(cl_int *)clGetDeviceInfo(devices[0],CL_DEVICE_MAX_COMPUTE_UNITS,0,0
,&nDeviceDescriptorSize);
cl_uint * maxCores = (cl_uint *)malloc(nDeviceDescriptorSize);
err=(cl_int *)clGetDeviceInfo(devices[0],CL_DEVICE_MAX_COMPUTE_UNITS,nDe
viceDescriptorSize,maxCores,0);
if(err==CL_SUCCESS)
cout<<"The maximum compute cores = "<<maxCores[0]<<endl;

where devices[0] is the ID of my GPU device…

I’m not sure why this might happen!

I’m not sure if my question is wrong or trivial but I’m an OpenCL beginner :$

I’m not sure if my question is wrong or trivial but I’m an OpenCL beginner :$

Compute units and cores are not the same thing. A compute unit is a collection of cores, 8 in your case.

Compute units and cores are not the same thing. A compute unit is a collection of cores, 8 in your case.

Thanks very much! but is there a way to query my GPU cores using opencl?

Thanks very much! but is there a way to query my GPU cores using opencl?

Looking at oclDeviceQuery from CUDA toolkit:

[codebox]cl_uint compute_units;

clGetDeviceInfo(device, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(compute_units), &compute_units, NULL);

shrLogEx(iLogMode, 0, " CL_DEVICE_MAX_COMPUTE_UNITS:\t\t%u\n", compute_units);

cl_uint compute_capability_major, compute_capability_minor;

clGetDeviceInfo(device, CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV, sizeof(cl_uint), &compute_capability_major, NULL);

clGetDeviceInfo(device, CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV, sizeof(cl_uint), &compute_capability_minor, NULL);

shrLogEx(iLogMode, 0, “\n CL_DEVICE_COMPUTE_CAPABILITY_NV:\t%u.%u\n”, compute_capability_major, compute_capability_minor);

shrLogEx(iLogMode, 0, " NUMBER OF MULTIPROCESSORS:\t\t%u\n", compute_units); // this is the same value reported by CL_DEVICE_MAX_COMPUTE_UNITS

shrLogEx(iLogMode, 0, " NUMBER OF CUDA CORES:\t\t\t%u\n", nGpuArchCoresPerSM[compute_capability_major] * compute_units);

[/codebox]

Looking at oclDeviceQuery from CUDA toolkit:

[codebox]cl_uint compute_units;

clGetDeviceInfo(device, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(compute_units), &compute_units, NULL);

shrLogEx(iLogMode, 0, " CL_DEVICE_MAX_COMPUTE_UNITS:\t\t%u\n", compute_units);

cl_uint compute_capability_major, compute_capability_minor;

clGetDeviceInfo(device, CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV, sizeof(cl_uint), &compute_capability_major, NULL);

clGetDeviceInfo(device, CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV, sizeof(cl_uint), &compute_capability_minor, NULL);

shrLogEx(iLogMode, 0, “\n CL_DEVICE_COMPUTE_CAPABILITY_NV:\t%u.%u\n”, compute_capability_major, compute_capability_minor);

shrLogEx(iLogMode, 0, " NUMBER OF MULTIPROCESSORS:\t\t%u\n", compute_units); // this is the same value reported by CL_DEVICE_MAX_COMPUTE_UNITS

shrLogEx(iLogMode, 0, " NUMBER OF CUDA CORES:\t\t\t%u\n", nGpuArchCoresPerSM[compute_capability_major] * compute_units);

[/codebox]

Thanks a lot for your answer I’ll try it

Thanks a lot for your answer I’ll try it

Hi there. Pretty new to OpenCL and CUDA and I have been trying to query the number of cores as well. I found this thread and tried it and was able to obtain the compute capability major and minor numbers on Windows 7, but when I try on my MacBook Pro with a 330M, it returns 0 for both numbers. My MacPro with FX4800s returns -1 and 0.

Is this a known discrepancy between the OS X and Windows implementations? Or am I doing something wrong?

Hi there. Pretty new to OpenCL and CUDA and I have been trying to query the number of cores as well. I found this thread and tried it and was able to obtain the compute capability major and minor numbers on Windows 7, but when I try on my MacBook Pro with a 330M, it returns 0 for both numbers. My MacPro with FX4800s returns -1 and 0.

Is this a known discrepancy between the OS X and Windows implementations? Or am I doing something wrong?