1bf215546Sopenharmony_ci// 2bf215546Sopenharmony_ci// Copyright 2013 Francisco Jerez 3bf215546Sopenharmony_ci// 4bf215546Sopenharmony_ci// Permission is hereby granted, free of charge, to any person obtaining a 5bf215546Sopenharmony_ci// copy of this software and associated documentation files (the "Software"), 6bf215546Sopenharmony_ci// to deal in the Software without restriction, including without limitation 7bf215546Sopenharmony_ci// the rights to use, copy, modify, merge, publish, distribute, sublicense, 8bf215546Sopenharmony_ci// and/or sell copies of the Software, and to permit persons to whom the 9bf215546Sopenharmony_ci// Software is furnished to do so, subject to the following conditions: 10bf215546Sopenharmony_ci// 11bf215546Sopenharmony_ci// The above copyright notice and this permission notice shall be included in 12bf215546Sopenharmony_ci// all copies or substantial portions of the Software. 13bf215546Sopenharmony_ci// 14bf215546Sopenharmony_ci// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15bf215546Sopenharmony_ci// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16bf215546Sopenharmony_ci// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17bf215546Sopenharmony_ci// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 18bf215546Sopenharmony_ci// OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19bf215546Sopenharmony_ci// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20bf215546Sopenharmony_ci// OTHER DEALINGS IN THE SOFTWARE. 21bf215546Sopenharmony_ci// 22bf215546Sopenharmony_ci 23bf215546Sopenharmony_ci#ifndef API_DISPATCH_HPP 24bf215546Sopenharmony_ci#define API_DISPATCH_HPP 25bf215546Sopenharmony_ci 26bf215546Sopenharmony_ci#include "CL/cl.h" 27bf215546Sopenharmony_ci#include "CL/cl_ext.h" 28bf215546Sopenharmony_ci#include "CL/cl_egl.h" 29bf215546Sopenharmony_ci#include "CL/cl_gl.h" 30bf215546Sopenharmony_ci#include "CL/cl_icd.h" 31bf215546Sopenharmony_ci 32bf215546Sopenharmony_cinamespace clover { 33bf215546Sopenharmony_ci extern const cl_icd_dispatch _dispatch; 34bf215546Sopenharmony_ci 35bf215546Sopenharmony_ci cl_int 36bf215546Sopenharmony_ci GetPlatformInfo(cl_platform_id d_platform, cl_platform_info param, 37bf215546Sopenharmony_ci size_t size, void *r_buf, size_t *r_size); 38bf215546Sopenharmony_ci 39bf215546Sopenharmony_ci void * 40bf215546Sopenharmony_ci GetExtensionFunctionAddress(const char *p_name); 41bf215546Sopenharmony_ci 42bf215546Sopenharmony_ci void * 43bf215546Sopenharmony_ci GetExtensionFunctionAddressForPlatform(cl_platform_id d_platform, 44bf215546Sopenharmony_ci const char *p_name); 45bf215546Sopenharmony_ci 46bf215546Sopenharmony_ci cl_int 47bf215546Sopenharmony_ci IcdGetPlatformIDsKHR(cl_uint num_entries, cl_platform_id *rd_platforms, 48bf215546Sopenharmony_ci cl_uint *rnum_platforms); 49bf215546Sopenharmony_ci 50bf215546Sopenharmony_ci cl_int 51bf215546Sopenharmony_ci EnqueueSVMFree(cl_command_queue command_queue, 52bf215546Sopenharmony_ci cl_uint num_svm_pointers, 53bf215546Sopenharmony_ci void *svm_pointers[], 54bf215546Sopenharmony_ci void (CL_CALLBACK *pfn_free_func) ( 55bf215546Sopenharmony_ci cl_command_queue queue, cl_uint num_svm_pointers, 56bf215546Sopenharmony_ci void *svm_pointers[], void *user_data), 57bf215546Sopenharmony_ci void *user_data, 58bf215546Sopenharmony_ci cl_uint num_events_in_wait_list, 59bf215546Sopenharmony_ci const cl_event *event_wait_list, 60bf215546Sopenharmony_ci cl_event *event, 61bf215546Sopenharmony_ci cl_int cmd); 62bf215546Sopenharmony_ci 63bf215546Sopenharmony_ci cl_int 64bf215546Sopenharmony_ci EnqueueSVMMemcpy(cl_command_queue command_queue, 65bf215546Sopenharmony_ci cl_bool blocking_copy, 66bf215546Sopenharmony_ci void *dst_ptr, 67bf215546Sopenharmony_ci const void *src_ptr, 68bf215546Sopenharmony_ci size_t size, 69bf215546Sopenharmony_ci cl_uint num_events_in_wait_list, 70bf215546Sopenharmony_ci const cl_event *event_wait_list, 71bf215546Sopenharmony_ci cl_event *event, 72bf215546Sopenharmony_ci cl_int cmd); 73bf215546Sopenharmony_ci 74bf215546Sopenharmony_ci cl_int 75bf215546Sopenharmony_ci EnqueueSVMMap(cl_command_queue command_queue, 76bf215546Sopenharmony_ci cl_bool blocking_map, 77bf215546Sopenharmony_ci cl_map_flags map_flags, 78bf215546Sopenharmony_ci void *svm_ptr, 79bf215546Sopenharmony_ci size_t size, 80bf215546Sopenharmony_ci cl_uint num_events_in_wait_list, 81bf215546Sopenharmony_ci const cl_event *event_wait_list, 82bf215546Sopenharmony_ci cl_event *event, 83bf215546Sopenharmony_ci cl_int cmd); 84bf215546Sopenharmony_ci 85bf215546Sopenharmony_ci cl_int 86bf215546Sopenharmony_ci EnqueueSVMMemFill(cl_command_queue command_queue, 87bf215546Sopenharmony_ci void *svm_ptr, 88bf215546Sopenharmony_ci const void *pattern, 89bf215546Sopenharmony_ci size_t pattern_size, 90bf215546Sopenharmony_ci size_t size, 91bf215546Sopenharmony_ci cl_uint num_events_in_wait_list, 92bf215546Sopenharmony_ci const cl_event *event_wait_list, 93bf215546Sopenharmony_ci cl_event *event, 94bf215546Sopenharmony_ci cl_int cmd); 95bf215546Sopenharmony_ci 96bf215546Sopenharmony_ci cl_int 97bf215546Sopenharmony_ci EnqueueSVMUnmap(cl_command_queue command_queue, 98bf215546Sopenharmony_ci void *svm_ptr, 99bf215546Sopenharmony_ci cl_uint num_events_in_wait_list, 100bf215546Sopenharmony_ci const cl_event *event_wait_list, 101bf215546Sopenharmony_ci cl_event *event, 102bf215546Sopenharmony_ci cl_int cmd); 103bf215546Sopenharmony_ci 104bf215546Sopenharmony_ci cl_program 105bf215546Sopenharmony_ci CreateProgramWithILKHR(cl_context d_ctx, const void *il, 106bf215546Sopenharmony_ci size_t length, cl_int *r_errcode); 107bf215546Sopenharmony_ci} 108bf215546Sopenharmony_ci 109bf215546Sopenharmony_ci#endif 110