DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::detail::pi Namespace Reference

Classes

struct  PiFuncInfo
 
struct  IsStdVector
 
struct  IsStdVector< std::vector< T > >
 
struct  printOut
 
struct  printOut< PiEvent * >
 
struct  printOut< PiMem * >
 
struct  printOut< void * >
 
struct  printOut< T ** >
 

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 PiContextInfo = ::pi_context_info
 
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

template<class To >
To cast (std::vector< cl_event > value)
 
template<>
PiDevice cast (cl_device_id)=delete
 
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 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...
 
PiDeviceBinaryType getBinaryImageFormat (const unsigned char *ImgData, size_t ImgSize)
 Tries to determine the device binary image foramat. More...
 
template<class To , class FromE >
To cast (std::vector< FromE > Values)
 
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)
 
template const plugingetPlugin< backend::opencl > ()
 
template const plugingetPlugin< backend::ext_oneapi_level_zero > ()
 
template const plugingetPlugin< backend::ext_intel_esimd_emulator > ()
 
template const plugingetPlugin< backend::ext_oneapi_cuda > ()
 
template<typename ResT >
static ResT readELFValue (const unsigned char *Data, size_t NumBytes, bool IsBigEndian)
 
static bool checkELFSectionPresent (const std::string &ExpectedSectionName, const unsigned char *ImgData, size_t ImgSize)
 
static uint16_t getELFHeaderType (const unsigned char *ImgData, size_t ImgSize)
 
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

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

Typedef Documentation

◆ PiContext

Definition at line 126 of file pi.hpp.

◆ PiContextInfo

Definition at line 127 of file pi.hpp.

◆ PiDevice

Definition at line 122 of file pi.hpp.

◆ PiDeviceBinaryType

Definition at line 125 of file pi.hpp.

◆ PiDeviceInfo

Definition at line 124 of file pi.hpp.

◆ PiDeviceType

Definition at line 123 of file pi.hpp.

◆ PiEvent

Definition at line 134 of file pi.hpp.

◆ PiKernel

Definition at line 129 of file pi.hpp.

◆ PiMem

Definition at line 132 of file pi.hpp.

◆ PiMemFlags

Definition at line 133 of file pi.hpp.

◆ PiMemImageChannelOrder

Definition at line 144 of file pi.hpp.

◆ PiMemImageChannelType

Definition at line 145 of file pi.hpp.

◆ PiMemImageDesc

Definition at line 141 of file pi.hpp.

◆ PiMemImageFormat

Definition at line 140 of file pi.hpp.

◆ PiMemImageInfo

Definition at line 142 of file pi.hpp.

◆ PiMemObjectType

Definition at line 143 of file pi.hpp.

◆ PiPlatform

Definition at line 121 of file pi.hpp.

◆ PiPlugin

Definition at line 119 of file pi.hpp.

◆ PiProgram

Definition at line 128 of file pi.hpp.

◆ PiQueue

Definition at line 130 of file pi.hpp.

◆ PiQueueProperties

Definition at line 131 of file pi.hpp.

◆ PiResult

Definition at line 120 of file pi.hpp.

◆ PiSampler

Definition at line 135 of file pi.hpp.

◆ PiSamplerAddressingMode

◆ PiSamplerFilterMode

Definition at line 139 of file pi.hpp.

◆ PiSamplerInfo

Definition at line 136 of file pi.hpp.

◆ PiSamplerProperties

Definition at line 137 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()

◆ bindPlugin()

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

Definition at line 380 of file pi.cpp.

References getOsLibraryFuncAddress(), and piPluginInit().

Referenced by initializePlugins().

◆ cast() [1/4]

template<>
PiDevice sycl::_V1::detail::pi::cast ( cl_device_id  )
inlinedelete

◆ cast() [2/4]

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

Definition at line 249 of file pi.hpp.

References assertion().

◆ cast() [3/4]

template<class To >
To sycl::_V1::detail::pi::cast ( std::vector< cl_event >  value)
inline

Definition at line 163 of file backend_traits_opencl.hpp.

References assertion().

◆ cast() [4/4]

template<class To , class FromE >
To sycl::_V1::detail::pi::cast ( std::vector< FromE >  Values)

Definition at line 261 of file pi.hpp.

◆ checkELFSectionPresent()

static bool sycl::_V1::detail::pi::checkELFSectionPresent ( const std::string &  ExpectedSectionName,
const unsigned char *  ImgData,
size_t  ImgSize 
)
static

Definition at line 569 of file pi.cpp.

Referenced by getBinaryImageFormat().

◆ contextSetExtendedDeleter()

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

◆ cuPrint()

void sycl::_V1::detail::pi::cuPrint ( const char *  Message)

Definition at line 363 of file pi_cuda.cpp.

