Renesas GR-PEACH OpenCV Development / gr-peach-opencv-project-sd-card_update

Fork of gr-peach-opencv-project-sd-card by the do

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers opencl_svm_hsa_extension.hpp Source File

opencl_svm_hsa_extension.hpp

00001 /* See LICENSE file in the root OpenCV directory */
00002 
00003 #ifndef __OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_HSA_EXTENSION_HPP__
00004 #define __OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_HSA_EXTENSION_HPP__
00005 
00006 #if defined(HAVE_OPENCL_SVM)
00007 #include "opencl_core.hpp"
00008 
00009 #ifndef CL_DEVICE_SVM_CAPABILITIES_AMD
00010 //
00011 //  Part of the file is an extract from the cl_ext.h file from AMD APP SDK package.
00012 //  Below is the original copyright.
00013 //
00014 /*******************************************************************************
00015  * Copyright (c) 2008-2013 The Khronos Group Inc.
00016  *
00017  * Permission is hereby granted, free of charge, to any person obtaining a
00018  * copy of this software and/or associated documentation files (the
00019  * "Materials"), to deal in the Materials without restriction, including
00020  * without limitation the rights to use, copy, modify, merge, publish,
00021  * distribute, sublicense, and/or sell copies of the Materials, and to
00022  * permit persons to whom the Materials are furnished to do so, subject to
00023  * the following conditions:
00024  *
00025  * The above copyright notice and this permission notice shall be included
00026  * in all copies or substantial portions of the Materials.
00027  *
00028  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00029  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00030  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00031  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00032  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00033  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00034  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
00035  ******************************************************************************/
00036 
00037 /*******************************************
00038  * Shared Virtual Memory (SVM) extension
00039  *******************************************/
00040 typedef cl_bitfield                      cl_device_svm_capabilities_amd;
00041 typedef cl_bitfield                      cl_svm_mem_flags_amd;
00042 typedef cl_uint                          cl_kernel_exec_info_amd;
00043 
00044 /* cl_device_info */
00045 #define CL_DEVICE_SVM_CAPABILITIES_AMD                     0x1053
00046 #define CL_DEVICE_PREFERRED_PLATFORM_ATOMIC_ALIGNMENT_AMD  0x1054
00047 
00048 /* cl_device_svm_capabilities_amd */
00049 #define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER_AMD             (1 << 0)
00050 #define CL_DEVICE_SVM_FINE_GRAIN_BUFFER_AMD               (1 << 1)
00051 #define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM_AMD               (1 << 2)
00052 #define CL_DEVICE_SVM_ATOMICS_AMD                         (1 << 3)
00053 
00054 /* cl_svm_mem_flags_amd */
00055 #define CL_MEM_SVM_FINE_GRAIN_BUFFER_AMD                  (1 << 10)
00056 #define CL_MEM_SVM_ATOMICS_AMD                            (1 << 11)
00057 
00058 /* cl_mem_info */
00059 #define CL_MEM_USES_SVM_POINTER_AMD                       0x1109
00060 
00061 /* cl_kernel_exec_info_amd */
00062 #define CL_KERNEL_EXEC_INFO_SVM_PTRS_AMD                  0x11B6
00063 #define CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM_AMD     0x11B7
00064 
00065 /* cl_command_type */
00066 #define CL_COMMAND_SVM_FREE_AMD                           0x1209
00067 #define CL_COMMAND_SVM_MEMCPY_AMD                         0x120A
00068 #define CL_COMMAND_SVM_MEMFILL_AMD                        0x120B
00069 #define CL_COMMAND_SVM_MAP_AMD                            0x120C
00070 #define CL_COMMAND_SVM_UNMAP_AMD                          0x120D
00071 
00072 typedef CL_API_ENTRY void*
00073 (CL_API_CALL * clSVMAllocAMD_fn)(
00074     cl_context            /* context */,
00075     cl_svm_mem_flags_amd  /* flags */,
00076     size_t                /* size */,
00077     unsigned int          /* alignment */
00078 ) CL_EXT_SUFFIX__VERSION_1_2;
00079 
00080 typedef CL_API_ENTRY void
00081 (CL_API_CALL * clSVMFreeAMD_fn)(
00082     cl_context  /* context */,
00083     void*       /* svm_pointer */
00084 ) CL_EXT_SUFFIX__VERSION_1_2;
00085 
00086 typedef CL_API_ENTRY cl_int
00087 (CL_API_CALL * clEnqueueSVMFreeAMD_fn)(
00088     cl_command_queue /* command_queue */,
00089     cl_uint          /* num_svm_pointers */,
00090     void**           /* svm_pointers */,
00091     void (CL_CALLBACK *)( /*pfn_free_func*/
00092         cl_command_queue /* queue */,
00093         cl_uint          /* num_svm_pointers */,
00094         void**           /* svm_pointers */,
00095         void*            /* user_data */),
00096     void*             /* user_data */,
00097     cl_uint           /* num_events_in_wait_list */,
00098     const cl_event*   /* event_wait_list */,
00099     cl_event*         /* event */
00100 ) CL_EXT_SUFFIX__VERSION_1_2;
00101 
00102 typedef CL_API_ENTRY cl_int
00103 (CL_API_CALL * clEnqueueSVMMemcpyAMD_fn)(
00104     cl_command_queue /* command_queue */,
00105     cl_bool          /* blocking_copy */,
00106     void*            /* dst_ptr */,
00107     const void*      /* src_ptr */,
00108     size_t           /* size */,
00109     cl_uint          /* num_events_in_wait_list */,
00110     const cl_event*  /* event_wait_list */,
00111     cl_event*        /* event */
00112 ) CL_EXT_SUFFIX__VERSION_1_2;
00113 
00114 typedef CL_API_ENTRY cl_int
00115 (CL_API_CALL * clEnqueueSVMMemFillAMD_fn)(
00116     cl_command_queue /* command_queue */,
00117     void*            /* svm_ptr */,
00118     const void*      /* pattern */,
00119     size_t           /* pattern_size */,
00120     size_t           /* size */,
00121     cl_uint          /* num_events_in_wait_list */,
00122     const cl_event*  /* event_wait_list */,
00123     cl_event*        /* event */
00124 ) CL_EXT_SUFFIX__VERSION_1_2;
00125 
00126 typedef CL_API_ENTRY cl_int
00127 (CL_API_CALL * clEnqueueSVMMapAMD_fn)(
00128     cl_command_queue /* command_queue */,
00129     cl_bool          /* blocking_map */,
00130     cl_map_flags     /* map_flags */,
00131     void*            /* svm_ptr */,
00132     size_t           /* size */,
00133     cl_uint          /* num_events_in_wait_list */,
00134     const cl_event*  /* event_wait_list */,
00135     cl_event*        /* event */
00136 ) CL_EXT_SUFFIX__VERSION_1_2;
00137 
00138 typedef CL_API_ENTRY cl_int
00139 (CL_API_CALL * clEnqueueSVMUnmapAMD_fn)(
00140     cl_command_queue /* command_queue */,
00141     void*            /* svm_ptr */,
00142     cl_uint          /* num_events_in_wait_list */,
00143     const cl_event*  /* event_wait_list */,
00144     cl_event*        /* event */
00145 ) CL_EXT_SUFFIX__VERSION_1_2;
00146 
00147 typedef CL_API_ENTRY cl_int
00148 (CL_API_CALL * clSetKernelArgSVMPointerAMD_fn)(
00149     cl_kernel     /* kernel */,
00150     cl_uint       /* arg_index */,
00151     const void *  /* arg_value */
00152 ) CL_EXT_SUFFIX__VERSION_1_2;
00153 
00154 typedef CL_API_ENTRY cl_int
00155 (CL_API_CALL * clSetKernelExecInfoAMD_fn)(
00156      cl_kernel                /* kernel */,
00157      cl_kernel_exec_info_amd  /* param_name */,
00158      size_t                   /* param_value_size */,
00159      const void *             /* param_value */
00160 ) CL_EXT_SUFFIX__VERSION_1_2;
00161 
00162 #endif
00163 
00164 #endif // HAVE_OPENCL_SVM
00165 
00166 #endif // __OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_HSA_EXTENSION_HPP__
00167