}
-static MagickBooleanType checkAccelerateCondition(const Image* image, const ChannelType channel, ExceptionInfo *exception)
+static MagickBooleanType checkAccelerateCondition(const Image* image, const ChannelType channel)
{
/* check if the image's colorspace is supported */
if (image->colorspace != RGBColorspace
if (status == MagickFalse)
return NULL;
- status = checkAccelerateCondition(image, channel, exception);
+ status = checkAccelerateCondition(image, channel);
if (status == MagickFalse)
return NULL;
status = checkOpenCLEnvironment(exception);
if (status == MagickTrue)
{
- status = checkAccelerateCondition(image, channel, exception);
+ status = checkAccelerateCondition(image, channel);
if (status == MagickTrue)
{
status = ComputeFunctionImage(image, channel, function, number_parameters, parameters, exception);
if (status == MagickFalse)
return NULL;
- status = checkAccelerateCondition(image, channel, exception);
+ status = checkAccelerateCondition(image, channel);
if (status == MagickFalse)
return NULL;
if (status == MagickFalse)
return NULL;
- status = checkAccelerateCondition(image, channel, exception);
+ status = checkAccelerateCondition(image, channel);
if (status == MagickFalse)
return NULL;
if (status == MagickFalse)
return NULL;
- status = checkAccelerateCondition(image, channel, exception);
+ status = checkAccelerateCondition(image, channel);
if (status == MagickFalse)
return NULL;
/* 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;
- status = checkAccelerateCondition(image, AllChannels, exception);
+ status = checkAccelerateCondition(image, AllChannels);
if (status == MagickFalse)
return NULL;
if (status == MagickFalse)
return MagickFalse;
- status = checkAccelerateCondition(image, AllChannels, exception);
+ status = checkAccelerateCondition(image, AllChannels);
if (status == MagickFalse)
return MagickFalse;
if (status == MagickFalse)
return MagickFalse;
- status = checkAccelerateCondition(image, AllChannels, exception);
+ status = checkAccelerateCondition(image, AllChannels);
if (status == MagickFalse)
return MagickFalse;
if (status == MagickFalse)
return MagickFalse;
- status = checkAccelerateCondition(image, channel, exception);
+ status = checkAccelerateCondition(image, channel);
if (status == MagickFalse)
return MagickFalse;
if (status == MagickFalse)
return NULL;
- status = checkAccelerateCondition(image, AllChannels, exception);
+ status = checkAccelerateCondition(image, AllChannels);
if (status == MagickFalse)
return NULL;
if (status == MagickFalse)
return NULL;
- status = checkAccelerateCondition(image, channel, exception);
+ status = checkAccelerateCondition(image, channel);
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);
MagickBooleanType GetMagickOpenCLEnvParam(MagickCLEnv clEnv, MagickOpenCLEnvParam param
, size_t dataSize, void* data, ExceptionInfo* exception)
{
- MagickBooleanType status;
+ MagickBooleanType
+ status;
+
+ magick_unreferenced(exception);
+
status = MagickFalse;
if (clEnv == NULL
return saveSuccessful;
}
-static MagickBooleanType loadBinaryCLProgram(MagickCLEnv clEnv, MagickOpenCLProgram prog, unsigned int signature, ExceptionInfo* exception)
+static MagickBooleanType loadBinaryCLProgram(MagickCLEnv clEnv, MagickOpenCLProgram prog, unsigned int signature)
{
MagickBooleanType loadSuccessful;
unsigned char* binaryProgram;
/* try to load the binary first */
if (!getenv("MAGICK_OCL_REC"))
- loadSuccessful = loadBinaryCLProgram(clEnv, (MagickOpenCLProgram)i, programSignature, exception);
+ loadSuccessful = loadBinaryCLProgram(clEnv, (MagickOpenCLProgram)i, programSignature);
if (loadSuccessful == MagickFalse)
{
return status;
}
-/* Pointer to a function that calculates the score of a device (ex: device->score)
- update the data size of score. The encoding and the format of the score data
- is implementation defined. The function should return DS_SUCCESS if there's no error to be reported.
+/*\r
+ Pointer to a function that updates the score of a device (ex: device->score)\r
+ The function should return DS_SUCCESS if there's no error to be reported.\r
*/
-typedef ds_status (*ds_perf_evaluator)(ds_device* device, void* data);
+typedef ds_status (*ds_perf_evaluator)(ds_device* device);
typedef enum {
DS_EVALUATE_ALL
} ds_evaluation_type;
static ds_status profileDevices(ds_profile* profile, const ds_evaluation_type type
- ,ds_perf_evaluator evaluator, void* evaluatorData, unsigned int* numUpdates) {
+ ,ds_perf_evaluator evaluator, unsigned int* numUpdates) {
ds_status status = DS_SUCCESS;
unsigned int i;
unsigned int updates = 0;
break;
/* else fall through */
case DS_EVALUATE_ALL:
- evaluatorStatus = evaluator(profile->devices+i, evaluatorData);
+ evaluatorStatus = evaluator(profile->devices+i);
if (evaluatorStatus != DS_SUCCESS) {
status = evaluatorStatus;
return status;
}
versionStringLength = strlen(profile->version);
- if (versionStringLength!=(dataEnd-dataStart)
+ if (versionStringLength!=(size_t)(dataEnd-dataStart)
|| strncmp(profile->version, dataStart, versionStringLength)!=(int)0) {
/* version mismatch */
status = DS_PROFILE_FILE_ERROR;
currentPosition = dataEnd+strlen(DS_TAG_VERSION_END);
/* parse the device information */
+DisableMSCWarning(4127)
while (1) {
+RestoreMSCWarning
unsigned int i;
const char* deviceTypeStart;
actualDeviceNameLength = strlen(profile->devices[i].oclDeviceName);
driverVersionLength = strlen(profile->devices[i].oclDriverVersion);
- if (actualDeviceNameLength == (deviceNameEnd - deviceNameStart)
- && driverVersionLength == (deviceDriverEnd - deviceDriverStart)
+ if (actualDeviceNameLength == (size_t)(deviceNameEnd - deviceNameStart)
+ && driverVersionLength == (size_t)(deviceDriverEnd - deviceDriverStart)
&& maxComputeUnits == profile->devices[i].oclMaxComputeUnits
&& maxClockFrequency == profile->devices[i].oclMaxClockFrequency
&& strncmp(profile->devices[i].oclDeviceName, deviceNameStart, actualDeviceNameLength)==(int)0
typedef double AccelerateScoreType;
-static ds_status AcceleratePerfEvaluator(ds_device* device, void* data) {
+static ds_status AcceleratePerfEvaluator(ds_device* device) {
ds_status status = DS_SUCCESS;
MagickCLEnv clEnv = NULL;
,DirectorySeparator,IMAGEMAGICK_PROFILE_FILE);
readProfileFromFile(profile, AccelerateScoreDeserializer, path);
- status = profileDevices(profile, DS_EVALUATE_NEW_ONLY, AcceleratePerfEvaluator, NULL, &numDeviceProfiled);
+ status = profileDevices(profile, DS_EVALUATE_NEW_ONLY, AcceleratePerfEvaluator, &numDeviceProfiled);
if (status!=DS_SUCCESS) {
(void) ThrowMagickException(exception, GetMagickModule(), ModuleFatalError, "Error when initializing the profile", "'%s'", ".");
goto cleanup;