DPC++ Runtime
Runtime libraries for oneAPI DPC++
sycl::_V1::detail::plugin Class Reference

The plugin class provides a unified interface to the underlying low-level runtimes for the device-agnostic SYCL runtime. More...

#include <detail/plugin.hpp>

Public Member Functions

 plugin ()=delete
 
 plugin (const std::shared_ptr< RT::PiPlugin > &Plugin, backend UseBackend, void *LibraryHandle)
 
pluginoperator= (const plugin &)=default
 
 plugin (const plugin &)=default
 
pluginoperator= (plugin &&other) noexcept=default
 
 plugin (plugin &&other) noexcept=default
 
 ~plugin ()=default
 
const RT::PiPlugin & getPiPlugin () const
 
RT::PiPlugin & getPiPlugin ()
 
const std::shared_ptr< RT::PiPlugin > & getPiPluginPtr () const
 
template<typename Exception = sycl::runtime_error>
void checkPiResult (RT::PiResult pi_result) const
 Checks return value from PI calls. More...
 
template<sycl::errc errc>
void checkPiResult (RT::PiResult pi_result) const
 
void reportPiError (RT::PiResult pi_result, const char *context) const
 
template<PiApiKind PiApiOffset, typename... ArgsT>
RT::PiResult call_nocheck (ArgsT... Args) const
 Calls the PiApi, traces the call, and returns the result. More...
 
template<PiApiKind PiApiOffset, typename... ArgsT>
void call (ArgsT... Args) const
 Calls the API, traces the call, checks the result. More...
 
template<sycl::errc errc, PiApiKind PiApiOffset, typename... ArgsT>
void call (ArgsT... Args) const
 
backend getBackend (void) const
 
void * getLibraryHandle () const
 
void * getLibraryHandle ()
 
int unload ()
 
int getPlatformId (RT::PiPlatform Platform)
 
int getStartingDeviceId (RT::PiPlatform Platform)
 
void setLastDeviceId (RT::PiPlatform Platform, int Id)
 
void adjustLastDeviceId (RT::PiPlatform Platform)
 
bool containsPiPlatform (RT::PiPlatform Platform)
 
std::shared_ptr< std::mutex > getPluginMutex ()
 

Detailed Description

The plugin class provides a unified interface to the underlying low-level runtimes for the device-agnostic SYCL runtime.

Definition at line 90 of file plugin.hpp.

Constructor & Destructor Documentation

◆ plugin() [1/4]

sycl::_V1::detail::plugin::plugin ( )
delete

◆ plugin() [2/4]

sycl::_V1::detail::plugin::plugin ( const std::shared_ptr< RT::PiPlugin > &  Plugin,
backend  UseBackend,
void *  LibraryHandle 
)
inline

Definition at line 93 of file plugin.hpp.

◆ plugin() [3/4]

sycl::_V1::detail::plugin::plugin ( const plugin )
default

◆ plugin() [4/4]

sycl::_V1::detail::plugin::plugin ( plugin &&  other)
defaultnoexcept

◆ ~plugin()

sycl::_V1::detail::plugin::~plugin ( )
default

Member Function Documentation

◆ adjustLastDeviceId()

void sycl::_V1::detail::plugin::adjustLastDeviceId ( RT::PiPlatform  Platform)
inline

Definition at line 269 of file plugin.hpp.

◆ call() [1/2]

template<PiApiKind PiApiOffset, typename... ArgsT>
void sycl::_V1::detail::plugin::call ( ArgsT...  Args) const
inline

Calls the API, traces the call, checks the result.

Exceptions
sycl::runtime_exceptionif the call was not successful.

Definition at line 217 of file plugin.hpp.

