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 PiPlatformBackend = ::pi_platform_backend
 
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
 
using PiKernelCacheConfig = ::pi_kernel_cache_config
 
using PiExtSyncPoint = ::pi_ext_sync_point
 
using PiExtCommandBuffer = ::pi_ext_command_buffer
 
using PiExtCommandBufferDesc = ::pi_ext_command_buffer_desc
 
using PiExtCommandBufferCommand = ::pi_ext_command_buffer_command
 
using PiPeerAttr = ::pi_peer_attr
 
using PiImageHandle = ::pi_image_handle
 
using PiImageMemHandle = ::pi_image_mem_handle
 
using PiImageCopyFlags = ::pi_image_copy_flags
 
using PiInteropMemHandle = ::pi_interop_mem_handle
 
using PiInteropSemaphoreHandle = ::pi_interop_semaphore_handle
 
using PiImageOffset = ::pi_image_offset_struct
 
using PiImageRegion = ::pi_image_region_struct
 

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)
 
void * loadOsPluginLibrary (const std::string &Library)
 
int unloadOsPluginLibrary (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< PluginPtr > & initialize ()
 
template<backend BE>
const PluginPtrgetPlugin ()
 
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< PluginPtr > &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)
 
std::vector< std::tuple< std::string, backend, void * > > loadPlugins (const std::vector< std::pair< std::string, backend >> &&PluginNames)
 
template const PluginPtrgetPlugin< backend::opencl > ()
 
template const PluginPtrgetPlugin< backend::ext_oneapi_level_zero > ()
 
template const PluginPtrgetPlugin< backend::ext_intel_esimd_emulator > ()
 
template const PluginPtrgetPlugin< backend::ext_oneapi_cuda > ()
 
template const PluginPtrgetPlugin< backend::ext_oneapi_hip > ()
 
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)
 
static std::filesystem::path getCurrentDSODirPath ()
 

Variables

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

Typedef Documentation

◆ PiContext

Definition at line 135 of file pi.hpp.

◆ PiContextInfo

Definition at line 136 of file pi.hpp.

◆ PiDevice

Definition at line 131 of file pi.hpp.

◆ PiDeviceBinaryType

Definition at line 134 of file pi.hpp.

◆ PiDeviceInfo

Definition at line 133 of file pi.hpp.

◆ PiDeviceType

Definition at line 132 of file pi.hpp.

◆ PiEvent

Definition at line 143 of file pi.hpp.

◆ PiExtCommandBuffer

Definition at line 157 of file pi.hpp.

◆ PiExtCommandBufferCommand

◆ PiExtCommandBufferDesc

◆ PiExtSyncPoint

Definition at line 156 of file pi.hpp.

◆ PiImageCopyFlags

Definition at line 163 of file pi.hpp.

◆ PiImageHandle

Definition at line 161 of file pi.hpp.

◆ PiImageMemHandle

Definition at line 162 of file pi.hpp.

◆ PiImageOffset

Definition at line 166 of file pi.hpp.

◆ PiImageRegion

Definition at line 167 of file pi.hpp.

◆ PiInteropMemHandle

Definition at line 164 of file pi.hpp.

◆ PiInteropSemaphoreHandle

◆ PiKernel

Definition at line 138 of file pi.hpp.

◆ PiKernelCacheConfig

Definition at line 155 of file pi.hpp.

◆ PiMem

Definition at line 141 of file pi.hpp.

◆ PiMemFlags

Definition at line 142 of file pi.hpp.

◆ PiMemImageChannelOrder

Definition at line 153 of file pi.hpp.

◆ PiMemImageChannelType

Definition at line 154 of file pi.hpp.

◆ PiMemImageDesc

Definition at line 150 of file pi.hpp.

◆ PiMemImageFormat

Definition at line 149 of file pi.hpp.

◆ PiMemImageInfo

Definition at line 151 of file pi.hpp.

◆ PiMemObjectType

Definition at line 152 of file pi.hpp.

◆ PiPeerAttr

Definition at line 160 of file pi.hpp.

◆ PiPlatform

Definition at line 129 of file pi.hpp.

◆ PiPlatformBackend

