DPC++ Runtime
Runtime libraries for oneAPI Data Parallel C++
cl::sycl::detail::pi Namespace Reference

Classes

class  ByteArray
 
class  DeviceBinaryImage
 
class  DeviceBinaryProperty
 
struct  PiFuncInfo
 
struct  printOut
 
struct  printOut< PiEvent * >
 
struct  printOut< PiMem * >
 
struct  printOut< T ** >
 
struct  printOut< void * >
 

Typedefs

using PiPlugin = ::pi_plugin
 
using PiResult = ::pi_result
 
using PiPlatform = ::pi_platform
 
using PiDevice = ::pi_device
 
using PiDeviceType = ::pi_device_type
 
using PiDeviceInfo = ::pi_device_info
 
using PiDeviceBinaryType = ::pi_device_binary_type
 
using PiContext = ::pi_context
 
using PiProgram = ::pi_program
 
using PiKernel = ::pi_kernel
 
using PiQueue = ::pi_queue
 
using PiQueueProperties = ::pi_queue_properties
 
using PiMem = ::pi_mem
 
using PiMemFlags = ::pi_mem_flags
 
using PiEvent = ::pi_event
 
using PiSampler = ::pi_sampler
 
using PiSamplerInfo = ::pi_sampler_info
 
using PiSamplerProperties = ::pi_sampler_properties
 
using PiSamplerAddressingMode = ::pi_sampler_addressing_mode
 
using PiSamplerFilterMode = ::pi_sampler_filter_mode
 
using PiMemImageFormat = ::pi_image_format
 
using PiMemImageDesc = ::pi_image_desc
 
using PiMemImageInfo = ::pi_image_info
 
using PiMemObjectType = ::pi_mem_type
 
using PiMemImageChannelOrder = ::pi_image_channel_order
 
using PiMemImageChannelType = ::pi_image_channel_type
 

Enumerations

enum  TraceLevel { PI_TRACE_BASIC = 0x1, PI_TRACE_CALLS = 0x2, PI_TRACE_ALL = -1 }
 

Functions

bool trace (TraceLevel level)
 
void die (const char *Message)
 
void assertion (bool Condition, const char *Message=nullptr)
 
template<typename T >
void handleUnknownParamName (const char *functionName, T parameter)
 
void contextSetExtendedDeleter (const cl::sycl::context &constext, pi_context_extended_deleter func, void *user_data)
 
void * loadOsLibrary (const std::string &Library)
 
int unloadOsLibrary (void *Library)
 
int unloadPlugin (void *Library)
 
void * getOsLibraryFuncAddress (void *Library, const std::string &FunctionName)
 
std::string platformInfoToString (pi_platform_info info)
 
template<class To , class From >
To cast (From value)
 
std::vector< plugin > & initialize ()
 
template<backend BE>
const plugingetPlugin ()
 
uint64_t emitFunctionBeginTrace (const char *FName)
 Emits an XPTI trace before a PI API call is made. More...
 
void emitFunctionEndTrace (uint64_t CorrelationID, const char *FName)
 Emits an XPTI trace after the PI API call has been made. More...
 
uint64_t emitFunctionWithArgsBeginTrace (uint32_t FuncID, const char *FName, unsigned char *ArgsData, pi_plugin Plugin)
 Notifies XPTI subscribers about PI function calls and packs call arguments. More...
 
void emitFunctionWithArgsEndTrace (uint64_t CorrelationID, uint32_t FuncID, const char *FName, unsigned char *ArgsData, pi_result Result, pi_plugin Plugin)
 Notifies XPTI subscribers about PI function call result. More...
 
std::ostream & operator<< (std::ostream &Out, const DeviceBinaryProperty &P)
 
PiDeviceBinaryType getBinaryImageFormat (const unsigned char *ImgData, size_t ImgSize)
 Tries to determine the device binary image foramat. More...
 
template<>
pi::PiDevice cast (cl_device_id)
 
static void initializePlugins (std::vector< plugin > &Plugins)
 
std::string memFlagToString (pi_mem_flags Flag)
 
std::string memFlagsToString (pi_mem_flags Flags)
 
std::vector< std::pair< std::string, backend > > findPlugins ()
 
void * loadPlugin (const std::string &PluginPath)
 
bool bindPlugin (void *Library, const std::shared_ptr< PiPlugin > &PluginInformation)
 
const template plugingetPlugin< backend::opencl > ()
 
const template plugingetPlugin< backend::ext_oneapi_level_zero > ()
 
const template plugingetPlugin< backend::ext_intel_esimd_emulator > ()
 
static pi_uint32 asUint32 (const void *Addr)
 
