\r
status = 0;\r
/* dump out each binary into its own separate file. */\r
- for( i = 0; i < numDevices; i++ )\r
+ for (i = 0; i < numDevices; i++)\r
{\r
- char fileName[256] = {0};\r
- char cl_name[128] = {0};\r
- if( devices[i] != 0 )\r
+ char fileName[256] = { 0 };\r
+ char cl_name[128] = { 0 };\r
+ if (devices[i])\r
{\r
char deviceName[1024];\r
- status = clGetDeviceInfo( devices[i],\r
- CL_DEVICE_NAME,\r
- sizeof(deviceName),\r
- deviceName,\r
- NULL );\r
- str = (char*)strstr( cl_file_name, (char*)".cl" );\r
- memcpy( cl_name, cl_file_name, str - cl_file_name );\r
+ status = clGetDeviceInfo(devices[i],\r
+ CL_DEVICE_NAME,\r
+ sizeof(deviceName),\r
+ deviceName,\r
+ NULL);\r
+\r
+ str = (char*)strstr(cl_file_name, ".cl");\r
+ memcpy(cl_name, cl_file_name, str - cl_file_name);\r
cl_name[str - cl_file_name] = '\0';\r
- sprintf( fileName, "./%s-%s.bin", cl_name, deviceName );\r
- fd = fopen( fileName, "rb" );\r
- status = (fd != NULL) ? 1 : 0;\r
+ sprintf(fileName, "./%s - %s.bin", cl_name, deviceName);\r
+ fd = fopen(fileName, "rb");\r
+ status = fd != NULL;\r
}\r
}\r
\r
}\r
\r
/* dump out each binary into its own separate file. */\r
- for( i = 0; i < numDevices; i++ )\r
+ for (i = 0; i < numDevices; i++)\r
{\r
char fileName[256] = {0};\r
- char cl_name[128] = {0};\r
- if( binarySizes[i] != 0 )\r
+ char cl_name[128] = {0};\r
+ if (binarySizes[i])\r
{\r
char deviceName[1024];\r
- status = clGetDeviceInfo( devices[i],\r
- CL_DEVICE_NAME,\r
- sizeof(deviceName),\r
- deviceName,\r
- NULL );\r
-\r
- str = (char*)strstr( cl_file_name, (char*)".cl" );\r
- memcpy( cl_name, cl_file_name, str - cl_file_name );\r
+ status = clGetDeviceInfo(devices[i],\r
+ CL_DEVICE_NAME,\r
+ sizeof(deviceName),\r
+ deviceName,\r
+ NULL);\r
+\r
+ str = (char*)strstr(cl_file_name, ".cl");\r
+ memcpy(cl_name, cl_file_name, str - cl_file_name);\r
cl_name[str - cl_file_name] = '\0';\r
- sprintf( fileName, "./%s-%s.bin", cl_name, deviceName );\r
+ sprintf(fileName, "./%s - %s.bin", cl_name, deviceName);\r
\r
- if( !hb_write_binary_to_file( fileName, binaries[i], binarySizes[i] ))\r
+ if (!hb_write_binary_to_file(fileName, binaries[i], binarySizes[i]))\r
{\r
hb_log("OpenCL: hb_generat_bin_from_kernel_source: unable to write kernel, writing to temporary directory instead.");\r
return 0;\r
return(1);\r
\r
/*initialize program, kernel_name, kernel_count*/\r
- status = hb_compile_kernel_file( "hb-kernels.cl", &gpu_env, 0, build_option );\r
+ status = hb_compile_kernel_file("hb-opencl-kernels.cl",\r
+ &gpu_env, 0, build_option);\r
\r
if( status == 0 || gpu_env.kernel_count == 0 )\r
{\r