• Home
  • Raw
  • Download

Lines Matching refs:device

373     device;  in SelectOpenCLDevice()  local
384 device=clEnv->devices[i]; in SelectOpenCLDevice()
385 if (device->type != type) in SelectOpenCLDevice()
388 device->enabled=MagickTrue; in SelectOpenCLDevice()
395 if (IsSameOpenCLDevice(device,other_device)) in SelectOpenCLDevice()
445 MagickPrivate cl_mem CreateOpenCLBuffer(MagickCLDevice device, in CreateOpenCLBuffer() argument
448 return(openCL_library->clCreateBuffer(device->context,flags,size,host_ptr, in CreateOpenCLBuffer()
496 MagickPrivate MagickCLCacheInfo AcquireMagickCLCacheInfo(MagickCLDevice device, in AcquireMagickCLCacheInfo() argument
510 device->requested++; in AcquireMagickCLCacheInfo()
512 info->device=device; in AcquireMagickCLCacheInfo()
515 info->buffer=openCL_library->clCreateBuffer(device->context, in AcquireMagickCLCacheInfo()
521 device->requested--; in AcquireMagickCLCacheInfo()
548 device; in AcquireMagickCLDevice() local
550 device=(MagickCLDevice) AcquireMagickMemory(sizeof(*device)); in AcquireMagickCLDevice()
551 if (device != NULL) in AcquireMagickCLDevice()
553 (void) ResetMagickMemory(device,0,sizeof(*device)); in AcquireMagickCLDevice()
554 ActivateSemaphoreInfo(&device->lock); in AcquireMagickCLDevice()
555 device->score=MAGICKCORE_OPENCL_UNDEFINED_SCORE; in AcquireMagickCLDevice()
556 device->command_queues_index=-1; in AcquireMagickCLDevice()
557 device->enabled=MagickTrue; in AcquireMagickCLDevice()
559 return(device); in AcquireMagickCLDevice()
622 MagickPrivate cl_command_queue AcquireOpenCLCommandQueue(MagickCLDevice device) in AcquireOpenCLCommandQueue() argument
630 assert(device != (MagickCLDevice) NULL); in AcquireOpenCLCommandQueue()
631 LockSemaphoreInfo(device->lock); in AcquireOpenCLCommandQueue()
632 if ((device->profile_kernels == MagickFalse) && in AcquireOpenCLCommandQueue()
633 (device->command_queues_index >= 0)) in AcquireOpenCLCommandQueue()
635 queue=device->command_queues[device->command_queues_index--]; in AcquireOpenCLCommandQueue()
636 UnlockSemaphoreInfo(device->lock); in AcquireOpenCLCommandQueue()
640 UnlockSemaphoreInfo(device->lock); in AcquireOpenCLCommandQueue()
642 if (device->profile_kernels != MagickFalse) in AcquireOpenCLCommandQueue()
644 queue=openCL_library->clCreateCommandQueue(device->context, in AcquireOpenCLCommandQueue()
645 device->deviceID,properties,(cl_int *) NULL); in AcquireOpenCLCommandQueue()
678 MagickPrivate cl_kernel AcquireOpenCLKernel(MagickCLDevice device, in AcquireOpenCLKernel() argument
684 assert(device != (MagickCLDevice) NULL); in AcquireOpenCLKernel()
685 kernel=openCL_library->clCreateKernel(device->program,kernel_name, in AcquireOpenCLKernel()
792 device; in LoadOpenCLDeviceBenchmark() local
799 device=clEnv->devices[i]; in LoadOpenCLDeviceBenchmark()
800 if (IsBenchmarkedOpenCLDevice(device,device_benchmark)) in LoadOpenCLDeviceBenchmark()
801 device->score=device_benchmark->score; in LoadOpenCLDeviceBenchmark()
1091 MagickCLDevice device) in RunDeviceBenckmark() argument
1093 testEnv->devices[0]=device; in RunDeviceBenckmark()
1095 device->score=RunOpenCLBenchmark(MagickFalse); in RunDeviceBenckmark()
1109 device; in CacheOpenCLBenchmarks() local
1130 device=clEnv->devices[i]; in CacheOpenCLBenchmarks()
1134 if (IsSameOpenCLDevice(clEnv->devices[j],device)) in CacheOpenCLBenchmarks()
1144 if (device->score != MAGICKCORE_OPENCL_UNDEFINED_SCORE) in CacheOpenCLBenchmarks()
1147 device->platform_name,device->name,device->version, in CacheOpenCLBenchmarks()
1148 (int)device->max_clock_frequency,(int)device->max_compute_units, in CacheOpenCLBenchmarks()
1149 device->score); in CacheOpenCLBenchmarks()
1159 device; in BenchmarkOpenCLDevices() local
1181 device=clEnv->devices[i]; in BenchmarkOpenCLDevices()
1182 if (device->score == MAGICKCORE_OPENCL_UNDEFINED_SCORE) in BenchmarkOpenCLDevices()
1183 RunDeviceBenckmark(clEnv,testEnv,device); in BenchmarkOpenCLDevices()
1192 if (IsSameOpenCLDevice(device,other_device)) in BenchmarkOpenCLDevices()
1193 other_device->score=device->score; in BenchmarkOpenCLDevices()
1240 static void CacheOpenCLKernel(MagickCLDevice device,char *filename, in CacheOpenCLKernel() argument
1252 status=openCL_library->clGetProgramInfo(device->program, in CacheOpenCLKernel()
1258 status=openCL_library->clGetProgramInfo(device->program, in CacheOpenCLKernel()
1265 static MagickBooleanType LoadCachedOpenCLKernel(MagickCLDevice device, in LoadCachedOpenCLKernel() argument
1286 device->program=openCL_library->clCreateProgramWithBinary(device->context,1, in LoadCachedOpenCLKernel()
1287 &device->deviceID,&length,(const unsigned char**)&binaryProgram, in LoadCachedOpenCLKernel()
1294 static void LogOpenCLBuildFailure(MagickCLDevice device,const char *kernel, in LogOpenCLBuildFailure() argument
1310 openCL_library->clGetProgramBuildInfo(device->program,device->deviceID, in LogOpenCLBuildFailure()
1313 openCL_library->clGetProgramBuildInfo(device->program,device->deviceID, in LogOpenCLBuildFailure()
1323 static MagickBooleanType CompileOpenCLKernel(MagickCLDevice device, in CompileOpenCLKernel() argument
1341 (void) CopyMagickString(deviceName,device->name,MagickPathExtent); in CompileOpenCLKernel()
1356 loaded=LoadCachedOpenCLKernel(device,filename); in CompileOpenCLKernel()
1361 device->program=openCL_library->clCreateProgramWithSource( in CompileOpenCLKernel()
1362 device->context,1,&kernel,&length,&status); in CompileOpenCLKernel()
1367 status=openCL_library->clBuildProgram(device->program,1,&device->deviceID, in CompileOpenCLKernel()
1373 LogOpenCLBuildFailure(device,kernel,exception); in CompileOpenCLKernel()
1379 CacheOpenCLKernel(device,filename,exception); in CompileOpenCLKernel()
1418 queue=AcquireOpenCLCommandQueue(info->device); in CopyMagickCLCacheInfo()
1423 ReleaseOpenCLCommandQueue(info->device,queue); in CopyMagickCLCacheInfo()
1486 device; in DumpOpenCLProfileData() local
1488 device=clEnv->devices[i]; in DumpOpenCLProfileData()
1489 if ((device->profile_kernels == MagickFalse) || in DumpOpenCLProfileData()
1490 (device->profile_records == (KernelProfileRecord *) NULL)) in DumpOpenCLProfileData()
1494 fprintf(log,"Device: %s\n",device->name); in DumpOpenCLProfileData()
1495 fprintf(log,"Version: %s\n",device->version); in DumpOpenCLProfileData()
1500 while (device->profile_records[j] != (KernelProfileRecord) NULL) in DumpOpenCLProfileData()
1505 profile=device->profile_records[j]; in DumpOpenCLProfileData()
1643 (void) OpenCLThrowMagickException(input_info->opencl->device,exception, in EnqueueOpenCLKernel()
1648 if (RecordProfileData(input_info->opencl->device,kernel,event) == MagickFalse) in EnqueueOpenCLKernel()
1727 const MagickCLDevice device) in GetOpenCLDeviceBenchmarkScore() argument
1729 if (device == (MagickCLDevice) NULL) in GetOpenCLDeviceBenchmarkScore()
1731 return(device->score); in GetOpenCLDeviceBenchmarkScore()
1757 const MagickCLDevice device) in GetOpenCLDeviceEnabled() argument
1759 if (device == (MagickCLDevice) NULL) in GetOpenCLDeviceEnabled()
1761 return(device->enabled); in GetOpenCLDeviceEnabled()
1786 MagickExport const char *GetOpenCLDeviceName(const MagickCLDevice device) in GetOpenCLDeviceName() argument
1788 if (device == (MagickCLDevice) NULL) in GetOpenCLDeviceName()
1790 return(device->name); in GetOpenCLDeviceName()
1862 const MagickCLDevice device) in GetOpenCLDeviceType() argument
1864 if (device == (MagickCLDevice) NULL) in GetOpenCLDeviceType()
1866 if (device->type == CL_DEVICE_TYPE_GPU) in GetOpenCLDeviceType()
1868 if (device->type == CL_DEVICE_TYPE_CPU) in GetOpenCLDeviceType()
1895 MagickExport const char *GetOpenCLDeviceVersion(const MagickCLDevice device) in GetOpenCLDeviceVersion() argument
1897 if (device == (MagickCLDevice) NULL) in GetOpenCLDeviceVersion()
1899 return(device->version); in GetOpenCLDeviceVersion()
1956 const MagickCLDevice device,size_t *length) in GetOpenCLKernelProfileRecords() argument
1958 if ((device == (const MagickCLDevice) NULL) || (device->profile_records == in GetOpenCLKernelProfileRecords()
1968 LockSemaphoreInfo(device->lock); in GetOpenCLKernelProfileRecords()
1969 while (device->profile_records[*length] != (KernelProfileRecord) NULL) in GetOpenCLKernelProfileRecords()
1971 UnlockSemaphoreInfo(device->lock); in GetOpenCLKernelProfileRecords()
1973 return(device->profile_records); in GetOpenCLKernelProfileRecords()
2061 device; in HasOpenCLDevices() local
2066 device=clEnv->devices[i]; in HasOpenCLDevices()
2067 if ((device->enabled == MagickFalse) || in HasOpenCLDevices()
2068 (device->program != (cl_program) NULL)) in HasOpenCLDevices()
2071 LockSemaphoreInfo(device->lock); in HasOpenCLDevices()
2072 if (device->program != (cl_program) NULL) in HasOpenCLDevices()
2074 UnlockSemaphoreInfo(device->lock); in HasOpenCLDevices()
2078 device_signature^=StringSignature(device->platform_name); in HasOpenCLDevices()
2079 status=CompileOpenCLKernel(device,accelerateKernelsBuffer,options, in HasOpenCLDevices()
2081 UnlockSemaphoreInfo(device->lock); in HasOpenCLDevices()
2233 device; in LoadOpenCLDevices() local
2235 device=AcquireMagickCLDevice(); in LoadOpenCLDevices()
2236 if (device == (MagickCLDevice) NULL) in LoadOpenCLDevices()
2239 device->context=clEnv->contexts[i]; in LoadOpenCLDevices()
2240 device->deviceID=devices[j]; in LoadOpenCLDevices()
2244 device->platform_name=AcquireQuantumMemory(length, in LoadOpenCLDevices()
2245 sizeof(*device->platform_name)); in LoadOpenCLDevices()
2247 device->platform_name,NULL); in LoadOpenCLDevices()
2251 device->name=AcquireQuantumMemory(length,sizeof(*device->name)); in LoadOpenCLDevices()
2253 device->name,NULL); in LoadOpenCLDevices()
2257 device->version=AcquireQuantumMemory(length,sizeof(*device->version)); in LoadOpenCLDevices()
2259 device->version,NULL); in LoadOpenCLDevices()
2262 sizeof(cl_uint),&device->max_clock_frequency,NULL); in LoadOpenCLDevices()
2265 sizeof(cl_uint),&device->max_compute_units,NULL); in LoadOpenCLDevices()
2268 sizeof(cl_device_type),&device->type,NULL); in LoadOpenCLDevices()
2271 sizeof(cl_ulong),&device->local_memory_size,NULL); in LoadOpenCLDevices()
2273 clEnv->devices[next]=device; in LoadOpenCLDevices()
2486 MagickCLDevice device,ExceptionInfo *exception,const char *module, in OpenCLThrowMagickException() argument
2493 assert(device != (MagickCLDevice) NULL); in OpenCLThrowMagickException()
2500 if (device->type == CL_DEVICE_TYPE_CPU) in OpenCLThrowMagickException()
2504 if (strncmp(device->platform_name, "Intel",5) == 0) in OpenCLThrowMagickException()
2555 MagickPrivate MagickBooleanType RecordProfileData(MagickCLDevice device, in RecordProfileData() argument
2576 if (device->profile_kernels == MagickFalse) in RecordProfileData()
2603 LockSemaphoreInfo(device->lock); in RecordProfileData()
2606 if (device->profile_records != (KernelProfileRecord *) NULL) in RecordProfileData()
2608 while (device->profile_records[i] != (KernelProfileRecord) NULL) in RecordProfileData()
2610 if (LocaleCompare(device->profile_records[i]->kernel_name,name) == 0) in RecordProfileData()
2612 profile_record=device->profile_records[i]; in RecordProfileData()
2625 device->profile_records=ResizeMagickMemory(device->profile_records,(i+2)* in RecordProfileData()
2626 sizeof(*device->profile_records)); in RecordProfileData()
2627 device->profile_records[i]=profile_record; in RecordProfileData()
2628 device->profile_records[i+1]=(KernelProfileRecord) NULL; in RecordProfileData()
2636 UnlockSemaphoreInfo(device->lock); in RecordProfileData()
2665 MagickPrivate void ReleaseOpenCLCommandQueue(MagickCLDevice device, in ReleaseOpenCLCommandQueue() argument
2671 assert(device != (MagickCLDevice) NULL); in ReleaseOpenCLCommandQueue()
2672 LockSemaphoreInfo(device->lock); in ReleaseOpenCLCommandQueue()
2673 if ((device->profile_kernels != MagickFalse) || in ReleaseOpenCLCommandQueue()
2674 (device->command_queues_index >= MAGICKCORE_OPENCL_COMMAND_QUEUES-1)) in ReleaseOpenCLCommandQueue()
2676 UnlockSemaphoreInfo(device->lock); in ReleaseOpenCLCommandQueue()
2683 device->command_queues[++device->command_queues_index]=queue; in ReleaseOpenCLCommandQueue()
2684 UnlockSemaphoreInfo(device->lock); in ReleaseOpenCLCommandQueue()
2711 MagickPrivate void ReleaseOpenCLDevice(MagickCLDevice device) in ReleaseOpenCLDevice() argument
2713 assert(device != (MagickCLDevice) NULL); in ReleaseOpenCLDevice()
2715 device->requested--; in ReleaseOpenCLDevice()
2755 ReleaseOpenCLDevice(info->device); in DestroyMagickCLCacheInfo()
2815 static MagickCLDevice RelinquishMagickCLDevice(MagickCLDevice device) in RelinquishMagickCLDevice() argument
2817 if (device == (MagickCLDevice) NULL) in RelinquishMagickCLDevice()
2820 device->platform_name=RelinquishMagickMemory(device->platform_name); in RelinquishMagickCLDevice()
2821 device->name=RelinquishMagickMemory(device->name); in RelinquishMagickCLDevice()
2822 device->version=RelinquishMagickMemory(device->version); in RelinquishMagickCLDevice()
2823 if (device->program != (cl_program) NULL) in RelinquishMagickCLDevice()
2824 (void) openCL_library->clReleaseProgram(device->program); in RelinquishMagickCLDevice()
2825 while (device->command_queues_index >= 0) in RelinquishMagickCLDevice()
2827 device->command_queues[device->command_queues_index--]); in RelinquishMagickCLDevice()
2828 RelinquishSemaphoreInfo(&device->lock); in RelinquishMagickCLDevice()
2829 return((MagickCLDevice) RelinquishMagickMemory(device)); in RelinquishMagickCLDevice()
2899 device; in RequestOpenCLDevice() local
2919 device=(MagickCLDevice) NULL; in RequestOpenCLDevice()
2929 if ((device == (MagickCLDevice) NULL) || (score < best_score)) in RequestOpenCLDevice()
2931 device=clEnv->devices[i]; in RequestOpenCLDevice()
2935 if (device != (MagickCLDevice)NULL) in RequestOpenCLDevice()
2936 device->requested++; in RequestOpenCLDevice()
2939 return(device); in RequestOpenCLDevice()
2967 MagickExport void SetOpenCLDeviceEnabled(MagickCLDevice device, in SetOpenCLDeviceEnabled() argument
2970 if (device == (MagickCLDevice) NULL) in SetOpenCLDeviceEnabled()
2972 device->enabled=value; in SetOpenCLDeviceEnabled()
3002 MagickExport void SetOpenCLKernelProfileEnabled(MagickCLDevice device, in SetOpenCLKernelProfileEnabled() argument
3005 if (device == (MagickCLDevice) NULL) in SetOpenCLKernelProfileEnabled()
3007 device->profile_kernels=value; in SetOpenCLKernelProfileEnabled()
3047 const MagickCLDevice magick_unused(device)) in GetOpenCLDeviceBenchmarkScore() argument
3049 magick_unreferenced(device); in GetOpenCLDeviceBenchmarkScore()
3054 const MagickCLDevice magick_unused(device)) in GetOpenCLDeviceEnabled() argument
3056 magick_unreferenced(device); in GetOpenCLDeviceEnabled()
3061 const MagickCLDevice magick_unused(device)) in GetOpenCLDeviceName() argument
3063 magick_unreferenced(device); in GetOpenCLDeviceName()
3077 const MagickCLDevice magick_unused(device)) in GetOpenCLDeviceType() argument
3079 magick_unreferenced(device); in GetOpenCLDeviceType()
3084 const MagickCLDevice magick_unused(device),size_t *length) in GetOpenCLKernelProfileRecords() argument
3086 magick_unreferenced(device); in GetOpenCLKernelProfileRecords()
3093 const MagickCLDevice magick_unused(device)) in GetOpenCLDeviceVersion() argument
3095 magick_unreferenced(device); in GetOpenCLDeviceVersion()
3105 MagickCLDevice magick_unused(device), in SetOpenCLDeviceEnabled() argument
3108 magick_unreferenced(device); in SetOpenCLDeviceEnabled()
3120 MagickCLDevice magick_unused(device), in SetOpenCLKernelProfileEnabled() argument
3123 magick_unreferenced(device); in SetOpenCLKernelProfileEnabled()