DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
pi_esimd_emulator.cpp File Reference
#include <stdint.h>
#include <CL/sycl/backend_types.hpp>
#include <CL/sycl/detail/accessor_impl.hpp>
#include <CL/sycl/detail/common.hpp>
#include <CL/sycl/detail/export.hpp>
#include <CL/sycl/detail/helpers.hpp>
#include <CL/sycl/detail/host_profiling_info.hpp>
#include <CL/sycl/detail/kernel_desc.hpp>
#include <CL/sycl/detail/type_traits.hpp>
#include <CL/sycl/group.hpp>
#include <CL/sycl/id.hpp>
#include <CL/sycl/kernel.hpp>
#include <CL/sycl/nd_item.hpp>
#include <CL/sycl/range.hpp>
#include <esimdemu_support.h>
#include <cstdarg>
#include <cstdio>
#include <cstring>
#include <functional>
#include <map>
#include <memory>
#include <string>
#include <thread>
#include <utility>
#include "pi_esimd_emulator.hpp"
#include <CL/sycl/detail/pi.def>
Include dependency graph for pi_esimd_emulator.cpp:

Go to the source code of this file.

Classes

struct  LambdaWrapper< NDims >
 
struct  RangeBuilder< NDims >
 
struct  RangeBuilder< 1 >
 
struct  RangeBuilder< 2 >
 
struct  RangeBuilder< 3 >
 
class  libCMBatch< DIMS >
 
struct  InvokeImpl< NDims >
 

Macros

#define ESIMDEmuPluginDataVersion   0
 
#define ESIMDEmuPluginInterfaceVersion   1
 
#define DIE_NO_IMPLEMENTATION
 
#define CONTINUE_NO_IMPLEMENTATION
 
#define CASE_PI_UNSUPPORTED(not_supported)
 
#define _PI_API(api)   (PluginInit->PiFunctionTable).api = (decltype(&::api))(&api);
 

Typedefs

using IDBuilder = sycl::detail::Builder
 
template<int NDims>
using KernelFunc = std::function< void(const sycl::nd_item< NDims > &)>
 

Functions

template<int NDims>
auto MakeLambdaWrapper (KernelFunc< NDims > ArgFunc, const sycl::range< NDims > &LocalSize, const sycl::range< NDims > &GlobalSize, const sycl::id< NDims > &GlobalOffset)
 
template<int NDims>
void InvokeLambda (void *Wrapper)
 
void sycl_get_cm_buffer_params (void *PtrInput, char **BaseAddr, uint32_t *Width, std::mutex **MtxLock)
 
void sycl_get_cm_image_params (void *PtrInput, char **BaseAddr, uint32_t *Width, uint32_t *Height, uint32_t *Bpp, std::mutex **MtxLock)
 
static bool isNull (int NDims, const size_t *R)
 Implementation for Host Kernel Launch used by piEnqueueKernelLaunch. More...
 
pi_result piPlatformsGet (pi_uint32 NumEntries, pi_platform *Platforms, pi_uint32 *NumPlatforms)
 
