}
}
if (temp == (char *) NULL)
- temp=AcquireString("?");
+ {
+ temp=AcquireString("?");
+ (void) LogMagickEvent(AccelerateEvent,GetMagickModule(),
+ "Cannot use cache directory: \"%s\"",path);
+ }
+ else
+ (void) LogMagickEvent(AccelerateEvent,GetMagickModule(),
+ "Using cache directory: \"%s\"",temp);
cache_directory=temp;
}
UnlockSemaphoreInfo(cache_directory_lock);
i,
j;
+ (void) LogMagickEvent(AccelerateEvent,GetMagickModule(),
+ "Selecting OpenCL device for type: %d",(int) type);
for (i = 0; i < clEnv->number_devices; i++)
clEnv->devices[i]->enabled=MagickFalse;
continue;
device->enabled=MagickTrue;
+ (void) LogMagickEvent(AccelerateEvent,GetMagickModule(),
+ "Selected device: %s",device->name);
for (j = i+1; j < clEnv->number_devices; j++)
{
MagickCLDevice
kernel;
assert(device != (MagickCLDevice) NULL);
+ (void) LogMagickEvent(AccelerateEvent,GetMagickModule(),"Using kernel: %s",
+ kernel_name);
kernel=openCL_library->clCreateKernel(device->program,kernel_name,
(cl_int *) NULL);
return(kernel);
profileFile=fopen(filename,"ab");
- if (profileFile == (FILE *)NULL)
- return(MagickFalse);
+ if (profileFile == (FILE *) NULL)
+ {
+ (void) LogMagickEvent(AccelerateEvent,GetMagickModule(),
+ "Unable to save profile to: \"%s\"",filename);
+ return(MagickFalse);
+ }
fclose(profileFile);
return(MagickTrue);
i,
j;
+ (void) LogMagickEvent(AccelerateEvent,GetMagickModule(),
+ "Starting benchmark");
testEnv=AcquireMagickCLEnv();
testEnv->library=openCL_library;
testEnv->devices=(MagickCLDevice *) AcquireCriticalMemory(
status=openCL_library->clGetProgramInfo(device->program,
CL_PROGRAM_BINARIES,sizeof(unsigned char*),&binaryProgram,NULL);
if (status == CL_SUCCESS)
- (void) BlobToFile(filename,binaryProgram,binaryProgramSize,exception);
+ {
+ (void) LogMagickEvent(AccelerateEvent,GetMagickModule(),
+ "Creating cache file: \"%s\"",filename);
+ (void) BlobToFile(filename,binaryProgram,binaryProgramSize,exception);
+ }
binaryProgram=(unsigned char *) RelinquishMagickMemory(binaryProgram);
}
-static MagickBooleanType LoadCachedOpenCLKernel(MagickCLDevice device,
+static MagickBooleanType LoadCachedOpenCLKernels(MagickCLDevice device,
const char *filename)
{
cl_int
sans_exception=DestroyExceptionInfo(sans_exception);
if (binaryProgram == (unsigned char *) NULL)
return(MagickFalse);
+ (void) LogMagickEvent(AccelerateEvent,GetMagickModule(),
+ "Loaded cached kernels: \"%s\"",filename);
device->program=openCL_library->clCreateProgramWithBinary(device->context,1,
&device->deviceID,&length,(const unsigned char**)&binaryProgram,
&binaryStatus,&status);
"%s%s%s_%s_%08x_%.20g.bin",GetOpenCLCacheDirectory(),
DirectorySeparator,"magick_opencl",deviceName,(unsigned int) signature,
(double) sizeof(char*)*8);
- loaded=LoadCachedOpenCLKernel(device,filename);
+ loaded=LoadCachedOpenCLKernels(device,filename);
if (loaded == MagickFalse)
{
/* Binary CL program unavailable, compile the program from source */