Compute Library
 23.08
CLSymbols Class Referencefinal

Class for loading OpenCL symbols. More...

#include <OpenCL.h>

Public Member Functions

 CLSymbols () noexcept(false)
 Default Constructor. More...
 
void load_symbols (void *handle)
 Load OpenCL symbols from handle. More...
 
bool load (const std::vector< std::string > &libraries_filenames, bool use_loader=false)
 This method attempts to load the OpenCL symbols from the first available library from the provided OpenCL libraries. More...
 
bool load_default ()
 Load symbols from any of the default OpenCL library names. More...
 

Static Public Member Functions

static CLSymbolsget ()
 Get the static instance of CLSymbols. More...
 

Data Fields

std::function< decltype(clCreateContext)> clCreateContext_ptr = nullptr
 
std::function< decltype(clCreateContextFromType)> clCreateContextFromType_ptr = nullptr
 
std::function< decltype(clCreateCommandQueue)> clCreateCommandQueue_ptr = nullptr
 
std::function< decltype(clCreateCommandQueueWithProperties)> clCreateCommandQueueWithProperties_ptr = nullptr
 
std::function< decltype(clGetContextInfo)> clGetContextInfo_ptr = nullptr
 
std::function< decltype(clBuildProgram)> clBuildProgram_ptr = nullptr
 
std::function< decltype(clEnqueueNDRangeKernel)> clEnqueueNDRangeKernel_ptr = nullptr
 
std::function< decltype(clSetKernelArg)> clSetKernelArg_ptr = nullptr
 
std::function< decltype(clReleaseKernel)> clReleaseKernel_ptr = nullptr
 
std::function< decltype(clCreateProgramWithSource)> clCreateProgramWithSource_ptr = nullptr
 
std::function< decltype(clCreateBuffer)> clCreateBuffer_ptr = nullptr
 
std::function< decltype(clRetainKernel)> clRetainKernel_ptr = nullptr
 
std::function< decltype(clCreateKernel)> clCreateKernel_ptr = nullptr
 
std::function< decltype(clGetProgramInfo)> clGetProgramInfo_ptr = nullptr
 
std::function< decltype(clFlush)> clFlush_ptr = nullptr
 
std::function< decltype(clFinish)> clFinish_ptr = nullptr
 
std::function< decltype(clReleaseProgram)> clReleaseProgram_ptr = nullptr
 
std::function< decltype(clRetainContext)> clRetainContext_ptr = nullptr
 
std::function< decltype(clCreateProgramWithBinary)> clCreateProgramWithBinary_ptr = nullptr
 
std::function< decltype(clReleaseCommandQueue)> clReleaseCommandQueue_ptr = nullptr
 
std::function< decltype(clEnqueueMapBuffer)> clEnqueueMapBuffer_ptr = nullptr
 
std::function< decltype(clRetainProgram)> clRetainProgram_ptr = nullptr
 
std::function< decltype(clGetProgramBuildInfo)> clGetProgramBuildInfo_ptr = nullptr
 
std::function< decltype(clEnqueueReadBuffer)> clEnqueueReadBuffer_ptr = nullptr
 
std::function< decltype(clEnqueueWriteBuffer)> clEnqueueWriteBuffer_ptr = nullptr
 
std::function< decltype(clReleaseEvent)> clReleaseEvent_ptr = nullptr
 
std::function< decltype(clReleaseContext)> clReleaseContext_ptr = nullptr
 
std::function< decltype(clRetainCommandQueue)> clRetainCommandQueue_ptr = nullptr
 
std::function< decltype(clEnqueueUnmapMemObject)> clEnqueueUnmapMemObject_ptr = nullptr
 
std::function< decltype(clRetainMemObject)> clRetainMemObject_ptr = nullptr
 
std::function< decltype(clReleaseMemObject)> clReleaseMemObject_ptr = nullptr
 
std::function< decltype(clGetDeviceInfo)> clGetDeviceInfo_ptr = nullptr
 
std::function< decltype(clGetDeviceIDs)> clGetDeviceIDs_ptr = nullptr
 
std::function< decltype(clGetMemObjectInfo)> clGetMemObjectInfo_ptr = nullptr
 
std::function< decltype(clRetainEvent)> clRetainEvent_ptr = nullptr
 
std::function< decltype(clGetPlatformInfo)> clGetPlatformInfo_ptr = nullptr
 