pi_result piPlatformGetInfo (pi_platform Platform, pi_platform_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
 
pi_result piextPlatformGetNativeHandle (pi_platform, pi_native_handle *)
 Gets the native handle of a PI platform object. More...
 
pi_result piextPlatformCreateWithNativeHandle (pi_native_handle, pi_platform *)
 Creates PI platform object from a native handle. More...
 
pi_result piDevicesGet (pi_platform Platform, pi_device_type DeviceType, pi_uint32 NumEntries, pi_device *Devices, pi_uint32 *NumDevices)
 
pi_result piDeviceRetain (pi_device Device)
 
pi_result piDeviceRelease (pi_device Device)
 
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 piDevicePartition (pi_device, const pi_device_partition_property *, pi_uint32, pi_device *, pi_uint32 *)
 
pi_result piextDeviceGetNativeHandle (pi_device, pi_native_handle *)
 Gets the native handle of a PI device object. More...
 
pi_result piextDeviceCreateWithNativeHandle (pi_native_handle, pi_platform, pi_device *)
 Creates PI device object from a native handle. More...
 
pi_result piContextCreate (const pi_context_properties *Properties, pi_uint32 NumDevices, const pi_device *Devices, void(*PFnNotify)(const char *ErrInfo, const void *PrivateInfo, size_t CB, void *UserData), void *UserData, pi_context *RetContext)
 
pi_result piContextGetInfo (pi_context, pi_context_info, size_t, void *, size_t *)
 
pi_result piextContextSetExtendedDeleter (pi_context, pi_context_extended_deleter, void *)
 
pi_result piextContextGetNativeHandle (pi_context, pi_native_handle *)
 Gets the native handle of a PI context object. More...
 
pi_result piextContextCreateWithNativeHandle (pi_native_handle, pi_uint32, const pi_device *, bool, pi_context *)
 Creates PI context object from a native handle. More...
 
pi_result piContextRetain (pi_context Context)
 
pi_result piContextRelease (pi_context Context)
 
pi_result piQueueCreate (pi_context Context, pi_device Device, pi_queue_properties Properties, pi_queue *Queue)
 
pi_result piQueueGetInfo (pi_queue, pi_queue_info, size_t, void *, size_t *)
 
pi_result piQueueRetain (pi_queue Queue)
 
pi_result piQueueRelease (pi_queue Queue)
 
pi_result piQueueFinish (pi_queue)
 
pi_result piQueueFlush (pi_queue)
 
pi_result piextQueueGetNativeHandle (pi_queue, pi_native_handle *)
 Gets the native handle of a PI queue object. More...
 
pi_result piextQueueCreateWithNativeHandle (pi_native_handle, pi_context, pi_queue *, bool)
 Creates PI queue object from a native handle. More...
 
pi_result piMemBufferCreate (pi_context Context, pi_mem_flags Flags, size_t Size, void *HostPtr, pi_mem *RetMem, const pi_mem_properties *properties)
 
pi_result piMemGetInfo (pi_mem, cl_mem_info, size_t, void *, size_t *)
 
pi_result piMemRetain (pi_mem Mem)
 
pi_result piMemRelease (pi_mem Mem)
 
cm_support::CM_SURFACE_FORMAT ConvertPiImageFormatToCmFormat (const pi_image_format *PiFormat)
 
pi_result piMemImageCreate (pi_context Context, pi_mem_flags Flags, const pi_image_format *ImageFormat, const pi_image_desc *ImageDesc, void *HostPtr, pi_mem *RetImage)
 
pi_result piextMemGetNativeHandle (pi_mem, pi_native_handle *)
 Gets the native handle of a PI mem object. More...
 
pi_result piextMemCreateWithNativeHandle (pi_native_handle, pi_mem *)
 Creates PI mem object from a native handle. More...
 
pi_result piProgramCreate (pi_context, const void *, size_t, pi_program *)
 
pi_result piProgramCreateWithBinary (pi_context, pi_uint32, const pi_device *, const size_t *, const unsigned char **, size_t, const pi_device_binary_property *, pi_int32 *, pi_program *)
 Creates a PI program for a context and loads the given binary into it. More...
 
pi_result piclProgramCreateWithBinary (pi_context, pi_uint32, const pi_device *, const size_t *, const unsigned char **, pi_int32 *, pi_program *)
 
pi_result piclProgramCreateWithSource (pi_context, pi_uint32, const char **, const size_t *, pi_program *)
 
pi_result piProgramGetInfo (pi_program, pi_program_info, size_t, void *, size_t *)
 
pi_result piProgramLink (pi_context, pi_uint32, const pi_device *, const char *, pi_uint32, const pi_program *, void(*)(pi_program, void *), void *, pi_program *)
 
pi_result piProgramCompile (pi_program, pi_uint32, const pi_device *, const char *, pi_uint32, const pi_program *, const char **, void(*)(pi_program, void *), void *)
 
pi_result piProgramBuild (pi_program, pi_uint32, const pi_device *, const char *, void(*)(pi_program, void *), void *)
 
pi_result piProgramGetBuildInfo (pi_program, pi_device, cl_program_build_info, size_t, void *, size_t *)
 
pi_result piProgramRetain (pi_program)
 
pi_result piProgramRelease (pi_program)
 
pi_result piextProgramGetNativeHandle (pi_program, pi_native_handle *)
 Gets the native handle of a PI program object. More...
 
pi_result piextProgramCreateWithNativeHandle (pi_native_handle, pi_context, bool, pi_program *)
 Creates PI program object from a native handle. More...
 
pi_result piKernelCreate (pi_program, const char *, pi_kernel *)
 
pi_result piKernelSetArg (pi_kernel, pi_uint32, size_t, const void *)
 
pi_result piextKernelSetArgMemObj (pi_kernel, pi_uint32, const pi_mem *)
 
pi_result piextKernelSetArgSampler (pi_kernel, pi_uint32, const pi_sampler *)
 
pi_result piKernelGetInfo (pi_kernel, pi_kernel_info, size_t, void *, size_t *)
 
pi_result piKernelGetGroupInfo (pi_kernel, pi_device, pi_kernel_group_info, size_t, void *, size_t *)
 
pi_result piKernelGetSubGroupInfo (pi_kernel, pi_device, pi_kernel_sub_group_info, size_t, const void *, size_t, void *, size_t *)
 API to query information from the sub-group from a kernel. More...
 
pi_result piKernelRetain (pi_kernel)
 
pi_result piKernelRelease (pi_kernel)
 
pi_result piEventCreate (pi_context, pi_event *)
 
pi_result piEventGetInfo (pi_event, pi_event_info, size_t, void *, size_t *)
 
pi_result piEventGetProfilingInfo (pi_event Event, pi_profiling_info ParamName, size_t ParamValueSize, void *ParamValue, size_t *ParamValueSizeRet)
 
pi_result piEventsWait (pi_uint32 NumEvents, const pi_event *EventList)
 
pi_result piEventSetCallback (pi_event, pi_int32, void(*)(pi_event, pi_int32, void *), void *)
 
pi_result piEventSetStatus (pi_event, pi_int32)
 
pi_result piEventRetain (pi_event Event)
 
pi_result piEventRelease (pi_event Event)
 
pi_result piextEventGetNativeHandle (pi_event, pi_native_handle *)
 Gets the native handle of a PI event object. More...
 
pi_result piextEventCreateWithNativeHandle (pi_native_handle, pi_context, bool, pi_event *)
 Creates PI event object from a native handle. More...
 
pi_result piSamplerCreate (pi_context, const pi_sampler_properties *, pi_sampler *)
 
pi_result piSamplerGetInfo (pi_sampler, pi_sampler_info, size_t, void *, size_t *)
 
pi_result piSamplerRetain (pi_sampler)
 
pi_result piSamplerRelease (pi_sampler)
 
pi_result piEnqueueEventsWait (pi_queue, pi_uint32, const pi_event *, pi_event *)
 
pi_result piEnqueueEventsWaitWithBarrier (pi_queue, pi_uint32, const pi_event *, pi_event *)
 
pi_result piEnqueueMemBufferRead (pi_queue Queue, pi_mem Src, pi_bool BlockingRead, size_t Offset, size_t Size, void *Dst, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
 
pi_result piEnqueueMemBufferReadRect (pi_queue, pi_mem, pi_bool, pi_buff_rect_offset, pi_buff_rect_offset, pi_buff_rect_region, size_t, size_t, size_t, size_t, void *, pi_uint32, const pi_event *, pi_event *)
 
pi_result piEnqueueMemBufferWrite (pi_queue, pi_mem, pi_bool, size_t, size_t, const void *, pi_uint32, const pi_event *, pi_event *)
 
pi_result piEnqueueMemBufferWriteRect (pi_queue, pi_mem, pi_bool, pi_buff_rect_offset, pi_buff_rect_offset, pi_buff_rect_region, size_t, size_t, size_t, size_t, const void *, pi_uint32, const pi_event *, pi_event *)
 
pi_result piEnqueueMemBufferCopy (pi_queue, pi_mem, pi_mem, size_t, size_t, size_t, pi_uint32, const pi_event *, pi_event *)
 
pi_result piEnqueueMemBufferCopyRect (pi_queue, pi_mem, pi_mem, pi_buff_rect_offset, pi_buff_rect_offset, pi_buff_rect_region, size_t, size_t, size_t, size_t, pi_uint32, const pi_event *, pi_event *)
 
pi_result piEnqueueMemBufferFill (pi_queue, pi_mem, const void *, size_t, size_t, size_t, pi_uint32, const pi_event *, pi_event *)
 
pi_result piEnqueueMemBufferMap (pi_queue, pi_mem, pi_bool, pi_map_flags, size_t, size_t, pi_uint32, const pi_event *, pi_event *, void **)
 
pi_result piEnqueueMemUnmap (pi_queue, pi_mem, void *, pi_uint32, const pi_event *, pi_event *)
 
pi_result piMemImageGetInfo (pi_mem, pi_image_info, size_t, void *, size_t *)
 
pi_result piEnqueueMemImageRead (pi_queue CommandQueue, pi_mem Image, pi_bool BlockingRead, pi_image_offset Origin, pi_image_region Region, size_t RowPitch, size_t SlicePitch, void *Ptr, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
 
pi_result piEnqueueMemImageWrite (pi_queue, pi_mem, pi_bool, pi_image_offset, pi_image_region, size_t, size_t, const void *, pi_uint32, const pi_event *, pi_event *)
 
pi_result piEnqueueMemImageCopy (pi_queue, pi_mem, pi_mem, pi_image_offset, pi_image_offset, pi_image_region, pi_uint32, const pi_event *, pi_event *)
 
pi_result piEnqueueMemImageFill (pi_queue, pi_mem, const void *, const size_t *, const size_t *, pi_uint32, const pi_event *, pi_event *)
 
pi_result piMemBufferPartition (pi_mem, pi_mem_flags, pi_buffer_create_type, void *, pi_mem *)
 
pi_result piEnqueueKernelLaunch (pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim, const size_t *GlobalWorkOffset, const size_t *GlobalWorkSize, const size_t *LocalWorkSize, pi_uint32 NumEventsInWaitList, const pi_event *EventWaitList, pi_event *Event)
 
pi_result piextKernelCreateWithNativeHandle (pi_native_handle, pi_context, pi_program, bool, pi_kernel *)
 Creates PI kernel object from a native handle. More...
 
pi_result piextKernelGetNativeHandle (pi_kernel, pi_native_handle *)
 Gets the native handle of a PI kernel object. More...
 
pi_result piEnqueueNativeKernel (pi_queue, void(*)(void *), void *, size_t, pi_uint32, const pi_mem *, const void **, pi_uint32, const pi_event *, pi_event *)
 
pi_result piextGetDeviceFunctionPointer (pi_device, pi_program, const char *, pi_uint64 *)
 Retrieves a device function pointer to a user-defined function. More...
 
pi_result piextUSMHostAlloc (void **, pi_context, pi_usm_mem_properties *, size_t, pi_uint32)
 Allocates host memory accessible by the device. More...
 
pi_result piextUSMDeviceAlloc (void **, pi_context, pi_device, pi_usm_mem_properties *, size_t, pi_uint32)
 Allocates device memory. More...
 
pi_result piextUSMSharedAlloc (void **ResultPtr, 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)
 Indicates that the allocated USM memory is no longer needed on the runtime side. More...
 
pi_result piextKernelSetArgPointer (pi_kernel, pi_uint32, size_t, const void *)
 Sets up pointer arguments for CL kernels. More...
 
pi_result piextUSMEnqueueMemset (pi_queue, void *, pi_int32, size_t, pi_uint32, const pi_event *, pi_event *)
 USM Memset API. More...
 
pi_result piextUSMEnqueueMemcpy (pi_queue, pi_bool, void *, const void *, size_t, pi_uint32, const pi_event *, pi_event *)
 USM Memcpy API. More...
 
pi_result piextUSMEnqueueMemAdvise (pi_queue, const void *, size_t, pi_mem_advice, pi_event *)
 USM Memadvise API. More...
 
pi_result piextUSMGetMemAllocInfo (pi_context, const void *, pi_mem_info, size_t, void *, size_t *)
 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, pi_kernel_exec_info, size_t, const void *)
 API to set attributes controlling kernel execution. More...
 
pi_result piextProgramSetSpecializationConstant (pi_program, pi_uint32, size_t, const void *)
 Sets a specialization constant to a specific value. More...
 
pi_result piextDeviceSelectBinary (pi_device, pi_device_binary *, pi_uint32 RawImgSize, pi_uint32 *ImgInd)
 Selects the most appropriate device binary based on runtime information and the IR characteristics. More...
 
pi_result piextUSMEnqueuePrefetch (pi_queue, const void *, size_t, pi_usm_migration_flags, pi_uint32, const pi_event *, pi_event *)
 Hint to migrate memory to the device. More...
 
pi_result piextPluginGetOpaqueData (void *, void **OpaqueDataReturn)
 API to get Plugin internal data, opaque to SYCL RT. More...
 
pi_result piTearDown (void *)
 API to notify that the plugin should clean up its resources. More...
 
pi_result piPluginInit (pi_plugin *PluginInit)
 

Variables

static bool PrintPiTrace = false
 
static sycl::detail::ESIMDEmuPluginOpaqueData * PiESimdDeviceAccess
 
static char ESimdEmuVersionString [32]
 
static char CmEmuDeviceVersionString [32]
 

Detailed Description

Declarations for CM Emulation Plugin. It is the interface between the device-agnostic SYCL runtime layer and underlying CM Emulation

Definition in file pi_esimd_emulator.cpp.

Macro Definition Documentation

◆ _PI_API

#define _PI_API (   api)    (PluginInit->PiFunctionTable).api = (decltype(&::api))(&api);

◆ CASE_PI_UNSUPPORTED

#define CASE_PI_UNSUPPORTED (   not_supported)
Value:
case not_supported: \
if (PrintPiTrace) { \
std::cerr << std::endl \
<< "Unsupported PI case : " << #not_supported << " in " \
<< __FUNCTION__ << ":" << __LINE__ << "(" << __FILE__ << ")" \
<< std::endl; \
} \

Definition at line 364 of file pi_esimd_emulator.cpp.

◆ CONTINUE_NO_IMPLEMENTATION

#define CONTINUE_NO_IMPLEMENTATION
Value:
if (PrintPiTrace) { \
std::cerr << "Warning : Not Implemented : " << __FUNCTION__ \
<< " - File : " << __FILE__; \
std::cerr << " / Line : " << __LINE__ << std::endl; \
} \
return PI_SUCCESS;

Definition at line 356 of file pi_esimd_emulator.cpp.

◆ DIE_NO_IMPLEMENTATION

#define DIE_NO_IMPLEMENTATION
Value:
if (PrintPiTrace) { \
std::cerr << "Not Implemented : " << __FUNCTION__ \
<< " - File : " << __FILE__; \
std::cerr << " / Line : " << __LINE__ << std::endl; \
} \

Definition at line 348 of file pi_esimd_emulator.cpp.

◆ ESIMDEmuPluginDataVersion

#define ESIMDEmuPluginDataVersion   0

Definition at line 121 of file pi_esimd_emulator.cpp.

◆ ESIMDEmuPluginInterfaceVersion

#define ESIMDEmuPluginInterfaceVersion   1

Definition at line 125 of file pi_esimd_emulator.cpp.

Typedef Documentation

◆ IDBuilder

using IDBuilder = sycl::detail::Builder

Definition at line 133 of file pi_esimd_emulator.cpp.

◆ KernelFunc

template<int NDims>
using KernelFunc = std::function<void(const sycl::nd_item<NDims> &)>

Definition at line 136 of file pi_esimd_emulator.cpp.

Function Documentation

◆ ConvertPiImageFormatToCmFormat()

◆ InvokeLambda()

template<int NDims>
void InvokeLambda ( void *  Wrapper)

Definition at line 192 of file pi_esimd_emulator.cpp.

References LambdaWrapper< NDims >::GlobalSize, and i.

◆ isNull()

static bool isNull ( int  NDims,
const size_t *  R 
)
static

Implementation for Host Kernel Launch used by piEnqueueKernelLaunch.

Definition at line 309 of file pi_esimd_emulator.cpp.

Referenced by piEnqueueKernelLaunch().

◆ MakeLambdaWrapper()

template<int NDims>
auto MakeLambdaWrapper ( KernelFunc< NDims >  ArgFunc,
const sycl::range< NDims > &  LocalSize,
const sycl::range< NDims > &  GlobalSize,
const sycl::id< NDims > &  GlobalOffset 
)

Definition at line 157 of file pi_esimd_emulator.cpp.

◆ piclProgramCreateWithBinary()

pi_result piclProgramCreateWithBinary ( pi_context  ,
pi_uint32  ,
const pi_device ,
const size_t *  ,
const unsigned char **  ,
pi_int32 ,
pi_program  
)

Definition at line 1175 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piclProgramCreateWithSource()

pi_result piclProgramCreateWithSource ( pi_context  ,
pi_uint32  ,
const char **  ,
const size_t *  ,
pi_program  
)

Definition at line 1181 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piContextCreate()

pi_result piContextCreate ( const pi_context_properties Properties,
pi_uint32  NumDevices,
const pi_device Devices,
void(*)(const char *ErrInfo, const void *PrivateInfo, size_t CB, void *UserData)  PFnNotify,
void *  UserData,
pi_context RetContext 
)

Single-root-device

Definition at line 784 of file pi_esimd_emulator.cpp.

References PI_ERROR_UNKNOWN, PI_INVALID_DEVICE, PI_INVALID_VALUE, PI_OUT_OF_HOST_MEMORY, and PI_SUCCESS.

◆ piContextGetInfo()

pi_result piContextGetInfo ( pi_context  ,
pi_context_info  ,
size_t  ,
void *  ,
size_t *   
)

Definition at line 811 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piContextRelease()

◆ piContextRetain()

pi_result piContextRetain ( pi_context  Context)

Definition at line 831 of file pi_esimd_emulator.cpp.

References PI_INVALID_CONTEXT, and PI_SUCCESS.

◆ piDeviceGetInfo()

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 550 of file pi_esimd_emulator.cpp.

References CASE_PI_UNSUPPORTED, CmEmuDeviceVersionString, DIE_NO_IMPLEMENTATION, ESIMDEmuPluginDataVersion, ESIMDEmuPluginInterfaceVersion, ESimdEmuVersionString, PI_DEVICE_EXEC_CAPABILITIES_KERNEL, PI_DEVICE_INFO_ADDRESS_BITS, PI_DEVICE_INFO_ATOMIC_64, PI_DEVICE_INFO_ATOMIC_MEMORY_ORDER_CAPABILITIES, PI_DEVICE_INFO_AVAILABLE, PI_DEVICE_INFO_BUILT_IN_KERNELS, PI_DEVICE_INFO_COMPILER_AVAILABLE, PI_DEVICE_INFO_DOUBLE_FP_CONFIG, PI_DEVICE_INFO_DRIVER_VERSION, PI_DEVICE_INFO_ENDIAN_LITTLE, PI_DEVICE_INFO_ERROR_CORRECTION_SUPPORT, PI_DEVICE_INFO_EXECUTION_CAPABILITIES, PI_DEVICE_INFO_EXTENSIONS, PI_DEVICE_INFO_GLOBAL_MEM_CACHE_SIZE, PI_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE, PI_DEVICE_INFO_GLOBAL_MEM_CACHELINE_SIZE, PI_DEVICE_INFO_GLOBAL_MEM_SIZE, 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_SLICES, PI_DEVICE_INFO_GPU_SUBSLICES_PER_SLICE, PI_DEVICE_INFO_HALF_FP_CONFIG, PI_DEVICE_INFO_HOST_UNIFIED_MEMORY, PI_DEVICE_INFO_IL_VERSION, PI_DEVICE_INFO_IMAGE2D_MAX_HEIGHT, PI_DEVICE_INFO_IMAGE2D_MAX_WIDTH, PI_DEVICE_INFO_IMAGE3D_MAX_DEPTH, PI_DEVICE_INFO_IMAGE3D_MAX_HEIGHT, PI_DEVICE_INFO_IMAGE3D_MAX_WIDTH, PI_DEVICE_INFO_IMAGE_MAX_ARRAY_SIZE, PI_DEVICE_INFO_IMAGE_MAX_BUFFER_SIZE, PI_DEVICE_INFO_IMAGE_SRGB, PI_DEVICE_INFO_IMAGE_SUPPORT, PI_DEVICE_INFO_LINKER_AVAILABLE, PI_DEVICE_INFO_LOCAL_MEM_SIZE, PI_DEVICE_INFO_LOCAL_MEM_TYPE, PI_DEVICE_INFO_MAX_CLOCK_FREQUENCY, PI_DEVICE_INFO_MAX_COMPUTE_UNITS, PI_DEVICE_INFO_MAX_CONSTANT_ARGS, PI_DEVICE_INFO_MAX_CONSTANT_BUFFER_SIZE, PI_DEVICE_INFO_MAX_MEM_ALLOC_SIZE, PI_DEVICE_INFO_MAX_MEM_BANDWIDTH, PI_DEVICE_INFO_MAX_NUM_SUB_GROUPS, PI_DEVICE_INFO_MAX_PARAMETER_SIZE, PI_DEVICE_INFO_MAX_READ_IMAGE_ARGS, PI_DEVICE_INFO_MAX_SAMPLERS, PI_DEVICE_INFO_MAX_WORK_GROUP_SIZE, PI_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS, PI_DEVICE_INFO_MAX_WORK_ITEM_SIZES, PI_DEVICE_INFO_MAX_WRITE_IMAGE_ARGS, PI_DEVICE_INFO_MEM_BASE_ADDR_ALIGN, PI_DEVICE_INFO_NAME, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_CHAR, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_FLOAT, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_INT, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_LONG, PI_DEVICE_INFO_NATIVE_VECTOR_WIDTH_SHORT, PI_DEVICE_INFO_OPENCL_C_VERSION, PI_DEVICE_INFO_PARENT_DEVICE, PI_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN, PI_DEVICE_INFO_PARTITION_MAX_SUB_DEVICES, PI_DEVICE_INFO_PARTITION_PROPERTIES, PI_DEVICE_INFO_PARTITION_TYPE, PI_DEVICE_INFO_PCI_ADDRESS, PI_DEVICE_INFO_PLATFORM, PI_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_CHAR, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_FLOAT, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_INT, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_LONG, PI_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_SHORT, PI_DEVICE_INFO_PRINTF_BUFFER_SIZE, PI_DEVICE_INFO_PROFILE, PI_DEVICE_INFO_PROFILING_TIMER_RESOLUTION, PI_DEVICE_INFO_QUEUE_PROPERTIES, PI_DEVICE_INFO_REFERENCE_COUNT, PI_DEVICE_INFO_SINGLE_FP_CONFIG, PI_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS, PI_DEVICE_INFO_SUB_GROUP_SIZES_INTEL, PI_DEVICE_INFO_TYPE, PI_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT, PI_DEVICE_INFO_USM_DEVICE_SUPPORT, PI_DEVICE_INFO_USM_HOST_SUPPORT, PI_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT, PI_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT, PI_DEVICE_INFO_VENDOR, PI_DEVICE_INFO_VENDOR_ID, PI_DEVICE_INFO_VERSION, PI_DEVICE_LOCAL_MEM_TYPE_LOCAL, PI_DEVICE_MEM_CACHE_TYPE_READ_WRITE_CACHE, PI_DEVICE_TYPE_GPU, PI_EXT_ONEAPI_DEVICE_INFO_MAX_GLOBAL_WORK_GROUPS, PI_EXT_ONEAPI_DEVICE_INFO_MAX_WORK_GROUPS_1D, PI_EXT_ONEAPI_DEVICE_INFO_MAX_WORK_GROUPS_2D, PI_EXT_ONEAPI_DEVICE_INFO_MAX_WORK_GROUPS_3D, PI_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT, PI_FP_DENORM, PI_FP_FMA, PI_FP_INF_NAN, PI_FP_ROUND_TO_INF, PI_FP_ROUND_TO_NEAREST, PI_FP_ROUND_TO_ZERO, PI_QUEUE_ON_DEVICE, PI_SUCCESS, PI_USM_ACCESS, PI_USM_ATOMIC_ACCESS, PI_USM_CONCURRENT_ACCESS, PI_USM_CONCURRENT_ATOMIC_ACCESS, and _pi_device::Platform.

◆ piDevicePartition()

pi_result piDevicePartition ( pi_device  ,
const pi_device_partition_property ,
pi_uint32  ,
pi_device ,
pi_uint32  
)

Definition at line 770 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piDeviceRelease()

pi_result piDeviceRelease ( pi_device  Device)

Definition at line 540 of file pi_esimd_emulator.cpp.

References PI_INVALID_DEVICE, and PI_SUCCESS.

◆ piDeviceRetain()

pi_result piDeviceRetain ( pi_device  Device)

Definition at line 530 of file pi_esimd_emulator.cpp.

References PI_INVALID_DEVICE, and PI_SUCCESS.

◆ piDevicesGet()

pi_result piDevicesGet ( pi_platform  Platform,
pi_device_type  DeviceType,
pi_uint32  NumEntries,
pi_device Devices,
pi_uint32 NumDevices 
)

Runtime queries number of devices

No GPU entry to fill 'Device' array

Definition at line 452 of file pi_esimd_emulator.cpp.

References CmEmuDeviceVersionString, PI_DEVICE_TYPE_GPU, PI_INVALID_DEVICE, PI_INVALID_PLATFORM, PI_INVALID_VALUE, PI_SUCCESS, and PrintPiTrace.

◆ piEnqueueEventsWait()

pi_result piEnqueueEventsWait ( pi_queue  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1357 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueEventsWaitWithBarrier()

pi_result piEnqueueEventsWaitWithBarrier ( pi_queue  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1362 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueKernelLaunch()

pi_result piEnqueueKernelLaunch ( pi_queue  Queue,
pi_kernel  Kernel,
pi_uint32  WorkDim,
const size_t *  GlobalWorkOffset,
const size_t *  GlobalWorkSize,
const size_t *  LocalWorkSize,
pi_uint32  NumEventsInWaitList,
const pi_event EventWaitList,
pi_event Event 
)

◆ piEnqueueMemBufferCopy()

pi_result piEnqueueMemBufferCopy ( pi_queue  ,
pi_mem  ,
pi_mem  ,
size_t  ,
size_t  ,
size_t  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1428 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueMemBufferCopyRect()

pi_result piEnqueueMemBufferCopyRect ( pi_queue  ,
pi_mem  ,
pi_mem  ,
pi_buff_rect_offset  ,
pi_buff_rect_offset  ,
pi_buff_rect_region  ,
size_t  ,
size_t  ,
size_t  ,
size_t  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1434 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueMemBufferFill()

pi_result piEnqueueMemBufferFill ( pi_queue  ,
pi_mem  ,
const void *  ,
size_t  ,
size_t  ,
size_t  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1442 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueMemBufferMap()

pi_result piEnqueueMemBufferMap ( pi_queue  ,
pi_mem  ,
pi_bool  ,
pi_map_flags  ,
size_t  ,
size_t  ,
pi_uint32  ,
const pi_event ,
pi_event ,
void **   
)

Definition at line 1448 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueMemBufferRead()

pi_result piEnqueueMemBufferRead ( pi_queue  Queue,
pi_mem  Src,
pi_bool  BlockingRead,
size_t  Offset,
size_t  Size,
void *  Dst,
pi_uint32  NumEventsInWaitList,
const pi_event EventWaitList,
pi_event Event 
)

TODO : Support Blocked read, 'Queue' handling

Definition at line 1367 of file pi_esimd_emulator.cpp.

References _pi_buffer::CmBufferPtr, PI_INVALID_EVENT_WAIT_LIST, PI_INVALID_MEM_OBJECT, PI_SUCCESS, and _pi_event::release().

◆ piEnqueueMemBufferReadRect()

pi_result piEnqueueMemBufferReadRect ( pi_queue  ,
pi_mem  ,
pi_bool  ,
pi_buff_rect_offset  ,
pi_buff_rect_offset  ,
pi_buff_rect_region  ,
size_t  ,
size_t  ,
size_t  ,
size_t  ,
void *  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1406 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueMemBufferWrite()

pi_result piEnqueueMemBufferWrite ( pi_queue  ,
pi_mem  ,
pi_bool  ,
size_t  ,
size_t  ,
const void *  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1414 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueMemBufferWriteRect()

pi_result piEnqueueMemBufferWriteRect ( pi_queue  ,
pi_mem  ,
pi_bool  ,
pi_buff_rect_offset  ,
pi_buff_rect_offset  ,
pi_buff_rect_region  ,
size_t  ,
size_t  ,
size_t  ,
size_t  ,
const void *  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1420 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueMemImageCopy()

pi_result piEnqueueMemImageCopy ( pi_queue  ,
pi_mem  ,
pi_mem  ,
pi_image_offset  ,
pi_image_offset  ,
pi_image_region  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1503 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueMemImageFill()

pi_result piEnqueueMemImageFill ( pi_queue  ,
pi_mem  ,
const void *  ,
const size_t *  ,
const size_t *  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1509 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueMemImageRead()

pi_result piEnqueueMemImageRead ( pi_queue  CommandQueue,
pi_mem  Image,
pi_bool  BlockingRead,
pi_image_offset  Origin,
pi_image_region  Region,
size_t  RowPitch,
size_t  SlicePitch,
void *  Ptr,
pi_uint32  NumEventsInWaitList,
const pi_event EventWaitList,
pi_event Event 
)

TODO : Support Blocked read, 'Queue' handling

Definition at line 1463 of file pi_esimd_emulator.cpp.

References _pi_image::CmSurfacePtr, pi_image_region_struct::height, PI_INVALID_MEM_OBJECT, PI_SUCCESS, and _pi_event::release().

◆ piEnqueueMemImageWrite()

pi_result piEnqueueMemImageWrite ( pi_queue  ,
pi_mem  ,
pi_bool  ,
pi_image_offset  ,
pi_image_region  ,
size_t  ,
size_t  ,
const void *  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1497 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueMemUnmap()

pi_result piEnqueueMemUnmap ( pi_queue  ,
pi_mem  ,
void *  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1454 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEnqueueNativeKernel()

pi_result piEnqueueNativeKernel ( pi_queue  ,
void(*)(void *)  ,
void *  ,
size_t  ,
pi_uint32  ,
const pi_mem ,
const void **  ,
pi_uint32  ,
const pi_event ,
pi_event  
)

Definition at line 1598 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEventCreate()

pi_result piEventCreate ( pi_context  ,
pi_event  
)

Definition at line 1263 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEventGetInfo()

pi_result piEventGetInfo ( pi_event  ,
pi_event_info  ,
size_t  ,
void *  ,
size_t *   
)

Definition at line 1265 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEventGetProfilingInfo()

pi_result piEventGetProfilingInfo ( pi_event  Event,
pi_profiling_info  ParamName,
size_t  ParamValueSize,
void *  ParamValue,
size_t *  ParamValueSizeRet 
)

Definition at line 1269 of file pi_esimd_emulator.cpp.

References PI_SUCCESS, and PrintPiTrace.

◆ piEventRelease()

◆ piEventRetain()

pi_result piEventRetain ( pi_event  Event)

Definition at line 1304 of file pi_esimd_emulator.cpp.

References PI_INVALID_EVENT, and PI_SUCCESS.

◆ piEventSetCallback()

pi_result piEventSetCallback ( pi_event  ,
pi_int32  ,
void(*)(pi_event, pi_int32, void *)  ,
void *   
)

Definition at line 1297 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEventSetStatus()

pi_result piEventSetStatus ( pi_event  ,
pi_int32   
)

Definition at line 1302 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piEventsWait()

pi_result piEventsWait ( pi_uint32  NumEvents,
const pi_event EventList 
)

◆ piextContextCreateWithNativeHandle()

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.

Parameters
nativeHandleis the native handle to create PI context from.
numDevicesis 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.
devicesis the list of devices in the context. Parameter is ignored if devices can be queried from the context native handle for a backend.
pluginOwnsNativeHandleIndicates whether the created PI object should take ownership of the native handle.
contextis the PI context created from the native handle.
Returns
PI_SUCCESS if successfully created pi_context from the handle. PI_OUT_OF_HOST_MEMORY if can't allocate memory for the pi_context object. PI_INVALID_VALUE if numDevices == 0 or devices is NULL but backend doesn't have API to query a list of devices from the context native handle. PI_UNKNOWN_ERROR in case of another error.

Definition at line 825 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextContextGetNativeHandle()

pi_result piextContextGetNativeHandle ( pi_context  context,
pi_native_handle nativeHandle 
)

Gets the native handle of a PI context object.

Parameters
contextis the PI context to get the native handle of.
nativeHandleis the native handle of context.

Definition at line 821 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextContextSetExtendedDeleter()

pi_result piextContextSetExtendedDeleter ( pi_context  ,
pi_context_extended_deleter  ,
void *   
)

Definition at line 816 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextDeviceCreateWithNativeHandle()

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.

Parameters
nativeHandleis the native handle to create PI device from.
platformis the platform of the device (optional).
deviceis the PI device created from the native handle.

Definition at line 779 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextDeviceGetNativeHandle()

pi_result piextDeviceGetNativeHandle ( pi_device  device,
pi_native_handle nativeHandle 
)

Gets the native handle of a PI device object.

Parameters
deviceis the PI device to get the native handle of.
nativeHandleis the native handle of device.

Definition at line 775 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextDeviceSelectBinary()

pi_result piextDeviceSelectBinary ( pi_device  ,
pi_device_binary ,
pi_uint32  RawImgSize,
pi_uint32 ImgInd 
)

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 1705 of file pi_esimd_emulator.cpp.

References PI_INVALID_VALUE, PI_SUCCESS, and PrintPiTrace.

◆ piextEventCreateWithNativeHandle()

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.

Parameters
nativeHandleis the native handle to create PI event from.
contextis the corresponding PI context
pluginOwnsNativeHandleIndicates whether the created PI object should take ownership of the native handle.
eventis the PI event created from the native handle.

Definition at line 1339 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextEventGetNativeHandle()

pi_result piextEventGetNativeHandle ( pi_event  event,
pi_native_handle nativeHandle 
)

Gets the native handle of a PI event object.

Parameters
eventis the PI event to get the native handle of.
nativeHandleis the native handle of event.

Definition at line 1335 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextGetDeviceFunctionPointer()

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 1604 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextKernelCreateWithNativeHandle()

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.

Parameters
nativeHandleis the native handle to create PI kernel from.
contextis the PI context of the kernel.
programis the PI program of the kernel.
pluginOwnsNativeHandleIndicates whether the created PI object should take ownership of the native handle.
kernelis the PI kernel created from the native handle.

Definition at line 1589 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextKernelGetNativeHandle()

pi_result piextKernelGetNativeHandle ( pi_kernel  kernel,
pi_native_handle nativeHandle 
)

Gets the native handle of a PI kernel object.

Parameters
kernelis the PI kernel to get the native handle of.
nativeHandleis the native handle of kernel.

Definition at line 1594 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextKernelSetArgMemObj()

pi_result piextKernelSetArgMemObj ( pi_kernel  ,
pi_uint32  ,
const pi_mem  
)

Definition at line 1235 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextKernelSetArgPointer()

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.

Parameters
kernelis the kernel to be launched
arg_indexis the index of the kernel argument
arg_sizeis the size in bytes of the argument (ignored in CL)
arg_valueis the pointer argument

Definition at line 1671 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextKernelSetArgSampler()

pi_result piextKernelSetArgSampler ( pi_kernel  ,
pi_uint32  ,
const pi_sampler  
)

Definition at line 1240 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextMemCreateWithNativeHandle()

pi_result piextMemCreateWithNativeHandle ( pi_native_handle  nativeHandle,
pi_mem mem 
)

Creates PI mem object from a native handle.

NOTE: The created PI object takes ownership of the native handle.

Parameters
nativeHandleis the native handle to create PI mem from.
memis the PI mem created from the native handle.

Definition at line 1160 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextMemGetNativeHandle()

pi_result piextMemGetNativeHandle ( pi_mem  mem,
pi_native_handle nativeHandle 
)

Gets the native handle of a PI mem object.

Parameters
memis the PI mem to get the native handle of.
nativeHandleis the native handle of mem.

Definition at line 1156 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextPlatformCreateWithNativeHandle()

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.

Parameters
nativeHandleis the native handle to create PI device from.
platformis the PI platform created from the native handle.

Definition at line 448 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextPlatformGetNativeHandle()

pi_result piextPlatformGetNativeHandle ( pi_platform  platform,
pi_native_handle nativeHandle 
)

Gets the native handle of a PI platform object.

Parameters
platformis the PI platform to get the native handle of.
nativeHandleis the native handle of platform.

Definition at line 444 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextPluginGetOpaqueData()

pi_result piextPluginGetOpaqueData ( void *  opaque_data_param,
void **  opaque_data_return 
)

API to get Plugin internal data, opaque to SYCL RT.

Some devices whose device code is compiled by the host compiler (e.g. CPU emulators) may use it to access some device code functionality implemented in/behind the plugin.

Parameters
opaque_data_param- unspecified argument, interpretation is specific to a plugin
opaque_data_return- placeholder for the returned opaque data.

Definition at line 1727 of file pi_esimd_emulator.cpp.

References PI_SUCCESS, and PiESimdDeviceAccess.

◆ piextProgramCreateWithNativeHandle()

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.

Parameters
nativeHandleis the native handle to create PI program from.
contextis the PI context of the program.
pluginOwnsNativeHandleIndicates whether the created PI object should take ownership of the native handle.
programis the PI program created from the native handle.

Definition at line 1222 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextProgramGetNativeHandle()

pi_result piextProgramGetNativeHandle ( pi_program  program,
pi_native_handle nativeHandle 
)

Gets the native handle of a PI program object.

Parameters
programis the PI program to get the native handle of.
nativeHandleis the native handle of program.

Definition at line 1218 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextProgramSetSpecializationConstant()

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.

Parameters
progthe program object which will use the value
spec_idinteger ID of the constant
spec_sizesize of the value
spec_valuebytes of the value

Definition at line 1700 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextQueueCreateWithNativeHandle()

pi_result piextQueueCreateWithNativeHandle ( pi_native_handle  nativeHandle,
pi_context  context,
pi_queue queue,
bool  pluginOwnsNativeHandle 
)

Creates PI queue object from a native handle.

NOTE: The created PI object takes ownership of the native handle.

Parameters
nativeHandleis the native handle to create PI queue from.
contextis the PI context of the queue.
queueis the PI queue created from the native handle.
pluginOwnsNativeHandleIndicates whether the created PI object should take ownership of the native handle.

Definition at line 926 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextQueueGetNativeHandle()

pi_result piextQueueGetNativeHandle ( pi_queue  queue,
pi_native_handle nativeHandle 
)

Gets the native handle of a PI queue object.

Parameters
queueis the PI queue to get the native handle of.
nativeHandleis the native handle of queue.

Definition at line 922 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextUSMDeviceAlloc()

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.

Parameters
result_ptrcontains the allocated memory
contextis the pi_context
deviceis the device the memory will be allocated on
propertiesare optional allocation properties
sizeis the size of the allocation
alignmentis the desired alignment of the allocation

Definition at line 1614 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextUSMEnqueueMemAdvise()

pi_result piextUSMEnqueueMemAdvise ( pi_queue  queue,
const void *  ptr,
size_t  length,
pi_mem_advice  advice,
pi_event event 
)

USM Memadvise API.

Parameters
queueis the queue to submit to
ptris the data to be advised
lengthis the size in bytes of the memory to advise
adviceis device specific advice
eventis the event that represents this operation

Definition at line 1685 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextUSMEnqueueMemcpy()

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.

Parameters
queueis the queue to submit to
blockingis whether this operation should block the host
src_ptris the data to be copied
dst_ptris the location the data will be copied
sizeis number of bytes to copy
num_events_in_waitlistis the number of events to wait on
events_waitlistis an array of events to wait on
eventis the event that represents this operation

Definition at line 1680 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextUSMEnqueueMemset()

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.

Parameters
queueis the queue to submit to
ptris the ptr to memset
valueis value to set. It is interpreted as an 8-bit value and the upper 24 bits are ignored
countis the size in bytes to memset
num_events_in_waitlistis the number of events to wait on
events_waitlistis an array of events to wait on
eventis the event that represents this operation

Definition at line 1675 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextUSMEnqueuePrefetch()

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.

Parameters
queueis the queue to submit to
ptrpoints to the memory to migrate
sizeis the number of bytes to migrate
flagsis a bitfield used to specify memory migration options
num_events_in_waitlistis the number of events to wait on
events_waitlistis an array of events to wait on
eventis the event that represents this operation

Definition at line 1721 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextUSMFree()

pi_result piextUSMFree ( pi_context  context,
void *  ptr 
)

Indicates that the allocated USM memory is no longer needed on the runtime side.

The actual freeing of the memory may be done in a blocking or deferred manner, e.g. to avoid issues with indirect memory access from kernels.

Parameters
contextis the pi_context of the allocation
ptris the memory to be freed

Definition at line 1648 of file pi_esimd_emulator.cpp.

References _pi_context::Addr2CmBufferSVM, _pi_device::CmDevicePtr, _pi_context::Device, PI_ERROR_UNKNOWN, PI_INVALID_CONTEXT, PI_INVALID_MEM_OBJECT, PI_INVALID_OPERATION, and PI_SUCCESS.

◆ piextUSMGetMemAllocInfo()

pi_result piextUSMGetMemAllocInfo ( pi_context  context,
const void *  ptr,
pi_mem_info  param_name,
size_t  param_value_size,
void *  param_value,
size_t *  param_value_size_ret 
)

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

Parameters
contextis the pi_context
ptris the pointer to query
param_nameis the type of query to perform
param_value_sizeis the size of the result in bytes
param_valueis the result
param_value_size_retis how many bytes were written

Definition at line 1690 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextUSMHostAlloc()

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.

Parameters
result_ptrcontains the allocated memory
contextis the pi_context
propertiesare optional allocation properties
sizeis the size of the allocation
alignmentis the desired alignment of the allocation

Definition at line 1609 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piextUSMSharedAlloc()

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.

Parameters
result_ptrcontains the allocated memory
contextis the pi_context
deviceis the device the memory will be allocated on
propertiesare optional allocation properties
sizeis the size of the allocation
alignmentis the desired alignment of the allocation

Definition at line 1619 of file pi_esimd_emulator.cpp.

References _pi_context::Addr2CmBufferSVM, _pi_device::CmDevicePtr, _pi_context::Device, PI_INVALID_CONTEXT, PI_INVALID_MEM_OBJECT, PI_INVALID_OPERATION, PI_OUT_OF_HOST_MEMORY, and PI_SUCCESS.

◆ piKernelCreate()

pi_result piKernelCreate ( pi_program  ,
const char ,
pi_kernel  
)

Definition at line 1227 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piKernelGetGroupInfo()

pi_result piKernelGetGroupInfo ( pi_kernel  ,
pi_device  ,
pi_kernel_group_info  ,
size_t  ,
void *  ,
size_t *   
)

Definition at line 1248 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piKernelGetInfo()

pi_result piKernelGetInfo ( pi_kernel  ,
pi_kernel_info  ,
size_t  ,
void *  ,
size_t *   
)

Definition at line 1244 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piKernelGetSubGroupInfo()

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.

Parameters
kernelis the pi_kernel to query
deviceis the device the kernel is executed on
param_nameis a pi_kernel_sub_group_info enum value that specifies the informtation queried for.
input_value_sizeis the size of input value passed in ptr input_value param
input_valueis the ptr to the input value passed.
param_value_sizeis the size of the value in bytes.
param_valueis a pointer to the value to set.
param_value_size_retis 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 1253 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piKernelRelease()

pi_result piKernelRelease ( pi_kernel  )

Definition at line 1261 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piKernelRetain()

pi_result piKernelRetain ( pi_kernel  )

Definition at line 1259 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piKernelSetArg()

pi_result piKernelSetArg ( pi_kernel  ,
pi_uint32  ,
size_t  ,
const void *   
)

Definition at line 1231 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piKernelSetExecInfo()

pi_result piKernelSetExecInfo ( pi_kernel  kernel,
pi_kernel_exec_info  value_name,
size_t  param_value_size,
const void *  param_value 
)

API to set attributes controlling kernel execution.

Parameters
kernelis the pi kernel to execute
param_nameis a pi_kernel_exec_info value that specifies the info passed to the kernel
param_value_sizeis the size of the value in bytes
param_valueis 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 1695 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piMemBufferCreate()

◆ piMemBufferPartition()

pi_result piMemBufferPartition ( pi_mem  ,
pi_mem_flags  ,
pi_buffer_create_type  ,
void *  ,
pi_mem  
)

Definition at line 1515 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piMemGetInfo()

pi_result piMemGetInfo ( pi_mem  ,
cl_mem_info  ,
size_t  ,
void *  ,
size_t *   
)

Definition at line 986 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piMemImageCreate()

◆ piMemImageGetInfo()

pi_result piMemImageGetInfo ( pi_mem  ,
pi_image_info  ,
size_t  ,
void *  ,
size_t *   
)

Definition at line 1459 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piMemRelease()

◆ piMemRetain()

pi_result piMemRetain ( pi_mem  Mem)

Definition at line 990 of file pi_esimd_emulator.cpp.

References PI_INVALID_MEM_OBJECT, and PI_SUCCESS.

◆ piPlatformGetInfo()

pi_result piPlatformGetInfo ( pi_platform  Platform,
pi_platform_info  ParamName,
size_t  ParamValueSize,
void *  ParamValue,
size_t *  ParamValueSizeRet 
)

◆ piPlatformsGet()

pi_result piPlatformsGet ( pi_uint32  NumEntries,
pi_platform Platforms,
pi_uint32 NumPlatforms 
)

Runtime queries number of Platforms

Definition at line 374 of file pi_esimd_emulator.cpp.

References _pi_platform::CmEmuVersion, PI_INVALID_VALUE, PI_SUCCESS, and PrintPiTrace.

◆ piPluginInit()

◆ piProgramBuild()

pi_result piProgramBuild ( pi_program  ,
pi_uint32  ,
const pi_device ,
const char ,
void(*)(pi_program, void *)  ,
void *   
)

Definition at line 1204 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piProgramCompile()

pi_result piProgramCompile ( pi_program  ,
pi_uint32  ,
const pi_device ,
const char ,
pi_uint32  ,
const pi_program ,
const char **  ,
void(*)(pi_program, void *)  ,
void *   
)

Definition at line 1197 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piProgramCreate()

pi_result piProgramCreate ( pi_context  ,
const void *  ,
size_t  ,
pi_program  
)

Definition at line 1164 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piProgramCreateWithBinary()

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.

Parameters
contextis the PI context to associate the program with.
num_devicesis the number of devices in device_list.
device_listis a pointer to a list of devices. These devices must all be in context.
lengthsis an array of sizes in bytes of the binary in binaries.
binariesis a pointer to a list of program binaries.
num_metadata_entriesis the number of metadata entries in metadata.
metadatais a pointer to a list of program metadata entries. The use of metadata entries is backend-defined.
binary_statusreturns 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_programis the PI program created from the program binaries.

Definition at line 1168 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piProgramGetBuildInfo()

pi_result piProgramGetBuildInfo ( pi_program  ,
pi_device  ,
cl_program_build_info  ,
size_t  ,
void *  ,
size_t *   
)

Definition at line 1209 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piProgramGetInfo()

pi_result piProgramGetInfo ( pi_program  ,
pi_program_info  ,
size_t  ,
void *  ,
size_t *   
)

Definition at line 1186 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piProgramLink()

pi_result piProgramLink ( pi_context  ,
pi_uint32  ,
const pi_device ,
const char ,
pi_uint32  ,
const pi_program ,
void(*)(pi_program, void *)  ,
void *  ,
pi_program  
)

Definition at line 1191 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piProgramRelease()

pi_result piProgramRelease ( pi_program  )

Definition at line 1216 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piProgramRetain()

pi_result piProgramRetain ( pi_program  )

Definition at line 1214 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piQueueCreate()

◆ piQueueFinish()

pi_result piQueueFinish ( pi_queue  )

Definition at line 908 of file pi_esimd_emulator.cpp.

References CONTINUE_NO_IMPLEMENTATION.

◆ piQueueFlush()

pi_result piQueueFlush ( pi_queue  )

Definition at line 915 of file pi_esimd_emulator.cpp.

References CONTINUE_NO_IMPLEMENTATION.

◆ piQueueGetInfo()

pi_result piQueueGetInfo ( pi_queue  ,
pi_queue_info  ,
size_t  ,
void *  ,
size_t *   
)

Definition at line 882 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piQueueRelease()

pi_result piQueueRelease ( pi_queue  Queue)

Definition at line 894 of file pi_esimd_emulator.cpp.

References _pi_queue::CmQueuePtr, PI_INVALID_QUEUE, and PI_SUCCESS.

◆ piQueueRetain()

pi_result piQueueRetain ( pi_queue  Queue)

Definition at line 886 of file pi_esimd_emulator.cpp.

References PI_INVALID_QUEUE, and PI_SUCCESS.

◆ piSamplerCreate()

pi_result piSamplerCreate ( pi_context  ,
const pi_sampler_properties ,
pi_sampler  
)

Definition at line 1343 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piSamplerGetInfo()

pi_result piSamplerGetInfo ( pi_sampler  ,
pi_sampler_info  ,
size_t  ,
void *  ,
size_t *   
)

Definition at line 1348 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piSamplerRelease()

pi_result piSamplerRelease ( pi_sampler  )

Definition at line 1355 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piSamplerRetain()

pi_result piSamplerRetain ( pi_sampler  )

Definition at line 1353 of file pi_esimd_emulator.cpp.

References DIE_NO_IMPLEMENTATION.

◆ piTearDown()

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.

Parameters
PluginParameterplaceholder for future use, currenly not used.

Definition at line 1732 of file pi_esimd_emulator.cpp.

References PI_SUCCESS, and PiESimdDeviceAccess.

◆ sycl_get_cm_buffer_params()

void sycl_get_cm_buffer_params ( void *  PtrInput,
char **  BaseAddr,
uint32_t *  Width,
std::mutex **  MtxLock 
)

◆ sycl_get_cm_image_params()

void sycl_get_cm_image_params ( void *  PtrInput,
char **  BaseAddr,
uint32_t *  Width,
uint32_t *  Height,
uint32_t *  Bpp,
std::mutex **  MtxLock 
)

Variable Documentation

◆ CmEmuDeviceVersionString

char CmEmuDeviceVersionString[32]
static

Definition at line 131 of file pi_esimd_emulator.cpp.

Referenced by piDeviceGetInfo(), and piDevicesGet().

◆ ESimdEmuVersionString

char ESimdEmuVersionString[32]
static

Definition at line 128 of file pi_esimd_emulator.cpp.

Referenced by piDeviceGetInfo().

◆ PiESimdDeviceAccess

sycl::detail::ESIMDEmuPluginOpaqueData* PiESimdDeviceAccess
static

Definition at line 117 of file pi_esimd_emulator.cpp.

Referenced by piextPluginGetOpaqueData(), piPluginInit(), and piTearDown().

◆ PrintPiTrace

PI_SUCCESS
@ PI_SUCCESS
Definition: pi.h:83
PI_INVALID_OPERATION
@ PI_INVALID_OPERATION
Definition: pi.h:85
PrintPiTrace
static bool PrintPiTrace
Definition: pi_esimd_emulator.cpp:110