template<typename T >
std::enable_if<!std::is_pointer< T >::value, void >::type print (T val)
 
template<typename T >
std::enable_if< std::is_pointer< T >::value, void >::type print (T val)
 
template<>
void print (PiPlatform val)
 
template<>
void print (PiEvent val)
 
template<>
void print (PiMem val)
 
template<>
void print (PiEvent *val)
 
template<>
void print (const PiEvent *val)
 
template<>
void print (pi_buffer_region rgn)
 
template<>
void print (pi_buff_rect_region rgn)
 
template<>
void print (pi_buff_rect_offset off)
 
template<>
void print (pi_image_region rgn)
 
template<>
void print (pi_image_offset off)
 
template<>
void print (const pi_image_desc *desc)
 
template<>
void print (PiResult val)
 
template<>
void print (std::nullptr_t)
 
template<>
void print (char *val)
 
template<>
void print (const char *val)
 
void printArgs (void)
 
template<typename Arg0 , typename... Args>
void printArgs (Arg0 arg0, Args... args)
 
void printOuts (void)
 
template<typename Arg0 , typename... Args>
void printOuts (Arg0 arg0, Args... args)
 
void cuPrint (const char *Message)
 
void hipPrint (const char *Message)
 

Variables

std::shared_ptr< pluginGlobalPlugin
 
template<>
pi::PiProgram cast (cl_program)
 
bool XPTIInitDone = false
 

Typedef Documentation

◆ PiContext

Definition at line 106 of file pi.hpp.

◆ PiDevice

Definition at line 102 of file pi.hpp.

◆ PiDeviceBinaryType

Definition at line 105 of file pi.hpp.

◆ PiDeviceInfo

Definition at line 104 of file pi.hpp.

◆ PiDeviceType

Definition at line 103 of file pi.hpp.

◆ PiEvent

Definition at line 113 of file pi.hpp.

◆ PiKernel

Definition at line 108 of file pi.hpp.

◆ PiMem

Definition at line 111 of file pi.hpp.

◆ PiMemFlags

Definition at line 112 of file pi.hpp.

◆ PiMemImageChannelOrder

Definition at line 123 of file pi.hpp.

◆ PiMemImageChannelType

Definition at line 124 of file pi.hpp.

◆ PiMemImageDesc

Definition at line 120 of file pi.hpp.

◆ PiMemImageFormat

Definition at line 119 of file pi.hpp.

◆ PiMemImageInfo

Definition at line 121 of file pi.hpp.

◆ PiMemObjectType

Definition at line 122 of file pi.hpp.

◆ PiPlatform

Definition at line 101 of file pi.hpp.

◆ PiPlugin

Definition at line 99 of file pi.hpp.

◆ PiProgram

Definition at line 107 of file pi.hpp.

◆ PiQueue

Definition at line 109 of file pi.hpp.

◆ PiQueueProperties

Definition at line 110 of file pi.hpp.

◆ PiResult

Definition at line 100 of file pi.hpp.

◆ PiSampler

Definition at line 114 of file pi.hpp.

◆ PiSamplerAddressingMode

◆ PiSamplerFilterMode

Definition at line 118 of file pi.hpp.

◆ PiSamplerInfo

Definition at line 115 of file pi.hpp.

◆ PiSamplerProperties

Definition at line 116 of file pi.hpp.

Enumeration Type Documentation

◆ TraceLevel

Enumerator
PI_TRACE_BASIC 
PI_TRACE_CALLS 
PI_TRACE_ALL 

Definition at line 55 of file pi.hpp.

Function Documentation

◆ assertion()

◆ asUint32()

static pi_uint32 cl::sycl::detail::pi::asUint32 ( const void *  Addr)
static

◆ bindPlugin()

bool cl::sycl::detail::pi::bindPlugin ( void *  Library,
const std::shared_ptr< PiPlugin > &  PluginInformation 
)

Definition at line 349 of file pi.cpp.

References getOsLibraryFuncAddress(), PI_SUCCESS, and piPluginInit().

Referenced by initializePlugins().

◆ cast() [1/2]

template<>
pi::PiDevice cl::sycl::detail::pi::cast ( cl_device_id  )
inline

Definition at line 422 of file pi.hpp.

References assertion().

◆ cast() [2/2]

template<class To , class From >
To cl::sycl::detail::pi::cast ( From  value)
inline

Definition at line 410 of file pi.hpp.

References assertion().

◆ contextSetExtendedDeleter()

void cl::sycl::detail::pi::contextSetExtendedDeleter ( const cl::sycl::context constext,
pi_context_extended_deleter  func,
void *  user_data 
)

