1 /* See LICENSE file in the root OpenCV directory */
2 
3 #ifndef __OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_2_0_HPP__
4 #define __OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_2_0_HPP__
5 
6 #if defined(HAVE_OPENCL_SVM)
7 #include "opencl_core.hpp"
8 
9 #include "opencl_svm_definitions.hpp"
10 
11 #ifndef HAVE_OPENCL_STATIC
12 
13 #undef clSVMAlloc
14 #define clSVMAlloc clSVMAlloc_pfn
15 #undef clSVMFree
16 #define clSVMFree clSVMFree_pfn
17 #undef clSetKernelArgSVMPointer
18 #define clSetKernelArgSVMPointer clSetKernelArgSVMPointer_pfn
19 #undef clSetKernelExecInfo
20 //#define clSetKernelExecInfo clSetKernelExecInfo_pfn
21 #undef clEnqueueSVMFree
22 //#define clEnqueueSVMFree clEnqueueSVMFree_pfn
23 #undef clEnqueueSVMMemcpy
24 #define clEnqueueSVMMemcpy clEnqueueSVMMemcpy_pfn
25 #undef clEnqueueSVMMemFill
26 #define clEnqueueSVMMemFill clEnqueueSVMMemFill_pfn
27 #undef clEnqueueSVMMap
28 #define clEnqueueSVMMap clEnqueueSVMMap_pfn
29 #undef clEnqueueSVMUnmap
30 #define clEnqueueSVMUnmap clEnqueueSVMUnmap_pfn
31 
32 extern CL_RUNTIME_EXPORT void* (CL_API_CALL *clSVMAlloc)(cl_context context, cl_svm_mem_flags flags, size_t size, unsigned int alignment);
33 extern CL_RUNTIME_EXPORT void (CL_API_CALL *clSVMFree)(cl_context context, void* svm_pointer);
34 extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clSetKernelArgSVMPointer)(cl_kernel kernel, cl_uint arg_index, const void* arg_value);
35 //extern CL_RUNTIME_EXPORT void* (CL_API_CALL *clSetKernelExecInfo)(cl_kernel kernel, cl_kernel_exec_info param_name, size_t param_value_size, const void* param_value);
36 //extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMFree)(cl_command_queue command_queue, cl_uint num_svm_pointers, void* svm_pointers[],
37 //        void (CL_CALLBACK *pfn_free_func)(cl_command_queue queue, cl_uint num_svm_pointers, void* svm_pointers[], void* user_data), void* user_data,
38 //        cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event);
39 extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMMemcpy)(cl_command_queue command_queue, cl_bool blocking_copy, void* dst_ptr, const void* src_ptr, size_t size,
40         cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event);
41 extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMMemFill)(cl_command_queue command_queue, void* svm_ptr, const void* pattern, size_t pattern_size, size_t size,
42         cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event);
43 extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMMap)(cl_command_queue command_queue, cl_bool blocking_map, cl_map_flags map_flags, void* svm_ptr, size_t size,
44         cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event);
45 extern CL_RUNTIME_EXPORT cl_int (CL_API_CALL *clEnqueueSVMUnmap)(cl_command_queue command_queue, void* svm_ptr,
46         cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event);
47 
48 #endif // HAVE_OPENCL_STATIC
49 
50 #endif // HAVE_OPENCL_SVM
51 
52 #endif // __OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_2_0_HPP__
53