References std::cerr.

Referenced by cuda_piclProgramCreateWithSource(), and cuda_piDeviceGetInfo().

◆ die()

void sycl::_V1::detail::pi::die ( const char *  Message)

Definition at line 542 of file pi.cpp.

References std::cerr.

Referenced by _pi_queue::_pi_queue(), assertion(), cuda_piContextCreate(), cuda_piDeviceGetInfo(), cuda_piEnqueueMemImageFill(), cuda_piEnqueueNativeKernel(), cuda_piEventCreate(), cuda_piEventGetProfilingInfo(), cuda_piEventSetCallback(), cuda_piEventSetStatus(), cuda_piextDeviceSelectBinary(), cuda_piextKernelCreateWithNativeHandle(), cuda_piextMemCreateWithNativeHandle(), cuda_piextProgramCreateWithNativeHandle(), cuda_piextProgramSetSpecializationConstant(), cuda_piextQueueCreateWithNativeHandle(), cuda_piextUSMEnqueueFill2D(), cuda_piextUSMEnqueueMemAdvise(), cuda_piextUSMEnqueueMemset2D(), cuda_piMemGetInfo(), cuda_piMemImageCreate(), cuda_piMemImageGetInfo(), cuda_piMemRelease(), cuda_piPlatformGetInfo(), cuda_piProgramCreate(), cuda_piProgramGetBuildInfo(), cuda_piProgramGetInfo(), cuda_piQueueGetInfo(), _pi_context::decrementUnreleasedEventsInPool(), DieUnsupported(), _pi_queue::executeCommandList(), _pi_buffer::free(), getKernelNames(), _pi_event::getOrCreateHostVisibleEvent(), _pi_buffer::getZeHandle(), _pi_queue::pi_queue_group_t::getZeQueue(), handleUnknownParamName(), hip_piContextCreate(), hip_piDeviceGetInfo(), hip_piEnqueueMemImageFill(), hip_piEnqueueNativeKernel(), hip_piEventCreate(), hip_piEventGetProfilingInfo(), hip_piEventSetCallback(), hip_piEventSetStatus(), hip_piextContextCreateWithNativeHandle(), hip_piextDeviceCreateWithNativeHandle(), hip_piextDeviceSelectBinary(), hip_piextEnqueueDeviceGlobalVariableRead(), hip_piextEnqueueDeviceGlobalVariableWrite(), hip_piextEventCreateWithNativeHandle(), hip_piextKernelSetArgMemObj(), hip_piextMemCreateWithNativeHandle(), hip_piextProgramCreateWithNativeHandle(), hip_piextProgramSetSpecializationConstant(), hip_piextQueueCreateWithNativeHandle(), hip_piextUSMEnqueueFill2D(), hip_piextUSMEnqueueMemset2D(), hip_piKernelGetGroupInfo(), hip_piMemGetInfo(), hip_piMemImageCreate(), hip_piMemImageGetInfo(), hip_piMemRelease(), hip_piPlatformGetInfo(), hip_piProgramCreate(), hip_piProgramGetBuildInfo(), hip_piProgramGetInfo(), hip_piProgramLink(), hip_piQueueGetInfo(), imageElementByteSize(), piContextGetInfo(), piDeviceGetInfo(), piEnqueueMemImageFill(), piEnqueueNativeKernel(), piEventSetCallback(), piEventSetStatus(), piEventsWait(), piextContextSetExtendedDeleter(), piextMemCreateWithNativeHandle(), piextUSMEnqueueFill2D(), piextUSMEnqueueMemset2D(), piKernelGetGroupInfo(), piKernelGetSubGroupInfo(), piMemBufferCreate(), piMemBufferPartition(), piMemGetInfo(), piMemImageCreate(), piMemImageGetInfo(), piPlatformGetInfo(), piProgramGetInfo(), piQueueGetInfo(), piSamplerGetInfo(), platformInfoToString(), _pi_event::record(), USMFreeHelper(), ZeCommandListBatchConfig(), ZeMemFreeHelper(), and ReleaseGuard< T >::~ReleaseGuard().

◆ emitFunctionBeginTrace()

uint64_t sycl::_V1::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 85 of file pi.cpp.

References sycl::_V1::detail::SYCL_PICALL_STREAM_NAME.

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

◆ emitFunctionEndTrace()

void sycl::_V1::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 129 of file pi.cpp.

References sycl::_V1::detail::SYCL_PICALL_STREAM_NAME.

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

◆ emitFunctionWithArgsBeginTrace()

uint64_t sycl::_V1::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 144 of file pi.cpp.

References sycl::_V1::detail::SYCL_PIDEBUGCALL_STREAM_NAME.

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

◆ emitFunctionWithArgsEndTrace()