◆ cuPrint()

void cl::sycl::detail::pi::cuPrint ( const char Message)

Definition at line 292 of file pi_cuda.cpp.

Referenced by cuda_piclProgramCreateWithSource().

◆ die()

void cl::sycl::detail::pi::die ( const char Message)

Definition at line 537 of file pi.cpp.

Referenced by assertion(), _pi_event::cleanup(), cuda_piContextCreate(), cuda_piDeviceGetInfo(), cuda_piEnqueueMemImageFill(), cuda_piEnqueueNativeKernel(), cuda_piEventCreate(), cuda_piEventGetProfilingInfo(), cuda_piEventSetCallback(), cuda_piEventSetStatus(), cuda_piextContextCreateWithNativeHandle(), cuda_piextDeviceCreateWithNativeHandle(), cuda_piextDeviceSelectBinary(), cuda_piextEventCreateWithNativeHandle(), cuda_piextKernelCreateWithNativeHandle(), cuda_piextKernelSetArgMemObj(), cuda_piextMemCreateWithNativeHandle(), cuda_piextProgramCreateWithNativeHandle(), cuda_piextQueueCreateWithNativeHandle(), cuda_piextUSMEnqueuePrefetch(), cuda_piMemGetInfo(), cuda_piMemImageCreate(), cuda_piMemImageGetInfo(), cuda_piMemRelease(), cuda_piPlatformGetInfo(), cuda_piProgramCreate(), cuda_piProgramGetBuildInfo(), cuda_piProgramGetInfo(), cuda_piQueueGetInfo(), _pi_context::decrementUnreleasedEventsInPool(), EventRelease(), _pi_queue::executeCommandList(), cl::sycl::detail::SYCLConfig< SYCL_BE >::get(), getKernelNames(), handleUnknownParamName(), hip_piContextCreate(), hip_piDeviceGetInfo(), hip_piEnqueueKernelLaunch(), hip_piEnqueueMemImageFill(), hip_piEnqueueNativeKernel(), hip_piEventCreate(), hip_piEventGetProfilingInfo(), hip_piEventSetCallback(), hip_piEventSetStatus(), hip_piextContextCreateWithNativeHandle(), hip_piextDeviceCreateWithNativeHandle(), hip_piextDeviceSelectBinary(), hip_piextEventCreateWithNativeHandle(), hip_piextKernelSetArgMemObj(), hip_piextMemCreateWithNativeHandle(), hip_piextProgramCreateWithNativeHandle(), hip_piextQueueCreateWithNativeHandle(), hip_piKernelGetGroupInfo(), hip_piMemGetInfo(), hip_piMemImageCreate(), hip_piMemImageGetInfo(), hip_piMemRelease(), hip_piPlatformGetInfo(), hip_piProgramCreate(), hip_piProgramGetBuildInfo(), hip_piProgramGetInfo(), hip_piProgramLink(), hip_piQueueGetInfo(), imageElementByteSize(), piContextGetInfo(), piDeviceRelease(), piEnqueueMemImageFill(), piEnqueueNativeKernel(), piEventSetCallback(), piEventSetStatus(), piEventsWait(), piextContextSetExtendedDeleter(), piextMemCreateWithNativeHandle(), piextProgramGetNativeHandle(), piKernelGetGroupInfo(), piKernelGetSubGroupInfo(), piMemBufferCreate(), piMemBufferPartition(), piMemGetInfo(), piMemImageCreate(), piMemImageGetInfo(), piPlatformGetInfo(), piProgramGetInfo(), piQueueGetInfo(), piSamplerGetInfo(), platformInfoToString(), _pi_event::record(), USMFreeHelper(), ZeMemFreeHelper(), zeModuleDynamicLinkMock(), and ReleaseGuard< T >::~ReleaseGuard().

◆ emitFunctionBeginTrace()

uint64_t cl::sycl::detail::pi::emitFunctionBeginTrace ( const char FName)

Emits an XPTI trace before a PI API call is made.

Parameters
FNameThe name of the PI API call
Returns
The correlation ID for the API call that is to be used by the emitFunctionEndTrace() call

Definition at line 87 of file pi.cpp.

References cl::sycl::detail::SYCL_PICALL_STREAM_NAME.

Referenced by cl::sycl::detail::plugin::call_nocheck().

◆ emitFunctionEndTrace()

void cl::sycl::detail::pi::emitFunctionEndTrace ( uint64_t  CorrelationID,
const char FName 
)

Emits an XPTI trace after the PI API call has been made.

