#include <CL/sycl/detail/cl.h>
#include <CL/sycl/detail/pi.h>
#include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>
#include <limits>
#include <map>
#include <sstream>
#include <string>
#include <vector>
Go to the source code of this file.
Macros | |
#define | CL_USE_DEPRECATED_OPENCL_1_2_APIS |
#define | CHECK_ERR_SET_NULL_RET(err, ptr, reterr) |
#define | CONSTFIX const |
#define | _PI_CL(pi_api, ocl_api) (PluginInit->PiFunctionTable).pi_api = (decltype(&::pi_api))(&ocl_api); |
Typedefs | |
typedef CL_API_ENTRY cl_int(CL_API_CALL * | clGetDeviceFunctionPointer_fn) (cl_device_id device, cl_program program, const char *FuncName, cl_ulong *ret_ptr) |
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) |
Functions | |
template<class To , class From > | |
To | cast (From value) |
static void | setErrorMessage (const char *message, pi_result error_code) |
pi_result | piPluginGetLastError (char **message) |
API to get Plugin specific warning and error messages. More... | |
template<const char * FuncName, typename T > | |
static pi_result | getExtFuncFromContext (pi_context context, T *fptr) |
static pi_result | USMSetIndirectAccess (pi_kernel kernel) |
Enables indirect access of pointers in kernels. More... | |
pi_result | piDeviceGetInfo (pi_device device, pi_device_info paramName, size_t paramValueSize, void *paramValue, size_t *paramValueSizeRet) |
Returns requested info for provided native device Return PI_DEVICE_INFO_EXTENSION_DEVICELIB_ASSERT for PI_DEVICE_INFO_EXTENSIONS query when the device supports native asserts. More... | |
pi_result | piPlatformsGet (pi_uint32 num_entries, pi_platform *platforms, pi_uint32 *num_platforms) |
pi_result | piextPlatformCreateWithNativeHandle (pi_native_handle nativeHandle, pi_platform *platform) |
Creates PI platform object from a native handle. More... | |
pi_result | piDevicesGet (pi_platform platform, pi_device_type device_type, pi_uint32 num_entries, pi_device *devices, pi_uint32 *num_devices) |
pi_result | piextDeviceSelectBinary (pi_device device, pi_device_binary *images, pi_uint32 num_images, pi_uint32 *selected_image_ind) |
Selects the most appropriate device binary based on runtime information and the IR characteristics. More... | |
pi_result | piextDeviceCreateWithNativeHandle (pi_native_handle nativeHandle, pi_platform, pi_device *piDevice) |
Creates PI device object from a native handle. More... | |
pi_result | piQueueCreate (pi_context context, pi_device device, pi_queue_properties properties, pi_queue *queue) |
pi_result | piextQueueCreateWithNativeHandle (pi_native_handle nativeHandle, pi_context, pi_device, bool ownNativeHandle, pi_queue *piQueue) |
Creates PI queue object from a native handle. More... | |
pi_result | piProgramCreate (pi_context context, const void *il, size_t length, pi_program *res_program) |
pi_result | piextProgramCreateWithNativeHandle (pi_native_handle nativeHandle, pi_context, bool, pi_program *piProgram) |
Creates PI program object from a native handle. More... | |
pi_result | piSamplerCreate (pi_context context, const pi_sampler_properties *sampler_properties, pi_sampler *result_sampler) |
pi_result | piextKernelSetArgMemObj (pi_kernel kernel, pi_uint32 arg_index, const pi_mem *arg_value) |
pi_result | piextKernelSetArgSampler (pi_kernel kernel, pi_uint32 arg_index, const pi_sampler *arg_value) |
pi_result | piextKernelCreateWithNativeHandle (pi_native_handle nativeHandle, pi_context, pi_program, bool, pi_kernel *piKernel) |
Creates PI kernel object from a native handle. More... | |
static bool | is_in_separated_string (const std::string &str, char delimiter, const std::string &sub_str) |
pi_result | piextGetDeviceFunctionPointer (pi_device device, pi_program program, const char *func_name, pi_uint64 *function_pointer_ret) |
Retrieves a device function pointer to a user-defined function. More... | |
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 | piextContextCreateWithNativeHandle (pi_native_handle nativeHandle, pi_uint32 num_devices, const pi_device *devices, bool ownNativeHandle, pi_context *piContext) |
Creates PI context object from a native handle. More... | |
pi_result | piMemBufferCreate (pi_context context, pi_mem_flags flags, size_t size, void *host_ptr, pi_mem *ret_mem, const pi_mem_properties *properties) |
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 | 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 | piextMemCreateWithNativeHandle (pi_native_handle nativeHandle, pi_context context, bool ownNativeHandle, pi_mem *piMem) |
Creates PI mem object from a native handle. More... | |
pi_result | piclProgramCreateWithSource (pi_context context, pi_uint32 count, const char **strings, const size_t *lengths, pi_program *ret_program) |
pi_result | piProgramCreateWithBinary (pi_context context, pi_uint32 num_devices, const pi_device *device_list, const size_t *lengths, const unsigned char **binaries, size_t num_metadata_entries, const pi_device_binary_property *metadata, pi_int32 *binary_status, pi_program *ret_program) |
Creates a PI program for a context and loads the given binary into it. More... | |
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 | piKernelCreate (pi_program program, const char *kernel_name, pi_kernel *ret_kernel) |
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 (pi_kernel kernel, pi_device device, pi_kernel_sub_group_info param_name, size_t input_value_size, const void *input_value, size_t param_value_size, void *param_value, size_t *param_value_size_ret) |
API to query information from the sub-group from a kernel. More... | |
pi_result | piEventCreate (pi_context context, pi_event *ret_event) |
pi_result | piextEventCreateWithNativeHandle (pi_native_handle nativeHandle, pi_context context, bool ownNativeHandle, pi_event *piEvent) |
Creates PI event object from a native handle. More... | |
pi_result | piEnqueueMemBufferMap (pi_queue command_queue, pi_mem buffer, pi_bool blocking_map, pi_map_flags map_flags, 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 | piextUSMHostAlloc (void **result_ptr, pi_context context, pi_usm_mem_properties *properties, size_t size, pi_uint32 alignment) |
Allocates host memory accessible by the device. More... | |
pi_result | piextUSMDeviceAlloc (void **result_ptr, pi_context context, pi_device device, pi_usm_mem_properties *properties, size_t size, pi_uint32 alignment) |
Allocates device memory. More... | |
pi_result | piextUSMSharedAlloc (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. More... | |
pi_result | piextUSMFree (pi_context context, void *ptr) |
Frees allocated USM memory. More... | |
pi_result | piextKernelSetArgPointer (pi_kernel kernel, pi_uint32 arg_index, size_t arg_size, const void *arg_value) |
Sets up pointer arguments for CL kernels. More... | |
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 Memset API. More... | |
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) |
USM Memcpy API. More... | |
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) |
Hint to migrate memory to the device. More... | |
pi_result | piextUSMEnqueueMemAdvise (pi_queue queue, const void *ptr, size_t length, pi_mem_advice advice, pi_event *event) |
USM Memadvise API. More... | |
pi_result | piextUSMGetMemAllocInfo (pi_context context, const void *ptr, pi_mem_alloc_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret) |
API to query information about USM allocated pointers Valid Queries: PI_MEM_ALLOC_TYPE returns host/device/shared pi_host_usm value PI_MEM_ALLOC_BASE_PTR returns the base ptr of an allocation if the queried pointer fell inside an allocation. More... | |
pi_result | piKernelSetExecInfo (pi_kernel kernel, pi_kernel_exec_info param_name, size_t param_value_size, const void *param_value) |
API to set attributes controlling kernel execution. More... | |
pi_result | piextProgramSetSpecializationConstant (pi_program prog, pi_uint32 spec_id, size_t spec_size, const void *spec_value) |
Sets a specialization constant to a specific value. More... | |
static pi_result | piextGetNativeHandle (void *piObj, pi_native_handle *nativeHandle) |
Common API for getting the native handle of a PI object. More... | |
pi_result | piextPlatformGetNativeHandle (pi_platform platform, pi_native_handle *nativeHandle) |
Gets the native handle of a PI platform object. More... | |
pi_result | piextDeviceGetNativeHandle (pi_device device, pi_native_handle *nativeHandle) |
Gets the native handle of a PI device object. More... | |
pi_result | piextContextGetNativeHandle (pi_context context, pi_native_handle *nativeHandle) |
Gets the native handle of a PI context object. More... | |
pi_result | piextQueueGetNativeHandle (pi_queue queue, pi_native_handle *nativeHandle) |
Gets the native handle of a PI queue object. More... | |
pi_result | piextMemGetNativeHandle (pi_mem mem, pi_native_handle *nativeHandle) |
Gets the native handle of a PI mem object. More... | |
pi_result | piextProgramGetNativeHandle (pi_program program, pi_native_handle *nativeHandle) |
Gets the native handle of a PI program object. More... | |
pi_result | piextKernelGetNativeHandle (pi_kernel kernel, pi_native_handle *nativeHandle) |
Gets the native handle of a PI kernel object. More... | |
pi_result | piTearDown (void *PluginParameter) |
API to notify that the plugin should clean up its resources. More... | |
pi_result | piPluginInit (pi_plugin *PluginInit) |
Variables | |
const char | SupportedVersion [] = _PI_H_VERSION_STRING |
CONSTFIX char | clHostMemAllocName [] = "clHostMemAllocINTEL" |
CONSTFIX char | clDeviceMemAllocName [] = "clDeviceMemAllocINTEL" |
CONSTFIX char | clSharedMemAllocName [] = "clSharedMemAllocINTEL" |
CONSTFIX char | clMemFreeName [] = "clMemFreeINTEL" |
CONSTFIX char | clMemBlockingFreeName [] = "clMemBlockingFreeINTEL" |
CONSTFIX char | clCreateBufferWithPropertiesName [] |
CONSTFIX char | clSetKernelArgMemPointerName [] = "clSetKernelArgMemPointerINTEL" |
CONSTFIX char | clEnqueueMemsetName [] = "clEnqueueMemsetINTEL" |
CONSTFIX char | clEnqueueMemcpyName [] = "clEnqueueMemcpyINTEL" |
CONSTFIX char | clGetMemAllocInfoName [] = "clGetMemAllocInfoINTEL" |
CONSTFIX char | clSetProgramSpecializationConstantName [] |
CONSTFIX char | clGetDeviceFunctionPointerName [] |
constexpr size_t | MaxMessageSize = 256 |
thread_local pi_result | ErrorMessageCode = PI_SUCCESS |
thread_local char | ErrorMessage [MaxMessageSize] |
Implementation of OpenCL Plugin. It is the interface between device-agnostic SYCL runtime layer and underlying OpenCL runtime.
Definition in file pi_opencl.cpp.
#define _PI_CL | ( | pi_api, | |
ocl_api | |||
) | (PluginInit->PiFunctionTable).pi_api = (decltype(&::pi_api))(&ocl_api); |
#define CHECK_ERR_SET_NULL_RET | ( | err, | |
ptr, | |||
reterr | |||
) |
Definition at line 32 of file pi_opencl.cpp.
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS |
Definition at line 17 of file pi_opencl.cpp.
#define CONSTFIX const |
Definition at line 52 of file pi_opencl.cpp.
typedef CL_API_ENTRY cl_int(CL_API_CALL * clGetDeviceFunctionPointer_fn) (cl_device_id device, cl_program program, const char *FuncName, cl_ulong *ret_ptr) |
Definition at line 608 of file pi_opencl.cpp.
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) |
Definition at line 1354 of file pi_opencl.cpp.
To cast | ( | From | value | ) |
Definition at line 42 of file pi_opencl.cpp.
Referenced by piProgramLink().
|
static |
Definition at line 95 of file pi_opencl.cpp.
References PI_INVALID_CONTEXT, PI_INVALID_VALUE, and PI_SUCCESS.
Referenced by piextGetDeviceFunctionPointer(), piextKernelSetArgPointer(), piextProgramSetSpecializationConstant(), and piMemBufferCreate().
|
static |
Definition at line 586 of file pi_opencl.cpp.
References cl::sycl::length().
Referenced by piextGetDeviceFunctionPointer().
pi_result piclProgramCreateWithSource | ( | pi_context | context, |
pi_uint32 | count, | ||
const char ** | strings, | ||
const size_t * | lengths, | ||
pi_program * | ret_program | ||
) |
Definition at line 766 of file pi_opencl.cpp.
References PI_INVALID_OPERATION.
Referenced by piPluginInit().
pi_result piContextCreate | ( | const pi_context_properties * | properties, |
pi_uint32 | num_devices, | ||
const pi_device * | devices, | ||
void(*)(const char *errinfo, const void *private_info, size_t cb, void *user_data1) | pfn_notify, | ||
void * | user_data, | ||
pi_context * | retcontext | ||
) |
Definition at line 675 of file pi_opencl.cpp.
References PI_INVALID_OPERATION.
Referenced by piPluginInit().
pi_result piDeviceGetInfo | ( | pi_device | device, |
pi_device_info | paramName, | ||
size_t | paramValueSize, | ||
void * | paramValue, | ||
size_t * | paramValueSizeRet | ||
) |
Returns requested info for provided native device Return PI_DEVICE_INFO_EXTENSION_DEVICELIB_ASSERT for PI_DEVICE_INFO_EXTENSIONS query when the device supports native asserts.
Combination of ESIMDEmuPluginDataVersion and ESIMDEmuPluginInterfaceVersion : 0.a.b a : ESIMDEmuPluginInterfaceVersion b : ESIMDEmuPluginDataVersion
TODO : Check
TODO : Check. CM_MAX_1D_SURF_WIDTH from CM_EMU
TODO : Check
TODO : Check. CM_MAX_SAMPLERS_PER_KERNEL from CM_EMU
TODO : Check
TODO : Check. half_type.hpp from CM_EMU
Definition at line 195 of file pi_opencl.cpp.
References max(), cl::sycl::detail::memcpy(), PI_DEVICE_INFO_ATOMIC_64, PI_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, PI_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, PI_DEVICE_INFO_BUILD_ON_SUBDEVICE, PI_DEVICE_INFO_GPU_EU_COUNT, PI_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE, PI_DEVICE_INFO_GPU_EU_SIMD_WIDTH, PI_DEVICE_INFO_GPU_HW_THREADS_PER_EU, PI_DEVICE_INFO_GPU_SLICES, PI_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE, PI_DEVICE_INFO_IMAGE_SRGB, PI_DEVICE_INFO_MAX_MEM_BANDWIDTH, PI_DEVICE_INFO_PCI_ADDRESS, PI_DEVICE_INFO_UUID, PI_EXT_ONEAPI_DEVICE_INFO_MAX_WORK_GROUPS_3D, PI_INVALID_VALUE, and PI_SUCCESS.
Referenced by cl::sycl::detail::applyAllowList(), cl::sycl::detail::filterDeviceFilter(), cl::sycl::detail::get_device_info< T, param >::get(), cl::sycl::detail::get_device_info< platform, param >::get(), cl::sycl::detail::get_device_info_string< param >::get(), cl::sycl::detail::get_device_info< id< 3 >, param >::get(), cl::sycl::detail::get_device_info< std::vector< info::fp_config >, param >::get(), cl::sycl::detail::get_device_info< std::vector< info::fp_config >, info::device::single_fp_config >::get(), cl::sycl::detail::get_device_info< bool, info::device::queue_profiling >::get(), cl::sycl::detail::get_device_info< std::vector< memory_order >, info::device::atomic_memory_order_capabilities >::get(), cl::sycl::detail::get_device_info< std::vector< memory_scope >, info::device::atomic_memory_scope_capabilities >::get(), cl::sycl::detail::get_device_info< std::vector< info::execution_capability >, info::device::execution_capabilities >::get(), cl::sycl::detail::get_device_info< std::vector< info::partition_property >, info::device::partition_properties >::get(), cl::sycl::detail::get_device_info< std::vector< info::partition_affinity_domain >, info::device::partition_affinity_domains >::get(), cl::sycl::detail::get_device_info< info::partition_affinity_domain, info::device::partition_type_affinity_domain >::get(), cl::sycl::detail::get_device_info< info::partition_property, info::device::partition_type_property >::get(), cl::sycl::detail::get_device_info< std::vector< size_t >, info::device::sub_group_sizes >::get(), cl::sycl::detail::get_device_info< id< 3 >, info::device::max_work_item_sizes >::get(), cl::sycl::detail::get_device_info< id< 1 >, info::device::ext_oneapi_max_work_groups_1d >::get(), cl::sycl::detail::get_device_info< id< 2 >, info::device::ext_oneapi_max_work_groups_2d >::get(), cl::sycl::detail::get_device_info< id< 3 >, info::device::ext_oneapi_max_work_groups_3d >::get(), cl::sycl::detail::get_device_info< device, info::device::parent_device >::get(), cl::sycl::detail::get_device_info< bool, info::device::usm_device_allocations >::get(), cl::sycl::detail::get_device_info< bool, info::device::usm_host_allocations >::get(), cl::sycl::detail::get_device_info< bool, info::device::usm_shared_allocations >::get(), cl::sycl::detail::get_device_info< bool, info::device::usm_restricted_shared_allocations >::get(), cl::sycl::detail::get_device_info< bool, info::device::usm_system_allocations >::get(), cl::sycl::detail::get_device_info< bool, info::device::ext_intel_mem_channel >::get(), cl::sycl::detail::ProgramManager::getBuiltPIProgram(), cl::sycl::detail::platform_impl::getPlatformFromPiDevice(), cl::sycl::detail::ProgramManager::getProgramBuildLog(), cl::sycl::detail::enqueue_kernel_launch::handleInvalidValue(), cl::sycl::detail::enqueue_kernel_launch::handleInvalidWorkGroupSize(), cl::sycl::detail::enqueue_kernel_launch::handleInvalidWorkItemSize(), cl::sycl::detail::device_impl::has(), and piPluginInit().
pi_result piDevicesGet | ( | pi_platform | platform, |
pi_device_type | device_type, | ||
pi_uint32 | num_entries, | ||
pi_device * | devices, | ||
pi_uint32 * | num_devices | ||
) |
Runtime queries number of devices
No GPU entry to fill 'Devices' array
Definition at line 298 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by cl::sycl::detail::platform_impl::get_devices(), and piPluginInit().
pi_result piEnqueueMemBufferMap | ( | pi_queue | command_queue, |
pi_mem | buffer, | ||
pi_bool | blocking_map, | ||
pi_map_flags | map_flags, | ||
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 | ||
) |
Definition at line 888 of file pi_opencl.cpp.
References PI_INVALID_OPERATION.
Referenced by cl::sycl::detail::memBufferMapHelper(), and piPluginInit().
pi_result piEventCreate | ( | pi_context | context, |
pi_event * | ret_event | ||
) |
Definition at line 864 of file pi_opencl.cpp.
References PI_INVALID_OPERATION.
Referenced by piPluginInit().
pi_result piextContextCreateWithNativeHandle | ( | pi_native_handle | nativeHandle, |
pi_uint32 | numDevices, | ||
const pi_device * | devices, | ||
bool | pluginOwnsNativeHandle, | ||
pi_context * | context | ||
) |
Creates PI context object from a native handle.
NOTE: The created PI object takes ownership of the native handle. NOTE: The number of devices and the list of devices is needed for Level Zero backend because there is no possilibity to query this information from context handle for Level Zero. If backend has API to query a list of devices from the context native handle then these parameters are ignored.
nativeHandle | is the native handle to create PI context from. |
numDevices | is the number of devices in the context. Parameter is ignored if number of devices can be queried from the context native handle for a backend. |
devices | is the list of devices in the context. Parameter is ignored if devices can be queried from the context native handle for a backend. |
pluginOwnsNativeHandle | Indicates whether the created PI object should take ownership of the native handle. |
context | is the PI context created from the native handle. |
Definition at line 690 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by cl::sycl::ext::oneapi::level_zero::make_context(), cl::sycl::detail::make_context(), and piPluginInit().
pi_result piextContextGetNativeHandle | ( | pi_context | context, |
pi_native_handle * | nativeHandle | ||
) |
Gets the native handle of a PI context object.
context | is the PI context to get the native handle of. |
nativeHandle | is the native handle of context. |
Definition at line 1404 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by cl::sycl::detail::context_impl::getNative(), and piPluginInit().
pi_result piextDeviceCreateWithNativeHandle | ( | pi_native_handle | nativeHandle, |
pi_platform | platform, | ||
pi_device * | device | ||
) |
Creates PI device object from a native handle.
NOTE: The created PI object takes ownership of the native handle.
nativeHandle | is the native handle to create PI device from. |
platform | is the platform of the device (optional). |
device | is the PI device created from the native handle. |
Definition at line 386 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by cl::sycl::ext::oneapi::level_zero::make_device(), cl::sycl::detail::make_device(), and piPluginInit().
pi_result piextDeviceGetNativeHandle | ( | pi_device | device, |
pi_native_handle * | nativeHandle | ||
) |
Gets the native handle of a PI device object.
device | is the PI device to get the native handle of. |
nativeHandle | is the native handle of device. |
Definition at line 1399 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by cl::sycl::detail::device_impl::getNative(), and piPluginInit().
pi_result piextDeviceSelectBinary | ( | pi_device | device, |
pi_device_binary * | images, | ||
pi_uint32 | num_images, | ||
pi_uint32 * | selected_image_ind | ||
) |
Selects the most appropriate device binary based on runtime information and the IR characteristics.
TODO : Support multiple images and enable selection algorithm for the images
Definition at line 315 of file pi_opencl.cpp.
References __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64, __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64_FPGA, __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64_GEN, __SYCL_PI_DEVICE_BINARY_TARGET_SPIRV64_X86_64, max(), PI_INVALID_BINARY, and PI_SUCCESS.
Referenced by cl::sycl::detail::compatibleWithDevice(), and piPluginInit().
pi_result piextEventCreateWithNativeHandle | ( | pi_native_handle | nativeHandle, |
pi_context | context, | ||
bool | ownNativeHandle, | ||
pi_event * | event | ||
) |
Creates PI event object from a native handle.
NOTE: The created PI object takes ownership of the native handle.
nativeHandle | is the native handle to create PI event from. |
context | is the corresponding PI context |
pluginOwnsNativeHandle | Indicates whether the created PI object should take ownership of the native handle. |
event | is the PI event created from the native handle. |
Definition at line 872 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by cl::sycl::detail::make_event(), and piPluginInit().
pi_result piextGetDeviceFunctionPointer | ( | pi_device | device, |
pi_program | program, | ||
const char * | function_name, | ||
pi_uint64 * | function_pointer_ret | ||
) |
Retrieves a device function pointer to a user-defined function.
function_name
. function_pointer_ret
is set to 0 if query failed.program
must be built before calling this API. device
must present in the list of devices returned by get_device
method for program
.If a fallback method determines the function exists but the address is not available PI_FUNCTION_ADDRESS_IS_NOT_AVAILABLE is returned. If the address does not exist PI_INVALID_KERNEL_NAME is returned.
Definition at line 611 of file pi_opencl.cpp.
References clGetDeviceFunctionPointerName, getExtFuncFromContext(), is_in_separated_string(), PI_FUNCTION_ADDRESS_IS_NOT_AVAILABLE, PI_INVALID_KERNEL_NAME, PI_PROGRAM_INFO_KERNEL_NAMES, and PI_SUCCESS.
Referenced by cl::sycl::detail::getDeviceFunctionPointerImpl(), cl::sycl::detail::program_impl::has_kernel(), and piPluginInit().
|
static |
Common API for getting the native handle of a PI object.
piObj | is the pi object to get the native handle of |
nativeHandle | is a pointer to be set to the native handle |
PI_SUCCESS
Definition at line 1387 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by piextContextGetNativeHandle(), piextDeviceGetNativeHandle(), piextKernelGetNativeHandle(), piextMemGetNativeHandle(), piextPlatformGetNativeHandle(), piextProgramGetNativeHandle(), piextQueueGetNativeHandle(), and piPluginInit().
pi_result piextKernelCreateWithNativeHandle | ( | pi_native_handle | nativeHandle, |
pi_context | context, | ||
pi_program | program, | ||
bool | pluginOwnsNativeHandle, | ||
pi_kernel * | kernel | ||
) |
Creates PI kernel object from a native handle.
NOTE: The created PI object takes ownership of the native handle.
nativeHandle | is the native handle to create PI kernel from. |
context | is the PI context of the kernel. |
program | is the PI program of the kernel. |
pluginOwnsNativeHandle | Indicates whether the created PI object should take ownership of the native handle. |
kernel | is the PI kernel created from the native handle. |
Definition at line 574 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by cl::sycl::detail::make_kernel(), and piPluginInit().
pi_result piextKernelGetNativeHandle | ( | pi_kernel | kernel, |
pi_native_handle * | nativeHandle | ||
) |
Gets the native handle of a PI kernel object.
kernel | is the PI kernel to get the native handle of. |
nativeHandle | is the native handle of kernel. |
Definition at line 1423 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by cl::sycl::detail::kernel_impl::getNative(), and piPluginInit().
pi_result piextKernelSetArgMemObj | ( | pi_kernel | kernel, |
pi_uint32 | arg_index, | ||
const pi_mem * | arg_value | ||
) |
Definition at line 560 of file pi_opencl.cpp.
Referenced by piPluginInit(), and cl::sycl::detail::SetKernelParamsAndLaunch().
pi_result piextKernelSetArgPointer | ( | pi_kernel | kernel, |
pi_uint32 | arg_index, | ||
size_t | arg_size, | ||
const void * | arg_value | ||
) |
Sets up pointer arguments for CL kernels.
An extra indirection is required due to CL argument conventions.
kernel | is the kernel to be launched |
arg_index | is the index of the kernel argument |
arg_size | is the size in bytes of the argument (ignored in CL) |
arg_value | is the pointer argument |
Definition at line 1088 of file pi_opencl.cpp.
References clSetKernelArgMemPointerName, and getExtFuncFromContext().
Referenced by piPluginInit(), and cl::sycl::detail::SetKernelParamsAndLaunch().
pi_result piextKernelSetArgSampler | ( | pi_kernel | kernel, |
pi_uint32 | arg_index, | ||
const pi_sampler * | arg_value | ||
) |
Definition at line 567 of file pi_opencl.cpp.
Referenced by piPluginInit(), and cl::sycl::detail::SetKernelParamsAndLaunch().
pi_result piextMemCreateWithNativeHandle | ( | pi_native_handle | nativeHandle, |
pi_context | context, | ||
bool | ownNativeHandle, | ||
pi_mem * | mem | ||
) |
Creates PI mem object from a native handle.
NOTE: The created PI object takes ownership of the native handle.
nativeHandle | is the native handle to create PI mem from. |
context | The PI context of the memory allocation. |
ownNativeHandle | Indicates if we own the native memory handle or it came from interop that asked to not transfer the ownership to SYCL RT. |
mem | is the PI mem created from the native handle. |
Definition at line 756 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by piPluginInit(), and cl::sycl::detail::SYCLMemObjT::SYCLMemObjT().
pi_result piextMemGetNativeHandle | ( | pi_mem | mem, |
pi_native_handle * | nativeHandle | ||
) |
Gets the native handle of a PI mem object.
mem | is the PI mem to get the native handle of. |
nativeHandle | is the native handle of mem. |
Definition at line 1414 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by cl::sycl::detail::buffer_impl::getNativeVector(), cl::sycl::detail::memBufferCreateHelper(), cl::sycl::detail::memReleaseHelper(), and piPluginInit().
pi_result piextPlatformCreateWithNativeHandle | ( | pi_native_handle | nativeHandle, |
pi_platform * | platform | ||
) |
Creates PI platform object from a native handle.
NOTE: The created PI object takes ownership of the native handle.
nativeHandle | is the native handle to create PI device from. |
platform | is the PI platform created from the native handle. |
Definition at line 290 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by cl::sycl::detail::make_platform(), and piPluginInit().
pi_result piextPlatformGetNativeHandle | ( | pi_platform | platform, |
pi_native_handle * | nativeHandle | ||
) |
Gets the native handle of a PI platform object.
platform | is the PI platform to get the native handle of. |
nativeHandle | is the native handle of platform. |
Definition at line 1394 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by cl::sycl::detail::platform_impl::getNative(), and piPluginInit().
pi_result piextProgramCreateWithNativeHandle | ( | pi_native_handle | nativeHandle, |
pi_context | context, | ||
bool | pluginOwnsNativeHandle, | ||
pi_program * | program | ||
) |
Creates PI program object from a native handle.
NOTE: The created PI object takes ownership of the native handle.
nativeHandle | is the native handle to create PI program from. |
context | is the PI context of the program. |
pluginOwnsNativeHandle | Indicates whether the created PI object should take ownership of the native handle. |
program | is the PI program created from the native handle. |
Definition at line 521 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by cl::sycl::detail::make_kernel_bundle(), and piPluginInit().
pi_result piextProgramGetNativeHandle | ( | pi_program | program, |
pi_native_handle * | nativeHandle | ||
) |
Gets the native handle of a PI program object.
program | is the PI program to get the native handle of. |
nativeHandle | is the native handle of program. |
Definition at line 1418 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by cl::sycl::detail::device_image_impl::getNative(), cl::sycl::detail::program_impl::getNative(), and piPluginInit().
pi_result piextProgramSetSpecializationConstant | ( | pi_program | prog, |
pi_uint32 | spec_id, | ||
size_t | spec_size, | ||
const void * | spec_value | ||
) |
Sets a specialization constant to a specific value.
Note: Only used when specialization constants are natively supported (SPIR-V binaries), and not when they are emulated (AOT binaries).
prog | the program object which will use the value |
spec_id | integer ID of the constant |
spec_size | size of the value |
spec_value | bytes of the value |
Definition at line 1358 of file pi_opencl.cpp.
References clSetProgramSpecializationConstantName, getExtFuncFromContext(), and PI_INVALID_OPERATION.
Referenced by cl::sycl::detail::ProgramManager::build(), cl::sycl::detail::enableITTAnnotationsIfNeeded(), cl::sycl::detail::program_impl::flush_spec_constants(), and piPluginInit().
pi_result piextQueueCreateWithNativeHandle | ( | pi_native_handle | nativeHandle, |
pi_context | context, | ||
pi_device | device, | ||
bool | pluginOwnsNativeHandle, | ||
pi_queue * | queue | ||
) |
Creates PI queue object from a native handle.
NOTE: The created PI object takes ownership of the native handle.
nativeHandle | is the native handle to create PI queue from. |
context | is the PI context of the queue. |
device | is the PI device associated with the native device used when creating the native queue. This parameter is optional but some backends may fail to create the right PI queue if omitted. |
pluginOwnsNativeHandle | Indicates whether the created PI object should take ownership of the native handle. |
queue | is the PI queue created from the native handle. |
Definition at line 433 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by cl::sycl::detail::make_queue_impl(), and piPluginInit().
pi_result piextQueueGetNativeHandle | ( | pi_queue | queue, |
pi_native_handle * | nativeHandle | ||
) |
Gets the native handle of a PI queue object.
queue | is the PI queue to get the native handle of. |
nativeHandle | is the native handle of queue. |
Definition at line 1409 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by cl::sycl::detail::queue_impl::getNative(), and piPluginInit().
pi_result piextUSMDeviceAlloc | ( | void ** | result_ptr, |
pi_context | context, | ||
pi_device | device, | ||
pi_usm_mem_properties * | properties, | ||
size_t | size, | ||
pi_uint32 | alignment | ||
) |
Allocates device memory.
result_ptr | contains the allocated memory |
context | is the pi_context |
device | is the device the memory will be allocated on |
pi_usm_mem_properties | are optional allocation properties |
size_t | is the size of the allocation |
alignment | is the desired alignment of the allocation |
Definition at line 952 of file pi_opencl.cpp.
References PI_INVALID_OPERATION, and PI_SUCCESS.
Referenced by piPluginInit().
pi_result piextUSMEnqueueMemAdvise | ( | pi_queue | queue, |
const void * | ptr, | ||
size_t | length, | ||
pi_mem_advice | advice, | ||
pi_event * | event | ||
) |
USM Memadvise API.
queue | is the queue to submit to |
ptr | is the data to be advised |
length | is the size in bytes of the meory to advise |
advice | is device specific advice |
event | is the event that represents this operation |
Definition at line 1257 of file pi_opencl.cpp.
References cl::sycl::length().
Referenced by cl::sycl::detail::MemoryManager::advise_usm(), and piPluginInit().
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 | ||
) |
USM Memcpy API.
queue | is the queue to submit to |
blocking | is whether this operation should block the host |
src_ptr | is the data to be copied |
dst_ptr | is the location the data will be copied |
size | is number of bytes to copy |
num_events_in_waitlist | is the number of events to wait on |
events_waitlist | is an array of events to wait on |
event | is the event that represents this operation |
Definition at line 1168 of file pi_opencl.cpp.
Referenced by cl::sycl::detail::MemoryManager::copy_usm(), and piPluginInit().
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 Memset API.
queue | is the queue to submit to |
ptr | is the ptr to memset |
value | is value to set. It is interpreted as an 8-bit value and the upper 24 bits are ignored |
count | is the size in bytes to memset |
num_events_in_waitlist | is the number of events to wait on |
events_waitlist | is an array of events to wait on |
event | is the event that represents this operation |
Definition at line 1129 of file pi_opencl.cpp.
Referenced by cl::sycl::detail::MemoryManager::fill_usm(), and piPluginInit().
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 | ||
) |
Hint to migrate memory to the device.
queue | is the queue to submit to |
ptr | points to the memory to migrate |
size | is the number of bytes to migrate |
flags | is a bitfield used to specify memory migration options |
num_events_in_waitlist | is the number of events to wait on |
events_waitlist | is an array of events to wait on |
event | is the event that represents this operation |
Please note that the following code should be run before the subsequent getAvailableCommandList() call so that there is no dead-lock from waiting unsubmitted events in an open batch.
Definition at line 1207 of file pi_opencl.cpp.
References PI_INVALID_VALUE.
Referenced by piPluginInit(), and cl::sycl::detail::MemoryManager::prefetch_usm().
pi_result piextUSMFree | ( | pi_context | context, |
void * | ptr | ||
) |
Frees allocated USM memory.
Indicates that the allocated USM memory is no longer needed on the runtime side.
context | is the pi_context of the allocation |
ptr | is the memory to be freed |
Definition at line 1022 of file pi_opencl.cpp.
References PI_INVALID_CONTEXT, PI_INVALID_DEVICE, and PI_INVALID_OPERATION.
Referenced by cl::sycl::detail::usm::free(), and piPluginInit().
pi_result piextUSMGetMemAllocInfo | ( | pi_context | context, |
const void * | ptr, | ||
pi_mem_alloc_info | param_name, | ||
size_t | param_value_size, | ||
void * | param_value, | ||
size_t * | param_value_size_ret | ||
) |
API to query information about USM allocated pointers Valid Queries: PI_MEM_ALLOC_TYPE returns host/device/shared pi_host_usm value PI_MEM_ALLOC_BASE_PTR returns the base ptr of an allocation if the queried pointer fell inside an allocation.
Result must fit in void * PI_MEM_ALLOC_SIZE returns how big the queried pointer's allocation is in bytes. Result is a size_t. PI_MEM_ALLOC_DEVICE returns the pi_device this was allocated against
context | is the pi_context |
ptr | is the pointer to query |
param_name | is the type of query to perform |
param_value_size | is the size of the result in bytes |
param_value | is the result |
param_value_ret | is how many bytes were written |
Definition at line 1312 of file pi_opencl.cpp.
Referenced by cl::sycl::get_pointer_device(), cl::sycl::get_pointer_type(), and piPluginInit().
pi_result piextUSMHostAlloc | ( | void ** | result_ptr, |
pi_context | context, | ||
pi_usm_mem_properties * | properties, | ||
size_t | size, | ||
pi_uint32 | alignment | ||
) |
Allocates host memory accessible by the device.
result_ptr | contains the allocated memory |
context | is the pi_context |
pi_usm_mem_properties | are optional allocation properties |
size_t | is the size of the allocation |
alignment | is the desired alignment of the allocation |
Definition at line 916 of file pi_opencl.cpp.
References PI_INVALID_OPERATION, and PI_SUCCESS.
Referenced by cl::sycl::detail::usm::alignedAllocHost(), and piPluginInit().
pi_result piextUSMSharedAlloc | ( | 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.
result_ptr | contains the allocated memory |
context | is the pi_context |
device | is the device the memory will be allocated on |
pi_usm_mem_properties | are optional allocation properties |
size_t | is the size of the allocation |
alignment | is the desired alignment of the allocation |
Definition at line 990 of file pi_opencl.cpp.
References PI_INVALID_OPERATION, and PI_SUCCESS.
Referenced by piPluginInit().
pi_result piKernelCreate | ( | pi_program | program, |
const char * | kernel_name, | ||
pi_kernel * | ret_kernel | ||
) |
Definition at line 812 of file pi_opencl.cpp.
References PI_INVALID_OPERATION.
Referenced by cl::sycl::detail::ProgramManager::getOrCreateKernel(), and piPluginInit().
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 | ||
) |
Definition at line 821 of file pi_opencl.cpp.
References PI_INVALID_KERNEL, PI_INVALID_VALUE, and PI_KERNEL_GROUP_INFO_NUM_REGS.
Referenced by cl::sycl::detail::get_kernel_device_specific_info< T, Param >::get(), cl::sycl::detail::get_kernel_device_specific_info< cl::sycl::range< 3 >, Param >::get(), cl::sycl::detail::enqueue_kernel_launch::handleInvalidWorkGroupSize(), piPluginInit(), and cl::sycl::detail::SetKernelParamsAndLaunch().
pi_result piKernelGetSubGroupInfo | ( | pi_kernel | kernel, |
pi_device | device, | ||
pi_kernel_sub_group_info | param_name, | ||
size_t | input_value_size, | ||
const void * | input_value, | ||
size_t | param_value_size, | ||
void * | param_value, | ||
size_t * | param_value_size_ret | ||
) |
API to query information from the sub-group from a kernel.
kernel | is the pi_kernel to query |
device | is the device the kernel is executed on |
param_name | is a pi_kernel_sub_group_info enum value that specifies the informtation queried for. |
input_value_size | is the size of input value passed in ptr input_value param |
input_value | is the ptr to the input value passed. |
param_value_size | is the size of the value in bytes. |
param_value | is a pointer to the value to set. |
param_value_size_ret | is a pointer to return the size of data in param_value ptr. |
All queries expect a return of 4 bytes in param_value_size, param_value_size_ret, and a uint32_t value should to be written in param_value ptr. Note: This behaviour differs from OpenCL. OpenCL returns size_t.
Definition at line 841 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by cl::sycl::detail::get_kernel_device_specific_info< T, Param >::get(), cl::sycl::detail::get_kernel_device_specific_info_with_input< Param >::get(), and piPluginInit().
pi_result piKernelSetExecInfo | ( | pi_kernel | kernel, |
pi_kernel_exec_info | param_name, | ||
size_t | param_value_size, | ||
const void * | param_value | ||
) |
API to set attributes controlling kernel execution.
kernel | is the pi kernel to execute |
param_name | is a pi_kernel_exec_info value that specifies the info passed to the kernel |
param_value_size | is the size of the value in bytes |
param_value | is a pointer to the value to set for the kernel |
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
Definition at line 1342 of file pi_opencl.cpp.
References PI_TRUE, PI_USM_INDIRECT_ACCESS, and USMSetIndirectAccess().
Referenced by cl::sycl::detail::ProgramManager::getOrCreateKernel(), cl::sycl::detail::kernel_impl::kernel_impl(), and piPluginInit().
pi_result piMemBufferCreate | ( | pi_context | context, |
pi_mem_flags | flags, | ||
size_t | size, | ||
void * | host_ptr, | ||
pi_mem * | ret_mem, | ||
const pi_mem_properties * | properties | ||
) |
Definition at line 704 of file pi_opencl.cpp.
References clCreateBufferWithPropertiesName, getExtFuncFromContext(), and PI_INVALID_OPERATION.
Referenced by cl::sycl::detail::memBufferCreateHelper(), and piPluginInit().
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 | ||
) |
Definition at line 744 of file pi_opencl.cpp.
References PI_INVALID_OPERATION.
Referenced by cl::sycl::detail::MemoryManager::allocateMemSubBuffer(), and piPluginInit().
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 | ||
) |
Definition at line 730 of file pi_opencl.cpp.
References PI_INVALID_OPERATION.
Referenced by cl::sycl::detail::MemoryManager::allocateImageObject(), and piPluginInit().
pi_result piPlatformsGet | ( | pi_uint32 | num_entries, |
pi_platform * | platforms, | ||
pi_uint32 * | num_platforms | ||
) |
Runtime queries number of Platforms
Definition at line 275 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by cl::sycl::detail::platform_impl::get_platforms(), and piPluginInit().
API to get Plugin specific warning and error messages.
message | is a returned address to the first element in the message the plugin owns the error message string. The string is thread-local. As a result, different threads may return different errors. A message is overwritten by the following error or warning that is produced within the given thread. The memory is cleaned up at the end of the thread's lifetime. |
Definition at line 88 of file pi_opencl.cpp.
References ErrorMessage, and ErrorMessageCode.
Referenced by piPluginInit().
Definition at line 1436 of file pi_opencl.cpp.
References _PI_CL, PI_INVALID_OPERATION, PI_INVALID_VALUE, PI_SUCCESS, piclProgramCreateWithSource(), piContextCreate(), piContextGetInfo(), piContextRelease(), piContextRetain(), piDeviceGetInfo(), piDevicePartition(), piDeviceRelease(), piDeviceRetain(), piDevicesGet(), piEnqueueEventsWait(), piEnqueueEventsWaitWithBarrier(), piEnqueueKernelLaunch(), piEnqueueMemBufferCopy(), piEnqueueMemBufferCopyRect(), piEnqueueMemBufferFill(), piEnqueueMemBufferMap(), piEnqueueMemBufferRead(), piEnqueueMemBufferReadRect(), piEnqueueMemBufferWrite(), piEnqueueMemBufferWriteRect(), piEnqueueMemImageCopy(), piEnqueueMemImageFill(), piEnqueueMemImageRead(), piEnqueueMemImageWrite(), piEnqueueMemUnmap(), piEnqueueNativeKernel(), piEventCreate(), piEventGetInfo(), piEventGetProfilingInfo(), piEventRelease(), piEventRetain(), piEventSetCallback(), piEventSetStatus(), piEventsWait(), piextContextCreateWithNativeHandle(), piextContextGetNativeHandle(), piextDeviceCreateWithNativeHandle(), piextDeviceGetNativeHandle(), piextDeviceSelectBinary(), piextEventCreateWithNativeHandle(), piextEventGetNativeHandle(), piextGetDeviceFunctionPointer(), piextGetNativeHandle(), piextKernelCreateWithNativeHandle(), piextKernelGetNativeHandle(), piextKernelSetArgMemObj(), piextKernelSetArgPointer(), piextKernelSetArgSampler(), piextMemCreateWithNativeHandle(), piextMemGetNativeHandle(), piextPlatformCreateWithNativeHandle(), piextPlatformGetNativeHandle(), piextProgramCreateWithNativeHandle(), piextProgramGetNativeHandle(), piextProgramSetSpecializationConstant(), piextQueueCreateWithNativeHandle(), piextQueueGetNativeHandle(), piextUSMDeviceAlloc(), piextUSMEnqueueMemAdvise(), piextUSMEnqueueMemcpy(), piextUSMEnqueueMemset(), piextUSMEnqueuePrefetch(), piextUSMFree(), piextUSMGetMemAllocInfo(), piextUSMHostAlloc(), piextUSMSharedAlloc(), piKernelCreate(), piKernelGetGroupInfo(), piKernelGetInfo(), piKernelGetSubGroupInfo(), piKernelRelease(), piKernelRetain(), piKernelSetArg(), piKernelSetExecInfo(), piMemBufferCreate(), piMemBufferPartition(), piMemGetInfo(), piMemImageCreate(), piMemImageGetInfo(), piMemRelease(), piMemRetain(), piPlatformGetInfo(), piPlatformsGet(), piPluginGetLastError(), piProgramBuild(), piProgramCompile(), piProgramCreate(), piProgramCreateWithBinary(), piProgramGetBuildInfo(), piProgramGetInfo(), piProgramLink(), piProgramRelease(), piProgramRetain(), piQueueCreate(), piQueueFinish(), piQueueFlush(), piQueueGetInfo(), piQueueRelease(), piQueueRetain(), piSamplerCreate(), piSamplerGetInfo(), piSamplerRelease(), piSamplerRetain(), piTearDown(), _pi_plugin::PiVersion, _pi_plugin::PluginVersion, and SupportedVersion.
Referenced by cl::sycl::detail::pi::bindPlugin().
pi_result piProgramCreate | ( | pi_context | context, |
const void * | il, | ||
size_t | length, | ||
pi_program * | res_program | ||
) |
Definition at line 444 of file pi_opencl.cpp.
References CHECK_ERR_SET_NULL_RET, cl::sycl::length(), PI_INVALID_VALUE, and PI_SUCCESS.
Referenced by cl::sycl::detail::createSpirvProgram(), and piPluginInit().
pi_result piProgramCreateWithBinary | ( | pi_context | context, |
pi_uint32 | num_devices, | ||
const pi_device * | device_list, | ||
const size_t * | lengths, | ||
const unsigned char ** | binaries, | ||
size_t | num_metadata_entries, | ||
const pi_device_binary_property * | metadata, | ||
pi_int32 * | binary_status, | ||
pi_program * | ret_program | ||
) |
Creates a PI program for a context and loads the given binary into it.
context | is the PI context to associate the program with. |
num_devices | is the number of devices in device_list. |
device_list | is a pointer to a list of devices. These devices must all be in context. |
lengths | is an array of sizes in bytes of the binary in binaries. |
binaries | is a pointer to a list of program binaries. |
num_metadata_entries | is the number of metadata entries in metadata. |
metadata | is a pointer to a list of program metadata entries. The use of metadata entries is backend-defined. |
binary_status | returns whether the program binary was loaded succesfully or not, for each device in device_list. binary_status is ignored if it is null and otherwise it must be an array of num_devices elements. |
ret_program | is the PI program created from the program binaries. |
Definition at line 778 of file pi_opencl.cpp.
References PI_INVALID_OPERATION.
Referenced by cl::sycl::detail::createBinaryProgram(), and piPluginInit().
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(*)(pi_program program, void *user_data) | pfn_notify, | ||
void * | user_data, | ||
pi_program * | ret_program | ||
) |
Definition at line 794 of file pi_opencl.cpp.
References cast(), and PI_INVALID_OPERATION.
Referenced by cl::sycl::detail::program_impl::link(), cl::sycl::detail::ProgramManager::link(), cl::sycl::detail::make_kernel_bundle(), piPluginInit(), and cl::sycl::detail::program_impl::program_impl().
pi_result piQueueCreate | ( | pi_context | context, |
pi_device | device, | ||
pi_queue_properties | properties, | ||
pi_queue * | queue | ||
) |
Definition at line 393 of file pi_opencl.cpp.
References CHECK_ERR_SET_NULL_RET.
Referenced by cl::sycl::detail::queue_impl::createQueue(), and piPluginInit().
pi_result piSamplerCreate | ( | pi_context | context, |
const pi_sampler_properties * | sampler_properties, | ||
pi_sampler * | result_sampler | ||
) |
Definition at line 529 of file pi_opencl.cpp.
References PI_SAMPLER_ADDRESSING_MODE_CLAMP, PI_SAMPLER_FILTER_MODE_NEAREST, PI_SAMPLER_INFO_ADDRESSING_MODE, PI_SAMPLER_INFO_FILTER_MODE, PI_SAMPLER_INFO_NORMALIZED_COORDS, and PI_TRUE.
Referenced by cl::sycl::detail::sampler_impl::getOrCreateSampler(), and piPluginInit().
pi_result piTearDown | ( | void * | PluginParameter | ) |
API to notify that the plugin should clean up its resources.
No PI calls should be made until the next piPluginInit call.
PluginParameter | placeholder for future use, currenly not used. |
Definition at line 1431 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by piPluginInit(), and cl::sycl::detail::shutdown().
Definition at line 80 of file pi_opencl.cpp.
References ErrorMessage, ErrorMessageCode, and MaxMessageSize.
Enables indirect access of pointers in kernels.
Necessary to avoid telling CL about every pointer that might be used.
kernel | is the kernel to be launched |
Definition at line 153 of file pi_opencl.cpp.
References PI_SUCCESS.
Referenced by piKernelSetExecInfo().
Definition at line 61 of file pi_opencl.cpp.
Referenced by piMemBufferCreate().
Definition at line 57 of file pi_opencl.cpp.
Definition at line 65 of file pi_opencl.cpp.
Definition at line 64 of file pi_opencl.cpp.
Definition at line 69 of file pi_opencl.cpp.
Referenced by piextGetDeviceFunctionPointer().
Definition at line 66 of file pi_opencl.cpp.
Definition at line 56 of file pi_opencl.cpp.
Definition at line 60 of file pi_opencl.cpp.
Definition at line 59 of file pi_opencl.cpp.
Definition at line 63 of file pi_opencl.cpp.
Referenced by piextKernelSetArgPointer().
Definition at line 67 of file pi_opencl.cpp.
Referenced by piextProgramSetSpecializationConstant().
Definition at line 58 of file pi_opencl.cpp.
thread_local char ErrorMessage[MaxMessageSize] |
Definition at line 77 of file pi_opencl.cpp.
Referenced by piPluginGetLastError(), and setErrorMessage().
thread_local pi_result ErrorMessageCode = PI_SUCCESS |
Definition at line 76 of file pi_opencl.cpp.
Referenced by piPluginGetLastError(), and setErrorMessage().
|
constexpr |
Definition at line 75 of file pi_opencl.cpp.
Referenced by setErrorMessage().
const char SupportedVersion[] = _PI_H_VERSION_STRING |
Definition at line 39 of file pi_opencl.cpp.
Referenced by piPluginInit().