我有一张NVidia GTX 970卡,正在做一些OpenCL。我使用clGetDeviceInfo获取一些值,奇怪的是,我的最大工作量只有13。 (CL_DEVICE_MAX_WORK_GROUP_SIZE = 13)。是不应该是512或1024?这是我的代码:
int queryInt;
int queryDim[3] = {0,0,0};
cl_int clError;
clError = clGetDeviceInfo(device, CL_DEVICE_NAME, sizeof(queryBuffer), &queryBuffer, NULL);
printf("CL_DEVICE_NAME: %s\n", queryBuffer);
queryBuffer[0] = '\0';
clError = clGetDeviceInfo(device, CL_DEVICE_VENDOR, sizeof(queryBuffer), &queryBuffer, NULL);
printf("CL_DEVICE_VENDOR: %s\n", queryBuffer);
queryBuffer[0] = '\0';
clError = clGetDeviceInfo(device, CL_DRIVER_VERSION, sizeof(queryBuffer), &queryBuffer, NULL);
printf("CL_DRIVER_VERSION: %s\n", queryBuffer);
queryBuffer[0] = '\0';
clError = clGetDeviceInfo(device, CL_DEVICE_VERSION, sizeof(queryBuffer), &queryBuffer, NULL);
printf("CL_DEVICE_VERSION: %s\n", queryBuffer);
queryBuffer[0] = '\0';
clError = clGetDeviceInfo(device, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(int), &queryInt, NULL);
printf("CL_DEVICE_MAX_COMPUTE_UNITS: %d\n", queryInt);
clError = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(int), &queryInt, NULL);
printf("CL_DEVICE_MAX_WORK_GROUP_SIZE: %d\n", queryInt);
max_work_items = queryInt;
clError = clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, 3*sizeof(int), queryDim, NULL);
printf("CL_DEVICE_MAX_WORK_ITEM_SIZES: (%d %d %d)\n", queryDim[0], queryDim[1], queryDim[2]);
结果:
CL_DEVICE_NAME: GeForce GTX 970
CL_DEVICE_VENDOR: NVIDIA Corporation
CL_DRIVER_VERSION: 346.59
CL_DEVICE_VERSION: OpenCL 1.1 CUDA
CL_DEVICE_MAX_COMPUTE_UNITS: 13
CL_DEVICE_MAX_WORK_GROUP_SIZE: 13
CL_DEVICE_MAX_WORK_ITEM_SIZES: (0 0 0)