Parameters
CorrelationIDThe correlation ID for the API call generated by the emitFunctionBeginTrace() call.
FNameThe name of the PI API call

Definition at line 131 of file pi.cpp.

References cl::sycl::detail::SYCL_PICALL_STREAM_NAME.

Referenced by cl::sycl::detail::plugin::call_nocheck().

◆ emitFunctionWithArgsBeginTrace()

uint64_t cl::sycl::detail::pi::emitFunctionWithArgsBeginTrace ( uint32_t  FuncID,
const char FName,
unsigned char ArgsData,
pi_plugin  Plugin 
)

Notifies XPTI subscribers about PI function calls and packs call arguments.

Parameters
FuncIDis the API hash ID from PiApiID type trait.
FNameThe name of the PI API call.
ArgsDatais a pointer to packed function call arguments.
Pluginis the plugin, which is used to make call.

Definition at line 146 of file pi.cpp.

References cl::sycl::detail::SYCL_PIDEBUGCALL_STREAM_NAME.

Referenced by cl::sycl::detail::plugin::call_nocheck().

◆ emitFunctionWithArgsEndTrace()

void cl::sycl::detail::pi::emitFunctionWithArgsEndTrace ( uint64_t  CorrelationID,
uint32_t  FuncID,
const char FName,
unsigned char ArgsData,
pi_result  Result,
pi_plugin  Plugin 
)

Notifies XPTI subscribers about PI function call result.

Parameters
CorrelationIDThe correlation ID for the API call generated by the emitFunctionWithArgsBeginTrace() call.
FuncIDis the API hash ID from PiApiID type trait.
FNameThe name of the PI API call.
ArgsDatais a pointer to packed function call arguments.
Resultis function call result value.
Pluginis the plugin, which is used to make call.

Definition at line 166 of file pi.cpp.

References cl::sycl::detail::SYCL_PIDEBUGCALL_STREAM_NAME.

Referenced by cl::sycl::detail::plugin::call_nocheck().

◆ findPlugins()

◆ getBinaryImageFormat()

RT::PiDeviceBinaryType cl::sycl::detail::pi::getBinaryImageFormat ( const unsigned char ImgData,
size_t  ImgSize 
)

Tries to determine the device binary image foramat.

Returns PI_DEVICE_BINARY_TYPE_NONE if unsuccessful.

Definition at line 687 of file pi.cpp.

References PI_DEVICE_BINARY_TYPE_LLVMIR_BITCODE, PI_DEVICE_BINARY_TYPE_NONE, and PI_DEVICE_BINARY_TYPE_SPIRV.

Referenced by cl::sycl::detail::ProgramManager::createPIProgram(), cl::sycl::detail::DynRTDeviceBinaryImage::DynRTDeviceBinaryImage(), and cl::sycl::detail::pi::DeviceBinaryImage::init().

◆ getOsLibraryFuncAddress()

void * cl::sycl::detail::pi::getOsLibraryFuncAddress ( void *  Library,
const std::string &  FunctionName 
)

◆ getPlugin()

◆ getPlugin< backend::ext_intel_esimd_emulator >()

◆ getPlugin< backend::ext_oneapi_level_zero >()

◆ getPlugin< backend::opencl >()

◆ handleUnknownParamName()

template<typename T >
void cl::sycl::detail::pi::handleUnknownParamName ( const char functionName,
T  parameter 
)

Definition at line 84 of file pi.hpp.

References die().

◆ hipPrint()

void cl::sycl::detail::pi::hipPrint ( const char Message)

Definition at line 345 of file pi_hip.cpp.

Referenced by hip_piclProgramCreateWithSource().

◆ initialize()

std::vector< plugin > & cl::sycl::detail::pi::initialize ( )

◆ initializePlugins()

◆ loadOsLibrary()

void * cl::sycl::detail::pi::loadOsLibrary ( const std::string &  Library)

◆ loadPlugin()

void* cl::sycl::detail::pi::loadPlugin ( const std::string &  PluginPath)

Definition at line 335 of file pi.cpp.

References loadOsLibrary().

Referenced by initializePlugins().

◆ memFlagsToString()

std::string cl::sycl::detail::pi::memFlagsToString ( pi_mem_flags  Flags)

◆ memFlagToString()

std::string cl::sycl::detail::pi::memFlagToString ( pi_mem_flags  Flag)

◆ operator<<()

std::ostream & cl::sycl::detail::pi::operator<< ( std::ostream &  Out,
const DeviceBinaryProperty P 
)

◆ platformInfoToString()

std::string cl::sycl::detail::pi::platformInfoToString ( pi_platform_info  info)

◆ print() [1/17]