Referenced by sycl::_V1::detail::buffer_impl::addInteropObject(), sycl::_V1::detail::MemoryManager::advise_usm(), sycl::_V1::detail::MemoryManager::allocateImageObject(), sycl::_V1::detail::MemoryManager::allocateInteropMemObject(), sycl::_V1::detail::applyAllowList(), sycl::_V1::detail::ProgramManager::build(), sycl::_V1::detail::program_impl::build_with_kernel_name(), sycl::_V1::detail::context_impl::context_impl(), sycl::_V1::detail::pi::contextSetExtendedDeleter(), sycl::_V1::detail::MemoryManager::copy_usm(), sycl::_V1::detail::copyD2D(), sycl::_V1::detail::copyD2H(), sycl::_V1::detail::copyH2D(), sycl::_V1::detail::device_impl::create_sub_devices(), sycl::_V1::detail::createBinaryProgram(), sycl::_V1::detail::createSpirvProgram(), sycl::_V1::detail::enableITTAnnotationsIfNeeded(), sycl::_V1::detail::event_impl::event_impl(), sycl::_V1::detail::queue_impl::ext_oneapi_empty(), sycl::_V1::detail::MemoryManager::fill(), sycl::_V1::detail::MemoryManager::fill_usm(), sycl::_V1::detail::filterDeviceFilter(), sycl::_V1::detail::event_impl::flushIfNeeded(), sycl::_V1::detail::usm::free(), sycl::_V1::detail::queue_impl::get(), sycl::_V1::detail::context_impl::get(), sycl::_V1::detail::device_impl::get(), sycl::_V1::detail::kernel_impl::get(), sycl::_V1::detail::program_impl::get(), sycl::_V1::detail::get_device_info_impl< ReturnT, Param >::get(), sycl::_V1::detail::get_device_info_impl< platform, Param >::get(), sycl::_V1::detail::get_device_info_impl< std::vector< info::fp_config >, Param >::get(), sycl::_V1::detail::get_device_info_impl< std::vector< info::fp_config >, info::device::single_fp_config >::get(), sycl::_V1::detail::get_device_info_impl< bool, info::device::queue_profiling >::get(), sycl::_V1::detail::get_device_info_impl< std::vector< info::execution_capability >, info::device::execution_capabilities >::get(), sycl::_V1::detail::get_device_info_impl< std::vector< info::partition_property >, info::device::partition_properties >::get(), sycl::_V1::detail::get_device_info_impl< std::vector< info::partition_affinity_domain >, info::device::partition_affinity_domains >::get(), sycl::_V1::detail::get_device_info_impl< info::partition_affinity_domain, info::device::partition_type_affinity_domain >::get(), sycl::_V1::detail::get_device_info_impl< info::partition_property, info::device::partition_type_property >::get(), sycl::_V1::detail::get_device_info_impl< std::vector< size_t >, info::device::sub_group_sizes >::get(), sycl::_V1::detail::get_device_info_impl< id< Dimensions >, info::device::max_work_item_sizes< Dimensions > >::get(), sycl::_V1::detail::get_device_info_impl< id< 1 >, ext::oneapi::experimental::info::device::max_work_groups< 1 > >::get(), sycl::_V1::detail::get_device_info_impl< id< 2 >, ext::oneapi::experimental::info::device::max_work_groups< 2 > >::get(), sycl::_V1::detail::get_device_info_impl< id< 3 >, ext::oneapi::experimental::info::device::max_work_groups< 3 > >::get(), sycl::_V1::detail::get_device_info_impl< device, info::device::parent_device >::get(), sycl::_V1::detail::program_impl::get_binaries(), sycl::_V1::detail::get_context_info(), sycl::_V1::detail::get_device_info_string(), sycl::_V1::detail::platform_impl::get_devices(), sycl::_V1::detail::get_event_info(), sycl::_V1::detail::get_event_profiling_info(), sycl::_V1::detail::get_kernel_device_specific_info_helper(), sycl::_V1::detail::get_kernel_device_specific_info_with_input(), sycl::_V1::detail::get_kernel_info(), sycl::_V1::detail::get_platform_info_string_impl(), sycl::_V1::get_pointer_device(), sycl::_V1::detail::SYCLMemObjT::getBufSizeForContext(), sycl::_V1::detail::queue_impl::getExclusiveQueueHandleRef(), sycl::_V1::detail::getImageInfo(), sycl::_V1::detail::device_image_impl::getNative(), sycl::_V1::detail::device_impl::getNative(), sycl::_V1::detail::kernel_impl::getNative(), sycl::_V1::detail::queue_impl::getNative(), sycl::_V1::detail::ProgramManager::getOrCreateKernel(), sycl::_V1::detail::ProgramManager::getPiProgramFromPiKernel(), sycl::_V1::detail::platform_impl::getPlatformFromPiDevice(), sycl::_V1::detail::ProgramManager::getProgramBuildLog(), sycl::_V1::detail::enqueue_kernel_launch::handleInvalidValue(), sycl::_V1::detail::enqueue_kernel_launch::handleInvalidWorkGroupSize(), sycl::_V1::detail::enqueue_kernel_launch::handleInvalidWorkItemSize(), sycl::_V1::opencl::has_extension(), sycl::_V1::detail::kernel_impl::kernel_impl(), sycl::_V1::detail::program_impl::link(), sycl::_V1::detail::memBufferCreateHelper(), sycl::_V1::detail::memBufferMapHelper(), sycl::_V1::detail::memReleaseHelper(), sycl::_V1::detail::memUnmapHelper(), sycl::_V1::detail::MemoryManager::prefetch_usm(), sycl::_V1::detail::queue_impl::get_info< info::queue::reference_count >(), sycl::_V1::detail::sampler_impl::sampler_impl(), sycl::_V1::detail::SetKernelParamsAndLaunch(), sycl::_V1::detail::SYCLMemObjT::SYCLMemObjT(), sycl::_V1::detail::SYCLMemObjT::updateHostMemory(), sycl::_V1::detail::queue_impl::wait(), sycl::_V1::detail::waitForEvents(), sycl::_V1::detail::Command::waitForEvents(), sycl::_V1::detail::event_impl::waitInternal(), sycl::_V1::detail::context_impl::~context_impl(), sycl::_V1::detail::device_image_impl::~device_image_impl(), sycl::_V1::detail::event_impl::~event_impl(), sycl::_V1::detail::kernel_impl::~kernel_impl(), sycl::_V1::detail::KernelProgramCache::~KernelProgramCache(), sycl::_V1::detail::program_impl::~program_impl(), sycl::_V1::detail::queue_impl::~queue_impl(), and sycl::_V1::detail::sampler_impl::~sampler_impl().

