diff --git a/sycl/include/CL/sycl/detail/pi.h b/sycl/include/CL/sycl/detail/pi.h index f44b74292b664..854c7387817cf 100644 --- a/sycl/include/CL/sycl/detail/pi.h +++ b/sycl/include/CL/sycl/detail/pi.h @@ -48,6 +48,7 @@ #include #include +#include #include #ifdef __cplusplus @@ -751,56 +752,62 @@ using pi_plugin = _pi_plugin; // populate the PI Version it supports, update targets field and populate // PiFunctionTable with Supported APIs. The pointers are in a predetermined // order in pi.def file. -pi_result piPluginInit(pi_plugin *plugin_info); +__SYCL_EXPORT pi_result piPluginInit(pi_plugin *plugin_info); // // Platform // -pi_result piPlatformsGet(pi_uint32 num_entries, pi_platform *platforms, - pi_uint32 *num_platforms); +__SYCL_EXPORT pi_result piPlatformsGet(pi_uint32 num_entries, + pi_platform *platforms, + pi_uint32 *num_platforms); -pi_result piPlatformGetInfo(pi_platform platform, pi_platform_info param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piPlatformGetInfo(pi_platform platform, + pi_platform_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); -pi_result piDevicesGet(pi_platform platform, pi_device_type device_type, - pi_uint32 num_entries, pi_device *devices, - pi_uint32 *num_devices); +__SYCL_EXPORT pi_result piDevicesGet(pi_platform platform, + pi_device_type device_type, + pi_uint32 num_entries, pi_device *devices, + pi_uint32 *num_devices); -pi_result piDeviceGetInfo(pi_device device, pi_device_info param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piDeviceGetInfo(pi_device device, + pi_device_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); -pi_result piDeviceRetain(pi_device device); +__SYCL_EXPORT pi_result piDeviceRetain(pi_device device); -pi_result piDeviceRelease(pi_device device); +__SYCL_EXPORT pi_result piDeviceRelease(pi_device device); -pi_result piDevicePartition(pi_device device, - const pi_device_partition_property *properties, - pi_uint32 num_devices, pi_device *out_devices, - pi_uint32 *out_num_devices); +__SYCL_EXPORT pi_result piDevicePartition( + pi_device device, const pi_device_partition_property *properties, + pi_uint32 num_devices, pi_device *out_devices, pi_uint32 *out_num_devices); /// Gets the native handle of a PI device object. /// /// \param device is the PI device to get the native handle of. /// \param nativeHandle is the native handle of device. -pi_result piextDeviceGetNativeHandle(pi_device device, - pi_native_handle *nativeHandle); +__SYCL_EXPORT pi_result +piextDeviceGetNativeHandle(pi_device device, pi_native_handle *nativeHandle); /// Creates PI device object from a native handle. /// NOTE: The created PI object takes ownership of the native handle. /// /// \param nativeHandle is the native handle to create PI device from. /// \param device is the PI device created from the native handle. -pi_result piextDeviceCreateWithNativeHandle(pi_native_handle nativeHandle, - pi_device *device); +__SYCL_EXPORT pi_result piextDeviceCreateWithNativeHandle( + pi_native_handle nativeHandle, pi_device *device); /// Selects the most appropriate device binary based on runtime information /// and the IR characteristics. /// -pi_result piextDeviceSelectBinary(pi_device device, pi_device_binary *binaries, - pi_uint32 num_binaries, - pi_uint32 *selected_binary_ind); +__SYCL_EXPORT pi_result piextDeviceSelectBinary(pi_device device, + pi_device_binary *binaries, + pi_uint32 num_binaries, + pi_uint32 *selected_binary_ind); /// Retrieves a device function pointer to a user-defined function /// \arg \c function_name. \arg \c function_pointer_ret is set to 0 if query @@ -810,172 +817,180 @@ pi_result piextDeviceSelectBinary(pi_device device, pi_device_binary *binaries, /// must present in the list of devices returned by \c get_device method for /// \arg \c program. /// -pi_result piextGetDeviceFunctionPointer(pi_device device, pi_program program, - const char *function_name, - pi_uint64 *function_pointer_ret); +__SYCL_EXPORT pi_result piextGetDeviceFunctionPointer( + pi_device device, pi_program program, const char *function_name, + pi_uint64 *function_pointer_ret); // // Context // -pi_result piContextCreate(const pi_context_properties *properties, - pi_uint32 num_devices, const pi_device *devices, - void (*pfn_notify)(const char *errinfo, - const void *private_info, - size_t cb, void *user_data), - void *user_data, pi_context *ret_context); +__SYCL_EXPORT pi_result piContextCreate( + const pi_context_properties *properties, pi_uint32 num_devices, + const pi_device *devices, + void (*pfn_notify)(const char *errinfo, const void *private_info, size_t cb, + void *user_data), + void *user_data, pi_context *ret_context); -pi_result piContextGetInfo(pi_context context, pi_context_info param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piContextGetInfo(pi_context context, + pi_context_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); -pi_result piContextRetain(pi_context context); +__SYCL_EXPORT pi_result piContextRetain(pi_context context); -pi_result piContextRelease(pi_context context); +__SYCL_EXPORT pi_result piContextRelease(pi_context context); typedef void (*pi_context_extended_deleter)(void *user_data); -pi_result piextContextSetExtendedDeleter(pi_context context, - pi_context_extended_deleter func, - void *user_data); +__SYCL_EXPORT pi_result piextContextSetExtendedDeleter( + pi_context context, pi_context_extended_deleter func, void *user_data); /// Gets the native handle of a PI context object. /// /// \param context is the PI context to get the native handle of. /// \param nativeHandle is the native handle of context. -pi_result piextContextGetNativeHandle(pi_context context, - pi_native_handle *nativeHandle); +__SYCL_EXPORT pi_result +piextContextGetNativeHandle(pi_context context, pi_native_handle *nativeHandle); /// Creates PI context object from a native handle. /// NOTE: The created PI object takes ownership of the native handle. /// /// \param nativeHandle is the native handle to create PI context from. /// \param context is the PI context created from the native handle. -pi_result piextContextCreateWithNativeHandle(pi_native_handle nativeHandle, - pi_context *context); +__SYCL_EXPORT pi_result piextContextCreateWithNativeHandle( + pi_native_handle nativeHandle, pi_context *context); // // Queue // -pi_result piQueueCreate(pi_context context, pi_device device, - pi_queue_properties properties, pi_queue *queue); +__SYCL_EXPORT pi_result piQueueCreate(pi_context context, pi_device device, + pi_queue_properties properties, + pi_queue *queue); -pi_result piQueueGetInfo(pi_queue command_queue, pi_queue_info param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piQueueGetInfo(pi_queue command_queue, + pi_queue_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); -pi_result piQueueRetain(pi_queue command_queue); +__SYCL_EXPORT pi_result piQueueRetain(pi_queue command_queue); -pi_result piQueueRelease(pi_queue command_queue); +__SYCL_EXPORT pi_result piQueueRelease(pi_queue command_queue); -pi_result piQueueFinish(pi_queue command_queue); +__SYCL_EXPORT pi_result piQueueFinish(pi_queue command_queue); /// Gets the native handle of a PI queue object. /// /// \param queue is the PI queue to get the native handle of. /// \param nativeHandle is the native handle of queue. -pi_result piextQueueGetNativeHandle(pi_queue queue, - pi_native_handle *nativeHandle); +__SYCL_EXPORT pi_result +piextQueueGetNativeHandle(pi_queue queue, pi_native_handle *nativeHandle); /// Creates PI queue object from a native handle. /// NOTE: The created PI object takes ownership of the native handle. /// /// \param nativeHandle is the native handle to create PI queue from. /// \param queue is the PI queue created from the native handle. -pi_result piextQueueCreateWithNativeHandle(pi_native_handle nativeHandle, - pi_queue *queue); +__SYCL_EXPORT pi_result piextQueueCreateWithNativeHandle( + pi_native_handle nativeHandle, pi_queue *queue); // // Memory // -pi_result piMemBufferCreate(pi_context context, pi_mem_flags flags, size_t size, - void *host_ptr, pi_mem *ret_mem); - -pi_result piMemImageCreate(pi_context context, pi_mem_flags flags, - const pi_image_format *image_format, - const pi_image_desc *image_desc, void *host_ptr, - pi_mem *ret_mem); - -pi_result piMemGetInfo(pi_mem mem, - cl_mem_info param_name, // TODO: untie from OpenCL - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piMemBufferCreate(pi_context context, + pi_mem_flags flags, size_t size, + void *host_ptr, pi_mem *ret_mem); + +__SYCL_EXPORT pi_result piMemImageCreate(pi_context context, pi_mem_flags flags, + const pi_image_format *image_format, + const pi_image_desc *image_desc, + void *host_ptr, pi_mem *ret_mem); + +__SYCL_EXPORT pi_result piMemGetInfo( + pi_mem mem, + cl_mem_info param_name, // TODO: untie from OpenCL + size_t param_value_size, void *param_value, size_t *param_value_size_ret); -pi_result piMemImageGetInfo(pi_mem image, pi_image_info param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piMemImageGetInfo(pi_mem image, + pi_image_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); -pi_result piMemRetain(pi_mem mem); +__SYCL_EXPORT pi_result piMemRetain(pi_mem mem); -pi_result piMemRelease(pi_mem mem); +__SYCL_EXPORT pi_result piMemRelease(pi_mem mem); -pi_result piMemBufferPartition(pi_mem buffer, pi_mem_flags flags, - pi_buffer_create_type buffer_create_type, - void *buffer_create_info, pi_mem *ret_mem); +__SYCL_EXPORT pi_result piMemBufferPartition( + pi_mem buffer, pi_mem_flags flags, pi_buffer_create_type buffer_create_type, + void *buffer_create_info, pi_mem *ret_mem); /// Gets the native handle of a PI mem object. /// /// \param mem is the PI mem to get the native handle of. /// \param nativeHandle is the native handle of mem. -pi_result piextMemGetNativeHandle(pi_mem mem, pi_native_handle *nativeHandle); +__SYCL_EXPORT pi_result piextMemGetNativeHandle(pi_mem mem, + pi_native_handle *nativeHandle); /// Creates PI mem object from a native handle. /// NOTE: The created PI object takes ownership of the native handle. /// /// \param nativeHandle is the native handle to create PI mem from. /// \param mem is the PI mem created from the native handle. -pi_result piextMemCreateWithNativeHandle(pi_native_handle nativeHandle, - pi_mem *mem); +__SYCL_EXPORT pi_result +piextMemCreateWithNativeHandle(pi_native_handle nativeHandle, pi_mem *mem); // // Program // -pi_result piProgramCreate(pi_context context, const void *il, size_t length, - pi_program *res_program); - -pi_result piclProgramCreateWithSource(pi_context context, pi_uint32 count, - const char **strings, - const size_t *lengths, - pi_program *ret_program); - -pi_result piclProgramCreateWithBinary(pi_context context, pi_uint32 num_devices, - const pi_device *device_list, - const size_t *lengths, - const unsigned char **binaries, - pi_int32 *binary_status, - pi_program *ret_program); - -pi_result piProgramGetInfo(pi_program program, pi_program_info param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); - -pi_result piProgramLink(pi_context context, pi_uint32 num_devices, - const pi_device *device_list, const char *options, - pi_uint32 num_input_programs, - const pi_program *input_programs, - void (*pfn_notify)(pi_program program, void *user_data), - void *user_data, pi_program *ret_program); - -pi_result piProgramCompile( +__SYCL_EXPORT pi_result piProgramCreate(pi_context context, const void *il, + size_t length, pi_program *res_program); + +__SYCL_EXPORT pi_result piclProgramCreateWithSource(pi_context context, + pi_uint32 count, + const char **strings, + const size_t *lengths, + pi_program *ret_program); + +__SYCL_EXPORT pi_result piclProgramCreateWithBinary( + pi_context context, pi_uint32 num_devices, const pi_device *device_list, + const size_t *lengths, const unsigned char **binaries, + pi_int32 *binary_status, pi_program *ret_program); + +__SYCL_EXPORT pi_result piProgramGetInfo(pi_program program, + pi_program_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); + +__SYCL_EXPORT pi_result +piProgramLink(pi_context context, pi_uint32 num_devices, + const pi_device *device_list, const char *options, + pi_uint32 num_input_programs, const pi_program *input_programs, + void (*pfn_notify)(pi_program program, void *user_data), + void *user_data, pi_program *ret_program); + +__SYCL_EXPORT pi_result piProgramCompile( pi_program program, pi_uint32 num_devices, const pi_device *device_list, const char *options, pi_uint32 num_input_headers, const pi_program *input_headers, const char **header_include_names, void (*pfn_notify)(pi_program program, void *user_data), void *user_data); -pi_result piProgramBuild(pi_program program, pi_uint32 num_devices, - const pi_device *device_list, const char *options, - void (*pfn_notify)(pi_program program, - void *user_data), - void *user_data); +__SYCL_EXPORT pi_result piProgramBuild( + pi_program program, pi_uint32 num_devices, const pi_device *device_list, + const char *options, + void (*pfn_notify)(pi_program program, void *user_data), void *user_data); -pi_result piProgramGetBuildInfo( +__SYCL_EXPORT pi_result piProgramGetBuildInfo( pi_program program, pi_device device, cl_program_build_info param_name, // TODO: untie from OpenCL size_t param_value_size, void *param_value, size_t *param_value_size_ret); -pi_result piProgramRetain(pi_program program); +__SYCL_EXPORT pi_result piProgramRetain(pi_program program); -pi_result piProgramRelease(pi_program program); +__SYCL_EXPORT pi_result piProgramRelease(pi_program program); /// Sets a specialization constant to a specific value. /// @@ -983,25 +998,24 @@ pi_result piProgramRelease(pi_program program); /// \param spec_id integer ID of the constant /// \param spec_size size of the value /// \param spec_value bytes of the value -pi_result piextProgramSetSpecializationConstant(pi_program prog, - pi_uint32 spec_id, - size_t spec_size, - const void *spec_value); +__SYCL_EXPORT pi_result +piextProgramSetSpecializationConstant(pi_program prog, pi_uint32 spec_id, + size_t spec_size, const void *spec_value); /// Gets the native handle of a PI program object. /// /// \param program is the PI program to get the native handle of. /// \param nativeHandle is the native handle of program. -pi_result piextProgramGetNativeHandle(pi_program program, - pi_native_handle *nativeHandle); +__SYCL_EXPORT pi_result +piextProgramGetNativeHandle(pi_program program, pi_native_handle *nativeHandle); /// Creates PI program object from a native handle. /// NOTE: The created PI object takes ownership of the native handle. /// /// \param nativeHandle is the native handle to create PI program from. /// \param program is the PI program created from the native handle. -pi_result piextProgramCreateWithNativeHandle(pi_native_handle nativeHandle, - pi_program *program); +__SYCL_EXPORT pi_result piextProgramCreateWithNativeHandle( + pi_native_handle nativeHandle, pi_program *program); // // Kernel @@ -1016,30 +1030,34 @@ typedef enum { using pi_kernel_exec_info = _pi_kernel_exec_info; -pi_result piKernelCreate(pi_program program, const char *kernel_name, - pi_kernel *ret_kernel); +__SYCL_EXPORT pi_result piKernelCreate(pi_program program, + const char *kernel_name, + pi_kernel *ret_kernel); -pi_result piKernelSetArg(pi_kernel kernel, pi_uint32 arg_index, size_t arg_size, - const void *arg_value); +__SYCL_EXPORT pi_result piKernelSetArg(pi_kernel kernel, pi_uint32 arg_index, + size_t arg_size, const void *arg_value); -pi_result piKernelGetInfo(pi_kernel kernel, pi_kernel_info param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piKernelGetInfo(pi_kernel kernel, + pi_kernel_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); -pi_result piKernelGetGroupInfo(pi_kernel kernel, pi_device device, - pi_kernel_group_info param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piKernelGetGroupInfo(pi_kernel kernel, pi_device device, + pi_kernel_group_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); -pi_result piKernelGetSubGroupInfo( +__SYCL_EXPORT pi_result piKernelGetSubGroupInfo( pi_kernel kernel, pi_device device, cl_kernel_sub_group_info param_name, // TODO: untie from OpenCL size_t input_value_size, const void *input_value, size_t param_value_size, void *param_value, size_t *param_value_size_ret); -pi_result piKernelRetain(pi_kernel kernel); +__SYCL_EXPORT pi_result piKernelRetain(pi_kernel kernel); -pi_result piKernelRelease(pi_kernel kernel); +__SYCL_EXPORT pi_result piKernelRelease(pi_kernel kernel); /// Sets up pointer arguments for CL kernels. An extra indirection /// is required due to CL argument conventions. @@ -1048,8 +1066,10 @@ pi_result piKernelRelease(pi_kernel kernel); /// \param arg_index is the index of the kernel argument /// \param arg_size is the size in bytes of the argument (ignored in CL) /// \param arg_value is the pointer argument -pi_result piextKernelSetArgPointer(pi_kernel kernel, pi_uint32 arg_index, - size_t arg_size, const void *arg_value); +__SYCL_EXPORT pi_result piextKernelSetArgPointer(pi_kernel kernel, + pi_uint32 arg_index, + size_t arg_size, + const void *arg_value); /// API to set attributes controlling kernel execution /// @@ -1062,183 +1082,181 @@ pi_result piextKernelSetArgPointer(pi_kernel kernel, pi_uint32 arg_index, /// If param_name is PI_USM_INDIRECT_ACCESS, the value will be a ptr to /// the pi_bool value PI_TRUE /// If param_name is PI_USM_PTRS, the value will be an array of ptrs -pi_result piKernelSetExecInfo(pi_kernel kernel, pi_kernel_exec_info value_name, - size_t param_value_size, const void *param_value); +__SYCL_EXPORT pi_result piKernelSetExecInfo(pi_kernel kernel, + pi_kernel_exec_info value_name, + size_t param_value_size, + const void *param_value); // // Events // -pi_result piEventCreate(pi_context context, pi_event *ret_event); +__SYCL_EXPORT pi_result piEventCreate(pi_context context, pi_event *ret_event); -pi_result piEventGetInfo(pi_event event, - cl_event_info param_name, // TODO: untie from OpenCL - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piEventGetInfo( + pi_event event, + cl_event_info param_name, // TODO: untie from OpenCL + size_t param_value_size, void *param_value, size_t *param_value_size_ret); -pi_result piEventGetProfilingInfo(pi_event event, pi_profiling_info param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piEventGetProfilingInfo(pi_event event, + pi_profiling_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); -pi_result piEventsWait(pi_uint32 num_events, const pi_event *event_list); +__SYCL_EXPORT pi_result piEventsWait(pi_uint32 num_events, + const pi_event *event_list); -pi_result piEventSetCallback(pi_event event, - pi_int32 command_exec_callback_type, - void (*pfn_notify)(pi_event event, - pi_int32 event_command_status, - void *user_data), - void *user_data); +__SYCL_EXPORT pi_result piEventSetCallback( + pi_event event, pi_int32 command_exec_callback_type, + void (*pfn_notify)(pi_event event, pi_int32 event_command_status, + void *user_data), + void *user_data); -pi_result piEventSetStatus(pi_event event, pi_int32 execution_status); +__SYCL_EXPORT pi_result piEventSetStatus(pi_event event, + pi_int32 execution_status); -pi_result piEventRetain(pi_event event); +__SYCL_EXPORT pi_result piEventRetain(pi_event event); -pi_result piEventRelease(pi_event event); +__SYCL_EXPORT pi_result piEventRelease(pi_event event); /// Gets the native handle of a PI event object. /// /// \param event is the PI event to get the native handle of. /// \param nativeHandle is the native handle of event. -pi_result piextEventGetNativeHandle(pi_event event, - pi_native_handle *nativeHandle); +__SYCL_EXPORT pi_result +piextEventGetNativeHandle(pi_event event, pi_native_handle *nativeHandle); /// Creates PI event object from a native handle. /// NOTE: The created PI object takes ownership of the native handle. /// /// \param nativeHandle is the native handle to create PI event from. /// \param event is the PI event created from the native handle. -pi_result piextEventCreateWithNativeHandle(pi_native_handle nativeHandle, - pi_event *event); +__SYCL_EXPORT pi_result piextEventCreateWithNativeHandle( + pi_native_handle nativeHandle, pi_event *event); // // Sampler // -pi_result piSamplerCreate(pi_context context, - const pi_sampler_properties *sampler_properties, - pi_sampler *result_sampler); +__SYCL_EXPORT pi_result piSamplerCreate( + pi_context context, const pi_sampler_properties *sampler_properties, + pi_sampler *result_sampler); -pi_result piSamplerGetInfo(pi_sampler sampler, pi_sampler_info param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piSamplerGetInfo(pi_sampler sampler, + pi_sampler_info param_name, + size_t param_value_size, + void *param_value, + size_t *param_value_size_ret); -pi_result piSamplerRetain(pi_sampler sampler); +__SYCL_EXPORT pi_result piSamplerRetain(pi_sampler sampler); -pi_result piSamplerRelease(pi_sampler sampler); +__SYCL_EXPORT pi_result piSamplerRelease(pi_sampler sampler); // // Queue Commands // -pi_result piEnqueueKernelLaunch( +__SYCL_EXPORT pi_result piEnqueueKernelLaunch( pi_queue queue, pi_kernel kernel, pi_uint32 work_dim, const size_t *global_work_offset, const size_t *global_work_size, const size_t *local_work_size, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event); -pi_result -piEnqueueNativeKernel(pi_queue queue, void (*user_func)(void *), void *args, - size_t cb_args, pi_uint32 num_mem_objects, - const pi_mem *mem_list, const void **args_mem_loc, - pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, pi_event *event); +__SYCL_EXPORT pi_result piEnqueueNativeKernel( + pi_queue queue, void (*user_func)(void *), void *args, size_t cb_args, + pi_uint32 num_mem_objects, const pi_mem *mem_list, + const void **args_mem_loc, pi_uint32 num_events_in_wait_list, + const pi_event *event_wait_list, pi_event *event); + +__SYCL_EXPORT pi_result piEnqueueEventsWait(pi_queue command_queue, + pi_uint32 num_events_in_wait_list, + const pi_event *event_wait_list, + pi_event *event); + +__SYCL_EXPORT pi_result piEnqueueMemBufferRead( + pi_queue queue, pi_mem buffer, pi_bool blocking_read, size_t offset, + size_t size, void *ptr, pi_uint32 num_events_in_wait_list, + const pi_event *event_wait_list, pi_event *event); -pi_result piEnqueueEventsWait(pi_queue command_queue, - pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, pi_event *event); - -pi_result piEnqueueMemBufferRead(pi_queue queue, pi_mem buffer, - pi_bool blocking_read, size_t offset, - size_t size, void *ptr, - pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, - pi_event *event); - -pi_result -piEnqueueMemBufferReadRect(pi_queue command_queue, pi_mem buffer, - pi_bool blocking_read, const size_t *buffer_offset, - const size_t *host_offset, const size_t *region, - size_t buffer_row_pitch, size_t buffer_slice_pitch, - size_t host_row_pitch, size_t host_slice_pitch, - void *ptr, pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, pi_event *event); - -pi_result piEnqueueMemBufferWrite(pi_queue command_queue, pi_mem buffer, - pi_bool blocking_write, size_t offset, - size_t size, const void *ptr, - pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, - pi_event *event); - -pi_result -piEnqueueMemBufferWriteRect(pi_queue command_queue, pi_mem buffer, - pi_bool blocking_write, const size_t *buffer_offset, - const size_t *host_offset, const size_t *region, - size_t buffer_row_pitch, size_t buffer_slice_pitch, - size_t host_row_pitch, size_t host_slice_pitch, - const void *ptr, pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, pi_event *event); - -pi_result piEnqueueMemBufferCopy(pi_queue command_queue, pi_mem src_buffer, - pi_mem dst_buffer, size_t src_offset, - size_t dst_offset, size_t size, - pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, - pi_event *event); - -pi_result piEnqueueMemBufferCopyRect( +__SYCL_EXPORT pi_result piEnqueueMemBufferReadRect( + pi_queue command_queue, pi_mem buffer, pi_bool blocking_read, + const size_t *buffer_offset, const size_t *host_offset, + const size_t *region, size_t buffer_row_pitch, size_t buffer_slice_pitch, + size_t host_row_pitch, size_t host_slice_pitch, void *ptr, + pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, + pi_event *event); + +__SYCL_EXPORT pi_result +piEnqueueMemBufferWrite(pi_queue command_queue, pi_mem buffer, + pi_bool blocking_write, size_t offset, size_t size, + const void *ptr, pi_uint32 num_events_in_wait_list, + const pi_event *event_wait_list, pi_event *event); + +__SYCL_EXPORT pi_result piEnqueueMemBufferWriteRect( + pi_queue command_queue, pi_mem buffer, pi_bool blocking_write, + const size_t *buffer_offset, const size_t *host_offset, + const size_t *region, size_t buffer_row_pitch, size_t buffer_slice_pitch, + size_t host_row_pitch, size_t host_slice_pitch, const void *ptr, + pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, + pi_event *event); + +__SYCL_EXPORT pi_result +piEnqueueMemBufferCopy(pi_queue command_queue, pi_mem src_buffer, + pi_mem dst_buffer, size_t src_offset, size_t dst_offset, + size_t size, pi_uint32 num_events_in_wait_list, + const pi_event *event_wait_list, pi_event *event); + +__SYCL_EXPORT pi_result piEnqueueMemBufferCopyRect( pi_queue command_queue, pi_mem src_buffer, pi_mem dst_buffer, const size_t *src_origin, const size_t *dst_origin, const size_t *region, size_t src_row_pitch, size_t src_slice_pitch, size_t dst_row_pitch, size_t dst_slice_pitch, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event); -pi_result piEnqueueMemBufferFill(pi_queue command_queue, pi_mem buffer, - const void *pattern, size_t pattern_size, - size_t offset, size_t size, - pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, - pi_event *event); - -pi_result piEnqueueMemImageRead(pi_queue command_queue, pi_mem image, - pi_bool blocking_read, const size_t *origin, - const size_t *region, size_t row_pitch, - size_t slice_pitch, void *ptr, - pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, - pi_event *event); - -pi_result piEnqueueMemImageWrite(pi_queue command_queue, pi_mem image, - pi_bool blocking_write, const size_t *origin, - const size_t *region, size_t input_row_pitch, - size_t input_slice_pitch, const void *ptr, - pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, - pi_event *event); - -pi_result piEnqueueMemImageCopy(pi_queue command_queue, pi_mem src_image, - pi_mem dst_image, const size_t *src_origin, - const size_t *dst_origin, const size_t *region, - pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, - pi_event *event); - -pi_result piEnqueueMemImageFill(pi_queue command_queue, pi_mem image, - const void *fill_color, const size_t *origin, - const size_t *region, - pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, - pi_event *event); - -pi_result piEnqueueMemBufferMap( +__SYCL_EXPORT pi_result +piEnqueueMemBufferFill(pi_queue command_queue, pi_mem buffer, + const void *pattern, size_t pattern_size, size_t offset, + size_t size, pi_uint32 num_events_in_wait_list, + const pi_event *event_wait_list, pi_event *event); + +__SYCL_EXPORT pi_result piEnqueueMemImageRead( + pi_queue command_queue, pi_mem image, pi_bool blocking_read, + const size_t *origin, const size_t *region, size_t row_pitch, + size_t slice_pitch, void *ptr, pi_uint32 num_events_in_wait_list, + const pi_event *event_wait_list, pi_event *event); + +__SYCL_EXPORT pi_result piEnqueueMemImageWrite( + pi_queue command_queue, pi_mem image, pi_bool blocking_write, + const size_t *origin, const size_t *region, size_t input_row_pitch, + size_t input_slice_pitch, const void *ptr, + pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, + pi_event *event); + +__SYCL_EXPORT pi_result piEnqueueMemImageCopy( + pi_queue command_queue, pi_mem src_image, pi_mem dst_image, + const size_t *src_origin, const size_t *dst_origin, const size_t *region, + pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, + pi_event *event); + +__SYCL_EXPORT pi_result +piEnqueueMemImageFill(pi_queue command_queue, pi_mem image, + const void *fill_color, const size_t *origin, + const size_t *region, pi_uint32 num_events_in_wait_list, + const pi_event *event_wait_list, pi_event *event); + +__SYCL_EXPORT pi_result piEnqueueMemBufferMap( pi_queue command_queue, pi_mem buffer, pi_bool blocking_map, cl_map_flags map_flags, // TODO: untie from OpenCL size_t offset, size_t size, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event, void **ret_map); -pi_result piEnqueueMemUnmap(pi_queue command_queue, pi_mem memobj, - void *mapped_ptr, pi_uint32 num_events_in_wait_list, - const pi_event *event_wait_list, pi_event *event); +__SYCL_EXPORT pi_result piEnqueueMemUnmap(pi_queue command_queue, pi_mem memobj, + void *mapped_ptr, + pi_uint32 num_events_in_wait_list, + const pi_event *event_wait_list, + pi_event *event); -pi_result piextKernelSetArgMemObj(pi_kernel kernel, pi_uint32 arg_index, - const pi_mem *arg_value); +__SYCL_EXPORT pi_result piextKernelSetArgMemObj(pi_kernel kernel, + pi_uint32 arg_index, + const pi_mem *arg_value); /// // USM @@ -1299,9 +1317,9 @@ using pi_usm_migration_flags = _pi_usm_migration_flags; /// \param pi_usm_mem_properties are optional allocation properties /// \param size_t is the size of the allocation /// \param alignment is the desired alignment of the allocation -pi_result piextUSMHostAlloc(void **result_ptr, pi_context context, - pi_usm_mem_properties *properties, size_t size, - pi_uint32 alignment); +__SYCL_EXPORT pi_result piextUSMHostAlloc(void **result_ptr, pi_context context, + pi_usm_mem_properties *properties, + size_t size, pi_uint32 alignment); /// Allocates device memory /// @@ -1311,10 +1329,11 @@ pi_result piextUSMHostAlloc(void **result_ptr, pi_context context, /// \param pi_usm_mem_properties are optional allocation properties /// \param size_t is the size of the allocation /// \param alignment is the desired alignment of the allocation -pi_result piextUSMDeviceAlloc(void **result_ptr, pi_context context, - pi_device device, - pi_usm_mem_properties *properties, size_t size, - pi_uint32 alignment); +__SYCL_EXPORT pi_result piextUSMDeviceAlloc(void **result_ptr, + pi_context context, + pi_device device, + pi_usm_mem_properties *properties, + size_t size, pi_uint32 alignment); /// Allocates memory accessible on both host and device /// @@ -1324,16 +1343,17 @@ pi_result piextUSMDeviceAlloc(void **result_ptr, pi_context context, /// \param pi_usm_mem_properties are optional allocation properties /// \param size_t is the size of the allocation /// \param alignment is the desired alignment of the allocation -pi_result piextUSMSharedAlloc(void **result_ptr, pi_context context, - pi_device device, - pi_usm_mem_properties *properties, size_t size, - pi_uint32 alignment); +__SYCL_EXPORT pi_result piextUSMSharedAlloc(void **result_ptr, + pi_context context, + pi_device device, + pi_usm_mem_properties *properties, + size_t size, pi_uint32 alignment); /// Frees allocated USM memory /// /// \param context is the pi_context of the allocation /// \param ptr is the memory to be freed -pi_result piextUSMFree(pi_context context, void *ptr); +__SYCL_EXPORT pi_result piextUSMFree(pi_context context, void *ptr); /// USM Memset API /// @@ -1346,10 +1366,11 @@ pi_result piextUSMFree(pi_context context, void *ptr); /// \param num_events_in_waitlist is the number of events to wait on /// \param events_waitlist is an array of events to wait on /// \param event is the event that represents this operation -pi_result piextUSMEnqueueMemset(pi_queue queue, void *ptr, pi_int32 value, - size_t count, pi_uint32 num_events_in_waitlist, - const pi_event *events_waitlist, - pi_event *event); +__SYCL_EXPORT pi_result piextUSMEnqueueMemset(pi_queue queue, void *ptr, + pi_int32 value, size_t count, + pi_uint32 num_events_in_waitlist, + const pi_event *events_waitlist, + pi_event *event); /// USM Memcpy API /// @@ -1361,11 +1382,12 @@ pi_result piextUSMEnqueueMemset(pi_queue queue, void *ptr, pi_int32 value, /// \param num_events_in_waitlist is the number of events to wait on /// \param events_waitlist is an array of events to wait on /// \param event is the event that represents this operation -pi_result piextUSMEnqueueMemcpy(pi_queue queue, pi_bool blocking, void *dst_ptr, - const void *src_ptr, size_t size, - pi_uint32 num_events_in_waitlist, - const pi_event *events_waitlist, - pi_event *event); +__SYCL_EXPORT pi_result piextUSMEnqueueMemcpy(pi_queue queue, pi_bool blocking, + void *dst_ptr, + const void *src_ptr, size_t size, + pi_uint32 num_events_in_waitlist, + const pi_event *events_waitlist, + pi_event *event); /// Hint to migrate memory to the device /// @@ -1376,11 +1398,10 @@ pi_result piextUSMEnqueueMemcpy(pi_queue queue, pi_bool blocking, void *dst_ptr, /// \param num_events_in_waitlist is the number of events to wait on /// \param events_waitlist is an array of events to wait on /// \param event is the event that represents this operation -pi_result piextUSMEnqueuePrefetch(pi_queue queue, const void *ptr, size_t size, - pi_usm_migration_flags flags, - pi_uint32 num_events_in_waitlist, - const pi_event *events_waitlist, - pi_event *event); +__SYCL_EXPORT pi_result piextUSMEnqueuePrefetch( + pi_queue queue, const void *ptr, size_t size, pi_usm_migration_flags flags, + pi_uint32 num_events_in_waitlist, const pi_event *events_waitlist, + pi_event *event); /// USM Memadvise API /// @@ -1390,8 +1411,9 @@ pi_result piextUSMEnqueuePrefetch(pi_queue queue, const void *ptr, size_t size, /// \param advice is device specific advice /// \param event is the event that represents this operation // USM memadvise API to govern behavior of automatic migration mechanisms -pi_result piextUSMEnqueueMemAdvise(pi_queue queue, const void *ptr, - size_t length, int advice, pi_event *event); +__SYCL_EXPORT pi_result piextUSMEnqueueMemAdvise(pi_queue queue, + const void *ptr, size_t length, + int advice, pi_event *event); /// API to query information about USM allocated pointers /// Valid Queries: @@ -1409,10 +1431,9 @@ pi_result piextUSMEnqueueMemAdvise(pi_queue queue, const void *ptr, /// \param param_value_size is the size of the result in bytes /// \param param_value is the result /// \param param_value_ret is how many bytes were written -pi_result piextUSMGetMemAllocInfo(pi_context context, const void *ptr, - pi_mem_info param_name, - size_t param_value_size, void *param_value, - size_t *param_value_size_ret); +__SYCL_EXPORT pi_result piextUSMGetMemAllocInfo( + pi_context context, const void *ptr, pi_mem_info param_name, + size_t param_value_size, void *param_value, size_t *param_value_size_ret); struct _pi_plugin { // PI version supported by host passed to the plugin. The Plugin diff --git a/sycl/plugins/ld-version-script.txt b/sycl/plugins/ld-version-script.txt new file mode 100644 index 0000000000000..1ad2c6d5f8390 --- /dev/null +++ b/sycl/plugins/ld-version-script.txt @@ -0,0 +1,10 @@ +{ + /* in CMakelists.txt, we pass -fvisibility=hidden compiler flag */ + /* This file is used to give exception of the hidden visibility */ + /* Export only pi* function symbols which are individually marked 'default' visibility */ + + global: pi*; + + /* all other symbols are local scope, meaning not exported */ + local: *; +}; diff --git a/sycl/plugins/opencl/CMakeLists.txt b/sycl/plugins/opencl/CMakeLists.txt index b085d53ba8175..30674c1d5621b 100644 --- a/sycl/plugins/opencl/CMakeLists.txt +++ b/sycl/plugins/opencl/CMakeLists.txt @@ -9,6 +9,7 @@ #TODO: remove dependency on pi.hpp in sycl project. #TODO: Currently, the pi.hpp header is common between sycl and plugin library sources. #This can be changed by copying the pi.hpp file in the plugins project. + add_library(pi_opencl SHARED "${sycl_inc_dir}/CL/sycl/detail/pi.h" "pi_opencl.cpp" @@ -28,9 +29,28 @@ target_include_directories(pi_opencl PRIVATE "${sycl_inc_dir}") #link pi_opencl with OpenCL headers and ICD Loader. target_link_libraries( pi_opencl - PRIVATE OpenCL::Headers - PRIVATE ${OpenCL_LIBRARIES} + PRIVATE OpenCL::Headers + PRIVATE ${OpenCL_LIBRARIES} ) +if (MSVC) + # by defining __SYCL_BUILD_SYCL_DLL, we can use __declspec(dllexport) + # which are individually tagged for all pi* symbols in pi.h + target_compile_definitions(pi_opencl PRIVATE __SYCL_BUILD_SYCL_DLL) +else() + # we set the visibility of all symbols 'hidden' by default. + # In pi.h file, we set exported symbols with visibility==default individually + target_compile_options(pi_opencl PUBLIC -fvisibility=hidden) + + # This script file is used to allow exporting pi* symbols only. + # All other symbols are regarded as local (hidden) + set(linker_script "${CMAKE_CURRENT_SOURCE_DIR}/../ld-version-script.txt") + + # Filter symbols based on the scope defined in the script file, + # and export pi* function symbols in the library. + target_link_libraries( pi_opencl + PRIVATE "-Wl,--version-script=${linker_script}" + ) +endif() add_common_options(pi_opencl) diff --git a/sycl/plugins/opencl/pi_opencl.cpp b/sycl/plugins/opencl/pi_opencl.cpp index 67e0e98935543..bee9ad4b5ba90 100644 --- a/sycl/plugins/opencl/pi_opencl.cpp +++ b/sycl/plugins/opencl/pi_opencl.cpp @@ -160,12 +160,9 @@ static pi_result USMSetIndirectAccess(pi_kernel kernel) { extern "C" { -// Convenience macro makes source code search easier -#define OCL(pi_api) Ocl##pi_api - // Example of a PI interface that does not map exactly to an OpenCL one. -pi_result OCL(piPlatformsGet)(pi_uint32 num_entries, pi_platform *platforms, - pi_uint32 *num_platforms) { +pi_result piPlatformsGet(pi_uint32 num_entries, pi_platform *platforms, + pi_uint32 *num_platforms) { cl_int result = clGetPlatformIDs(cast(num_entries), cast(platforms), cast(num_platforms)); @@ -180,9 +177,9 @@ pi_result OCL(piPlatformsGet)(pi_uint32 num_entries, pi_platform *platforms, } // Example of a PI interface that does not map exactly to an OpenCL one. -pi_result OCL(piDevicesGet)(pi_platform platform, pi_device_type device_type, - pi_uint32 num_entries, pi_device *devices, - pi_uint32 *num_devices) { +pi_result piDevicesGet(pi_platform platform, pi_device_type device_type, + pi_uint32 num_entries, pi_device *devices, + pi_uint32 *num_devices) { cl_int result = clGetDeviceIDs( cast(platform), cast(device_type), cast(num_entries), cast(devices), @@ -197,10 +194,9 @@ pi_result OCL(piDevicesGet)(pi_platform platform, pi_device_type device_type, return cast(result); } -pi_result OCL(piextDeviceSelectBinary)(pi_device device, - pi_device_binary *images, - pi_uint32 num_images, - pi_uint32 *selected_image_ind) { +pi_result piextDeviceSelectBinary(pi_device device, pi_device_binary *images, + pi_uint32 num_images, + pi_uint32 *selected_image_ind) { // TODO: this is a bare-bones implementation for choosing a device image // that would be compatible with the targeted device. An AOT-compiled @@ -269,15 +265,15 @@ pi_result OCL(piextDeviceSelectBinary)(pi_device device, return PI_INVALID_BINARY; } -pi_result OCL(piextDeviceCreateWithNativeHandle)(pi_native_handle nativeHandle, - pi_device *piDevice) { +pi_result piextDeviceCreateWithNativeHandle(pi_native_handle nativeHandle, + pi_device *piDevice) { assert(piDevice != nullptr); *piDevice = reinterpret_cast(nativeHandle); return PI_SUCCESS; } -pi_result OCL(piQueueCreate)(pi_context context, pi_device device, - pi_queue_properties properties, pi_queue *queue) { +pi_result piQueueCreate(pi_context context, pi_device device, + pi_queue_properties properties, pi_queue *queue) { assert(queue && "piQueueCreate failed, queue argument is null"); cl_platform_id curPlatform; @@ -316,15 +312,15 @@ pi_result OCL(piQueueCreate)(pi_context context, pi_device device, return cast(ret_err); } -pi_result OCL(piextQueueCreateWithNativeHandle)(pi_native_handle nativeHandle, - pi_queue *piQueue) { +pi_result piextQueueCreateWithNativeHandle(pi_native_handle nativeHandle, + pi_queue *piQueue) { assert(piQueue != nullptr); *piQueue = reinterpret_cast(nativeHandle); return PI_SUCCESS; } -pi_result OCL(piProgramCreate)(pi_context context, const void *il, - size_t length, pi_program *res_program) { +pi_result piProgramCreate(pi_context context, const void *il, size_t length, + pi_program *res_program) { size_t deviceCount; @@ -401,16 +397,16 @@ pi_result OCL(piProgramCreate)(pi_context context, const void *il, return err; } -pi_result OCL(piextProgramCreateWithNativeHandle)(pi_native_handle nativeHandle, - pi_program *piProgram) { +pi_result piextProgramCreateWithNativeHandle(pi_native_handle nativeHandle, + pi_program *piProgram) { assert(piProgram != nullptr); *piProgram = reinterpret_cast(nativeHandle); return PI_SUCCESS; } -pi_result OCL(piSamplerCreate)(pi_context context, - const pi_sampler_properties *sampler_properties, - pi_sampler *result_sampler) { +pi_result piSamplerCreate(pi_context context, + const pi_sampler_properties *sampler_properties, + pi_sampler *result_sampler) { // Initialize properties according to OpenCL 2.1 spec. pi_result error_code; pi_bool normalizedCoords = PI_TRUE; @@ -439,17 +435,16 @@ pi_result OCL(piSamplerCreate)(pi_context context, return error_code; } -pi_result OCL(piextKernelSetArgMemObj)(pi_kernel kernel, pi_uint32 arg_index, - const pi_mem *arg_value) { +pi_result piextKernelSetArgMemObj(pi_kernel kernel, pi_uint32 arg_index, + const pi_mem *arg_value) { return cast( clSetKernelArg(cast(kernel), cast(arg_index), sizeof(arg_value), cast(arg_value))); } -pi_result OCL(piextGetDeviceFunctionPointer)(pi_device device, - pi_program program, - const char *func_name, - pi_uint64 *function_pointer_ret) { +pi_result piextGetDeviceFunctionPointer(pi_device device, pi_program program, + const char *func_name, + pi_uint64 *function_pointer_ret) { pi_platform platform; cl_int ret_err = clGetDeviceInfo(cast(device), PI_DEVICE_INFO_PLATFORM, @@ -484,12 +479,12 @@ pi_result OCL(piextGetDeviceFunctionPointer)(pi_device device, function_pointer_ret)); } -pi_result OCL(piContextCreate)(const pi_context_properties *properties, - pi_uint32 num_devices, const pi_device *devices, - void (*pfn_notify)(const char *errinfo, - const void *private_info, - size_t cb, void *user_data1), - void *user_data, pi_context *retcontext) { +pi_result piContextCreate(const pi_context_properties *properties, + pi_uint32 num_devices, const pi_device *devices, + void (*pfn_notify)(const char *errinfo, + const void *private_info, + size_t cb, void *user_data1), + void *user_data, pi_context *retcontext) { pi_result ret = PI_INVALID_OPERATION; *retcontext = cast( clCreateContext(properties, cast(num_devices), @@ -499,15 +494,15 @@ pi_result OCL(piContextCreate)(const pi_context_properties *properties, return ret; } -pi_result OCL(piextContextCreateWithNativeHandle)(pi_native_handle nativeHandle, - pi_context *piContext) { +pi_result piextContextCreateWithNativeHandle(pi_native_handle nativeHandle, + pi_context *piContext) { assert(piContext != nullptr); *piContext = reinterpret_cast(nativeHandle); return PI_SUCCESS; } -pi_result OCL(piMemBufferCreate)(pi_context context, pi_mem_flags flags, - size_t size, void *host_ptr, pi_mem *ret_mem) { +pi_result piMemBufferCreate(pi_context context, pi_mem_flags flags, size_t size, + void *host_ptr, pi_mem *ret_mem) { pi_result ret_err = PI_INVALID_OPERATION; *ret_mem = cast(clCreateBuffer(cast(context), cast(flags), size, @@ -516,10 +511,10 @@ pi_result OCL(piMemBufferCreate)(pi_context context, pi_mem_flags flags, return ret_err; } -pi_result OCL(piMemImageCreate)(pi_context context, pi_mem_flags flags, - const pi_image_format *image_format, - const pi_image_desc *image_desc, void *host_ptr, - pi_mem *ret_mem) { +pi_result piMemImageCreate(pi_context context, pi_mem_flags flags, + const pi_image_format *image_format, + const pi_image_desc *image_desc, void *host_ptr, + pi_mem *ret_mem) { pi_result ret_err = PI_INVALID_OPERATION; *ret_mem = cast( clCreateImage(cast(context), cast(flags), @@ -530,9 +525,9 @@ pi_result OCL(piMemImageCreate)(pi_context context, pi_mem_flags flags, return ret_err; } -pi_result OCL(piMemBufferPartition)(pi_mem buffer, pi_mem_flags flags, - pi_buffer_create_type buffer_create_type, - void *buffer_create_info, pi_mem *ret_mem) { +pi_result piMemBufferPartition(pi_mem buffer, pi_mem_flags flags, + pi_buffer_create_type buffer_create_type, + void *buffer_create_info, pi_mem *ret_mem) { pi_result ret_err = PI_INVALID_OPERATION; *ret_mem = cast( @@ -542,17 +537,17 @@ pi_result OCL(piMemBufferPartition)(pi_mem buffer, pi_mem_flags flags, return ret_err; } -pi_result OCL(piextMemCreateWithNativeHandle)(pi_native_handle nativeHandle, - pi_mem *piMem) { +pi_result piextMemCreateWithNativeHandle(pi_native_handle nativeHandle, + pi_mem *piMem) { assert(piMem != nullptr); *piMem = reinterpret_cast(nativeHandle); return PI_SUCCESS; } -pi_result OCL(piclProgramCreateWithSource)(pi_context context, pi_uint32 count, - const char **strings, - const size_t *lengths, - pi_program *ret_program) { +pi_result piclProgramCreateWithSource(pi_context context, pi_uint32 count, + const char **strings, + const size_t *lengths, + pi_program *ret_program) { pi_result ret_err = PI_INVALID_OPERATION; *ret_program = cast( @@ -561,10 +556,12 @@ pi_result OCL(piclProgramCreateWithSource)(pi_context context, pi_uint32 count, return ret_err; } -pi_result OCL(piclProgramCreateWithBinary)( - pi_context context, pi_uint32 num_devices, const pi_device *device_list, - const size_t *lengths, const unsigned char **binaries, - pi_int32 *binary_status, pi_program *ret_program) { +pi_result piclProgramCreateWithBinary(pi_context context, pi_uint32 num_devices, + const pi_device *device_list, + const size_t *lengths, + const unsigned char **binaries, + pi_int32 *binary_status, + pi_program *ret_program) { pi_result ret_err = PI_INVALID_OPERATION; *ret_program = cast(clCreateProgramWithBinary( @@ -574,13 +571,12 @@ pi_result OCL(piclProgramCreateWithBinary)( return ret_err; } -pi_result OCL(piProgramLink)(pi_context context, pi_uint32 num_devices, - const pi_device *device_list, const char *options, - pi_uint32 num_input_programs, - const pi_program *input_programs, - void (*pfn_notify)(pi_program program, - void *user_data), - void *user_data, pi_program *ret_program) { +pi_result piProgramLink(pi_context context, pi_uint32 num_devices, + const pi_device *device_list, const char *options, + pi_uint32 num_input_programs, + const pi_program *input_programs, + void (*pfn_notify)(pi_program program, void *user_data), + void *user_data, pi_program *ret_program) { pi_result ret_err = PI_INVALID_OPERATION; *ret_program = cast( @@ -593,8 +589,8 @@ pi_result OCL(piProgramLink)(pi_context context, pi_uint32 num_devices, return ret_err; } -pi_result OCL(piKernelCreate)(pi_program program, const char *kernel_name, - pi_kernel *ret_kernel) { +pi_result piKernelCreate(pi_program program, const char *kernel_name, + pi_kernel *ret_kernel) { pi_result ret_err = PI_INVALID_OPERATION; *ret_kernel = cast(clCreateKernel( @@ -602,7 +598,7 @@ pi_result OCL(piKernelCreate)(pi_program program, const char *kernel_name, return ret_err; } -pi_result OCL(piEventCreate)(pi_context context, pi_event *ret_event) { +pi_result piEventCreate(pi_context context, pi_event *ret_event) { pi_result ret_err = PI_INVALID_OPERATION; *ret_event = cast( @@ -610,14 +606,14 @@ pi_result OCL(piEventCreate)(pi_context context, pi_event *ret_event) { return ret_err; } -pi_result OCL(piextEventCreateWithNativeHandle)(pi_native_handle nativeHandle, - pi_event *piEvent) { +pi_result piextEventCreateWithNativeHandle(pi_native_handle nativeHandle, + pi_event *piEvent) { assert(piEvent != nullptr); *piEvent = reinterpret_cast(nativeHandle); return PI_SUCCESS; } -pi_result OCL(piEnqueueMemBufferMap)( +pi_result piEnqueueMemBufferMap( pi_queue command_queue, pi_mem buffer, pi_bool blocking_map, cl_map_flags map_flags, // TODO: untie from OpenCL size_t offset, size_t size, pi_uint32 num_events_in_wait_list, @@ -644,9 +640,9 @@ pi_result OCL(piEnqueueMemBufferMap)( /// \param pi_usm_mem_properties are optional allocation properties /// \param size_t is the size of the allocation /// \param alignment is the desired alignment of the allocation -pi_result OCL(piextUSMHostAlloc)(void **result_ptr, pi_context context, - pi_usm_mem_properties *properties, size_t size, - pi_uint32 alignment) { +pi_result piextUSMHostAlloc(void **result_ptr, pi_context context, + pi_usm_mem_properties *properties, size_t size, + pi_uint32 alignment) { void *Ptr = nullptr; pi_result RetVal = PI_INVALID_OPERATION; @@ -675,10 +671,10 @@ pi_result OCL(piextUSMHostAlloc)(void **result_ptr, pi_context context, /// \param pi_usm_mem_properties are optional allocation properties /// \param size_t is the size of the allocation /// \param alignment is the desired alignment of the allocation -pi_result OCL(piextUSMDeviceAlloc)(void **result_ptr, pi_context context, - pi_device device, - pi_usm_mem_properties *properties, - size_t size, pi_uint32 alignment) { +pi_result piextUSMDeviceAlloc(void **result_ptr, pi_context context, + pi_device device, + pi_usm_mem_properties *properties, size_t size, + pi_uint32 alignment) { void *Ptr = nullptr; pi_result RetVal = PI_INVALID_OPERATION; @@ -708,10 +704,10 @@ pi_result OCL(piextUSMDeviceAlloc)(void **result_ptr, pi_context context, /// \param pi_usm_mem_properties are optional allocation properties /// \param size_t is the size of the allocation /// \param alignment is the desired alignment of the allocation -pi_result OCL(piextUSMSharedAlloc)(void **result_ptr, pi_context context, - pi_device device, - pi_usm_mem_properties *properties, - size_t size, pi_uint32 alignment) { +pi_result piextUSMSharedAlloc(void **result_ptr, pi_context context, + pi_device device, + pi_usm_mem_properties *properties, size_t size, + pi_uint32 alignment) { void *Ptr = nullptr; pi_result RetVal = PI_INVALID_OPERATION; @@ -737,7 +733,7 @@ pi_result OCL(piextUSMSharedAlloc)(void **result_ptr, pi_context context, /// /// \param context is the pi_context of the allocation /// \param ptr is the memory to be freed -pi_result OCL(piextUSMFree)(pi_context context, void *ptr) { +pi_result piextUSMFree(pi_context context, void *ptr) { clMemFreeINTEL_fn FuncPtr = nullptr; pi_result RetVal = PI_INVALID_OPERATION; @@ -758,9 +754,8 @@ pi_result OCL(piextUSMFree)(pi_context context, void *ptr) { /// \param arg_index is the index of the kernel argument /// \param arg_size is the size in bytes of the argument (ignored in CL) /// \param arg_value is the pointer argument -pi_result OCL(piextKernelSetArgPointer)(pi_kernel kernel, pi_uint32 arg_index, - size_t arg_size, - const void *arg_value) { +pi_result piextKernelSetArgPointer(pi_kernel kernel, pi_uint32 arg_index, + size_t arg_size, const void *arg_value) { // Size is unused in CL as pointer args are passed by value. @@ -799,11 +794,10 @@ pi_result OCL(piextKernelSetArgPointer)(pi_kernel kernel, pi_uint32 arg_index, /// \param num_events_in_waitlist is the number of events to wait on /// \param events_waitlist is an array of events to wait on /// \param event is the event that represents this operation -pi_result OCL(piextUSMEnqueueMemset)(pi_queue queue, void *ptr, pi_int32 value, - size_t count, - pi_uint32 num_events_in_waitlist, - const pi_event *events_waitlist, - pi_event *event) { +pi_result piextUSMEnqueueMemset(pi_queue queue, void *ptr, pi_int32 value, + size_t count, pi_uint32 num_events_in_waitlist, + const pi_event *events_waitlist, + pi_event *event) { // Have to look up the context from the kernel cl_context CLContext; @@ -839,12 +833,11 @@ pi_result OCL(piextUSMEnqueueMemset)(pi_queue queue, void *ptr, pi_int32 value, /// \param num_events_in_waitlist is the number of events to wait on /// \param events_waitlist is an array of events to wait on /// \param event is the event that represents this operation -pi_result OCL(piextUSMEnqueueMemcpy)(pi_queue queue, pi_bool blocking, - void *dst_ptr, const void *src_ptr, - size_t size, - pi_uint32 num_events_in_waitlist, - const pi_event *events_waitlist, - pi_event *event) { +pi_result piextUSMEnqueueMemcpy(pi_queue queue, pi_bool blocking, void *dst_ptr, + const void *src_ptr, size_t size, + pi_uint32 num_events_in_waitlist, + const pi_event *events_waitlist, + pi_event *event) { // Have to look up the context from the kernel cl_context CLContext; @@ -879,12 +872,11 @@ pi_result OCL(piextUSMEnqueueMemcpy)(pi_queue queue, pi_bool blocking, /// \param num_events_in_waitlist is the number of events to wait on /// \param events_waitlist is an array of events to wait on /// \param event is the event that represents this operation -pi_result OCL(piextUSMEnqueuePrefetch)(pi_queue queue, const void *ptr, - size_t size, - pi_usm_migration_flags flags, - pi_uint32 num_events_in_waitlist, - const pi_event *events_waitlist, - pi_event *event) { +pi_result piextUSMEnqueuePrefetch(pi_queue queue, const void *ptr, size_t size, + pi_usm_migration_flags flags, + pi_uint32 num_events_in_waitlist, + const pi_event *events_waitlist, + pi_event *event) { return cast(clEnqueueMarkerWithWaitList( cast(queue), num_events_in_waitlist, @@ -924,9 +916,8 @@ pi_result OCL(piextUSMEnqueuePrefetch)(pi_queue queue, const void *ptr, /// \param advice is device specific advice /// \param event is the event that represents this operation // USM memadvise API to govern behavior of automatic migration mechanisms -pi_result OCL(piextUSMEnqueueMemAdvise)(pi_queue queue, const void *ptr, - size_t length, int advice, - pi_event *event) { +pi_result piextUSMEnqueueMemAdvise(pi_queue queue, const void *ptr, + size_t length, int advice, pi_event *event) { return cast( clEnqueueMarkerWithWaitList(cast(queue), 0, nullptr, @@ -976,11 +967,10 @@ pi_result OCL(piextUSMEnqueueMemAdvise)(pi_queue queue, const void *ptr, /// \param param_value_size is the size of the result in bytes /// \param param_value is the result /// \param param_value_ret is how many bytes were written -pi_result OCL(piextUSMGetMemAllocInfo)(pi_context context, const void *ptr, - pi_mem_info param_name, - size_t param_value_size, - void *param_value, - size_t *param_value_size_ret) { +pi_result piextUSMGetMemAllocInfo(pi_context context, const void *ptr, + pi_mem_info param_name, + size_t param_value_size, void *param_value, + size_t *param_value_size_ret) { clGetMemAllocInfoINTEL_fn FuncPtr = nullptr; pi_result RetVal = @@ -1007,10 +997,9 @@ pi_result OCL(piextUSMGetMemAllocInfo)(pi_context context, const void *ptr, /// If param_name is PI_USM_INDIRECT_ACCESS, the value will be a ptr to /// the pi_bool value PI_TRUE /// If param_name is PI_USM_PTRS, the value will be an array of ptrs -pi_result OCL(piKernelSetExecInfo)(pi_kernel kernel, - pi_kernel_exec_info param_name, - size_t param_value_size, - const void *param_value) { +pi_result piKernelSetExecInfo(pi_kernel kernel, pi_kernel_exec_info param_name, + size_t param_value_size, + const void *param_value) { if (param_name == PI_USM_INDIRECT_ACCESS && *(static_cast(param_value)) == PI_TRUE) { return USMSetIndirectAccess(kernel); @@ -1024,9 +1013,10 @@ typedef CL_API_ENTRY cl_int(CL_API_CALL *clSetProgramSpecializationConstant_fn)( cl_program program, cl_uint spec_id, size_t spec_size, const void *spec_value); -static pi_result OCL(piextProgramSetSpecializationConstantImpl)( - pi_program prog, unsigned int spec_id, size_t spec_size, - const void *spec_value) { +pi_result piextProgramSetSpecializationConstant(pi_program prog, + pi_uint32 spec_id, + size_t spec_size, + const void *spec_value) { cl_program ClProg = cast(prog); cl_context Ctx = nullptr; size_t RetSize = 0; @@ -1052,13 +1042,37 @@ static pi_result OCL(piextProgramSetSpecializationConstantImpl)( /// \param nativeHandle is a pointer to be set to the native handle /// /// PI_SUCCESS -pi_result OCL(piextGetNativeHandle)(void *piObj, - pi_native_handle *nativeHandle) { +static pi_result piextGetNativeHandle(void *piObj, + pi_native_handle *nativeHandle) { assert(nativeHandle != nullptr); *nativeHandle = reinterpret_cast(piObj); return PI_SUCCESS; } +pi_result piextDeviceGetNativeHandle(pi_device device, + pi_native_handle *nativeHandle) { + return piextGetNativeHandle(device, nativeHandle); +} + +pi_result piextContextGetNativeHandle(pi_context context, + pi_native_handle *nativeHandle) { + return piextGetNativeHandle(context, nativeHandle); +} + +pi_result piextQueueGetNativeHandle(pi_queue queue, + pi_native_handle *nativeHandle) { + return piextGetNativeHandle(queue, nativeHandle); +} + +pi_result piextMemGetNativeHandle(pi_mem mem, pi_native_handle *nativeHandle) { + return piextGetNativeHandle(mem, nativeHandle); +} + +pi_result piextProgramGetNativeHandle(pi_program program, + pi_native_handle *nativeHandle) { + return piextGetNativeHandle(program, nativeHandle); +} + pi_result piPluginInit(pi_plugin *PluginInit) { int CompareVersions = strcmp(PluginInit->PiVersion, SupportedVersion); if (CompareVersions < 0) { @@ -1074,74 +1088,70 @@ pi_result piPluginInit(pi_plugin *PluginInit) { (PluginInit->PiFunctionTable).pi_api = (decltype(&::pi_api))(&ocl_api); // Platform - _PI_CL(piPlatformsGet, OCL(piPlatformsGet)) + _PI_CL(piPlatformsGet, piPlatformsGet) _PI_CL(piPlatformGetInfo, clGetPlatformInfo) // Device - _PI_CL(piDevicesGet, OCL(piDevicesGet)) + _PI_CL(piDevicesGet, piDevicesGet) _PI_CL(piDeviceGetInfo, clGetDeviceInfo) _PI_CL(piDevicePartition, clCreateSubDevices) _PI_CL(piDeviceRetain, clRetainDevice) _PI_CL(piDeviceRelease, clReleaseDevice) - _PI_CL(piextDeviceSelectBinary, OCL(piextDeviceSelectBinary)) - _PI_CL(piextGetDeviceFunctionPointer, OCL(piextGetDeviceFunctionPointer)) - _PI_CL(piextDeviceGetNativeHandle, OCL(piextGetNativeHandle)) - _PI_CL(piextDeviceCreateWithNativeHandle, - OCL(piextDeviceCreateWithNativeHandle)) + _PI_CL(piextDeviceSelectBinary, piextDeviceSelectBinary) + _PI_CL(piextGetDeviceFunctionPointer, piextGetDeviceFunctionPointer) + _PI_CL(piextDeviceGetNativeHandle, piextDeviceGetNativeHandle) + _PI_CL(piextDeviceCreateWithNativeHandle, piextDeviceCreateWithNativeHandle) // Context - _PI_CL(piContextCreate, OCL(piContextCreate)) + _PI_CL(piContextCreate, piContextCreate) _PI_CL(piContextGetInfo, clGetContextInfo) _PI_CL(piContextRetain, clRetainContext) _PI_CL(piContextRelease, clReleaseContext) - _PI_CL(piextContextGetNativeHandle, OCL(piextGetNativeHandle)) - _PI_CL(piextContextCreateWithNativeHandle, - OCL(piextContextCreateWithNativeHandle)) + _PI_CL(piextContextGetNativeHandle, piextContextGetNativeHandle) + _PI_CL(piextContextCreateWithNativeHandle, piextContextCreateWithNativeHandle) // Queue - _PI_CL(piQueueCreate, OCL(piQueueCreate)) + _PI_CL(piQueueCreate, piQueueCreate) _PI_CL(piQueueGetInfo, clGetCommandQueueInfo) _PI_CL(piQueueFinish, clFinish) _PI_CL(piQueueRetain, clRetainCommandQueue) _PI_CL(piQueueRelease, clReleaseCommandQueue) - _PI_CL(piextQueueGetNativeHandle, OCL(piextGetNativeHandle)) - _PI_CL(piextQueueCreateWithNativeHandle, - OCL(piextQueueCreateWithNativeHandle)) + _PI_CL(piextQueueGetNativeHandle, piextQueueGetNativeHandle) + _PI_CL(piextQueueCreateWithNativeHandle, piextQueueCreateWithNativeHandle) // Memory - _PI_CL(piMemBufferCreate, OCL(piMemBufferCreate)) - _PI_CL(piMemImageCreate, OCL(piMemImageCreate)) + _PI_CL(piMemBufferCreate, piMemBufferCreate) + _PI_CL(piMemImageCreate, piMemImageCreate) _PI_CL(piMemGetInfo, clGetMemObjectInfo) _PI_CL(piMemImageGetInfo, clGetImageInfo) _PI_CL(piMemRetain, clRetainMemObject) _PI_CL(piMemRelease, clReleaseMemObject) - _PI_CL(piMemBufferPartition, OCL(piMemBufferPartition)) - _PI_CL(piextMemGetNativeHandle, OCL(piextGetNativeHandle)) - _PI_CL(piextMemCreateWithNativeHandle, OCL(piextMemCreateWithNativeHandle)) + _PI_CL(piMemBufferPartition, piMemBufferPartition) + _PI_CL(piextMemGetNativeHandle, piextMemGetNativeHandle) + _PI_CL(piextMemCreateWithNativeHandle, piextMemCreateWithNativeHandle) // Program - _PI_CL(piProgramCreate, OCL(piProgramCreate)) - _PI_CL(piclProgramCreateWithSource, OCL(piclProgramCreateWithSource)) - _PI_CL(piclProgramCreateWithBinary, OCL(piclProgramCreateWithBinary)) + _PI_CL(piProgramCreate, piProgramCreate) + _PI_CL(piclProgramCreateWithSource, piclProgramCreateWithSource) + _PI_CL(piclProgramCreateWithBinary, piclProgramCreateWithBinary) _PI_CL(piProgramGetInfo, clGetProgramInfo) _PI_CL(piProgramCompile, clCompileProgram) _PI_CL(piProgramBuild, clBuildProgram) - _PI_CL(piProgramLink, OCL(piProgramLink)) + _PI_CL(piProgramLink, piProgramLink) _PI_CL(piProgramGetBuildInfo, clGetProgramBuildInfo) _PI_CL(piProgramRetain, clRetainProgram) _PI_CL(piProgramRelease, clReleaseProgram) _PI_CL(piextProgramSetSpecializationConstant, - OCL(piextProgramSetSpecializationConstantImpl)) - _PI_CL(piextProgramGetNativeHandle, OCL(piextGetNativeHandle)) - _PI_CL(piextProgramCreateWithNativeHandle, - OCL(piextProgramCreateWithNativeHandle)) + piextProgramSetSpecializationConstant) + _PI_CL(piextProgramGetNativeHandle, piextProgramGetNativeHandle) + _PI_CL(piextProgramCreateWithNativeHandle, piextProgramCreateWithNativeHandle) // Kernel - _PI_CL(piKernelCreate, OCL(piKernelCreate)) + _PI_CL(piKernelCreate, piKernelCreate) _PI_CL(piKernelSetArg, clSetKernelArg) _PI_CL(piKernelGetInfo, clGetKernelInfo) _PI_CL(piKernelGetGroupInfo, clGetKernelWorkGroupInfo) _PI_CL(piKernelGetSubGroupInfo, clGetKernelSubGroupInfo) _PI_CL(piKernelRetain, clRetainKernel) _PI_CL(piKernelRelease, clReleaseKernel) - _PI_CL(piKernelSetExecInfo, OCL(piKernelSetExecInfo)) - _PI_CL(piextKernelSetArgPointer, OCL(piextKernelSetArgPointer)) + _PI_CL(piKernelSetExecInfo, piKernelSetExecInfo) + _PI_CL(piextKernelSetArgPointer, piextKernelSetArgPointer) // Event - _PI_CL(piEventCreate, OCL(piEventCreate)) + _PI_CL(piEventCreate, piEventCreate) _PI_CL(piEventGetInfo, clGetEventInfo) _PI_CL(piEventGetProfilingInfo, clGetEventProfilingInfo) _PI_CL(piEventsWait, clWaitForEvents) @@ -1149,11 +1159,10 @@ pi_result piPluginInit(pi_plugin *PluginInit) { _PI_CL(piEventSetStatus, clSetUserEventStatus) _PI_CL(piEventRetain, clRetainEvent) _PI_CL(piEventRelease, clReleaseEvent) - _PI_CL(piextEventGetNativeHandle, OCL(piextGetNativeHandle)) - _PI_CL(piextEventCreateWithNativeHandle, - OCL(piextEventCreateWithNativeHandle)) + _PI_CL(piextEventGetNativeHandle, piextGetNativeHandle) + _PI_CL(piextEventCreateWithNativeHandle, piextEventCreateWithNativeHandle) // Sampler - _PI_CL(piSamplerCreate, OCL(piSamplerCreate)) + _PI_CL(piSamplerCreate, piSamplerCreate) _PI_CL(piSamplerGetInfo, clGetSamplerInfo) _PI_CL(piSamplerRetain, clRetainSampler) _PI_CL(piSamplerRelease, clReleaseSampler) @@ -1172,20 +1181,20 @@ pi_result piPluginInit(pi_plugin *PluginInit) { _PI_CL(piEnqueueMemImageWrite, clEnqueueWriteImage) _PI_CL(piEnqueueMemImageCopy, clEnqueueCopyImage) _PI_CL(piEnqueueMemImageFill, clEnqueueFillImage) - _PI_CL(piEnqueueMemBufferMap, OCL(piEnqueueMemBufferMap)) + _PI_CL(piEnqueueMemBufferMap, piEnqueueMemBufferMap) _PI_CL(piEnqueueMemUnmap, clEnqueueUnmapMemObject) // USM - _PI_CL(piextUSMHostAlloc, OCL(piextUSMHostAlloc)) - _PI_CL(piextUSMDeviceAlloc, OCL(piextUSMDeviceAlloc)) - _PI_CL(piextUSMSharedAlloc, OCL(piextUSMSharedAlloc)) - _PI_CL(piextUSMFree, OCL(piextUSMFree)) - _PI_CL(piextUSMEnqueueMemset, OCL(piextUSMEnqueueMemset)) - _PI_CL(piextUSMEnqueueMemcpy, OCL(piextUSMEnqueueMemcpy)) - _PI_CL(piextUSMEnqueuePrefetch, OCL(piextUSMEnqueuePrefetch)) - _PI_CL(piextUSMEnqueueMemAdvise, OCL(piextUSMEnqueueMemAdvise)) - _PI_CL(piextUSMGetMemAllocInfo, OCL(piextUSMGetMemAllocInfo)) - - _PI_CL(piextKernelSetArgMemObj, OCL(piextKernelSetArgMemObj)) + _PI_CL(piextUSMHostAlloc, piextUSMHostAlloc) + _PI_CL(piextUSMDeviceAlloc, piextUSMDeviceAlloc) + _PI_CL(piextUSMSharedAlloc, piextUSMSharedAlloc) + _PI_CL(piextUSMFree, piextUSMFree) + _PI_CL(piextUSMEnqueueMemset, piextUSMEnqueueMemset) + _PI_CL(piextUSMEnqueueMemcpy, piextUSMEnqueueMemcpy) + _PI_CL(piextUSMEnqueuePrefetch, piextUSMEnqueuePrefetch) + _PI_CL(piextUSMEnqueueMemAdvise, piextUSMEnqueueMemAdvise) + _PI_CL(piextUSMGetMemAllocInfo, piextUSMGetMemAllocInfo) + + _PI_CL(piextKernelSetArgMemObj, piextKernelSetArgMemObj) #undef _PI_CL diff --git a/sycl/test/abi/pi_opencl_symbol_check.dump b/sycl/test/abi/pi_opencl_symbol_check.dump new file mode 100644 index 0000000000000..5ad52bd49911e --- /dev/null +++ b/sycl/test/abi/pi_opencl_symbol_check.dump @@ -0,0 +1,45 @@ +# RUN: env LLVM_BIN_PATH=%llvm_build_bin_dir python %sycl_tools_src_dir/abi_check.py --mode check_symbols --reference %s %sycl_libs_dir/libpi_opencl.so +# REQUIRES: linux + +piContextCreate +piDevicesGet +piEnqueueMemBufferMap +piEventCreate +piKernelCreate +piKernelSetExecInfo +piMemBufferCreate +piMemBufferPartition +piMemImageCreate +piPlatformsGet +piPluginInit +piProgramCreate +piProgramLink +piQueueCreate +piSamplerCreate +piclProgramCreateWithBinary +piclProgramCreateWithSource +piextContextCreateWithNativeHandle +piextContextGetNativeHandle +piextDeviceCreateWithNativeHandle +piextDeviceSelectBinary +piextDeviceGetNativeHandle +piextEventCreateWithNativeHandle +piextGetDeviceFunctionPointer +piextProgramGetNativeHandle +piextKernelSetArgMemObj +piextKernelSetArgPointer +piextMemCreateWithNativeHandle +piextMemGetNativeHandle +piextProgramCreateWithNativeHandle +piextProgramSetSpecializationConstant +piextQueueCreateWithNativeHandle +piextQueueGetNativeHandle +piextUSMDeviceAlloc +piextUSMEnqueueMemAdvise +piextUSMEnqueueMemcpy +piextUSMEnqueueMemset +piextUSMEnqueuePrefetch +piextUSMFree +piextUSMGetMemAllocInfo +piextUSMHostAlloc +piextUSMSharedAlloc \ No newline at end of file