Compute Library
 23.11
OpenCL.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2023 Arm Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 
25 #pragma GCC diagnostic push
26 #pragma GCC diagnostic ignored "-Wunused-parameter"
28 #pragma GCC diagnostic pop
29 
30 #include "arm_compute/core/Error.h"
31 
32 #include <algorithm>
33 #include <dlfcn.h>
34 #include <iostream>
35 #include <sstream>
36 
37 namespace arm_compute
38 {
39 CLSymbols::CLSymbols() noexcept(false) : _loaded({false, false})
40 {
41 }
42 
44 {
45  static CLSymbols symbols;
46  return symbols;
47 }
48 
50 {
51  static const std::vector<std::string> libraries_filenames{"libOpenCL.so", "libGLES_mali.so", "libmali.so"};
52 
53  if (_loaded.first)
54  {
55  return _loaded.second;
56  }
57 
58  // Indicate that default loading has been tried
59  _loaded.first = true;
60 
61  if (load(libraries_filenames, /* use_loader */ false))
62  {
64  "Failed to load OpenCL symbols from shared library");
65  return true;
66  }
67 
68 #ifdef __ANDROID__
69  // When running in NDK environment, the above libraries are not accessible.
70  static const std::vector<std::string> android_libraries_filenames{"libOpenCL-pixel.so", "libOpenCL-car.so"};
71 
72  if (load(android_libraries_filenames, /* use_loader */ true))
73  {
75  "Failed to load OpenCL symbols from android shared library");
76  return true;
77  }
78 #endif // __ANDROID__
79 
80  // If not returned till here then libraries not found
81  std::stringstream ss;
82  std::for_each(libraries_filenames.begin(), libraries_filenames.end(),
83  [&ss](const std::string &s) { ss << s << " "; });
84 #ifdef __ANDROID__
85  std::for_each(android_libraries_filenames.begin(), android_libraries_filenames.end(),
86  [&ss](const std::string &s) { ss << s << " "; });
87 #endif // __ANDROID__
88  std::cerr << "Couldn't find any of the following OpenCL library: " << ss.str() << std::endl;
89  return false;
90 }
91 
92 bool CLSymbols::load(const std::vector<std::string> &libraries_filenames, bool use_loader)
93 {
94  void *handle = nullptr;
95  unsigned int index = 0;
96  for (index = 0; index < libraries_filenames.size(); ++index)
97  {
98  handle = dlopen(libraries_filenames[index].c_str(), RTLD_LAZY | RTLD_LOCAL);
99  if (handle != nullptr)
100  {
101  break;
102  }
103  }
104  if (index == libraries_filenames.size())
105  {
106  // Set status of loading to failed
107  _loaded.second = false;
108  return false;
109  }
110 
111 #ifdef __ANDROID__
112  typedef void *(*loadOpenCLPointer_t)(const char *name);
113  loadOpenCLPointer_t loadOpenCLPointer;
114  if (use_loader)
115  {
116  typedef void (*enableOpenCL_t)();
117  enableOpenCL_t enableOpenCL = reinterpret_cast<enableOpenCL_t>(dlsym(handle, "enableOpenCL"));
118  enableOpenCL();
119 
120  loadOpenCLPointer = reinterpret_cast<loadOpenCLPointer_t>(dlsym(handle, "loadOpenCLPointer"));
121  }
122  else
123  {
124  loadOpenCLPointer = nullptr;
125  }
126 #define LOAD_FUNCTION_PTR(func_name, _handle) \
127  func_name##_ptr = reinterpret_cast<decltype(func_name) *>(use_loader ? loadOpenCLPointer(#func_name) \
128  : dlsym(handle, #func_name));
129 #else /* __ANDROID__ */
130  (void)use_loader; // Avoid unused warning
131 #define LOAD_FUNCTION_PTR(func_name, handle) \
132  func_name##_ptr = reinterpret_cast<decltype(func_name) *>(dlsym(handle, #func_name));
133 #endif /* __ANDROID__ */
134 
149  LOAD_FUNCTION_PTR(clFlush, handle);
150  LOAD_FUNCTION_PTR(clFinish, handle);
176  LOAD_FUNCTION_PTR(clSVMAlloc, handle);
177  LOAD_FUNCTION_PTR(clSVMFree, handle);
184 
185  // Command buffer and mutable dispatch command buffer extensions
192 
194 
195  // Third-party extensions
197 
198 #undef LOAD_FUNCTION_PTR
199 
200  //Don't call dlclose(handle) or all the symbols will be unloaded !
201 
202  // Disable default loading and set status to successful
203  _loaded = std::make_pair(true, true);
204 
205  return true;
206 }
207 
209 {
211 
212  // Using static objects that rely on OpenCL in their constructor or
213  // destructor is implementation defined according to the OpenCL API
214  // Specification. These objects include CLScheduler.
215  //
216  // For compatibility with OpenCL runtimes that also use static objects to
217  // hold their state, we call a harmless OpenCL function (clGetPlatformIDs
218  // with invalid parameters must result in CL_INVALID_VALUE) to ensure the
219  // runtimes have a chance to initialize their static objects first. Thanks
220  // to C++11 rules about normal program completion (cf [basic.start]), this
221  // ensures their static objects are destroyed last, i.e. after the
222  // singleton CLScheduler is destroyed.
223  //
224  // When OpenCL is not available, this call results in CL_OUT_OF_RESOURCES,
225  // which is equally harmless.
226  (void)clGetPlatformIDs(0, nullptr, nullptr);
227 
228  return CLSymbols::get().clBuildProgram_ptr != nullptr;
229 }
230 } // namespace arm_compute
231 
232 cl_int clEnqueueMarker(cl_command_queue command_queue, cl_event *event)
233 {
236  if (func != nullptr)
237  {
238  return func(command_queue, event);
239  }
240  else
241  {
242  return CL_OUT_OF_RESOURCES;
243  }
244 }
245 
246 cl_int clWaitForEvents(cl_uint num_events, const cl_event *event_list)
247 {
250  if (func != nullptr)
251  {
252  return func(num_events, event_list);
253  }
254  else
255  {
256  return CL_OUT_OF_RESOURCES;
257  }
258 }
259 
260 cl_int clEnqueueSVMMap(cl_command_queue command_queue,
261  cl_bool blocking_map,
262  cl_map_flags flags,
263  void *svm_ptr,
264  size_t size,
265  cl_uint num_events_in_wait_list,
266  const cl_event *event_wait_list,
267  cl_event *event)
268 {
271  if (func != nullptr)
272  {
273  return func(command_queue, blocking_map, flags, svm_ptr, size, num_events_in_wait_list, event_wait_list, event);
274  }
275  else
276  {
277  return CL_OUT_OF_RESOURCES;
278  }
279 }
280 
281 cl_int clEnqueueSVMUnmap(cl_command_queue command_queue,
282  void *svm_ptr,
283  cl_uint num_events_in_wait_list,
284  const cl_event *event_wait_list,
285  cl_event *event)
286 {
289  if (func != nullptr)
290  {
291  return func(command_queue, svm_ptr, num_events_in_wait_list, event_wait_list, event);
292  }
293  else
294  {
295  return CL_OUT_OF_RESOURCES;
296  }
297 }
298 
299 void *clSVMAlloc(cl_context context, cl_svm_mem_flags_arm flags, size_t size, cl_uint alignment)
300 {
303  if (func != nullptr)
304  {
305  return func(context, flags, size, alignment);
306  }
307  else
308  {
309  return nullptr;
310  }
311 }
312 
313 void clSVMFree(cl_context context, void *svm_pointer)
314 {
317  if (func != nullptr)
318  {
319  func(context, svm_pointer);
320  }
321 }
322 
323 cl_int clGetContextInfo(cl_context context,
324  cl_context_info param_name,
325  size_t param_value_size,
326  void *param_value,
327  size_t *param_value_size_ret)
328 {
331  if (func != nullptr)
332  {
333  return func(context, param_name, param_value_size, param_value, param_value_size_ret);
334  }
335  else
336  {
337  return CL_OUT_OF_RESOURCES;
338  }
339 }
340 
341 cl_command_queue clCreateCommandQueue(cl_context context,
342  cl_device_id device,
343  cl_command_queue_properties properties,
344  cl_int *errcode_ret)
345 {
348  if (func != nullptr)
349  {
350  return func(context, device, properties, errcode_ret);
351  }
352  else
353  {
354  return nullptr;
355  }
356 }
357 
358 cl_command_queue clCreateCommandQueueWithProperties(cl_context context,
359  cl_device_id device,
360  const cl_queue_properties *properties,
361  cl_int *errcode_ret)
362 {
365  if (func != nullptr)
366  {
367  return func(context, device, properties, errcode_ret);
368  }
369  else
370  {
371  return nullptr;
372  }
373 }
374 
375 cl_context clCreateContext(const cl_context_properties *properties,
376  cl_uint num_devices,
377  const cl_device_id *devices,
378  void (*pfn_notify)(const char *, const void *, size_t, void *),
379  void *user_data,
380  cl_int *errcode_ret)
381 {
384  if (func != nullptr)
385  {
386  return func(properties, num_devices, devices, pfn_notify, user_data, errcode_ret);
387  }
388  else
389  {
390  return nullptr;
391  }
392 }
393 
394 cl_context clCreateContextFromType(const cl_context_properties *properties,
395  cl_device_type device_type,
396  void (*pfn_notify)(const char *, const void *, size_t, void *),
397  void *user_data,
398  cl_int *errcode_ret)
399 {
402  if (func != nullptr)
403  {
404  return func(properties, device_type, pfn_notify, user_data, errcode_ret);
405  }
406  else
407  {
408  return nullptr;
409  }
410 }
411 
412 cl_int clBuildProgram(cl_program program,
413  cl_uint num_devices,
414  const cl_device_id *device_list,
415  const char *options,
416  void(CL_CALLBACK *pfn_notify)(cl_program program, void *user_data),
417  void *user_data)
418 {
421  if (func != nullptr)
422  {
423  return func(program, num_devices, device_list, options, pfn_notify, user_data);
424  }
425  else
426  {
427  return CL_OUT_OF_RESOURCES;
428  }
429 }
430 
431 cl_int clEnqueueNDRangeKernel(cl_command_queue command_queue,
432  cl_kernel kernel,
433  cl_uint work_dim,
434  const size_t *global_work_offset,
435  const size_t *global_work_size,
436  const size_t *local_work_size,
437  cl_uint num_events_in_wait_list,
438  const cl_event *event_wait_list,
439  cl_event *event)
440 {
443  if (func != nullptr)
444  {
445  return func(command_queue, kernel, work_dim, global_work_offset, global_work_size, local_work_size,
446  num_events_in_wait_list, event_wait_list, event);
447  }
448  else
449  {
450  return CL_OUT_OF_RESOURCES;
451  }
452 }
453 
454 cl_int clSetKernelArg(cl_kernel kernel, cl_uint arg_index, size_t arg_size, const void *arg_value)
455 {
458  if (func != nullptr)
459  {
460  return func(kernel, arg_index, arg_size, arg_value);
461  }
462  else
463  {
464  return CL_OUT_OF_RESOURCES;
465  }
466 }
467 
468 cl_int clRetainMemObject(cl_mem memobj)
469 {
472  if (func != nullptr)
473  {
474  return func(memobj);
475  }
476  else
477  {
478  return CL_OUT_OF_RESOURCES;
479  }
480 }
481 
482 cl_int clReleaseMemObject(cl_mem memobj)
483 {
486  if (func != nullptr)
487  {
488  return func(memobj);
489  }
490  else
491  {
492  return CL_OUT_OF_RESOURCES;
493  }
494 }
495 
496 cl_int clEnqueueUnmapMemObject(cl_command_queue command_queue,
497  cl_mem memobj,
498  void *mapped_ptr,
499  cl_uint num_events_in_wait_list,
500  const cl_event *event_wait_list,
501  cl_event *event)
502 {
505  if (func != nullptr)
506  {
507  return func(command_queue, memobj, mapped_ptr, num_events_in_wait_list, event_wait_list, event);
508  }
509  else
510  {
511  return CL_OUT_OF_RESOURCES;
512  }
513 }
514 
515 cl_int clRetainCommandQueue(cl_command_queue command_queue)
516 {
519  if (func != nullptr)
520  {
521  return func(command_queue);
522  }
523  else
524  {
525  return CL_OUT_OF_RESOURCES;
526  }
527 }
528 
529 cl_int clReleaseContext(cl_context context)
530 {
533  if (func != nullptr)
534  {
535  return func(context);
536  }
537  else
538  {
539  return CL_OUT_OF_RESOURCES;
540  }
541 }
542 cl_int clReleaseEvent(cl_event event)
543 {
546  if (func != nullptr)
547  {
548  return func(event);
549  }
550  else
551  {
552  return CL_OUT_OF_RESOURCES;
553  }
554 }
555 
556 cl_int clEnqueueWriteBuffer(cl_command_queue command_queue,
557  cl_mem buffer,
558  cl_bool blocking_write,
559  size_t offset,
560  size_t size,
561  const void *ptr,
562  cl_uint num_events_in_wait_list,
563  const cl_event *event_wait_list,
564  cl_event *event)
565 {
568  if (func != nullptr)
569  {
570  return func(command_queue, buffer, blocking_write, offset, size, ptr, num_events_in_wait_list, event_wait_list,
571  event);
572  }
573  else
574  {
575  return CL_OUT_OF_RESOURCES;
576  }
577 }
578 
579 cl_int clEnqueueReadBuffer(cl_command_queue command_queue,
580  cl_mem buffer,
581  cl_bool blocking_read,
582  size_t offset,
583  size_t size,
584  void *ptr,
585  cl_uint num_events_in_wait_list,
586  const cl_event *event_wait_list,
587  cl_event *event)
588 {
591  if (func != nullptr)
592  {
593  return func(command_queue, buffer, blocking_read, offset, size, ptr, num_events_in_wait_list, event_wait_list,
594  event);
595  }
596  else
597  {
598  return CL_OUT_OF_RESOURCES;
599  }
600 }
601 
602 cl_int clGetProgramBuildInfo(cl_program program,
603  cl_device_id device,
604  cl_program_build_info param_name,
605  size_t param_value_size,
606  void *param_value,
607  size_t *param_value_size_ret)
608 {
611  if (func != nullptr)
612  {
613  return func(program, device, param_name, param_value_size, param_value, param_value_size_ret);
614  }
615  else
616  {
617  return CL_OUT_OF_RESOURCES;
618  }
619 }
620 
621 cl_int clRetainProgram(cl_program program)
622 {
625  if (func != nullptr)
626  {
627  return func(program);
628  }
629  else
630  {
631  return CL_OUT_OF_RESOURCES;
632  }
633 }
634 
635 void *clEnqueueMapBuffer(cl_command_queue command_queue,
636  cl_mem buffer,
637  cl_bool blocking_map,
638  cl_map_flags map_flags,
639  size_t offset,
640  size_t size,
641  cl_uint num_events_in_wait_list,
642  const cl_event *event_wait_list,
643  cl_event *event,
644  cl_int *errcode_ret)
645 {
648  if (func != nullptr)
649  {
650  return func(command_queue, buffer, blocking_map, map_flags, offset, size, num_events_in_wait_list,
651  event_wait_list, event, errcode_ret);
652  }
653  else
654  {
655  if (errcode_ret != nullptr)
656  {
657  *errcode_ret = CL_OUT_OF_RESOURCES;
658  }
659  return nullptr;
660  }
661 }
662 
663 cl_int clReleaseCommandQueue(cl_command_queue command_queue)
664 {
667  if (func != nullptr)
668  {
669  return func(command_queue);
670  }
671  else
672  {
673  return CL_OUT_OF_RESOURCES;
674  }
675 }
676 
677 cl_program clCreateProgramWithBinary(cl_context context,
678  cl_uint num_devices,
679  const cl_device_id *device_list,
680  const size_t *lengths,
681  const unsigned char **binaries,
682  cl_int *binary_status,
683  cl_int *errcode_ret)
684 {
687  if (func != nullptr)
688  {
689  return func(context, num_devices, device_list, lengths, binaries, binary_status, errcode_ret);
690  }
691  else
692  {
693  if (errcode_ret != nullptr)
694  {
695  *errcode_ret = CL_OUT_OF_RESOURCES;
696  }
697  return nullptr;
698  }
699 }
700 
701 cl_int clRetainContext(cl_context context)
702 {
705  if (func != nullptr)
706  {
707  return func(context);
708  }
709  else
710  {
711  return CL_OUT_OF_RESOURCES;
712  }
713 }
714 
715 cl_int clReleaseProgram(cl_program program)
716 {
719  if (func != nullptr)
720  {
721  return func(program);
722  }
723  else
724  {
725  return CL_OUT_OF_RESOURCES;
726  }
727 }
728 
729 cl_int clFlush(cl_command_queue command_queue)
730 {
733  if (func != nullptr)
734  {
735  return func(command_queue);
736  }
737  else
738  {
739  return CL_OUT_OF_RESOURCES;
740  }
741 }
742 
743 cl_int clFinish(cl_command_queue command_queue)
744 {
747  if (func != nullptr)
748  {
749  return func(command_queue);
750  }
751  else
752  {
753  return CL_OUT_OF_RESOURCES;
754  }
755 }
756 
757 cl_int clGetProgramInfo(cl_program program,
758  cl_program_info param_name,
759  size_t param_value_size,
760  void *param_value,
761  size_t *param_value_size_ret)
762 {
765  if (func != nullptr)
766  {
767  return func(program, param_name, param_value_size, param_value, param_value_size_ret);
768  }
769  else
770  {
771  return CL_OUT_OF_RESOURCES;
772  }
773 }
774 
775 cl_kernel clCreateKernel(cl_program program, const char *kernel_name, cl_int *errcode_ret)
776 {
779  if (func != nullptr)
780  {
781  return func(program, kernel_name, errcode_ret);
782  }
783  else
784  {
785  if (errcode_ret != nullptr)
786  {
787  *errcode_ret = CL_OUT_OF_RESOURCES;
788  }
789  return nullptr;
790  }
791 }
792 
793 cl_int clRetainKernel(cl_kernel kernel)
794 {
797  if (func != nullptr)
798  {
799  return func(kernel);
800  }
801  else
802  {
803  return CL_OUT_OF_RESOURCES;
804  }
805 }
806 
807 cl_mem clCreateBuffer(cl_context context, cl_mem_flags flags, size_t size, void *host_ptr, cl_int *errcode_ret)
808 {
811  if (func != nullptr)
812  {
813  return func(context, flags, size, host_ptr, errcode_ret);
814  }
815  else
816  {
817  if (errcode_ret != nullptr)
818  {
819  *errcode_ret = CL_OUT_OF_RESOURCES;
820  }
821  return nullptr;
822  }
823 }
824 
826  cl_context context, cl_uint count, const char **strings, const size_t *lengths, cl_int *errcode_ret)
827 {
830  if (func != nullptr)
831  {
832  return func(context, count, strings, lengths, errcode_ret);
833  }
834  else
835  {
836  if (errcode_ret != nullptr)
837  {
838  *errcode_ret = CL_OUT_OF_RESOURCES;
839  }
840  return nullptr;
841  }
842 }
843 
844 cl_int clReleaseKernel(cl_kernel kernel)
845 {
848  if (func != nullptr)
849  {
850  return func(kernel);
851  }
852  else
853  {
854  return CL_OUT_OF_RESOURCES;
855  }
856 }
857 
858 cl_int clGetDeviceIDs(cl_platform_id platform,
859  cl_device_type device_type,
860  cl_uint num_entries,
861  cl_device_id *devices,
862  cl_uint *num_devices)
863 {
866  if (func != nullptr)
867  {
868  return func(platform, device_type, num_entries, devices, num_devices);
869  }
870  else
871  {
872  return CL_OUT_OF_RESOURCES;
873  }
874 }
875 
876 cl_int clGetDeviceInfo(cl_device_id device,
877  cl_device_info param_name,
878  size_t param_value_size,
879  void *param_value,
880  size_t *param_value_size_ret)
881 {
884  if (func != nullptr)
885  {
886  return func(device, param_name, param_value_size, param_value, param_value_size_ret);
887  }
888  else
889  {
890  return CL_OUT_OF_RESOURCES;
891  }
892 }
893 
895  cl_mem memobj, cl_mem_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
896 {
899  if (func != nullptr)
900  {
901  return func(memobj, param_name, param_value_size, param_value, param_value_size_ret);
902  }
903  else
904  {
905  return CL_OUT_OF_RESOURCES;
906  }
907 }
908 
909 cl_int clRetainEvent(cl_event event)
910 {
913  if (func != nullptr)
914  {
915  return func(event);
916  }
917  else
918  {
919  return CL_OUT_OF_RESOURCES;
920  }
921 }
922 
923 cl_int clGetPlatformInfo(cl_platform_id platform,
924  cl_platform_info param_name,
925  size_t param_value_size,
926  void *param_value,
927  size_t *param_value_size_ret)
928 {
931  if (func != nullptr)
932  {
933  return func(platform, param_name, param_value_size, param_value, param_value_size_ret);
934  }
935  else
936  {
937  return CL_OUT_OF_RESOURCES;
938  }
939 }
940 
941 cl_int clGetPlatformIDs(cl_uint num_entries, cl_platform_id *platforms, cl_uint *num_platforms)
942 {
945  if (func != nullptr)
946  {
947  return func(num_entries, platforms, num_platforms);
948  }
949  else
950  {
951  return CL_OUT_OF_RESOURCES;
952  }
953 }
954 
955 cl_int clGetKernelWorkGroupInfo(cl_kernel kernel,
956  cl_device_id device,
957  cl_kernel_work_group_info param_name,
958  size_t param_value_size,
959  void *param_value,
960  size_t *param_value_size_ret)
961 {
964  if (func != nullptr)
965  {
966  return func(kernel, device, param_name, param_value_size, param_value, param_value_size_ret);
967  }
968  else
969  {
970  return CL_OUT_OF_RESOURCES;
971  }
972 }
973 
974 cl_int clGetCommandQueueInfo(cl_command_queue command_queue,
975  cl_command_queue_info param_name,
976  size_t param_value_size,
977  void *param_value,
978  size_t *param_value_size_ret)
979 {
982  if (func != nullptr)
983  {
984  return func(command_queue, param_name, param_value_size, param_value, param_value_size_ret);
985  }
986  else
987  {
988  return CL_OUT_OF_RESOURCES;
989  }
990 }
991 
992 cl_int clGetKernelInfo(cl_kernel kernel,
993  cl_kernel_info param_name,
994  size_t param_value_size,
995  void *param_value,
996  size_t *param_value_size_ret)
997 {
1000  if (func != nullptr)
1001  {
1002  return func(kernel, param_name, param_value_size, param_value, param_value_size_ret);
1003  }
1004  else
1005  {
1006  return CL_OUT_OF_RESOURCES;
1007  }
1008 }
1009 
1010 cl_int clGetEventProfilingInfo(cl_event event,
1011  cl_profiling_info param_name,
1012  size_t param_value_size,
1013  void *param_value,
1014  size_t *param_value_size_ret)
1015 {
1018  if (func != nullptr)
1019  {
1020  return func(event, param_name, param_value_size, param_value, param_value_size_ret);
1021  }
1022  else
1023  {
1024  return CL_OUT_OF_RESOURCES;
1025  }
1026 }
1027 
1028 cl_mem clCreateImage(cl_context context,
1029  cl_mem_flags flags,
1030  const cl_image_format *image_format,
1031  const cl_image_desc *image_desc,
1032  void *host_ptr,
1033  cl_int *errcode_ret)
1034 {
1037  if (func != nullptr)
1038  {
1039  return func(context, flags, image_format, image_desc, host_ptr, errcode_ret);
1040  }
1041  else
1042  {
1043  if (errcode_ret != nullptr)
1044  {
1045  *errcode_ret = CL_OUT_OF_RESOURCES;
1046  }
1047  return nullptr;
1048  }
1049 }
1050 
1051 cl_int
1052 clSetKernelExecInfo(cl_kernel kernel, cl_kernel_exec_info param_name, size_t param_value_size, const void *param_value)
1053 {
1056  if (func != nullptr)
1057  {
1058  return func(kernel, param_name, param_value_size, param_value);
1059  }
1060  else
1061  {
1062  return CL_OUT_OF_RESOURCES;
1063  }
1064 }
1065 
1066 cl_command_buffer_khr clCreateCommandBufferKHR(cl_uint num_queues,
1067  const cl_command_queue *queues,
1068  const cl_command_buffer_properties_khr *properties,
1069  cl_int *errcode_ret)
1070 {
1073 
1074  if (func != nullptr)
1075  {
1076  return func(num_queues, queues, properties, errcode_ret);
1077  }
1078  else
1079  {
1080  if (errcode_ret != nullptr)
1081  {
1082  *errcode_ret = CL_INVALID_OPERATION;
1083  }
1084 
1085  return {};
1086  }
1087 }
1088 
1089 cl_int clFinalizeCommandBufferKHR(cl_command_buffer_khr command_buffer)
1090 {
1093 
1094  if (func != nullptr)
1095  {
1096  return func(command_buffer);
1097  }
1098  else
1099  {
1100  return CL_INVALID_OPERATION;
1101  }
1102 }
1103 
1104 cl_int clRetainCommandBufferKHR(cl_command_buffer_khr command_buffer)
1105 {
1108 
1109  if (func != nullptr)
1110  {
1111  return func(command_buffer);
1112  }
1113  else
1114  {
1115  return CL_INVALID_OPERATION;
1116  }
1117 }
1118 
1119 cl_int clReleaseCommandBufferKHR(cl_command_buffer_khr command_buffer)
1120 {
1123 
1124  if (func != nullptr)
1125  {
1126  return func(command_buffer);
1127  }
1128  else
1129  {
1130  return CL_INVALID_OPERATION;
1131  }
1132 }
1133 
1134 cl_int clEnqueueCommandBufferKHR(cl_uint num_queues,
1135  cl_command_queue *queues,
1136  cl_command_buffer_khr command_buffer,
1137  cl_uint num_events_in_wait_list,
1138  const cl_event *event_wait_list,
1139  cl_event *event)
1140 {
1143 
1144  if (func != nullptr)
1145  {
1146  return func(num_queues, queues, command_buffer, num_events_in_wait_list, event_wait_list, event);
1147  }
1148  else
1149  {
1150  return CL_INVALID_OPERATION;
1151  }
1152 }
1153 
1154 cl_int clCommandNDRangeKernelKHR(cl_command_buffer_khr command_buffer,
1155  cl_command_queue command_queue,
1156  const cl_ndrange_kernel_command_properties_khr *properties,
1157  cl_kernel kernel,
1158  cl_uint work_dim,
1159  const size_t *global_work_offset,
1160  const size_t *global_work_size,
1161  const size_t *local_work_size,
1162  cl_uint num_sync_points_in_wait_list,
1163  const cl_sync_point_khr *sync_point_wait_list,
1164  cl_sync_point_khr *sync_point,
1165  cl_mutable_command_khr *mutable_handle)
1166 {
1169 
1170  if (func != nullptr)
1171  {
1172  return func(command_buffer, command_queue, properties, kernel, work_dim, global_work_offset, global_work_size,
1173  local_work_size, num_sync_points_in_wait_list, sync_point_wait_list, sync_point, mutable_handle);
1174  }
1175  else
1176  {
1177  return CL_INVALID_OPERATION;
1178  }
1179 }
1180 
1181 cl_int clUpdateMutableCommandsKHR(cl_command_buffer_khr command_buffer,
1182  const cl_mutable_base_config_khr *mutable_config)
1183 {
1186 
1187  if (func != nullptr)
1188  {
1189  return func(command_buffer, mutable_config);
1190  }
1191  else
1192  {
1193  return CL_INVALID_OPERATION;
1194  }
1195 }
1196 
1197 cl_mem clImportMemoryARM(cl_context context,
1198  cl_mem_flags flags,
1199  const cl_import_properties_arm *properties,
1200  void *memory,
1201  size_t size,
1202  cl_int *errcode_ret)
1203 {
1206  if (func != nullptr)
1207  {
1208  return func(context, flags, properties, memory, size, errcode_ret);
1209  }
1210  else
1211  {
1212  if (errcode_ret != nullptr)
1213  {
1214  *errcode_ret = CL_OUT_OF_RESOURCES;
1215  }
1216  return nullptr;
1217  }
1218 }
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:757
clCreateCommandBufferKHR
cl_command_buffer_khr clCreateCommandBufferKHR(cl_uint num_queues, const cl_command_queue *queues, const cl_command_buffer_properties_khr *properties, cl_int *errcode_ret)
Definition: OpenCL.cpp:1066
arm_compute::CLSymbols::clEnqueueReadBuffer_ptr
std::function< decltype(clEnqueueReadBuffer)> clEnqueueReadBuffer_ptr
Definition: OpenCL.h:116
arm_compute::CLSymbols::clReleaseCommandBufferKHR_ptr
std::function< decltype(clReleaseCommandBufferKHR)> clReleaseCommandBufferKHR_ptr
Definition: OpenCL.h:146
arm_compute::CLSymbols::get
static CLSymbols & get()
Get the static instance of CLSymbols.
Definition: OpenCL.cpp:43
clCommandNDRangeKernelKHR
cl_int clCommandNDRangeKernelKHR(cl_command_buffer_khr command_buffer, cl_command_queue command_queue, const cl_ndrange_kernel_command_properties_khr *properties, 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_sync_points_in_wait_list, const cl_sync_point_khr *sync_point_wait_list, cl_sync_point_khr *sync_point, cl_mutable_command_khr *mutable_handle)
Definition: OpenCL.cpp:1154
arm_compute::opencl_is_available
bool opencl_is_available()
Check if OpenCL is available.
Definition: OpenCL.cpp:208
arm_compute::CLSymbols::clRetainContext_ptr
std::function< decltype(clRetainContext)> clRetainContext_ptr
Definition: OpenCL.h:110
arm_compute::CLSymbols::clReleaseKernel_ptr
std::function< decltype(clReleaseKernel)> clReleaseKernel_ptr
Definition: OpenCL.h:101
arm_compute::CLSymbols::clGetEventProfilingInfo_ptr
std::function< decltype(clGetEventProfilingInfo)> clGetEventProfilingInfo_ptr
Definition: OpenCL.h:133
arm_compute::CLSymbols::clEnqueueSVMUnmap_ptr
std::function< decltype(clEnqueueSVMUnmap)> clEnqueueSVMUnmap_ptr
Definition: OpenCL.h:137
arm_compute::CLSymbols::clGetDeviceInfo_ptr
std::function< decltype(clGetDeviceInfo)> clGetDeviceInfo_ptr
Definition: OpenCL.h:124
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:394
arm_compute::CLSymbols::clReleaseProgram_ptr
std::function< decltype(clReleaseProgram)> clReleaseProgram_ptr
Definition: OpenCL.h:109
clFlush
cl_int clFlush(cl_command_queue command_queue)
Definition: OpenCL.cpp:729
clCreateProgramWithSource
cl_program clCreateProgramWithSource(cl_context context, cl_uint count, const char **strings, const size_t *lengths, cl_int *errcode_ret)
Definition: OpenCL.cpp:825
clRetainContext
cl_int clRetainContext(cl_context context)
Definition: OpenCL.cpp:701
arm_compute::CLSymbols::clReleaseMemObject_ptr
std::function< decltype(clReleaseMemObject)> clReleaseMemObject_ptr
Definition: OpenCL.h:123
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:260
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:858
arm_compute::CLSymbols::clCreateCommandBufferKHR_ptr
std::function< decltype(clCreateCommandBufferKHR)> clCreateCommandBufferKHR_ptr
Definition: OpenCL.h:144
arm_compute::CLSymbols::clCreateProgramWithSource_ptr
std::function< decltype(clCreateProgramWithSource)> clCreateProgramWithSource_ptr
Definition: OpenCL.h:102
clRetainProgram
cl_int clRetainProgram(cl_program program)
Definition: OpenCL.cpp:621
arm_compute::CLSymbols::clRetainProgram_ptr
std::function< decltype(clRetainProgram)> clRetainProgram_ptr
Definition: OpenCL.h:114
clSVMFree
void clSVMFree(cl_context context, void *svm_pointer)
Definition: OpenCL.cpp:313
clReleaseEvent
cl_int clReleaseEvent(cl_event event)
Definition: OpenCL.cpp:542
clRetainKernel
cl_int clRetainKernel(cl_kernel kernel)
Definition: OpenCL.cpp:793
arm_compute::CLSymbols::clCreateBuffer_ptr
std::function< decltype(clCreateBuffer)> clCreateBuffer_ptr
Definition: OpenCL.h:103
clReleaseProgram
cl_int clReleaseProgram(cl_program program)
Definition: OpenCL.cpp:715
arm_compute::CLSymbols::clGetProgramInfo_ptr
std::function< decltype(clGetProgramInfo)> clGetProgramInfo_ptr
Definition: OpenCL.h:106
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:431
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:412
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:974
arm_compute::CLSymbols::clReleaseCommandQueue_ptr
std::function< decltype(clReleaseCommandQueue)> clReleaseCommandQueue_ptr
Definition: OpenCL.h:112
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:556
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:375
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:92
arm_compute::CLSymbols::clEnqueueSVMMap_ptr
std::function< decltype(clEnqueueSVMMap)> clEnqueueSVMMap_ptr
Definition: OpenCL.h:136
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:635
arm_compute::CLSymbols::clGetContextInfo_ptr
std::function< decltype(clGetContextInfo)> clGetContextInfo_ptr
Definition: OpenCL.h:97
arm_compute::CLSymbols::clRetainCommandQueue_ptr
std::function< decltype(clRetainCommandQueue)> clRetainCommandQueue_ptr
Definition: OpenCL.h:120
Error.h
clReleaseCommandBufferKHR
cl_int clReleaseCommandBufferKHR(cl_command_buffer_khr command_buffer)
Definition: OpenCL.cpp:1119
clWaitForEvents
cl_int clWaitForEvents(cl_uint num_events, const cl_event *event_list)
Definition: OpenCL.cpp:246
arm_compute::CLSymbols::clWaitForEvents_ptr
std::function< decltype(clWaitForEvents)> clWaitForEvents_ptr
Definition: OpenCL.h:139
arm_compute::CLSymbols::clEnqueueUnmapMemObject_ptr
std::function< decltype(clEnqueueUnmapMemObject)> clEnqueueUnmapMemObject_ptr
Definition: OpenCL.h:121
clCreateBuffer
cl_mem clCreateBuffer(cl_context context, cl_mem_flags flags, size_t size, void *host_ptr, cl_int *errcode_ret)
Definition: OpenCL.cpp:807
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:1010
clReleaseCommandQueue
cl_int clReleaseCommandQueue(cl_command_queue command_queue)
Definition: OpenCL.cpp:663
clReleaseMemObject
cl_int clReleaseMemObject(cl_mem memobj)
Definition: OpenCL.cpp:482
clFinish
cl_int clFinish(cl_command_queue command_queue)
Definition: OpenCL.cpp:743
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:894
arm_compute::CLSymbols::clSVMAlloc_ptr
std::function< decltype(clSVMAlloc)> clSVMAlloc_ptr
Definition: OpenCL.h:134
arm_compute::CLSymbols::clEnqueueNDRangeKernel_ptr
std::function< decltype(clEnqueueNDRangeKernel)> clEnqueueNDRangeKernel_ptr
Definition: OpenCL.h:99
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:281
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:1197
clGetPlatformIDs
cl_int clGetPlatformIDs(cl_uint num_entries, cl_platform_id *platforms, cl_uint *num_platforms)
Definition: OpenCL.cpp:941
clSVMAlloc
void * clSVMAlloc(cl_context context, cl_svm_mem_flags_arm flags, size_t size, cl_uint alignment)
Definition: OpenCL.cpp:299
arm_compute::test::validation::ss
std::stringstream ss(mlgo_str)
arm_compute::CLSymbols::clFinish_ptr
std::function< decltype(clFinish)> clFinish_ptr
Definition: OpenCL.h:108
arm_compute::CLSymbols::clGetPlatformIDs_ptr
std::function< decltype(clGetPlatformIDs)> clGetPlatformIDs_ptr
Definition: OpenCL.h:129
clRetainCommandQueue
cl_int clRetainCommandQueue(cl_command_queue command_queue)
Definition: OpenCL.cpp:515
arm_compute::CLSymbols::clCreateContext_ptr
std::function< decltype(clCreateContext)> clCreateContext_ptr
Definition: OpenCL.h:93
ARM_COMPUTE_ERROR_ON_MSG
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:456
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:323
arm_compute::CLSymbols::clGetKernelWorkGroupInfo_ptr
std::function< decltype(clGetKernelWorkGroupInfo)> clGetKernelWorkGroupInfo_ptr
Definition: OpenCL.h:130
arm_compute::CLSymbols::clCreateImage_ptr
std::function< decltype(clCreateImage)> clCreateImage_ptr
Definition: OpenCL.h:140
name
const char * name
Definition: NEBatchNormalizationLayerKernel.cpp:66
offset
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
Definition: helpers.h:1128
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:602
clUpdateMutableCommandsKHR
cl_int clUpdateMutableCommandsKHR(cl_command_buffer_khr command_buffer, const cl_mutable_base_config_khr *mutable_config)
Definition: OpenCL.cpp:1181
LOAD_FUNCTION_PTR
#define LOAD_FUNCTION_PTR(func_name, handle)
arm_compute::CLSymbols::clRetainCommandBufferKHR_ptr
std::function< decltype(clRetainCommandBufferKHR)> clRetainCommandBufferKHR_ptr
Definition: OpenCL.h:145
arm_compute::CLSymbols::load_default
bool load_default()
Load symbols from any of the default OpenCL library names.
Definition: OpenCL.cpp:49
OpenCL.h
Wrapper to configure the Khronos OpenCL C++ header.
arm_compute::CLSymbols::clGetCommandQueueInfo_ptr
std::function< decltype(clGetCommandQueueInfo)> clGetCommandQueueInfo_ptr
Definition: OpenCL.h:131
clCreateKernel
cl_kernel clCreateKernel(cl_program program, const char *kernel_name, cl_int *errcode_ret)
Definition: OpenCL.cpp:775
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:992
arm_compute::test::validation::context
auto context
Definition: DirectConv2d.cpp:156
arm_compute::CLSymbols::clGetDeviceIDs_ptr
std::function< decltype(clGetDeviceIDs)> clGetDeviceIDs_ptr
Definition: OpenCL.h:125
clFinalizeCommandBufferKHR
cl_int clFinalizeCommandBufferKHR(cl_command_buffer_khr command_buffer)
Definition: OpenCL.cpp:1089
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:1028
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:923
clReleaseContext
cl_int clReleaseContext(cl_context context)
Definition: OpenCL.cpp:529
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:677
arm_compute::CLSymbols::clEnqueueWriteBuffer_ptr
std::function< decltype(clEnqueueWriteBuffer)> clEnqueueWriteBuffer_ptr
Definition: OpenCL.h:117
arm_compute::CLSymbols::clEnqueueMarker_ptr
std::function< decltype(clEnqueueMarker)> clEnqueueMarker_ptr
Definition: OpenCL.h:138
arm_compute::CLSymbols::clCreateProgramWithBinary_ptr
std::function< decltype(clCreateProgramWithBinary)> clCreateProgramWithBinary_ptr
Definition: OpenCL.h:111
arm_compute::CLSymbols::clFinalizeCommandBufferKHR_ptr
std::function< decltype(clFinalizeCommandBufferKHR)> clFinalizeCommandBufferKHR_ptr
Definition: OpenCL.h:147
arm_compute::CLSymbols
Class for loading OpenCL symbols.
Definition: OpenCL.h:61
arm_compute::CLSymbols::clCreateCommandQueueWithProperties_ptr
std::function< decltype(clCreateCommandQueueWithProperties)> clCreateCommandQueueWithProperties_ptr
Definition: OpenCL.h:96
arm_compute::CLSymbols::clBuildProgram_ptr
std::function< decltype(clBuildProgram)> clBuildProgram_ptr
Definition: OpenCL.h:98
arm_compute::CLSymbols::clRetainEvent_ptr
std::function< decltype(clRetainEvent)> clRetainEvent_ptr
Definition: OpenCL.h:127
arm_compute
Copyright (c) 2017-2023 Arm Limited.
Definition: introduction.dox:24
arm_compute::CLSymbols::clRetainKernel_ptr
std::function< decltype(clRetainKernel)> clRetainKernel_ptr
Definition: OpenCL.h:104
arm_compute::CLSymbols::clCommandNDRangeKernelKHR_ptr
std::function< decltype(clCommandNDRangeKernelKHR)> clCommandNDRangeKernelKHR_ptr
Definition: OpenCL.h:149
arm_compute::CLSymbols::clGetKernelInfo_ptr
std::function< decltype(clGetKernelInfo)> clGetKernelInfo_ptr
Definition: OpenCL.h:132
clEnqueueCommandBufferKHR
cl_int clEnqueueCommandBufferKHR(cl_uint num_queues, cl_command_queue *queues, cl_command_buffer_khr command_buffer, cl_uint num_events_in_wait_list, const cl_event *event_wait_list, cl_event *event)
Definition: OpenCL.cpp:1134
arm_compute::CLSymbols::clImportMemoryARM_ptr
std::function< decltype(clImportMemoryARM)> clImportMemoryARM_ptr
Definition: OpenCL.h:154
arm_compute::CLSymbols::clGetPlatformInfo_ptr
std::function< decltype(clGetPlatformInfo)> clGetPlatformInfo_ptr
Definition: OpenCL.h:128
arm_compute::CLSymbols::clGetProgramBuildInfo_ptr
std::function< decltype(clGetProgramBuildInfo)> clGetProgramBuildInfo_ptr
Definition: OpenCL.h:115
clRetainCommandBufferKHR
cl_int clRetainCommandBufferKHR(cl_command_buffer_khr command_buffer)
Definition: OpenCL.cpp:1104
arm_compute::CLSymbols::clEnqueueMapBuffer_ptr
std::function< decltype(clEnqueueMapBuffer)> clEnqueueMapBuffer_ptr
Definition: OpenCL.h:113
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:496
arm_compute::CLSymbols::clEnqueueCommandBufferKHR_ptr
std::function< decltype(clEnqueueCommandBufferKHR)> clEnqueueCommandBufferKHR_ptr
Definition: OpenCL.h:148
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:1052
arm_compute::CLSymbols::clGetMemObjectInfo_ptr
std::function< decltype(clGetMemObjectInfo)> clGetMemObjectInfo_ptr
Definition: OpenCL.h:126
clCreateCommandQueueWithProperties
cl_command_queue clCreateCommandQueueWithProperties(cl_context context, cl_device_id device, const cl_queue_properties *properties, cl_int *errcode_ret)
Definition: OpenCL.cpp:358
clRetainMemObject
cl_int clRetainMemObject(cl_mem memobj)
Definition: OpenCL.cpp:468
arm_compute::CLSymbols::clFlush_ptr
std::function< decltype(clFlush)> clFlush_ptr
Definition: OpenCL.h:107
arm_compute::CLSymbols::clSetKernelExecInfo_ptr
std::function< decltype(clSetKernelExecInfo)> clSetKernelExecInfo_ptr
Definition: OpenCL.h:141
arm_compute::CLSymbols::clCreateCommandQueue_ptr
std::function< decltype(clCreateCommandQueue)> clCreateCommandQueue_ptr
Definition: OpenCL.h:95
arm_compute::CLSymbols::clReleaseContext_ptr
std::function< decltype(clReleaseContext)> clReleaseContext_ptr
Definition: OpenCL.h:119
arm_compute::CLSymbols::clCreateContextFromType_ptr
std::function< decltype(clCreateContextFromType)> clCreateContextFromType_ptr
Definition: OpenCL.h:94
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:579
clSetKernelArg
cl_int clSetKernelArg(cl_kernel kernel, cl_uint arg_index, size_t arg_size, const void *arg_value)
Definition: OpenCL.cpp:454
clRetainEvent
cl_int clRetainEvent(cl_event event)
Definition: OpenCL.cpp:909
clCreateCommandQueue
cl_command_queue clCreateCommandQueue(cl_context context, cl_device_id device, cl_command_queue_properties properties, cl_int *errcode_ret)
Definition: OpenCL.cpp:341
arm_compute::CLSymbols::clUpdateMutableCommandsKHR_ptr
std::function< decltype(clUpdateMutableCommandsKHR)> clUpdateMutableCommandsKHR_ptr
Definition: OpenCL.h:151
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:876
arm_compute::CLSymbols::clReleaseEvent_ptr
std::function< decltype(clReleaseEvent)> clReleaseEvent_ptr
Definition: OpenCL.h:118
arm_compute::CLSymbols::clSetKernelArg_ptr
std::function< decltype(clSetKernelArg)> clSetKernelArg_ptr
Definition: OpenCL.h:100
clEnqueueMarker
cl_int clEnqueueMarker(cl_command_queue command_queue, cl_event *event)
Definition: OpenCL.cpp:232
arm_compute::CLSymbols::clRetainMemObject_ptr
std::function< decltype(clRetainMemObject)> clRetainMemObject_ptr
Definition: OpenCL.h:122
arm_compute::CLSymbols::clCreateKernel_ptr
std::function< decltype(clCreateKernel)> clCreateKernel_ptr
Definition: OpenCL.h:105
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:955
arm_compute::CLSymbols::clSVMFree_ptr
std::function< decltype(clSVMFree)> clSVMFree_ptr
Definition: OpenCL.h:135
clReleaseKernel
cl_int clReleaseKernel(cl_kernel kernel)
Definition: OpenCL.cpp:844
kernel_name
std::string kernel_name
Definition: ClIm2ColKernel.cpp:58