◆ call() [2/2]

template<sycl::errc errc, PiApiKind PiApiOffset, typename... ArgsT>
void sycl::_V1::detail::plugin::call ( ArgsT...  Args) const
inline
Exceptions
sycl::exceptions(errc)if the call was not successful.

Definition at line 224 of file plugin.hpp.

◆ call_nocheck()

template<PiApiKind PiApiOffset, typename... ArgsT>
RT::PiResult sycl::_V1::detail::plugin::call_nocheck ( ArgsT...  Args) const
inline

Calls the PiApi, traces the call, and returns the result.

Usage:

PiResult Err = plugin.call<PiApiKind::pi>(Args);
Plugin.checkPiResult(Err); // Checks Result and throws a runtime_error
// exception.
::pi_result PiResult
Definition: pi.hpp:108
See also
plugin::checkPiResult

Definition at line 170 of file plugin.hpp.

References std::cout, sycl::_V1::detail::pi::emitFunctionBeginTrace(), sycl::_V1::detail::pi::emitFunctionEndTrace(), sycl::_V1::detail::pi::emitFunctionWithArgsBeginTrace(), sycl::_V1::detail::pi::emitFunctionWithArgsEndTrace(), sycl::_V1::detail::pi::PI_TRACE_CALLS, sycl::_V1::detail::pi::printArgs(), sycl::_V1::detail::pi::printOuts(), and sycl::_V1::detail::pi::trace().

Referenced by sycl::_V1::detail::usm::alignedAlloc(), sycl::_V1::detail::usm::alignedAllocHost(), sycl::_V1::detail::MemoryManager::allocateMemSubBuffer(), sycl::_V1::detail::ProgramManager::compile(), sycl::_V1::detail::queue_impl::createQueue(), sycl::_V1::detail::get_device_info_impl< std::vector< memory_order >, info::device::atomic_memory_order_capabilities >::get(), sycl::_V1::detail::get_device_info_impl< std::vector< memory_scope >, info::device::atomic_memory_scope_capabilities >::get(), sycl::_V1::detail::get_device_info_impl< bool, info::device::ext_oneapi_bfloat16_math_functions >::get(), sycl::_V1::detail::get_device_info_impl< bool, info::device::usm_device_allocations >::get(), sycl::_V1::detail::get_device_info_impl< bool, info::device::usm_host_allocations >::get(), sycl::_V1::detail::get_device_info_impl< bool, info::device::usm_shared_allocations >::get(), sycl::_V1::detail::get_device_info_impl< bool, info::device::usm_restricted_shared_allocations >::get(), sycl::_V1::detail::get_device_info_impl< bool, info::device::usm_system_allocations >::get(), sycl::_V1::detail::get_device_info_impl< bool, info::device::ext_intel_mem_channel >::get(), sycl::_V1::get_pointer_type(), sycl::_V1::detail::sampler_impl::getOrCreateSampler(), sycl::_V1::detail::device_impl::has(), sycl::_V1::detail::program_impl::has_kernel(), sycl::_V1::detail::ProgramManager::link(), sycl::_V1::detail::program_impl::link(), sycl::_V1::detail::loadDeviceLibFallback(), sycl::_V1::detail::memBufferCreateHelper(), sycl::_V1::detail::memUnmapHelper(), sycl::_V1::detail::program_impl::program_impl(), and sycl::_V1::detail::device_impl::~device_impl().

