| … | … | @@ -57,78 +57,147 @@ typedef cl_float4 cl_real4; |
| 57 | 57 | #endif |
| 58 | 58 | |
| 59 | 59 | #ifndef DEVICE_DETECT_DEBUG |
| 60 | | #define DEVICE_DETECT_DEBUG 1 |
| 60 | #define DEVICE_DETECT_DEBUG 0 |
| 61 | 61 | #endif |
| 62 | 62 | |
| 63 | 63 | #ifdef HAVE_OPENCL |
| 64 | 64 | void GPUInit(cl_context *context, cl_command_queue *queue, int *device_type, cl_program *program, char *filename, char *addlibsource) { |
| 65 | | printf("============== Hardware detection report ===============\n"); |
| 65 | if (DEVICE_DETECT_DEBUG){ |
| 66 | printf("============== Hardware detection report ===============\n"); |
| 67 | } |
| 66 | 68 | |
| 67 | | cl_platform_id* platform; |
| 69 | cl_platform_id* platforms; |
| 70 | cl_platform_id platform = NULL; |
| 68 | 71 | cl_uint num_platforms; |
| 69 | 72 | cl_uint num_devices; |
| 70 | | cl_device_id* device; |
| 73 | cl_device_id* devices; |
| 74 | int *device_appropriate; |
| 75 | int device_selected = -99; |
| 76 | cl_int platform_selected = -1; |
| 71 | 77 | //cl_program program; |
| 72 | 78 | cl_int error = 0; |
| 73 | 79 | |
| 74 | 80 | error = clGetPlatformIDs(0, NULL, &num_platforms); |
| 75 | | printf("\nGPUInit: %d opencl platform(s) detected\n",num_platforms); |
| 76 | | if(error != CL_SUCCESS) { |
| 77 | | printf("Error getting number of platforms\n"); |
| 78 | | exit(error); |
| 81 | if (DEVICE_DETECT_DEBUG){ |
| 82 | printf("\nGPUInit: %d opencl platform(s) detected\n",num_platforms); |
| 79 | 83 | } |
| 80 | | platform = (cl_platform_id*)malloc(num_platforms*sizeof(cl_platform_id)); |
| 81 | | error = clGetPlatformIDs(num_platforms, platform, 0); |
| 82 | 84 | if(error != CL_SUCCESS) { |
| 83 | | printf("Error getting platform id\n"); |
| 84 | | exit(error); |
| 85 | printf("GPU_INIT: Error with clGetPlatformIDs call in file %s at line %d\n", __FILE__, __LINE__); |
| 86 | if (error == CL_INVALID_VALUE){ |
| 87 | printf("GPU_INIT: Invalid value in clGetPlatformID call\n"); |
| 88 | } |
| 89 | exit(error); |
| 90 | } |
| 91 | if (num_platforms == 0) { |
| 92 | printf("GPU_INIT: Error -- No opencl platforms detected in file %s at line %d\n", __FILE__, __LINE__); |
| 93 | exit(-1); |
| 94 | } |
| 95 | if (DEVICE_DETECT_DEBUG){ |
| 96 | printf("\n\nGPU_INIT: %d opencl platform(s) detected\n",num_platforms); |
| 97 | } |
| 98 | |
| 99 | platforms = (cl_platform_id*)malloc(num_platforms*sizeof(cl_platform_id)); |
| 100 | error = clGetPlatformIDs(num_platforms, platforms, NULL); |
| 101 | if (error != CL_SUCCESS){ |
| 102 | printf("GPU_INIT: Error with clGetPlatformIDs call in file %s at line %d\n", __FILE__, __LINE__); |
| 103 | if (error == CL_INVALID_VALUE){ |
| 104 | printf("Invalid value in clGetPlatformID call\n"); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | if (DEVICE_DETECT_DEBUG){ |
| 109 | char info[1024]; |
| 110 | for (uint iplatform=0; iplatform<num_platforms; iplatform++){ |
| 111 | printf(" Platform %d:\n",iplatform+1); |
| 112 | |
| 113 | //clGetPlatformInfo(platforms[iplatform],CL_PLATFORM_PROFILE, 1024L,info,0); |
| 114 | //printf(" CL_PLATFORM_PROFILE : %s\n",info); |
| 115 | |
| 116 | clGetPlatformInfo(platforms[iplatform],CL_PLATFORM_VERSION, 1024L,info,0); |
| 117 | printf(" CL_PLATFORM_VERSION : %s\n",info); |
| 118 | |
| 119 | clGetPlatformInfo(platforms[iplatform],CL_PLATFORM_NAME, 1024L,info,0); |
| 120 | printf(" CL_PLATFORM_NAME : %s\n",info); |
| 121 | |
| 122 | clGetPlatformInfo(platforms[iplatform],CL_PLATFORM_VENDOR, 1024L,info,0); |
| 123 | printf(" CL_PLATFORM_VENDOR : %s\n",info); |
| 124 | |
| 125 | //clGetPlatformInfo(platforms[iplatform],CL_PLATFORM_EXTENSIONS,1024L,info,0); |
| 126 | //printf(" CL_PLATFORM_EXTENSIONS : %s\n",info); |
| 127 | } |
| 128 | printf("\n"); |
| 85 | 129 | } |
| 130 | |
| 86 | 131 | char info[1024]; |
| 87 | | clGetPlatformInfo(platform[0],CL_PLATFORM_VENDOR, 1024, info, 0); |
| 132 | clGetPlatformInfo(platforms[0],CL_PLATFORM_VENDOR, 1024, info, 0); |
| 88 | 133 | |
| 89 | | error = clGetDeviceIDs(platform[0], CL_DEVICE_TYPE_GPU, 0, NULL, &num_devices); |
| 90 | | if (error != CL_SUCCESS) error = clGetDeviceIDs(platform[0], CL_DEVICE_TYPE_ACCELERATOR, 0, NULL, &num_devices); |
| 91 | | if(error != CL_SUCCESS) { |
| 92 | | printf("Error getting device ids1\n"); |
| 93 | | exit(error); |
| 134 | // Get the number of devices, allocate, and get the devices |
| 135 | for (uint iplatform=0; iplatform<num_platforms; iplatform++){ |
| 136 | error = clGetDeviceIDs(platforms[iplatform],CL_DEVICE_TYPE_GPU,0,NULL,&num_devices); |
| 137 | if (error == CL_DEVICE_NOT_FOUND) { |
| 138 | if (DEVICE_DETECT_DEBUG) { |
| 139 | printf("Warning: Device of requested type not found for platform %d in clGetDeviceID call\n",iplatform); |
| 140 | } |
| 141 | continue; |
| 142 | } |
| 143 | if (error != CL_SUCCESS) { |
| 144 | /* Possible Errors |
| 145 | * CL_INVALID_PLATFORM: |
| 146 | * CL_INVALID_DEVICE_TYPE: |
| 147 | * CL_INVALID_VALUE: |
| 148 | * CL_DEVICE_NOT_FOUND: |
| 149 | */ |
| 150 | printf("GPU_INIT clGetDeviceIDs error %d file %s line %d\n", error, __FILE__, __LINE__); |
| 151 | } |
| 152 | if (DEVICE_DETECT_DEBUG){ |
| 153 | printf("GPU_INIT: %d opencl devices(s) detected\n",num_devices); |
| 154 | } |
| 155 | platform_selected = iplatform; |
| 156 | platform = platforms[iplatform]; |
| 157 | //nDevices_selected = nDevices; |
| 94 | 158 | } |
| 95 | | device = (cl_device_id*)malloc(num_devices*sizeof(cl_device_id)); |
| 159 | |
| 160 | if (platform_selected == -1){ |
| 161 | printf("Warning: Device of requested type not found in clGetDeviceID call\n"); |
| 162 | exit(-1); |
| 163 | } |
| 164 | |
| 165 | devices = (cl_device_id*)malloc(num_devices*sizeof(cl_device_id)); |
| 166 | device_appropriate = malloc(num_devices*sizeof(int)); |
| 96 | 167 | |
| 97 | | error = clGetDeviceIDs(platform[0], CL_DEVICE_TYPE_GPU, num_devices, device, 0); |
| 98 | | if(error != CL_SUCCESS) error = clGetDeviceIDs(platform[0], CL_DEVICE_TYPE_ACCELERATOR, num_devices, device, 0); |
| 168 | error = clGetDeviceIDs(platforms[platform_selected], CL_DEVICE_TYPE_GPU, num_devices, devices, NULL); |
| 99 | 169 | if(error != CL_SUCCESS) { |
| 100 | 170 | printf("Error getting device ids\n"); |
| 101 | 171 | exit(error); |
| 102 | 172 | } |
| 103 | | |
| 104 | | // char platform_info[1024]; |
| 105 | | for (int iplatform=0; iplatform<num_platforms; iplatform++){ |
| 106 | | printf(" Platform %d:\n",iplatform+1); |
| 107 | | |
| 108 | | //clGetPlatformInfo(platform[iplatform],CL_PLATFORM_PROFILE, 1024L,info,0); |
| 109 | | //printf(" CL_PLATFORM_PROFILE : %s\n",info); |
| 110 | | |
| 111 | | clGetPlatformInfo(platform[iplatform],CL_PLATFORM_VERSION, 1024L,info,0); |
| 112 | | printf(" CL_PLATFORM_VERSION : %s\n",info); |
| 113 | | |
| 114 | | clGetPlatformInfo(platform[iplatform],CL_PLATFORM_NAME, 1024L,info,0); |
| 115 | | printf(" CL_PLATFORM_NAME : %s\n",info); |
| 116 | | |
| 117 | | clGetPlatformInfo(platform[iplatform],CL_PLATFORM_VENDOR, 1024L,info,0); |
| 118 | | printf(" CL_PLATFORM_VENDOR : %s\n",info); |
| 119 | | |
| 120 | | //clGetPlatformInfo(platform[iplatform],CL_PLATFORM_EXTENSIONS,1024L,info,0); |
| 121 | | //printf(" CL_PLATFORM_EXTENSIONS : %s\n",info); |
| 173 | |
| 174 | int idevice_appropriate = 0; |
| 175 | for (uint idevice=0; idevice<num_devices; idevice++){ |
| 176 | device_appropriate[idevice] = device_double_support(devices[idevice]);; |
| 177 | if (device_appropriate[idevice] == 1){ |
| 178 | if (device_selected == -99) device_selected = idevice; |
| 179 | devices[idevice_appropriate] = devices[idevice]; |
| 180 | idevice_appropriate++; |
| 181 | } |
| 182 | if (DEVICE_DETECT_DEBUG){ |
| 183 | printf( " Device %d:\n", idevice+1); |
| 184 | device_info(devices[idevice]); |
| 185 | } |
| 122 | 186 | } |
| 123 | | |
| 187 | num_devices = idevice_appropriate; |
| 188 | |
| 124 | 189 | *device_type = VENDOR_UNKNOWN; |
| 125 | 190 | char *device_string[] = {"Unknown", "Nvidia", "Tesla K20Xm", "Tesla M2090", |
| 126 | 191 | "Tesla 2050/2070", "GeForce GT 650M", "ATI", "MIC"}; |
| 127 | 192 | |
| 128 | | printf("\n"); |
| 129 | | printf(" Device:\n"); |
| 130 | | clGetDeviceInfo(device[0], CL_DEVICE_NAME, sizeof(info), &info, NULL); |
| 131 | | printf(" CL_DEVICE_NAME : %s\n",info); |
| 193 | if (DEVICE_DETECT_DEBUG){ |
| 194 | printf("\n"); |
| 195 | printf(" Device:\n"); |
| 196 | } |
| 197 | clGetDeviceInfo(devices[0], CL_DEVICE_NAME, sizeof(info), &info, NULL); |
| 198 | if (DEVICE_DETECT_DEBUG){ |
| 199 | printf(" CL_DEVICE_NAME : %s\n",info); |
| 200 | } |
| 132 | 201 | |
| 133 | 202 | if (! strncmp(info,"Intel(R) Many Integrated Core",29) ) *device_type = MIC; |
| 134 | 203 | if (! strncmp(info,"Tesla K20Xm",11) ) *device_type = TESLA_K20Xm; |
| … | … | @@ -136,8 +205,10 @@ void GPUInit(cl_context *context, cl_command_queue *queue, int *device_type, cl_ |
| 136 | 205 | if (! strncmp(info,"Tesla 2050 / 2070",17) ) *device_type = TESLA_2050_2070; |
| 137 | 206 | if (! strncmp(info,"GeForce GT 650M",15) ) *device_type = GeFORCE_GT_650M; |
| 138 | 207 | |
| 139 | | clGetDeviceInfo(device[0], CL_DEVICE_VENDOR, sizeof(info), &info, NULL); |
| 140 | | printf(" CL_DEVICE_VENDOR : %s\n",info); |
| 208 | clGetDeviceInfo(devices[0], CL_DEVICE_VENDOR, sizeof(info), &info, NULL); |
| 209 | if (DEVICE_DETECT_DEBUG){ |
| 210 | printf(" CL_DEVICE_VENDOR : %s\n",info); |
| 211 | } |
| 141 | 212 | |
| 142 | 213 | if (*device_type == VENDOR_UNKNOWN){ |
| 143 | 214 | if (! strncmp(info,"ATI",5) ) *device_type = ATI; |
| … | … | @@ -145,24 +216,35 @@ void GPUInit(cl_context *context, cl_command_queue *queue, int *device_type, cl_ |
| 145 | 216 | } |
| 146 | 217 | |
| 147 | 218 | size_t isize; |
| 148 | | clGetDeviceInfo(device[0], CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(isize), &isize, NULL); |
| 149 | | printf(" CL_DEVICE_MAX_WORK_GROUP_SIZE : %lu\n",isize); |
| 150 | | printf("\n"); |
| 219 | clGetDeviceInfo(devices[0], CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(isize), &isize, NULL); |
| 220 | if (DEVICE_DETECT_DEBUG){ |
| 221 | printf(" CL_DEVICE_MAX_WORK_GROUP_SIZE : %lu\n",isize); |
| 222 | printf("\n"); |
| 151 | 223 | |
| 152 | | printf(" device vendor type set : %s\n",device_string[*device_type]); |
| 224 | printf(" device vendor type set : %s\n",device_string[*device_type]); |
| 225 | } |
| 226 | |
| 227 | cl_context_properties context_properties[3]= |
| 228 | { |
| 229 | CL_CONTEXT_PLATFORM, |
| 230 | (cl_context_properties)platform, |
| 231 | 0 // 0 terminates list |
| 232 | }; |
| 153 | 233 | |
| 154 | | *context = clCreateContext(0, 1, device, NULL, NULL, &error); |
| 234 | *context = clCreateContext(context_properties, num_devices, devices, NULL, NULL, &error); |
| 155 | 235 | if(error != CL_SUCCESS) { |
| 156 | 236 | printf("Error creating context\n"); |
| 157 | 237 | exit(error); |
| 158 | 238 | } |
| 159 | | *queue = clCreateCommandQueue(*context, device[0], CL_QUEUE_PROFILING_ENABLE, &error); |
| 239 | *queue = clCreateCommandQueue(*context, devices[0], CL_QUEUE_PROFILING_ENABLE, &error); |
| 160 | 240 | if(error != CL_SUCCESS) { |
| 161 | 241 | printf("Error creating command queue\n"); |
| 162 | 242 | exit(error); |
| 163 | 243 | } |
| 164 | 244 | |
| 165 | | printf("============== Hardware detection report ===============\n"); |
| 245 | if (DEVICE_DETECT_DEBUG){ |
| 246 | printf("============== Hardware detection report ===============\n"); |
| 247 | } |
| 166 | 248 | |
| 167 | 249 | // Load the kernel source code into the array source |
| 168 | 250 | struct stat statbuf; |
| … | … | @@ -224,11 +306,11 @@ void GPUInit(cl_context *context, cl_command_queue *queue, int *device_type, cl_ |
| 224 | 306 | if (*device_type == TESLA_2050_2070) strcat(CompileString, " -DIS_NVIDIA"); |
| 225 | 307 | if (*device_type == GeFORCE_GT_650M) strcat(CompileString, " -DIS_NVIDIA"); |
| 226 | 308 | |
| 227 | | error = clBuildProgram(*program, 1, device, CompileString, NULL, NULL); |
| 309 | error = clBuildProgram(*program, 1, devices, CompileString, NULL, NULL); |
| 228 | 310 | |
| 229 | 311 | if (error != CL_SUCCESS){ |
| 230 | 312 | printf("clBuildProgram returned an error %d at line %d in file %s\n", error,__LINE__,__FILE__); |
| 231 | | error = clGetProgramBuildInfo(*program, device[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &nReportSize); |
| 313 | error = clGetProgramBuildInfo(*program, devices[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &nReportSize); |
| 232 | 314 | if (error != CL_SUCCESS) { |
| 233 | 315 | switch (error){ |
| 234 | 316 | case CL_INVALID_DEVICE: |
| … | … | @@ -245,7 +327,7 @@ void GPUInit(cl_context *context, cl_command_queue *queue, int *device_type, cl_ |
| 245 | 327 | |
| 246 | 328 | BuildReport = (char *)malloc(nReportSize); |
| 247 | 329 | |
| 248 | | error = clGetProgramBuildInfo(*program, device[0], CL_PROGRAM_BUILD_LOG, nReportSize, BuildReport, NULL); |
| 330 | error = clGetProgramBuildInfo(*program, devices[0], CL_PROGRAM_BUILD_LOG, nReportSize, BuildReport, NULL); |
| 249 | 331 | if (error != CL_SUCCESS) { |
| 250 | 332 | switch (error){ |
| 251 | 333 | case CL_INVALID_DEVICE: |
| … | … | @@ -262,4 +344,123 @@ void GPUInit(cl_context *context, cl_command_queue *queue, int *device_type, cl_ |
| 262 | 344 | printf("%s\n", BuildReport); |
| 263 | 345 | } |
| 264 | 346 | } |
| 347 | |
| 348 | int device_double_support(cl_device_id device){ |
| 349 | int have_double = 0; |
| 350 | char info[1024]; |
| 351 | |
| 352 | clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, sizeof(info), &info, NULL); |
| 353 | |
| 354 | if (!(strstr(info,"cl_khr_fp64") == NULL)){ |
| 355 | if (DEVICE_DETECT_DEBUG){ |
| 356 | printf( " Device has double : %s\n\n", strstr(info,"cl_khr_fp64")); |
| 357 | } |
| 358 | have_double = 1; |
| 359 | } |
| 360 | |
| 361 | return(have_double); |
| 362 | } |
| 363 | |
| 364 | void device_info(cl_device_id device){ |
| 365 | if (device == NULL) { |
| 366 | printf(" Error with device in device_info\n"); |
| 367 | } |
| 368 | char info[1024]; |
| 369 | cl_bool iflag; |
| 370 | cl_uint inum; |
| 371 | size_t isize; |
| 372 | cl_ulong ilong; |
| 373 | cl_device_type device_type; |
| 374 | cl_command_queue_properties iprop; |
| 375 | |
| 376 | clGetDeviceInfo(device,CL_DEVICE_TYPE,sizeof(device_type),&device_type,0); |
| 377 | if( device_type & CL_DEVICE_TYPE_CPU ) |
| 378 | printf(" CL_DEVICE_TYPE : %s\n", "CL_DEVICE_TYPE_CPU"); |
| 379 | if( device_type & CL_DEVICE_TYPE_GPU ) |
| 380 | printf(" CL_DEVICE_TYPE : %s\n", "CL_DEVICE_TYPE_GPU"); |
| 381 | if( device_type & CL_DEVICE_TYPE_ACCELERATOR ) |
| 382 | printf(" CL_DEVICE_TYPE : %s\n", "CL_DEVICE_TYPE_ACCELERATOR"); |
| 383 | if( device_type & CL_DEVICE_TYPE_DEFAULT ) |
| 384 | printf(" CL_DEVICE_TYPE : %s\n", "CL_DEVICE_TYPE_DEFAULT"); |
| 385 | |
| 386 | clGetDeviceInfo(device,CL_DEVICE_AVAILABLE,sizeof(iflag),&iflag,0); |
| 387 | if (iflag == CL_TRUE) { |
| 388 | printf( " CL_DEVICE_AVAILABLE : TRUE\n"); |
| 389 | } else { |
| 390 | printf( " CL_DEVICE_AVAILABLE : FALSE\n"); |
| 391 | } |
| 392 | |
| 393 | clGetDeviceInfo(device, CL_DEVICE_VENDOR, sizeof(info), &info, NULL); |
| 394 | printf( " CL_DEVICE_VENDOR : %s\n", info); |
| 395 | |
| 396 | clGetDeviceInfo(device, CL_DEVICE_NAME, sizeof(info), &info, NULL); |
| 397 | printf( " CL_DEVICE_NAME : %s\n", info); |
| 398 | |
| 399 | clGetDeviceInfo(device, CL_DRIVER_VERSION, sizeof(info), &info, NULL); |
| 400 | printf( " CL_DRIVER_VERSION : %s\n", info); |
| 401 | |
| 402 | clGetDeviceInfo(device, CL_DEVICE_VERSION, sizeof(info), &info, NULL); |
| 403 | printf( " CL_DEVICE_VERSION : %s\n", info); |
| 404 | |
| 405 | clGetDeviceInfo(device,CL_DEVICE_MAX_COMPUTE_UNITS,sizeof(inum),&inum,0); |
| 406 | printf( " CL_DEVICE_MAX_COMPUTE_UNITS : %d\n", inum); |
| 407 | |
| 408 | clGetDeviceInfo(device,CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS,sizeof(inum),&inum,0); |
| 409 | printf( " CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS : %d\n", inum); |
| 410 | |
| 411 | size_t *item_sizes = (size_t *)malloc(inum*sizeof(size_t)); |
| 412 | clGetDeviceInfo(device,CL_DEVICE_MAX_WORK_ITEM_SIZES,sizeof(item_sizes),item_sizes,0); |
| 413 | printf( " CL_DEVICE_MAX_WORK_ITEM_SIZES : %ld %ld %ld\n", |
| 414 | item_sizes[0], item_sizes[1], item_sizes[2]); |
| 415 | free(item_sizes); |
| 416 | |
| 417 | clGetDeviceInfo(device,CL_DEVICE_MAX_WORK_GROUP_SIZE,sizeof(isize),&isize,0); |
| 418 | printf( " CL_DEVICE_MAX_WORK_GROUP_SIZE : %ld\n", isize); |
| 419 | |
| 420 | clGetDeviceInfo(device,CL_DEVICE_MAX_CLOCK_FREQUENCY,sizeof(inum),&inum,0); |
| 421 | printf( " CL_DEVICE_MAX_CLOCK_FREQUENCY : %d\n", inum); |
| 422 | |
| 423 | clGetDeviceInfo(device,CL_DEVICE_MAX_MEM_ALLOC_SIZE,sizeof(inum),&inum,0); |
| 424 | printf( " CL_DEVICE_MAX_MEM_ALLOC_SIZE : %d\n", inum); |
| 425 | |
| 426 | #ifdef __APPLE_CC__ |
| 427 | clGetDeviceInfo(device,CL_DEVICE_GLOBAL_MEM_SIZE,sizeof(ilong),&ilong,0); |
| 428 | printf( " CL_DEVICE_GLOBAL_MEM_SIZE : %llu\n", ilong); |
| 429 | |
| 430 | clGetDeviceInfo(device,CL_DEVICE_GLOBAL_MEM_CACHE_SIZE,sizeof(ilong),&ilong,0); |
| 431 | printf( " CL_DEVICE_GLOBAL_MEM_CACHE_SIZE : %llu\n", ilong); |
| 432 | #else |
| 433 | clGetDeviceInfo(device,CL_DEVICE_GLOBAL_MEM_SIZE,sizeof(ilong),&ilong,0); |
| 434 | printf( " CL_DEVICE_GLOBAL_MEM_SIZE : %lu\n", ilong); |
| 435 | |
| 436 | clGetDeviceInfo(device,CL_DEVICE_GLOBAL_MEM_CACHE_SIZE,sizeof(ilong),&ilong,0); |
| 437 | printf( " CL_DEVICE_GLOBAL_MEM_CACHE_SIZE : %lu\n", ilong); |
| 438 | #endif |
| 439 | clGetDeviceInfo(device,CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE,sizeof(inum),&inum,0); |
| 440 | printf( " CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE : %d\n", inum); |
| 441 | |
| 442 | clGetDeviceInfo(device,CL_DEVICE_MAX_CONSTANT_ARGS,sizeof(inum),&inum,0); |
| 443 | printf( " CL_DEVICE_GLOBAL_MAX_CONSTANT_ARGS : %d\n", inum); |
| 444 | |
| 445 | clGetDeviceInfo(device,CL_DEVICE_ERROR_CORRECTION_SUPPORT,sizeof(iflag),&iflag,0); |
| 446 | if (iflag == CL_TRUE) { |
| 447 | printf( " CL_DEVICE_ERROR_CORRECTION_SUPPORT : TRUE\n"); |
| 448 | } else { |
| 449 | printf( " CL_DEVICE_ERROR_CORRECTION_SUPPORT : FALSE\n"); |
| 450 | } |
| 451 | |
| 452 | clGetDeviceInfo(device,CL_DEVICE_PROFILING_TIMER_RESOLUTION,sizeof(isize),&isize,0); |
| 453 | printf( " CL_DEVICE_PROFILING_TIMER_RESOLUTION : %ld nanosecs\n", isize); |
| 454 | |
| 455 | clGetDeviceInfo(device,CL_DEVICE_QUEUE_PROPERTIES,sizeof(iprop),&iprop,0); |
| 456 | if (iprop & CL_QUEUE_PROFILING_ENABLE) { |
| 457 | printf( " CL_DEVICE_QUEUE PROFILING : AVAILABLE\n"); |
| 458 | } else { |
| 459 | printf( " CL_DEVICE_QUEUE PROFILING : NOT AVAILABLE\n"); |
| 460 | } |
| 461 | |
| 462 | clGetDeviceInfo(device, CL_DEVICE_EXTENSIONS, sizeof(info), &info, NULL); |
| 463 | printf( " CL_DEVICE_EXTENSIONS : %s\n\n", info); |
| 464 | |
| 465 | } |
| 265 | 466 | #endif |