/* get the local memory size supported by the device */
deviceLocalMemorySize = GetOpenCLDeviceLocalMemorySize(clEnv);
+DisableMSCWarning(4127)
while(1)
+RestoreMSCWarning
{
/* calculate the local memory size needed per workgroup */
cacheRangeStart = (int) (((0 + 0.5)/xFactor+MagickEpsilon)-support+0.5);
/* get the local memory size supported by the device */
deviceLocalMemorySize = GetOpenCLDeviceLocalMemorySize(clEnv);
+DisableMSCWarning(4127)
while(1)
+RestoreMSCWarning
{
/* calculate the local memory size needed per workgroup */
cacheRangeStart = (int) (((0 + 0.5)/yFactor+MagickEpsilon)-support+0.5);
if (status == MagickFalse)
return NULL;
+DisableMSCWarning(4127)
if (sizeof(unsigned long) == 4)
+RestoreMSCWarning
filteredImage = ComputeAddNoiseImageOptRandomNum(image,channel,noise_type,exception);
else
filteredImage = ComputeAddNoiseImage(image,channel,noise_type,exception);
*/
-#define DS_DEVICE_NAME_LENGTH 256
-
typedef enum {
DS_SUCCESS = 0
,DS_INVALID_PROFILE = 1000
}
clGetDeviceIDs(platforms[i], deviceType, numDevices, devices, &num);
for (j = 0; j < num; j++, next++) {
- char buffer[DS_DEVICE_NAME_LENGTH];
size_t length;
profile->devices[next].type = DS_DEVICE_OPENCL_DEVICE;
profile->devices[next].oclDeviceID = devices[j];
- clGetDeviceInfo(profile->devices[next].oclDeviceID, CL_DEVICE_NAME
- , DS_DEVICE_NAME_LENGTH, &buffer, NULL);
- length = strlen(buffer);
- profile->devices[next].oclDeviceName = (char*)malloc(length+1);
- memcpy(profile->devices[next].oclDeviceName, buffer, length+1);
-
- clGetDeviceInfo(profile->devices[next].oclDeviceID, CL_DRIVER_VERSION
- , DS_DEVICE_NAME_LENGTH, &buffer, NULL);
- length = strlen(buffer);
- profile->devices[next].oclDriverVersion = (char*)malloc(length+1);
- memcpy(profile->devices[next].oclDriverVersion, buffer, length+1);
+ clGetDeviceInfo(profile->devices[next].oclDeviceID, CL_DEVICE_NAME\r
+ , 0, NULL, &length);\r
+ profile->devices[next].oclDeviceName = (char*)malloc(sizeof(char)*length);\r
+ clGetDeviceInfo(profile->devices[next].oclDeviceID, CL_DEVICE_NAME\r
+ , length, profile->devices[next].oclDeviceName, NULL);\r
+\r
+ clGetDeviceInfo(profile->devices[next].oclDeviceID, CL_DRIVER_VERSION\r
+ , 0, NULL, &length);\r
+ profile->devices[next].oclDriverVersion = (char*)malloc(sizeof(char)*length);\r
+ clGetDeviceInfo(profile->devices[next].oclDeviceID, CL_DRIVER_VERSION\r
+ , length, profile->devices[next].oclDriverVersion, NULL);
clGetDeviceInfo(profile->devices[next].oclDeviceID, CL_DEVICE_MAX_CLOCK_FREQUENCY
, sizeof(cl_uint), &profile->devices[next].oclMaxClockFrequency, NULL);