◆ checkPiResult() [1/2]

template<typename Exception = sycl::runtime_error>
void sycl::_V1::detail::plugin::checkPiResult ( RT::PiResult  pi_result) const
inline

◆ checkPiResult() [2/2]

template<sycl::errc errc>
void sycl::_V1::detail::plugin::checkPiResult ( RT::PiResult  pi_result) const
inline
Exceptions
SYCL2020 exception(errc) if pi_result is not PI_SUCCESS

Definition at line 133 of file plugin.hpp.

References __SYCL_CHECK_CODE_THROW_VIA_ERRC, and std::clog.

◆ containsPiPlatform()

bool sycl::_V1::detail::plugin::containsPiPlatform ( RT::PiPlatform  Platform)
inline

Definition at line 276 of file plugin.hpp.

◆ getBackend()

◆ getLibraryHandle() [1/2]

void* sycl::_V1::detail::plugin::getLibraryHandle ( )
inline

Definition at line 231 of file plugin.hpp.

◆ getLibraryHandle() [2/2]

void* sycl::_V1::detail::plugin::getLibraryHandle ( ) const
inline

Definition at line 230 of file plugin.hpp.

◆ getPiPlugin() [1/2]

RT::PiPlugin& sycl::_V1::detail::plugin::getPiPlugin ( )
inline

Definition at line 107 of file plugin.hpp.

◆ getPiPlugin() [2/2]

const RT::PiPlugin& sycl::_V1::detail::plugin::getPiPlugin ( ) const
inline

◆ getPiPluginPtr()

const std::shared_ptr<RT::PiPlugin>& sycl::_V1::detail::plugin::getPiPluginPtr ( ) const
inline

Definition at line 108 of file plugin.hpp.

◆ getPlatformId()

int sycl::_V1::detail::plugin::getPlatformId ( RT::PiPlatform  Platform)
inline

Definition at line 237 of file plugin.hpp.

◆ getPluginMutex()

std::shared_ptr<std::mutex> sycl::_V1::detail::plugin::getPluginMutex ( )
inline

Definition at line 281 of file plugin.hpp.

Referenced by sycl::_V1::detail::filterDeviceFilter().

◆ getStartingDeviceId()

int sycl::_V1::detail::plugin::getStartingDeviceId ( RT::PiPlatform  Platform)
inline

Definition at line 252 of file plugin.hpp.

Referenced by sycl::_V1::detail::filterDeviceFilter().

◆ operator=() [1/2]

plugin& sycl::_V1::detail::plugin::operator= ( const plugin )
default

◆ operator=() [2/2]

plugin& sycl::_V1::detail::plugin::operator= ( plugin &&  other)
defaultnoexcept

◆ reportPiError()

void sycl::_V1::detail::plugin::reportPiError ( RT::PiResult  pi_result,
const char *  context 
) const
inline

◆ setLastDeviceId()

void sycl::_V1::detail::plugin::setLastDeviceId ( RT::PiPlatform  Platform,
int  Id 
)
inline

Definition at line 261 of file plugin.hpp.

Referenced by sycl::_V1::detail::filterDeviceFilter().

◆ unload()

int sycl::_V1::detail::plugin::unload ( )
inline

Definition at line 232 of file plugin.hpp.

References sycl::_V1::detail::pi::unloadPlugin().


The documentation for this class was generated from the following file: