#include <pi_opencl.hpp>
#include <sycl/detail/cl.h>
#include <sycl/detail/iostream_proxy.hpp>
#include <sycl/detail/pi.h>
#include <algorithm>
#include <cassert>
#include <cstring>
#include <limits>
#include <map>
#include <memory>
#include <mutex>
#include <sstream>
#include <string>
#include <string_view>
#include <vector>
Go to the source code of this file.
Classes | |
struct | FuncPtrCache< T > |
struct | ExtFuncPtrCacheT |
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 | |
using | clGetDeviceFunctionPointer_fn = CL_API_ENTRY cl_int(CL_API_CALL *)(cl_device_id device, cl_program program, const char *FuncName, cl_ulong *ret_ptr) |
using | clEnqueueWriteGlobalVariable_fn = CL_API_ENTRY cl_int(CL_API_CALL *)(cl_command_queue, cl_program, const char *, cl_bool, size_t, size_t, const void *, cl_uint, const cl_event *, cl_event *) |
using | clEnqueueReadGlobalVariable_fn = CL_API_ENTRY cl_int(CL_API_CALL *)(cl_command_queue, cl_program, const char *, cl_bool, size_t, size_t, void *, cl_uint, const cl_event *, cl_event *) |
using | clSetProgramSpecializationConstant_fn = CL_API_ENTRY cl_int(CL_API_CALL *)(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... | |
pi_result | piPluginGetBackendOption (pi_platform, const char *frontend_option, const char **backend_option) |
API to get backend specific option. More... | |
static cl_int | getPlatformVersion (cl_platform_id plat, OCLV::OpenCLVersion &version) |
static cl_int | getDeviceVersion (cl_device_id dev, OCLV::OpenCLVersion &version) |
static cl_int | checkDeviceExtensions (cl_device_id dev, const std::vector< std::string > &exts, bool &supported) |
template<typename T > | |
static pi_result | getExtFuncFromContext (cl_context context, FuncPtrCache< T > &FPtrCache, const char *FuncName, 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 | piPlatformGetInfo (pi_platform platform, pi_platform_info paramName, size_t paramValueSize, void *paramValue, size_t *paramValueSizeRet) |
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 | piextQueueCreate (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) |
pi_result | piQueueGetInfo (pi_queue queue, pi_queue_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret) |
pi_result | piextQueueCreateWithNativeHandle (pi_native_handle nativeHandle, int32_t NativeHandleDesc, pi_context, pi_device, bool ownNativeHandle, pi_queue_properties *Properties, 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 | piContextGetInfo (pi_context context, pi_context_info paramName, size_t paramValueSize, void *paramValue, size_t *paramValueSizeRet) |
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 | piextMemImageCreateWithNativeHandle (pi_native_handle nativeHandle, pi_context context, bool ownNativeHandle, const pi_image_format *ImageFormat, const pi_image_desc *ImageDesc, pi_mem *Img) |
Creates PI image 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) |
Create PI event object in a signalled/completed state. More... | |
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 in a blocking manner. 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 | piextUSMEnqueueFill2D (pi_queue queue, void *ptr, size_t pitch, size_t pattern_size, const void *pattern, size_t width, size_t height, pi_uint32 num_events_in_waitlist, const pi_event *events_waitlist, pi_event *event) |
USM 2D Fill API. More... | |
pi_result | piextUSMEnqueueMemset2D (pi_queue queue, void *ptr, size_t pitch, int value, size_t width, size_t height, pi_uint32 num_events_in_waitlist, const pi_event *events_waitlist, pi_event *event) |
USM 2D Memset API. More... | |
pi_result | piextUSMEnqueueMemcpy2D (pi_queue queue, pi_bool blocking, void *dst_ptr, size_t dst_pitch, const void *src_ptr, size_t src_pitch, size_t width, size_t height, pi_uint32 num_events_in_waitlist, const pi_event *events_waitlist, pi_event *event) |
USM 2D Memcpy 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 | piextEnqueueDeviceGlobalVariableWrite (pi_queue queue, pi_program program, const char *name, pi_bool blocking_write, size_t count, size_t offset, const void *src, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event) |
API for writing data from host to a device global variable. More... | |
pi_result | piextEnqueueDeviceGlobalVariableRead (pi_queue queue, pi_program program, const char *name, pi_bool blocking_read, size_t count, size_t offset, void *dst, pi_uint32 num_events_in_wait_list, const pi_event *event_wait_list, pi_event *event) |
API reading data from a device global variable to host. More... | |
pi_result | piextEnqueueReadHostPipe (pi_queue queue, pi_program program, const char *pipe_symbol, pi_bool blocking, void *ptr, size_t size, pi_uint32 num_events_in_waitlist, const pi_event *events_waitlist, pi_event *event) |
Plugin. More... | |
pi_result | piextEnqueueWriteHostPipe (pi_queue queue, pi_program program, const char *pipe_symbol, pi_bool blocking, void *ptr, size_t size, pi_uint32 num_events_in_waitlist, const pi_event *events_waitlist, pi_event *event) |
Write to pipe of a given name. 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, int32_t *nativeHandleDesc) |
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 | piGetDeviceAndHostTimer (pi_device Device, uint64_t *DeviceTime, uint64_t *HostTime) |
Queries device for it's global timestamp in nanoseconds, and updates HostTime with the value of the host timer at the closest possible point in time to that at which DeviceTime was returned. More... | |
pi_result | piPluginInit (pi_plugin *PluginInit) |
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 36 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 54 of file pi_opencl.cpp.
using clEnqueueReadGlobalVariable_fn = CL_API_ENTRY cl_int(CL_API_CALL *)(cl_command_queue, cl_program, const char *, cl_bool, size_t, size_t, void *, cl_uint, const cl_event *, cl_event *) |
Definition at line 202 of file pi_opencl.cpp.
using clEnqueueWriteGlobalVariable_fn = CL_API_ENTRY cl_int(CL_API_CALL *)(cl_command_queue, cl_program, const char *, cl_bool, size_t, size_t, const void *, cl_uint, const cl_event *, cl_event *) |
Definition at line 197 of file pi_opencl.cpp.
using clGetDeviceFunctionPointer_fn = CL_API_ENTRY cl_int(CL_API_CALL *)(cl_device_id device, cl_program program, const char *FuncName, cl_ulong *ret_ptr) |
Definition at line 192 of file pi_opencl.cpp.
using clSetProgramSpecializationConstant_fn = CL_API_ENTRY cl_int(CL_API_CALL *)(cl_program program, cl_uint spec_id, size_t spec_size, const void *spec_value) |
Definition at line 206 of file pi_opencl.cpp.
To cast | ( | From | value | ) |
Definition at line 44 of file pi_opencl.cpp.
Referenced by sycl::_V1::detail::BufferInterop< backend::opencl, DataT, Dimensions, AllocatorT >::GetNativeObjs(), and piProgramLink().
|
static |
Definition at line 167 of file pi_opencl.cpp.
Referenced by piDeviceGetInfo(), and piProgramCreate().
|
static |
Definition at line 147 of file pi_opencl.cpp.
References OCLV::OpenCLVersion::isValid().
Referenced by piDeviceGetInfo(), piGetDeviceAndHostTimer(), and piProgramCreate().
|
static |
Definition at line 246 of file pi_opencl.cpp.
References FuncPtrCache< T >::Map, and FuncPtrCache< T >::Mutex.
|
static |
Definition at line 125 of file pi_opencl.cpp.
References OCLV::OpenCLVersion::isValid().
Referenced by piGetDeviceAndHostTimer(), piProgramCreate(), and piQueueCreate().
|
static |
Definition at line 1141 of file pi_opencl.cpp.
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 1362 of file pi_opencl.cpp.
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 1227 of file pi_opencl.cpp.
Referenced by piPluginInit().
pi_result piContextGetInfo | ( | pi_context | context, |
pi_context_info | paramName, | ||
size_t | paramValueSize, | ||
void * | paramValue, | ||
size_t * | paramValueSizeRet | ||
) |
Definition at line 1256 of file pi_opencl.cpp.
References sycl::_V1::detail::memcpy(), PI_EXT_CONTEXT_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES, PI_EXT_CONTEXT_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES, PI_EXT_CONTEXT_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, PI_EXT_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, PI_EXT_ONEAPI_CONTEXT_INFO_USM_FILL2D_SUPPORT, PI_EXT_ONEAPI_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT, PI_EXT_ONEAPI_CONTEXT_INFO_USM_MEMSET2D_SUPPORT, and setErrorMessage().
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 352 of file pi_opencl.cpp.
References checkDeviceExtensions(), getDeviceVersion(), max(), sycl::_V1::detail::memcpy(), PI_DEVICE_INFO_ATOMIC_64, PI_DEVICE_INFO_BACKEND_VERSION, 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_MAX_NUM_SUB_GROUPS, PI_DEVICE_INFO_PCI_ADDRESS, PI_DEVICE_INFO_UUID, PI_EXT_DEVICE_INFO_ATOMIC_FENCE_ORDER_CAPABILITIES, PI_EXT_DEVICE_INFO_ATOMIC_FENCE_SCOPE_CAPABILITIES, PI_EXT_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, PI_EXT_DEVICE_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES, PI_EXT_INTEL_DEVICE_INFO_MAX_COMPUTE_QUEUE_INDICES, PI_EXT_INTEL_DEVICE_INFO_MEM_CHANNEL_SUPPORT, PI_EXT_ONEAPI_DEVICE_INFO_BFLOAT16_MATH_FUNCTIONS, PI_EXT_ONEAPI_DEVICE_INFO_MAX_WORK_GROUPS_3D, PI_MEMORY_ORDER_ACQ_REL, PI_MEMORY_ORDER_ACQUIRE, PI_MEMORY_ORDER_RELAXED, PI_MEMORY_ORDER_RELEASE, PI_MEMORY_ORDER_SEQ_CST, PI_MEMORY_SCOPE_DEVICE, PI_MEMORY_SCOPE_SUB_GROUP, PI_MEMORY_SCOPE_SYSTEM, PI_MEMORY_SCOPE_WORK_GROUP, PI_MEMORY_SCOPE_WORK_ITEM, OCLV::V2_0, OCLV::V2_1, and OCLV::V3_0.
Referenced by piKernelGetSubGroupInfo(), 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 796 of file pi_opencl.cpp.
Referenced by 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 1551 of file pi_opencl.cpp.
Referenced by piPluginInit().
pi_result piEventCreate | ( | pi_context | context, |
pi_event * | ret_event | ||
) |
Create PI event object in a signalled/completed state.
context | is the PI context of the event. |
ret_event | is the PI even created. |
Definition at line 1522 of file pi_opencl.cpp.
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 1242 of file pi_opencl.cpp.
Referenced by 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 2254 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by 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 884 of file pi_opencl.cpp.
Referenced by 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 2249 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by 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 813 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, and max().
Referenced by piPluginInit().
pi_result piextEnqueueDeviceGlobalVariableRead | ( | pi_queue | queue, |
pi_program | program, | ||
const char * | name, | ||
pi_bool | blocking_read, | ||
size_t | count, | ||
size_t | offset, | ||
void * | dst, | ||
pi_uint32 | num_events_in_wait_list, | ||
const pi_event * | event_wait_list, | ||
pi_event * | event | ||
) |
API reading data from a device global variable to host.
queue | is the queue |
program | is the program containing the device global variable |
name | is the unique identifier for the device global variable |
blocking_read | is true if the read should block |
count | is the number of bytes to copy |
offset | is the byte offset into the device global variable to start copying |
dst | is a pointer to where the data must be copied to |
num_events_in_wait_list | is a number of events in the wait list |
event_wait_list | is the wait list |
event | is the resulting event |
Definition at line 2101 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clEnqueueReadGlobalVariableCache, clEnqueueReadGlobalVariableName, and ExtFuncPtrCache.
Referenced by piPluginInit().
pi_result piextEnqueueDeviceGlobalVariableWrite | ( | pi_queue | queue, |
pi_program | program, | ||
const char * | name, | ||
pi_bool | blocking_write, | ||
size_t | count, | ||
size_t | offset, | ||
const void * | src, | ||
pi_uint32 | num_events_in_wait_list, | ||
const pi_event * | event_wait_list, | ||
pi_event * | event | ||
) |
API for writing data from host to a device global variable.
Device global variable.
queue | is the queue |
program | is the program containing the device global variable |
name | is the unique identifier for the device global variable |
blocking_write | is true if the write should block |
count | is the number of bytes to copy |
offset | is the byte offset into the device global variable to start copying |
src | is a pointer to where the data must be copied from |
num_events_in_wait_list | is a number of events in the wait list |
event_wait_list | is the wait list |
event | is the resulting event |
Definition at line 2062 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clEnqueueWriteGlobalVariableCache, clEnqueueWriteGlobalVariableName, and ExtFuncPtrCache.
Referenced by piPluginInit().
pi_result piextEnqueueReadHostPipe | ( | pi_queue | queue, |
pi_program | program, | ||
const char * | pipe_symbol, | ||
pi_bool | blocking, | ||
void * | ptr, | ||
size_t | size, | ||
pi_uint32 | num_events_in_waitlist, | ||
const pi_event * | events_waitlist, | ||
pi_event * | event | ||
) |
Plugin.
Read from pipe of a given name
queue | a valid host command-queue in which the read / write command will be queued. command_queue and program must be created with the same OpenCL context. |
program | a program object with a successfully built executable. |
pipe_symbol | the name of the program scope pipe global variable. |
blocking | indicate if the read and write operations are blocking or non-blocking |
ptr | a pointer to buffer in host memory that will hold resulting data from pipe |
size | size of the memory region to read or write, in bytes. |
num_events_in_waitlist | number of events in the wait list. |
events_waitlist | specify events that need to complete before this particular command can be executed. |
event | returns an event object that identifies this read / write command and can be used to query or queue a wait for this command to complete. |
Plugin.
Plugin.
Queue | is the queue |
Program | is the program containing the device variable |
PipeSymbol | is the unique identifier for the device variable |
Blocking | is true if the write should block |
Ptr | is a pointer to where the data will be copied to |
Size | is size of the data that is read/written from/to pipe |
NumEventsInWaitList | is a number of events in the wait list |
EventWaitList | is the wait list |
Event | is the resulting event |
Definition at line 2126 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clEnqueueReadHostPipeINTELCache, clEnqueueReadHostPipeName, and ExtFuncPtrCache.
Referenced by piPluginInit().
pi_result piextEnqueueWriteHostPipe | ( | pi_queue | queue, |
pi_program | program, | ||
const char * | pipe_symbol, | ||
pi_bool | blocking, | ||
void * | ptr, | ||
size_t | size, | ||
pi_uint32 | num_events_in_waitlist, | ||
const pi_event * | events_waitlist, | ||
pi_event * | event | ||
) |
Write to pipe of a given name.
queue | a valid host command-queue in which the read / write command will be queued. command_queue and program must be created with the same OpenCL context. |
program | a program object with a successfully built executable. |
pipe_symbol | the name of the program scope pipe global variable. |
blocking | indicate if the read and write operations are blocking or non-blocking |
ptr | a pointer to buffer in host memory that holds data to be written to host pipe. |
size | size of the memory region to read or write, in bytes. |
num_events_in_waitlist | number of events in the wait list. |
events_waitlist | specify events that need to complete before this particular command can be executed. |
event | returns an event object that identifies this read / write command and can be used to query or queue a wait for this command to complete. |
Write to pipe of a given name.
Queue | is the queue |
Program | is the program containing the device variable |
PipeSymbol | is the unique identifier for the device variable |
Blocking | is true if the write should block |
Ptr | is a pointer to where the data must be copied from |
Size | is size of the data that is read/written from/to pipe |
NumEventsInWaitList | is a number of events in the wait list |
EventWaitList | is the wait list |
Event | is the resulting event |
Definition at line 2155 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clEnqueueWriteHostPipeINTELCache, clEnqueueWriteHostPipeName, and ExtFuncPtrCache.
Referenced by 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 1535 of file pi_opencl.cpp.
Referenced by 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_ERROR_FUNCTION_ADDRESS_IS_NOT_AVAILABLE is returned. If the address does not exist PI_ERROR_INVALID_KERNEL_NAME is returned.
Definition at line 1163 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clGetDeviceFunctionPointerCache, clGetDeviceFunctionPointerName, ExtFuncPtrCache, is_in_separated_string(), and PI_PROGRAM_INFO_KERNEL_NAMES.
Referenced by 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 2237 of file pi_opencl.cpp.
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 1129 of file pi_opencl.cpp.
Referenced by 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 2275 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by piPluginInit().
pi_result piextKernelSetArgMemObj | ( | pi_kernel | kernel, |
pi_uint32 | arg_index, | ||
const pi_mem * | arg_value | ||
) |
Definition at line 1115 of file pi_opencl.cpp.
Referenced by piPluginInit().
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 1713 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clSetKernelArgMemPointerINTELCache, clSetKernelArgMemPointerName, and ExtFuncPtrCache.
Referenced by piPluginInit().
pi_result piextKernelSetArgSampler | ( | pi_kernel | kernel, |
pi_uint32 | arg_index, | ||
const pi_sampler * | arg_value | ||
) |
Definition at line 1122 of file pi_opencl.cpp.
Referenced by piPluginInit().
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 1339 of file pi_opencl.cpp.
Referenced by piPluginInit().
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 2266 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by piPluginInit().
pi_result piextMemImageCreateWithNativeHandle | ( | pi_native_handle | nativeHandle, |
pi_context | context, | ||
bool | ownNativeHandle, | ||
const pi_image_format * | ImageFormat, | ||
const pi_image_desc * | ImageDesc, | ||
pi_mem * | img | ||
) |
Creates PI image object from a native handle.
nativeHandle | is the native handle to create PI image 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. |
ImageFormat | is the pi_image_format struct that specifies the image channnel order and channel data type that match what the nativeHandle uses |
ImageDesc | is the pi_image_desc struct that specifies the image dimension, pitch, slice and other information about the nativeHandle |
img | is the PI img created from the native handle. |
Definition at line 1349 of file pi_opencl.cpp.
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 788 of file pi_opencl.cpp.
Referenced by 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 2244 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by 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 1076 of file pi_opencl.cpp.
Referenced by 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 2270 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by 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 2207 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clSetProgramSpecializationConstantCache, clSetProgramSpecializationConstantName, and ExtFuncPtrCache.
Referenced by piPluginInit().
pi_result piextQueueCreate | ( | pi_context | context, |
pi_device | device, | ||
pi_queue_properties * | properties, | ||
pi_queue * | queue | ||
) |
properties | points to a zero-terminated array of extra data describing desired queue properties. Format is {[PROPERTY[, property-specific elements of data]*,]* 0} |
Definition at line 891 of file pi_opencl.cpp.
References PI_QUEUE_FLAGS, and piQueueCreate().
Referenced by piPluginInit().
pi_result piextQueueCreateWithNativeHandle | ( | pi_native_handle | nativeHandle, |
int32_t | nativeHandleDesc, | ||
pi_context | context, | ||
pi_device | device, | ||
bool | pluginOwnsNativeHandle, | ||
pi_queue_properties * | Properties, | ||
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. |
nativeHandleDesc | provides additional properties of the native handle. |
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. |
Properties | holds queue properties. |
queue | is the PI queue created from the native handle. |
Definition at line 972 of file pi_opencl.cpp.
Referenced by piPluginInit().
pi_result piextQueueGetNativeHandle | ( | pi_queue | queue, |
pi_native_handle * | nativeHandle, | ||
int32_t * | nativeHandleDesc | ||
) |
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 or commandlist. |
nativeHandleDesc | provides additional properties of the native handle. |
Definition at line 2259 of file pi_opencl.cpp.
References piextGetNativeHandle().
Referenced by 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 1616 of file pi_opencl.cpp.
References sycl::_V1::ext::oneapi::experimental::alignment, ExtFuncPtrCacheT::clDeviceMemAllocINTELCache, clDeviceMemAllocName, and ExtFuncPtrCache.
Referenced by piPluginInit().
pi_result piextUSMEnqueueFill2D | ( | pi_queue | queue, |
void * | ptr, | ||
size_t | pitch, | ||
size_t | pattern_size, | ||
const void * | pattern, | ||
size_t | width, | ||
size_t | height, | ||
pi_uint32 | num_events_in_waitlist, | ||
const pi_event * | events_waitlist, | ||
pi_event * | event | ||
) |
USM 2D Fill API.
USM 2D fill API.
queue | is the queue to submit to |
ptr | is the ptr to fill |
pattern | is a pointer with the bytes of the pattern to set |
pattern_size | is the size in bytes of the pattern |
pitch | is the total width of the destination memory including padding |
width | is width in bytes of each row to fill |
height | is height the columns to fill |
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 1933 of file pi_opencl.cpp.
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 1882 of file pi_opencl.cpp.
Referenced by 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 1793 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clEnqueueMemcpyINTELCache, clEnqueueMemcpyName, and ExtFuncPtrCache.
Referenced by piPluginInit().
pi_result piextUSMEnqueueMemcpy2D | ( | pi_queue | queue, |
pi_bool | blocking, | ||
void * | dst_ptr, | ||
size_t | dst_pitch, | ||
const void * | src_ptr, | ||
size_t | src_pitch, | ||
size_t | width, | ||
size_t | height, | ||
pi_uint32 | num_events_in_waitlist, | ||
const pi_event * | events_waitlist, | ||
pi_event * | event | ||
) |
USM 2D Memcpy API.
queue | is the queue to submit to |
blocking | is whether this operation should block the host |
dst_ptr | is the location the data will be copied |
dst_pitch | is the total width of the destination memory including padding |
src_ptr | is the data to be copied |
dst_pitch | is the total width of the source memory including padding |
width | is width in bytes of each row to be copied |
height | is height the columns to be copied |
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 1994 of file pi_opencl.cpp.
Referenced by 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 1754 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clEnqueueMemFillINTELCache, clEnqueueMemFillName, and ExtFuncPtrCache.
Referenced by piPluginInit().
pi_result piextUSMEnqueueMemset2D | ( | pi_queue | queue, |
void * | ptr, | ||
size_t | pitch, | ||
int | value, | ||
size_t | width, | ||
size_t | height, | ||
pi_uint32 | num_events_in_waitlist, | ||
const pi_event * | events_waitlist, | ||
pi_event * | event | ||
) |
USM 2D Memset API.
queue | is the queue to submit to |
ptr | is the ptr to memset |
value | contains the byte to set with |
pitch | is the total width of the destination memory including padding |
width | is width in bytes of each row to memset |
height | is height the columns 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 1964 of file pi_opencl.cpp.
Referenced by 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 |
Definition at line 1832 of file pi_opencl.cpp.
Referenced by piPluginInit().
pi_result piextUSMFree | ( | pi_context | context, |
void * | ptr | ||
) |
Frees allocated USM memory in a blocking manner.
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 1688 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clMemBlockingFreeINTELCache, clMemBlockingFreeName, and ExtFuncPtrCache.
Referenced by 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 2029 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clGetMemAllocInfoINTELCache, clGetMemAllocInfoName, and ExtFuncPtrCache.
Referenced by 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 1579 of file pi_opencl.cpp.
References sycl::_V1::ext::oneapi::experimental::alignment, ExtFuncPtrCacheT::clHostMemAllocINTELCache, clHostMemAllocName, and ExtFuncPtrCache.
Referenced by 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 1655 of file pi_opencl.cpp.
References sycl::_V1::ext::oneapi::experimental::alignment, ExtFuncPtrCacheT::clSharedMemAllocINTELCache, clSharedMemAllocName, and ExtFuncPtrCache.
Referenced by piPluginInit().
Queries device for it's global timestamp in nanoseconds, and updates HostTime with the value of the host timer at the closest possible point in time to that at which DeviceTime was returned.
Device | device to query for timestamp |
DeviceTime | pointer to store device timestamp in nanoseconds. Optional argument, can be nullptr |
HostTime | pointer to store host timestamp in nanoseconds. Optional argurment, can be nullptr in which case timestamp will not be written |
Definition at line 2294 of file pi_opencl.cpp.
References getDeviceVersion(), getPlatformVersion(), setErrorMessage(), and OCLV::V2_1.
Referenced by piPluginInit().
pi_result piKernelCreate | ( | pi_program | program, |
const char * | kernel_name, | ||
pi_kernel * | ret_kernel | ||
) |
Definition at line 1408 of file pi_opencl.cpp.
Referenced by 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 1417 of file pi_opencl.cpp.
References PI_KERNEL_GROUP_INFO_NUM_REGS.
Referenced by piPluginInit().
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 1437 of file pi_opencl.cpp.
References PI_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS, PI_DEVICE_INFO_MAX_WORK_ITEM_SIZES, PI_DEVICE_INFO_SUB_GROUP_SIZES_INTEL, PI_KERNEL_COMPILE_NUM_SUB_GROUPS, PI_KERNEL_COMPILE_SUB_GROUP_SIZE_INTEL, PI_KERNEL_MAX_NUM_SUB_GROUPS, PI_KERNEL_MAX_SUB_GROUP_SIZE, and piDeviceGetInfo().
Referenced by 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 2195 of file pi_opencl.cpp.
References PI_TRUE, PI_USM_INDIRECT_ACCESS, and USMSetIndirectAccess().
Referenced by 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 1286 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clCreateBufferWithPropertiesINTELCache, clCreateBufferWithPropertiesName, and ExtFuncPtrCache.
Referenced by 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 1327 of file pi_opencl.cpp.
Referenced by 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 1313 of file pi_opencl.cpp.
Referenced by piPluginInit().
pi_result piPlatformGetInfo | ( | pi_platform | platform, |
pi_platform_info | paramName, | ||
size_t | paramValueSize, | ||
void * | paramValue, | ||
size_t * | paramValueSizeRet | ||
) |
Definition at line 762 of file pi_opencl.cpp.
References sycl::_V1::detail::memcpy(), PI_EXT_PLATFORM_BACKEND_OPENCL, and PI_EXT_PLATFORM_INFO_BACKEND.
Referenced by piPluginInit().
pi_result piPlatformsGet | ( | pi_uint32 | num_entries, |
pi_platform * | platforms, | ||
pi_uint32 * | num_platforms | ||
) |
Runtime queries number of Platforms
Definition at line 747 of file pi_opencl.cpp.
Referenced by piPluginInit().
pi_result piPluginGetBackendOption | ( | pi_platform | platform, |
const char * | frontend_option, | ||
const char ** | backend_option | ||
) |
API to get backend specific option.
frontend_option | is a string that contains frontend option. |
backend_option | is used to return the backend option corresponding to frontend option. |
Definition at line 104 of file pi_opencl.cpp.
Referenced by piPluginInit().
pi_result piPluginGetLastError | ( | char ** | message | ) |
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. |
device,and | syncronized host timestamp |
Definition at line 96 of file pi_opencl.cpp.
References ErrorMessage, and ErrorMessageCode.
Referenced by piPluginInit().
Definition at line 2336 of file pi_opencl.cpp.
References _PI_CL, _PI_PLUGIN_VERSION_CHECK, 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(), piextEnqueueDeviceGlobalVariableRead(), piextEnqueueDeviceGlobalVariableWrite(), piextEnqueueReadHostPipe(), piextEnqueueWriteHostPipe(), piextEventCreateWithNativeHandle(), piextEventGetNativeHandle(), piextGetDeviceFunctionPointer(), piextGetNativeHandle(), piextKernelCreateWithNativeHandle(), piextKernelGetNativeHandle(), piextKernelSetArgMemObj(), piextKernelSetArgPointer(), piextKernelSetArgSampler(), piextMemCreateWithNativeHandle(), piextMemGetNativeHandle(), piextPlatformCreateWithNativeHandle(), piextPlatformGetNativeHandle(), piextProgramCreateWithNativeHandle(), piextProgramGetNativeHandle(), piextProgramSetSpecializationConstant(), piextQueueCreate(), piextQueueCreateWithNativeHandle(), piextQueueGetNativeHandle(), piextUSMDeviceAlloc(), piextUSMEnqueueFill2D(), piextUSMEnqueueMemAdvise(), piextUSMEnqueueMemcpy(), piextUSMEnqueueMemcpy2D(), piextUSMEnqueueMemset(), piextUSMEnqueueMemset2D(), piextUSMEnqueuePrefetch(), piextUSMFree(), piextUSMGetMemAllocInfo(), piextUSMHostAlloc(), piextUSMSharedAlloc(), piGetDeviceAndHostTimer(), piKernelCreate(), piKernelGetGroupInfo(), piKernelGetInfo(), piKernelGetSubGroupInfo(), piKernelRelease(), piKernelRetain(), piKernelSetArg(), piKernelSetExecInfo(), piMemBufferCreate(), piMemBufferPartition(), piMemGetInfo(), piMemImageCreate(), piMemImageGetInfo(), piMemRelease(), piMemRetain(), piPlatformGetInfo(), piPlatformsGet(), piPluginGetBackendOption(), 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.
pi_result piProgramCreate | ( | pi_context | context, |
const void * | il, | ||
size_t | length, | ||
pi_program * | res_program | ||
) |
Definition at line 986 of file pi_opencl.cpp.
References CHECK_ERR_SET_NULL_RET, checkDeviceExtensions(), getDeviceVersion(), getPlatformVersion(), and OCLV::V2_1.
Referenced by 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 1374 of file pi_opencl.cpp.
Referenced by 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 1390 of file pi_opencl.cpp.
References cast().
Referenced by sycl::_V1::detail::program_impl::link(), sycl::_V1::detail::ProgramManager::link(), sycl::_V1::detail::make_kernel_bundle(), piPluginInit(), and sycl::_V1::detail::program_impl::program_impl().
pi_result piQueueCreate | ( | pi_context | context, |
pi_device | device, | ||
pi_queue_properties | properties, | ||
pi_queue * | queue | ||
) |
Definition at line 905 of file pi_opencl.cpp.
References CHECK_ERR_SET_NULL_RET, getPlatformVersion(), PI_EXT_ONEAPI_QUEUE_FLAG_DISCARD_EVENTS, PI_QUEUE_FLAG_ON_DEVICE, PI_QUEUE_FLAG_ON_DEVICE_DEFAULT, PI_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE, PI_QUEUE_FLAG_PROFILING_ENABLE, and OCLV::V2_0.
Referenced by piextQueueCreate(), and piPluginInit().
pi_result piQueueGetInfo | ( | pi_queue | queue, |
pi_queue_info | param_name, | ||
size_t | param_value_size, | ||
void * | param_value, | ||
size_t * | param_value_size_ret | ||
) |
Definition at line 950 of file pi_opencl.cpp.
References PI_EXT_ONEAPI_QUEUE_INFO_EMPTY.
Referenced by piPluginInit().
pi_result piSamplerCreate | ( | pi_context | context, |
const pi_sampler_properties * | sampler_properties, | ||
pi_sampler * | result_sampler | ||
) |
Definition at line 1084 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 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 2287 of file pi_opencl.cpp.
References ExtFuncPtrCache.
Referenced by piPluginInit().
|
static |
Definition at line 88 of file pi_opencl.cpp.
References ErrorMessage, ErrorMessageCode, and MaxMessageSize.
Referenced by piContextGetInfo(), and piGetDeviceAndHostTimer().
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 307 of file pi_opencl.cpp.
References ExtFuncPtrCacheT::clDeviceMemAllocINTELCache, clDeviceMemAllocName, ExtFuncPtrCacheT::clHostMemAllocINTELCache, clHostMemAllocName, ExtFuncPtrCacheT::clSharedMemAllocINTELCache, clSharedMemAllocName, and ExtFuncPtrCache.
Referenced by piKernelSetExecInfo().
CONSTFIX char clCreateBufferWithPropertiesName[] |
Definition at line 62 of file pi_opencl.cpp.
Referenced by piMemBufferCreate().
CONSTFIX char clDeviceMemAllocName[] = "clDeviceMemAllocINTEL" |
Definition at line 59 of file pi_opencl.cpp.
Referenced by piextUSMDeviceAlloc(), and USMSetIndirectAccess().
CONSTFIX char clEnqueueMemcpyName[] = "clEnqueueMemcpyINTEL" |
Definition at line 66 of file pi_opencl.cpp.
Referenced by piextUSMEnqueueMemcpy().
CONSTFIX char clEnqueueMemFillName[] = "clEnqueueMemFillINTEL" |
Definition at line 65 of file pi_opencl.cpp.
Referenced by piextUSMEnqueueMemset().
CONSTFIX char clEnqueueReadGlobalVariableName[] |
Definition at line 74 of file pi_opencl.cpp.
Referenced by piextEnqueueDeviceGlobalVariableRead().
CONSTFIX char clEnqueueReadHostPipeName[] = "clEnqueueReadHostPipeINTEL" |
Definition at line 77 of file pi_opencl.cpp.
Referenced by piextEnqueueReadHostPipe().
CONSTFIX char clEnqueueWriteGlobalVariableName[] |
Definition at line 72 of file pi_opencl.cpp.
Referenced by piextEnqueueDeviceGlobalVariableWrite().
CONSTFIX char clEnqueueWriteHostPipeName[] = "clEnqueueWriteHostPipeINTEL" |
Definition at line 78 of file pi_opencl.cpp.
Referenced by piextEnqueueWriteHostPipe().
CONSTFIX char clGetDeviceFunctionPointerName[] |
Definition at line 70 of file pi_opencl.cpp.
Referenced by piextGetDeviceFunctionPointer().
CONSTFIX char clGetMemAllocInfoName[] = "clGetMemAllocInfoINTEL" |
Definition at line 67 of file pi_opencl.cpp.
Referenced by piextUSMGetMemAllocInfo().
CONSTFIX char clHostMemAllocName[] = "clHostMemAllocINTEL" |
Definition at line 58 of file pi_opencl.cpp.
Referenced by piextUSMHostAlloc(), and USMSetIndirectAccess().
CONSTFIX char clMemBlockingFreeName[] = "clMemBlockingFreeINTEL" |
Definition at line 61 of file pi_opencl.cpp.
Referenced by piextUSMFree().
CONSTFIX char clSetKernelArgMemPointerName[] = "clSetKernelArgMemPointerINTEL" |
Definition at line 64 of file pi_opencl.cpp.
Referenced by piextKernelSetArgPointer().
CONSTFIX char clSetProgramSpecializationConstantName[] |
Definition at line 68 of file pi_opencl.cpp.
Referenced by piextProgramSetSpecializationConstant().
CONSTFIX char clSharedMemAllocName[] = "clSharedMemAllocINTEL" |
Definition at line 60 of file pi_opencl.cpp.
Referenced by piextUSMSharedAlloc(), and USMSetIndirectAccess().
thread_local char ErrorMessage[MaxMessageSize] |
Definition at line 85 of file pi_opencl.cpp.
Referenced by piPluginGetLastError(), and setErrorMessage().
thread_local pi_result ErrorMessageCode = PI_SUCCESS |
Definition at line 84 of file pi_opencl.cpp.
Referenced by piPluginGetLastError(), and setErrorMessage().
|
static |
Definition at line 242 of file pi_opencl.cpp.
Referenced by piextEnqueueDeviceGlobalVariableRead(), piextEnqueueDeviceGlobalVariableWrite(), piextEnqueueReadHostPipe(), piextEnqueueWriteHostPipe(), piextGetDeviceFunctionPointer(), piextKernelSetArgPointer(), piextProgramSetSpecializationConstant(), piextUSMDeviceAlloc(), piextUSMEnqueueMemcpy(), piextUSMEnqueueMemset(), piextUSMFree(), piextUSMGetMemAllocInfo(), piextUSMHostAlloc(), piextUSMSharedAlloc(), piMemBufferCreate(), piTearDown(), and USMSetIndirectAccess().
|
constexpr |
Definition at line 83 of file pi_opencl.cpp.
Referenced by setErrorMessage().
const char SupportedVersion[] = _PI_OPENCL_PLUGIN_VERSION_STRING |
Definition at line 2334 of file pi_opencl.cpp.
Referenced by piPluginInit().