template<>
void cl::sycl::detail::pi::print ( char val)
inline

Definition at line 114 of file plugin_printers.hpp.

◆ print() [2/17]

template<>
void cl::sycl::detail::pi::print ( const char val)
inline

Definition at line 118 of file plugin_printers.hpp.

Referenced by printArgs().

◆ print() [3/17]

◆ print() [4/17]

template<>
void cl::sycl::detail::pi::print ( const PiEvent val)
inline

Definition at line 56 of file plugin_printers.hpp.

◆ print() [5/17]

template<>
void cl::sycl::detail::pi::print ( pi_buff_rect_offset  off)
inline

Definition at line 76 of file plugin_printers.hpp.

◆ print() [6/17]

template<>
void cl::sycl::detail::pi::print ( pi_buff_rect_region  rgn)
inline

◆ print() [7/17]

template<>
void cl::sycl::detail::pi::print ( pi_buffer_region  rgn)
inline

◆ print() [8/17]

template<>
void cl::sycl::detail::pi::print ( pi_image_offset  off)
inline

Definition at line 86 of file plugin_printers.hpp.

◆ print() [9/17]

template<>
void cl::sycl::detail::pi::print ( pi_image_region  rgn)
inline

◆ print() [10/17]

template<>
void cl::sycl::detail::pi::print ( PiEvent val)
inline

Definition at line 47 of file plugin_printers.hpp.

◆ print() [11/17]

template<>
void cl::sycl::detail::pi::print ( PiEvent  val)
inline

Definition at line 39 of file plugin_printers.hpp.

◆ print() [12/17]

template<>
void cl::sycl::detail::pi::print ( PiMem  val)
inline

Definition at line 43 of file plugin_printers.hpp.

◆ print() [13/17]

template<>
void cl::sycl::detail::pi::print ( PiPlatform  val)
inline

Definition at line 35 of file plugin_printers.hpp.

◆ print() [14/17]

template<>
void cl::sycl::detail::pi::print ( PiResult  val)
inline

Definition at line 101 of file plugin_printers.hpp.

References PI_SUCCESS.

◆ print() [15/17]

template<>
void cl::sycl::detail::pi::print ( std::nullptr_t  )
inline

Definition at line 110 of file plugin_printers.hpp.

◆ print() [16/17]

template<typename T >
std::enable_if<!std::is_pointer<T>::value, void>::type cl::sycl::detail::pi::print ( T  val)
inline

◆ print() [17/17]

template<typename T >
std::enable_if<std::is_pointer<T>::value, void>::type cl::sycl::detail::pi::print ( T  val)
inline

Definition at line 30 of file plugin_printers.hpp.

◆ printArgs() [1/2]

template<typename Arg0 , typename... Args>
void cl::sycl::detail::pi::printArgs ( Arg0  arg0,
Args...  args 
)

Definition at line 124 of file plugin_printers.hpp.

References print().

◆ printArgs() [2/2]

void cl::sycl::detail::pi::printArgs ( void  )
inline

Definition at line 122 of file plugin_printers.hpp.

Referenced by cl::sycl::detail::plugin::call_nocheck().

◆ printOuts() [1/2]

template<typename Arg0 , typename... Args>
void cl::sycl::detail::pi::printOuts ( Arg0  arg0,
Args...  args 
)

Definition at line 173 of file plugin_printers.hpp.

References cl::sycl::a.

◆ printOuts() [2/2]

void cl::sycl::detail::pi::printOuts ( void  )
inline

Definition at line 171 of file plugin_printers.hpp.

Referenced by cl::sycl::detail::plugin::call_nocheck().

◆ trace()

◆ unloadOsLibrary()

int cl::sycl::detail::pi::unloadOsLibrary ( void *  Library)

Definition at line 25 of file posix_pi.cpp.

Referenced by unloadPlugin().

◆ unloadPlugin()

int cl::sycl::detail::pi::unloadPlugin ( void *  Library)

Definition at line 341 of file pi.cpp.

References unloadOsLibrary().

Referenced by cl::sycl::detail::plugin::unload().

Variable Documentation

◆ cast

template<>
pi::PiDevice cl::sycl::detail::pi::cast(cl_device_id)
inline

Definition at line 417 of file pi.hpp.

◆ GlobalPlugin

std::shared_ptr< plugin > cl::sycl::detail::pi::GlobalPlugin

Definition at line 270 of file pi.cpp.

Referenced by initializePlugins().

◆ XPTIInitDone

bool cl::sycl::detail::pi::XPTIInitDone = false

Definition at line 83 of file pi.cpp.

Referenced by initializePlugins().