Definition at line 130 of file pi.hpp.

◆ PiPlugin

Definition at line 127 of file pi.hpp.

◆ PiProgram

Definition at line 137 of file pi.hpp.

◆ PiQueue

Definition at line 139 of file pi.hpp.

◆ PiQueueProperties

Definition at line 140 of file pi.hpp.

◆ PiResult

Definition at line 128 of file pi.hpp.

◆ PiSampler

Definition at line 144 of file pi.hpp.

◆ PiSamplerAddressingMode

◆ PiSamplerFilterMode

Definition at line 148 of file pi.hpp.

◆ PiSamplerInfo

Definition at line 145 of file pi.hpp.

◆ PiSamplerProperties

Definition at line 146 of file pi.hpp.

Enumeration Type Documentation

◆ TraceLevel

Enumerator
PI_TRACE_BASIC 
PI_TRACE_CALLS 
PI_TRACE_ALL 

Definition at line 57 of file pi.hpp.

Function Documentation

◆ assertion()

void sycl::_V1::detail::pi::assertion ( bool  Condition,
const char *  Message = nullptr 
)

Definition at line 591 of file pi.cpp.

References die().

Referenced by cast(), and memFlagToString().

◆ bindPlugin()

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

Definition at line 410 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 278 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 145 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 291 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 613 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 
)

◆ die()

◆ 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 82 of file pi.cpp.

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 127 of file pi.cpp.

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 143 of file pi.cpp.

References sycl::_V1::detail::tls_code_loc_t::query().

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 175 of file pi.cpp.

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

◆ findPlugins()

◆ getBinaryImageFormat()

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

◆ getCurrentDSODirPath()

static std::filesystem::path sycl::_V1::detail::pi::getCurrentDSODirPath ( )
static

Definition at line 71 of file windows_pi.cpp.

References ExeModuleHandle, and getOSModuleHandle().

◆ getELFHeaderType()

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

Definition at line 677 of file pi.cpp.

Referenced by getBinaryImageFormat().

◆ getOsLibraryFuncAddress()

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

◆ getPlugin()

template<backend BE>
const PluginPtr & sycl::_V1::detail::pi::getPlugin ( )

Definition at line 558 of file pi.cpp.

References initialize().

◆ getPlugin< backend::ext_intel_esimd_emulator >()

template const PluginPtr& sycl::_V1::detail::pi::getPlugin< backend::ext_intel_esimd_emulator > ( )

◆ getPlugin< backend::ext_oneapi_cuda >()

◆ getPlugin< backend::ext_oneapi_hip >()

◆ 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 112 of file pi.hpp.

References die().

◆ initialize()

◆ initializePlugins()

◆ loadOsLibrary()

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

◆ loadOsPluginLibrary()

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

Definition at line 33 of file posix_pi.cpp.

References loadOsLibrary().

Referenced by loadPlugin(), and loadPlugins().

◆ loadPlugin()

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

Definition at line 396 of file pi.cpp.

References loadOsPluginLibrary().

◆ loadPlugins()

std::vector< std::tuple< std::string, backend, void * > > sycl::_V1::detail::pi::loadPlugins ( const std::vector< std::pair< std::string, backend >> &&  PluginNames)

Definition at line 53 of file posix_pi.cpp.

References loadOsPluginLibrary(), and sycl::_V1::detail::make_tuple().

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.

◆ 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 printArgs().

◆ 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, print(), and printArgs().

◆ 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(), and printArgs().

◆ 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.

References printOuts().

◆ 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(), and printOuts().

◆ readELFValue()

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

Definition at line 598 of file pi.cpp.

◆ trace()

◆ unloadOsLibrary()

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

Definition at line 37 of file posix_pi.cpp.

◆ unloadOsPluginLibrary()

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

Definition at line 39 of file posix_pi.cpp.

Referenced by unloadPlugin().

◆ unloadPlugin()

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

Definition at line 402 of file pi.cpp.

References unloadOsPluginLibrary().

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 283 of file pi.cpp.

◆ XPTIInitDone

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

Definition at line 78 of file pi.cpp.

Referenced by initializePlugins().