void sycl::_V1::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 164 of file pi.cpp.

References sycl::_V1::detail::SYCL_PIDEBUGCALL_STREAM_NAME.

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

◆ findPlugins()

std::vector<std::pair<std::string, backend> > sycl::_V1::detail::pi::findPlugins ( )

◆ getBinaryImageFormat()

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

◆ getELFHeaderType()

static uint16_t sycl::_V1::detail::pi::getELFHeaderType ( const unsigned char *  ImgData,
size_t  ImgSize 
)
static

Definition at line 633 of file pi.cpp.

Referenced by getBinaryImageFormat().

◆ getOsLibraryFuncAddress()

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

Definition at line 39 of file posix_pi.cpp.

Referenced by sycl::_V1::ext::__SYCL2020_DEPRECATED(), and bindPlugin().

◆ getPlugin()

◆ getPlugin< backend::ext_intel_esimd_emulator >()

◆ getPlugin< backend::ext_oneapi_cuda >()

◆ getPlugin< backend::ext_oneapi_level_zero >()

◆ getPlugin< backend::opencl >()

◆ handleUnknownParamName()

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

Definition at line 104 of file pi.hpp.

References die().

◆ hipPrint()

void sycl::_V1::detail::pi::hipPrint ( const char *  Message)

Definition at line 398 of file pi_hip.cpp.

References std::cerr.

Referenced by hip_piclProgramCreateWithSource().

◆ initialize()

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

◆ initializePlugins()

◆ loadOsLibrary()

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

Definition at line 19 of file posix_pi.cpp.

References std::cerr, PI_TRACE_ALL, and trace().

Referenced by sycl::_V1::ext::__SYCL2020_DEPRECATED(), and loadPlugin().

◆ loadPlugin()

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

Definition at line 366 of file pi.cpp.

References loadOsLibrary().

Referenced by initializePlugins().

◆ memFlagsToString()

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

◆ memFlagToString()

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

◆ platformInfoToString()

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

◆ print() [1/17]

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

Definition at line 114 of file plugin_printers.hpp.

References std::cout.

◆ print() [2/17]

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

Definition at line 118 of file plugin_printers.hpp.

References std::cout.

Referenced by printArgs().

◆ print() [3/17]

◆ print() [4/17]

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

Definition at line 56 of file plugin_printers.hpp.

References std::cout.

◆ print() [5/17]

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

◆ print() [6/17]

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

◆ print() [7/17]

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

◆ print() [8/17]

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

◆ print() [9/17]

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

◆ print() [10/17]

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

Definition at line 47 of file plugin_printers.hpp.

References std::cout.

◆ print() [11/17]

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

Definition at line 39 of file plugin_printers.hpp.

References std::cout.

◆ print() [12/17]

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

Definition at line 43 of file plugin_printers.hpp.

References std::cout.

◆ print() [13/17]

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

Definition at line 35 of file plugin_printers.hpp.

References std::cout.

◆ print() [14/17]

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

Definition at line 101 of file plugin_printers.hpp.

References std::cout.

◆ print() [15/17]

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

Definition at line 110 of file plugin_printers.hpp.

References std::cout.

◆ print() [16/17]

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

Definition at line 24 of file plugin_printers.hpp.

References std::cout.

Referenced by sycl::_V1::detail::DynRTDeviceBinaryImage::print().

◆ print() [17/17]

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

Definition at line 30 of file plugin_printers.hpp.

References std::cout.

◆ printArgs() [1/2]

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

Definition at line 124 of file plugin_printers.hpp.

References std::cout, and print().

◆ printArgs() [2/2]

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

Definition at line 122 of file plugin_printers.hpp.

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

◆ printOuts() [1/2]

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

Definition at line 173 of file plugin_printers.hpp.

◆ printOuts() [2/2]

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

Definition at line 171 of file plugin_printers.hpp.

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

◆ readELFValue()

template<typename ResT >
static ResT sycl::_V1::detail::pi::readELFValue ( const unsigned char *  Data,
size_t  NumBytes,
bool  IsBigEndian 
)
static

Definition at line 554 of file pi.cpp.

◆ trace()

◆ unloadOsLibrary()

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

Definition at line 31 of file posix_pi.cpp.

Referenced by unloadPlugin().

◆ unloadPlugin()

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

Definition at line 372 of file pi.cpp.

References unloadOsLibrary().

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

Variable Documentation

◆ cast

template<>
PiDevice sycl::_V1::detail::pi::cast(cl_device_id)=delete ( cl_program  )
inlinedelete

◆ GlobalPlugin

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

Definition at line 269 of file pi.cpp.

◆ XPTIInitDone

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

Definition at line 81 of file pi.cpp.

Referenced by initializePlugins().