std::function< decltype(clGetPlatformIDs)> clGetPlatformIDs_ptr = nullptr
 
std::function< decltype(clGetKernelWorkGroupInfo)> clGetKernelWorkGroupInfo_ptr = nullptr
 
std::function< decltype(clGetCommandQueueInfo)> clGetCommandQueueInfo_ptr = nullptr
 
std::function< decltype(clGetKernelInfo)> clGetKernelInfo_ptr = nullptr
 
std::function< decltype(clGetEventProfilingInfo)> clGetEventProfilingInfo_ptr = nullptr
 
std::function< decltype(clSVMAlloc)> clSVMAlloc_ptr = nullptr
 
std::function< decltype(clSVMFree)> clSVMFree_ptr = nullptr
 
std::function< decltype(clEnqueueSVMMap)> clEnqueueSVMMap_ptr = nullptr
 
std::function< decltype(clEnqueueSVMUnmap)> clEnqueueSVMUnmap_ptr = nullptr
 
std::function< decltype(clEnqueueMarker)> clEnqueueMarker_ptr = nullptr
 
std::function< decltype(clWaitForEvents)> clWaitForEvents_ptr = nullptr
 
std::function< decltype(clCreateImage)> clCreateImage_ptr = nullptr
 
std::function< decltype(clSetKernelExecInfo)> clSetKernelExecInfo_ptr = nullptr
 
std::function< decltype(clImportMemoryARM)> clImportMemoryARM_ptr = nullptr
 

Detailed Description

Class for loading OpenCL symbols.

Definition at line 61 of file OpenCL.h.

Constructor & Destructor Documentation

◆ CLSymbols()

CLSymbols ( )
noexcept

Default Constructor.

Definition at line 39 of file OpenCL.cpp.

40  : _loaded(
41 {
42  false, false
43 })
44 {
45 }

Member Function Documentation

◆ get()

◆ load()

bool load ( const std::vector< std::string > &  libraries_filenames,
bool  use_loader = false 
)

This method attempts to load the OpenCL symbols from the first available library from the provided OpenCL libraries.

Parameters
[in]libraries_filenamesVector containing the filenames of the libraries to be loaded.
[in]use_loaderUse symbol loader function loadOpenCLPointer.
Returns
True if loading the library is successful. False if all the provided libraries could not be loaded.

Definition at line 98 of file OpenCL.cpp.

99 {
100  void *handle = nullptr;
101  unsigned int index = 0;
102  for(index = 0; index < libraries_filenames.size(); ++index)
103  {
104  handle = dlopen(libraries_filenames[index].c_str(), RTLD_LAZY | RTLD_LOCAL);
105  if(handle != nullptr)
106  {
107  break;
108  }
109  }
110  if(index == libraries_filenames.size())
111  {
112  // Set status of loading to failed
113  _loaded.second = false;
114  return false;
115  }
116 
117 #ifdef __ANDROID__
118  typedef void* (*loadOpenCLPointer_t)(const char* name);
119  loadOpenCLPointer_t loadOpenCLPointer;
120  if (use_loader) {
121  typedef void (*enableOpenCL_t)();
122  enableOpenCL_t enableOpenCL =
123  reinterpret_cast<enableOpenCL_t>(dlsym(handle, "enableOpenCL"));
124  enableOpenCL();
125 
126  loadOpenCLPointer = reinterpret_cast<loadOpenCLPointer_t>(
127  dlsym(handle, "loadOpenCLPointer"));
128  } else {
129  loadOpenCLPointer = nullptr;
130  }
131 #define LOAD_FUNCTION_PTR(func_name, _handle) \
132  func_name##_ptr = reinterpret_cast<decltype(func_name) *>( use_loader ? \
133  loadOpenCLPointer(#func_name) : dlsym(handle, #func_name));
134 #else /* __ANDROID__ */
135  (void)use_loader; // Avoid unused warning
136 #define LOAD_FUNCTION_PTR(func_name, handle) \
137  func_name##_ptr = reinterpret_cast<decltype(func_name) *>(dlsym(handle, #func_name));
138 #endif /* __ANDROID__ */
139 
154  LOAD_FUNCTION_PTR(clFlush, handle);
155  LOAD_FUNCTION_PTR(clFinish, handle);
181  LOAD_FUNCTION_PTR(clSVMAlloc, handle);
182  LOAD_FUNCTION_PTR(clSVMFree, handle);
189 
190  // Third-party extensions
192 
193 #undef LOAD_FUNCTION_PTR
194 
195  //Don't call dlclose(handle) or all the symbols will be unloaded !
196 
197  // Disable default loading and set status to successful
198  _loaded = std::make_pair(true, true);
199 
200  return true;
201 }

References clBuildProgram(), clCreateBuffer(), clCreateCommandQueue(), clCreateCommandQueueWithProperties(), clCreateContext(), clCreateContextFromType(), clCreateImage(), clCreateKernel(), clCreateProgramWithBinary(), clCreateProgramWithSource(), clEnqueueMapBuffer(), clEnqueueMarker(), clEnqueueNDRangeKernel(), clEnqueueReadBuffer(), clEnqueueSVMMap(), clEnqueueSVMUnmap(), clEnqueueUnmapMemObject(), clEnqueueWriteBuffer(), clFinish(), clFlush(), clGetCommandQueueInfo(), clGetContextInfo(), clGetDeviceIDs(), clGetDeviceInfo(), clGetEventProfilingInfo(), clGetKernelInfo(), clGetKernelWorkGroupInfo(), clGetMemObjectInfo(), clGetPlatformIDs(), clGetPlatformInfo(), clGetProgramBuildInfo(), clGetProgramInfo(), clImportMemoryARM(), clReleaseCommandQueue(), clReleaseContext(), clReleaseEvent(), clReleaseKernel(), clReleaseMemObject(), clReleaseProgram(), clRetainCommandQueue(), clRetainContext(), clRetainEvent(), clRetainKernel(), clRetainMemObject(), clRetainProgram(), clSetKernelArg(), clSetKernelExecInfo(), clSVMAlloc(), clSVMFree(), clWaitForEvents(), LOAD_FUNCTION_PTR, and name.

Referenced by CLSymbols::load_default().

◆ load_default()

bool load_default ( )

Load symbols from any of the default OpenCL library names.

If all the default libraries could not be loaded, this method will print a warning message and return false.

Returns
True if loading any library is successful.

Definition at line 53 of file OpenCL.cpp.

54 {
55  static const std::vector<std::string> libraries_filenames{ "libOpenCL.so", "libGLES_mali.so", "libmali.so" };
56 
57  if(_loaded.first)
58  {
59  return _loaded.second;
60  }
61 
62  // Indicate that default loading has been tried
63  _loaded.first = true;
64 
65  if(load(libraries_filenames, /* use_loader */ false))
66  {
67  ARM_COMPUTE_ERROR_ON_MSG(this->clBuildProgram_ptr == nullptr, "Failed to load OpenCL symbols from shared library");
68  return true;
69  }
70 
71 #ifdef __ANDROID__
72  // When running in NDK environment, the above libraries are not accessible.
73  static const std::vector<std::string> android_libraries_filenames{ "libOpenCL-pixel.so", "libOpenCL-car.so" };
74 
75  if(load(android_libraries_filenames, /* use_loader */ true))
76  {
77  ARM_COMPUTE_ERROR_ON_MSG(this->clBuildProgram_ptr == nullptr, "Failed to load OpenCL symbols from android shared library");
78  return true;
79  }
80 #endif // __ANDROID__
81 
82  // If not returned till here then libraries not found
83  std::stringstream ss;
84  std::for_each(libraries_filenames.begin(), libraries_filenames.end(), [&ss](const std::string & s)
85  {
86  ss << s << " ";
87  });
88 #ifdef __ANDROID__
89  std::for_each(android_libraries_filenames.begin(), android_libraries_filenames.end(), [&ss](const std::string & s)
90  {
91  ss << s << " ";
92  });
93 #endif // __ANDROID__
94  std::cerr << "Couldn't find any of the following OpenCL library: " << ss.str() << std::endl;
95  return false;
96 }

References ARM_COMPUTE_ERROR_ON_MSG, CLSymbols::clBuildProgram_ptr, arm_compute::utility::for_each(), CLSymbols::load(), and arm_compute::test::validation::ss().

Referenced by clBuildProgram(), clCreateBuffer(), clCreateCommandQueue(), clCreateCommandQueueWithProperties(), clCreateContext(), clCreateContextFromType(), clCreateImage(), clCreateKernel(), clCreateProgramWithBinary(), clCreateProgramWithSource(), clEnqueueMapBuffer(), clEnqueueMarker(), clEnqueueNDRangeKernel(), clEnqueueReadBuffer(), clEnqueueSVMMap(), clEnqueueSVMUnmap(), clEnqueueUnmapMemObject(), clEnqueueWriteBuffer(), clFinish(), clFlush(), clGetCommandQueueInfo(), clGetContextInfo(), clGetDeviceIDs(), clGetDeviceInfo(), clGetEventProfilingInfo(), clGetKernelInfo(), clGetKernelWorkGroupInfo(), clGetMemObjectInfo(), clGetPlatformIDs(), clGetPlatformInfo(), clGetProgramBuildInfo(), clGetProgramInfo(), clImportMemoryARM(), clReleaseCommandQueue(), clReleaseContext(), clReleaseEvent(), clReleaseKernel(), clReleaseMemObject(), clReleaseProgram(), clRetainCommandQueue(), clRetainContext(), clRetainEvent(), clRetainKernel(), clRetainMemObject(), clRetainProgram(), CLRuntimeContext::CLRuntimeContext(), clSetKernelArg(), clSetKernelExecInfo(), clSVMAlloc(), clSVMFree(), clWaitForEvents(), and arm_compute::opencl_is_available().

◆ load_symbols()

void load_symbols ( void *  handle)

Load OpenCL symbols from handle.

Parameters
[in]handleHandle to load symbols from

Field Documentation

◆ clBuildProgram_ptr

std::function<decltype( clBuildProgram )> clBuildProgram_ptr = nullptr

◆ clCreateBuffer_ptr

std::function<decltype( clCreateBuffer )> clCreateBuffer_ptr = nullptr

◆ clCreateCommandQueue_ptr

std::function<decltype( clCreateCommandQueue )> clCreateCommandQueue_ptr = nullptr

Definition at line 96 of file OpenCL.h.

Referenced by clCreateCommandQueue().

◆ clCreateCommandQueueWithProperties_ptr

std::function<decltype( clCreateCommandQueueWithProperties )> clCreateCommandQueueWithProperties_ptr = nullptr

Definition at line 97 of file OpenCL.h.

Referenced by clCreateCommandQueueWithProperties().

◆ clCreateContext_ptr

std::function<decltype( clCreateContext )> clCreateContext_ptr = nullptr

Definition at line 94 of file OpenCL.h.

Referenced by clCreateContext().

◆ clCreateContextFromType_ptr

std::function<decltype( clCreateContextFromType )> clCreateContextFromType_ptr = nullptr

Definition at line 95 of file OpenCL.h.

Referenced by clCreateContextFromType().

◆ clCreateImage_ptr

std::function<decltype( clCreateImage )> clCreateImage_ptr = nullptr

Definition at line 141 of file OpenCL.h.

Referenced by clCreateImage().

◆ clCreateKernel_ptr

std::function<decltype( clCreateKernel )> clCreateKernel_ptr = nullptr

Definition at line 106 of file OpenCL.h.

Referenced by clCreateKernel().

◆ clCreateProgramWithBinary_ptr

std::function<decltype( clCreateProgramWithBinary )> clCreateProgramWithBinary_ptr = nullptr

Definition at line 112 of file OpenCL.h.

Referenced by clCreateProgramWithBinary().

◆ clCreateProgramWithSource_ptr

std::function<decltype( clCreateProgramWithSource )> clCreateProgramWithSource_ptr = nullptr

Definition at line 103 of file OpenCL.h.

Referenced by clCreateProgramWithSource().

◆ clEnqueueMapBuffer_ptr

std::function<decltype( clEnqueueMapBuffer )> clEnqueueMapBuffer_ptr = nullptr

Definition at line 114 of file OpenCL.h.

Referenced by clEnqueueMapBuffer().

◆ clEnqueueMarker_ptr

std::function<decltype( clEnqueueMarker )> clEnqueueMarker_ptr = nullptr

Definition at line 139 of file OpenCL.h.

Referenced by clEnqueueMarker().

◆ clEnqueueNDRangeKernel_ptr

std::function<decltype( clEnqueueNDRangeKernel )> clEnqueueNDRangeKernel_ptr = nullptr

◆ clEnqueueReadBuffer_ptr

std::function<decltype( clEnqueueReadBuffer )> clEnqueueReadBuffer_ptr = nullptr

Definition at line 117 of file OpenCL.h.

Referenced by clEnqueueReadBuffer().

◆ clEnqueueSVMMap_ptr

std::function<decltype( clEnqueueSVMMap )> clEnqueueSVMMap_ptr = nullptr

Definition at line 137 of file OpenCL.h.

Referenced by clEnqueueSVMMap().

◆ clEnqueueSVMUnmap_ptr

std::function<decltype( clEnqueueSVMUnmap )> clEnqueueSVMUnmap_ptr = nullptr

Definition at line 138 of file OpenCL.h.

Referenced by clEnqueueSVMUnmap().

◆ clEnqueueUnmapMemObject_ptr

std::function<decltype( clEnqueueUnmapMemObject )> clEnqueueUnmapMemObject_ptr = nullptr

Definition at line 122 of file OpenCL.h.

Referenced by clEnqueueUnmapMemObject().

◆ clEnqueueWriteBuffer_ptr

std::function<decltype( clEnqueueWriteBuffer )> clEnqueueWriteBuffer_ptr = nullptr

Definition at line 118 of file OpenCL.h.

Referenced by clEnqueueWriteBuffer().

◆ clFinish_ptr

std::function<decltype( clFinish )> clFinish_ptr = nullptr

Definition at line 109 of file OpenCL.h.

Referenced by clFinish().

◆ clFlush_ptr

std::function<decltype( clFlush )> clFlush_ptr = nullptr

Definition at line 108 of file OpenCL.h.

Referenced by clFlush().

◆ clGetCommandQueueInfo_ptr

std::function<decltype( clGetCommandQueueInfo )> clGetCommandQueueInfo_ptr = nullptr

Definition at line 132 of file OpenCL.h.

Referenced by clGetCommandQueueInfo().

◆ clGetContextInfo_ptr

std::function<decltype( clGetContextInfo )> clGetContextInfo_ptr = nullptr

Definition at line 98 of file OpenCL.h.

Referenced by clGetContextInfo().

◆ clGetDeviceIDs_ptr

std::function<decltype( clGetDeviceIDs )> clGetDeviceIDs_ptr = nullptr

Definition at line 126 of file OpenCL.h.

Referenced by clGetDeviceIDs().

◆ clGetDeviceInfo_ptr

std::function<decltype( clGetDeviceInfo )> clGetDeviceInfo_ptr = nullptr

Definition at line 125 of file OpenCL.h.

Referenced by clGetDeviceInfo().

◆ clGetEventProfilingInfo_ptr

std::function<decltype( clGetEventProfilingInfo )> clGetEventProfilingInfo_ptr = nullptr

Definition at line 134 of file OpenCL.h.

Referenced by clGetEventProfilingInfo().

◆ clGetKernelInfo_ptr

std::function<decltype( clGetKernelInfo )> clGetKernelInfo_ptr = nullptr

Definition at line 133 of file OpenCL.h.

Referenced by clGetKernelInfo().

◆ clGetKernelWorkGroupInfo_ptr

std::function<decltype( clGetKernelWorkGroupInfo )> clGetKernelWorkGroupInfo_ptr = nullptr

Definition at line 131 of file OpenCL.h.

Referenced by clGetKernelWorkGroupInfo().

◆ clGetMemObjectInfo_ptr

std::function<decltype( clGetMemObjectInfo )> clGetMemObjectInfo_ptr = nullptr

Definition at line 127 of file OpenCL.h.

Referenced by clGetMemObjectInfo().

◆ clGetPlatformIDs_ptr

std::function<decltype( clGetPlatformIDs )> clGetPlatformIDs_ptr = nullptr

Definition at line 130 of file OpenCL.h.

Referenced by clGetPlatformIDs().

◆ clGetPlatformInfo_ptr

std::function<decltype( clGetPlatformInfo )> clGetPlatformInfo_ptr = nullptr

Definition at line 129 of file OpenCL.h.

Referenced by clGetPlatformInfo().

◆ clGetProgramBuildInfo_ptr

std::function<decltype( clGetProgramBuildInfo )> clGetProgramBuildInfo_ptr = nullptr

Definition at line 116 of file OpenCL.h.

Referenced by clGetProgramBuildInfo().

◆ clGetProgramInfo_ptr

std::function<decltype( clGetProgramInfo )> clGetProgramInfo_ptr = nullptr

Definition at line 107 of file OpenCL.h.

Referenced by clGetProgramInfo().

◆ clImportMemoryARM_ptr

std::function<decltype( clImportMemoryARM )> clImportMemoryARM_ptr = nullptr

Definition at line 145 of file OpenCL.h.

Referenced by clImportMemoryARM().

◆ clReleaseCommandQueue_ptr

std::function<decltype( clReleaseCommandQueue )> clReleaseCommandQueue_ptr = nullptr

Definition at line 113 of file OpenCL.h.

Referenced by clReleaseCommandQueue().

◆ clReleaseContext_ptr

std::function<decltype( clReleaseContext )> clReleaseContext_ptr = nullptr

Definition at line 120 of file OpenCL.h.

Referenced by clReleaseContext().

◆ clReleaseEvent_ptr

std::function<decltype( clReleaseEvent )> clReleaseEvent_ptr = nullptr

Definition at line 119 of file OpenCL.h.

Referenced by clReleaseEvent().

◆ clReleaseKernel_ptr

std::function<decltype( clReleaseKernel )> clReleaseKernel_ptr = nullptr

Definition at line 102 of file OpenCL.h.

Referenced by clReleaseKernel().

◆ clReleaseMemObject_ptr

std::function<decltype( clReleaseMemObject )> clReleaseMemObject_ptr = nullptr

◆ clReleaseProgram_ptr

std::function<decltype( clReleaseProgram )> clReleaseProgram_ptr = nullptr

Definition at line 110 of file OpenCL.h.

Referenced by clReleaseProgram().

◆ clRetainCommandQueue_ptr

std::function<decltype( clRetainCommandQueue )> clRetainCommandQueue_ptr = nullptr

Definition at line 121 of file OpenCL.h.

Referenced by clRetainCommandQueue().

◆ clRetainContext_ptr

std::function<decltype( clRetainContext )> clRetainContext_ptr = nullptr

Definition at line 111 of file OpenCL.h.

Referenced by clRetainContext().

◆ clRetainEvent_ptr

std::function<decltype( clRetainEvent )> clRetainEvent_ptr = nullptr

Definition at line 128 of file OpenCL.h.

Referenced by clRetainEvent().

◆ clRetainKernel_ptr

std::function<decltype( clRetainKernel )> clRetainKernel_ptr = nullptr

Definition at line 105 of file OpenCL.h.

Referenced by clRetainKernel().

◆ clRetainMemObject_ptr

std::function<decltype( clRetainMemObject )> clRetainMemObject_ptr = nullptr

◆ clRetainProgram_ptr

std::function<decltype( clRetainProgram )> clRetainProgram_ptr = nullptr

Definition at line 115 of file OpenCL.h.

Referenced by clRetainProgram().

◆ clSetKernelArg_ptr

std::function<decltype( clSetKernelArg )> clSetKernelArg_ptr = nullptr

Definition at line 101 of file OpenCL.h.

Referenced by clSetKernelArg().

◆ clSetKernelExecInfo_ptr

std::function<decltype( clSetKernelExecInfo )> clSetKernelExecInfo_ptr = nullptr

Definition at line 142 of file OpenCL.h.

Referenced by clSetKernelExecInfo().

◆ clSVMAlloc_ptr

std::function<decltype( clSVMAlloc )> clSVMAlloc_ptr = nullptr

◆ clSVMFree_ptr

std::function<decltype( clSVMFree )> clSVMFree_ptr = nullptr

◆ clWaitForEvents_ptr

std::function<decltype( clWaitForEvents )> clWaitForEvents_ptr = nullptr

Definition at line 140 of file OpenCL.h.

Referenced by clWaitForEvents().


The documentation for this class was generated from the following files:
clGetProgramInfo
cl_int clGetProgramInfo(cl_program program, cl_program_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: OpenCL.cpp:754
clCreateContextFromType
cl_context clCreateContextFromType(const cl_context_properties *properties, cl_device_type device_type, void(*pfn_notify)(const char *, const void *, size_t, void *), void *user_data, cl_int *errcode_ret)
Definition: OpenCL.cpp:383
clFlush
cl_int clFlush(cl_command_queue command_queue)
Definition: OpenCL.cpp:726
clCreateProgramWithSource
cl_program clCreateProgramWithSource(cl_context context, cl_uint count, const char **strings, const size_t *lengths, cl_int *errcode_ret)
Definition: OpenCL.cpp:831
clRetainContext
cl_int clRetainContext(cl_context context)
Definition: OpenCL.cpp:698
clEnqueueSVMMap
cl_int clEnqueueSVMMap(cl_command_queue command_queue, cl_bool blocking_map, cl_map_flags flags, void *svm_ptr, size_t size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
Definition: OpenCL.cpp:257
clGetDeviceIDs
cl_int clGetDeviceIDs(cl_platform_id platform, cl_device_type device_type, cl_uint num_entries, cl_device_id *devices, cl_uint *num_devices)
Definition: OpenCL.cpp:868
clRetainProgram
cl_int clRetainProgram(cl_program program)
Definition: OpenCL.cpp:617
clSVMFree
void clSVMFree(cl_context context, void *svm_pointer)
Definition: OpenCL.cpp:301
clReleaseEvent
cl_int clReleaseEvent(cl_event event)
Definition: OpenCL.cpp:537
clRetainKernel
cl_int clRetainKernel(cl_kernel kernel)
Definition: OpenCL.cpp:794
clReleaseProgram
cl_int clReleaseProgram(cl_program program)
Definition: OpenCL.cpp:712
clEnqueueNDRangeKernel
cl_int clEnqueueNDRangeKernel(cl_command_queue command_queue, cl_kernel kernel, cl_uint work_dim, const size_t *global_work_offset, const size_t *global_work_size, const size_t *local_work_size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
Definition: OpenCL.cpp:421
clBuildProgram
cl_int clBuildProgram(cl_program program, cl_uint num_devices, const cl_device_id *device_list, const char *options, void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data), void *user_data)
Definition: OpenCL.cpp:401
clGetCommandQueueInfo
cl_int clGetCommandQueueInfo(cl_command_queue command_queue, cl_command_queue_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: OpenCL.cpp:989
clEnqueueWriteBuffer
cl_int clEnqueueWriteBuffer(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_write, size_t offset, size_t size, const void *ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
Definition: OpenCL.cpp:551
clCreateContext
cl_context clCreateContext(const cl_context_properties *properties, cl_uint num_devices, const cl_device_id *devices, void(*pfn_notify)(const char *, const void *, size_t, void *), void *user_data, cl_int *errcode_ret)
Definition: OpenCL.cpp:363
arm_compute::CLSymbols::load
bool load(const std::vector< std::string > &libraries_filenames, bool use_loader=false)
This method attempts to load the OpenCL symbols from the first available library from the provided Op...
Definition: OpenCL.cpp:98
clEnqueueMapBuffer
void * clEnqueueMapBuffer(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_map, cl_map_flags map_flags, size_t offset, size_t size, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event, cl_int *errcode_ret)
Definition: OpenCL.cpp:631
clWaitForEvents
cl_int clWaitForEvents(cl_uint num_events, const cl_event *event_list)
Definition: OpenCL.cpp:242
clCreateBuffer
cl_mem clCreateBuffer(cl_context context, cl_mem_flags flags, size_t size, void *host_ptr, cl_int *errcode_ret)
Definition: OpenCL.cpp:808
clGetEventProfilingInfo
cl_int clGetEventProfilingInfo(cl_event event, cl_profiling_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: OpenCL.cpp:1027
clReleaseCommandQueue
cl_int clReleaseCommandQueue(cl_command_queue command_queue)
Definition: OpenCL.cpp:659
clReleaseMemObject
cl_int clReleaseMemObject(cl_mem memobj)
Definition: OpenCL.cpp:476
clFinish
cl_int clFinish(cl_command_queue command_queue)
Definition: OpenCL.cpp:740
clGetMemObjectInfo
cl_int clGetMemObjectInfo(cl_mem memobj, cl_mem_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: OpenCL.cpp:904
arm_compute::CLSymbols::CLSymbols
CLSymbols() noexcept(false)
Default Constructor.
Definition: OpenCL.cpp:39
clEnqueueSVMUnmap
cl_int clEnqueueSVMUnmap(cl_command_queue command_queue, void *svm_ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
Definition: OpenCL.cpp:272
clImportMemoryARM
cl_mem clImportMemoryARM(cl_context context, cl_mem_flags flags, const cl_import_properties_arm *properties, void *memory, size_t size, cl_int *errcode_ret)
Definition: OpenCL.cpp:1087
clGetPlatformIDs
cl_int clGetPlatformIDs(cl_uint num_entries, cl_platform_id *platforms, cl_uint *num_platforms)
Definition: OpenCL.cpp:954
clSVMAlloc
void * clSVMAlloc(cl_context context, cl_svm_mem_flags_arm flags, size_t size, cl_uint alignment)
Definition: OpenCL.cpp:287
arm_compute::test::validation::ss
std::stringstream ss(mlgo_str)
clRetainCommandQueue
cl_int clRetainCommandQueue(cl_command_queue command_queue)
Definition: OpenCL.cpp:510
ARM_COMPUTE_ERROR_ON_MSG
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:457
clGetContextInfo
cl_int clGetContextInfo(cl_context context, cl_context_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: OpenCL.cpp:311
name
const char * name
Definition: NEBatchNormalizationLayerKernel.cpp:60
clGetProgramBuildInfo
cl_int clGetProgramBuildInfo(cl_program program, cl_device_id device, cl_program_build_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: OpenCL.cpp:597
LOAD_FUNCTION_PTR
#define LOAD_FUNCTION_PTR(func_name, handle)
clCreateKernel
cl_kernel clCreateKernel(cl_program program, const char *kernel_name, cl_int *errcode_ret)
Definition: OpenCL.cpp:773
clGetKernelInfo
cl_int clGetKernelInfo(cl_kernel kernel, cl_kernel_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: OpenCL.cpp:1008
clCreateImage
cl_mem clCreateImage(cl_context context, cl_mem_flags flags, const cl_image_format *image_format, const cl_image_desc *image_desc, void *host_ptr, cl_int *errcode_ret)
Definition: OpenCL.cpp:1046
clGetPlatformInfo
cl_int clGetPlatformInfo(cl_platform_id platform, cl_platform_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: OpenCL.cpp:936
clReleaseContext
cl_int clReleaseContext(cl_context context)
Definition: OpenCL.cpp:524
clCreateProgramWithBinary
cl_program clCreateProgramWithBinary(cl_context context, cl_uint num_devices, const cl_device_id *device_list, const size_t *lengths, const unsigned char **binaries, cl_int *binary_status, cl_int *errcode_ret)
Definition: OpenCL.cpp:673
arm_compute::CLSymbols::clBuildProgram_ptr
std::function< decltype(clBuildProgram)> clBuildProgram_ptr
Definition: OpenCL.h:99
clEnqueueUnmapMemObject
cl_int clEnqueueUnmapMemObject(cl_command_queue command_queue, cl_mem memobj, void *mapped_ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
Definition: OpenCL.cpp:490
clSetKernelExecInfo
cl_int clSetKernelExecInfo(cl_kernel kernel, cl_kernel_exec_info param_name, size_t param_value_size, const void *param_value)
Definition: OpenCL.cpp:1069
clCreateCommandQueueWithProperties
cl_command_queue clCreateCommandQueueWithProperties(cl_context context, cl_device_id device, const cl_queue_properties *properties, cl_int *errcode_ret)
Definition: OpenCL.cpp:346
clRetainMemObject
cl_int clRetainMemObject(cl_mem memobj)
Definition: OpenCL.cpp:462
arm_compute::utility::for_each
void for_each(F &&)
Base case of for_each.
Definition: Utility.h:111
clEnqueueReadBuffer
cl_int clEnqueueReadBuffer(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read, size_t offset, size_t size, void *ptr, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
Definition: OpenCL.cpp:574
clSetKernelArg
cl_int clSetKernelArg(cl_kernel kernel, cl_uint arg_index, size_t arg_size, const void *arg_value)
Definition: OpenCL.cpp:444
clRetainEvent
cl_int clRetainEvent(cl_event event)
Definition: OpenCL.cpp:922
clCreateCommandQueue
cl_command_queue clCreateCommandQueue(cl_context context, cl_device_id device, cl_command_queue_properties properties, cl_int *errcode_ret)
Definition: OpenCL.cpp:329
clGetDeviceInfo
cl_int clGetDeviceInfo(cl_device_id device, cl_device_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: OpenCL.cpp:886
clEnqueueMarker
cl_int clEnqueueMarker(cl_command_queue command_queue, cl_event *event)
Definition: OpenCL.cpp:227
clGetKernelWorkGroupInfo
cl_int clGetKernelWorkGroupInfo(cl_kernel kernel, cl_device_id device, cl_kernel_work_group_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Definition: OpenCL.cpp:969
clReleaseKernel
cl_int clReleaseKernel(cl_kernel kernel)
Definition: OpenCL.cpp:854