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>

Collaboration diagram for sycl::_V1::detail::plugin:

Public Member Functions

 plugin ()=delete
 
 plugin (ur_adapter_handle_t adapter, backend UseBackend)
 
pluginoperator= (const plugin &)=delete
 
 plugin (const plugin &)=delete
 
pluginoperator= (plugin &&other) noexcept=delete
 
 plugin (plugin &&other) noexcept=delete
 
 ~plugin ()=default
 
template<sycl::errc errc = sycl::errc::runtime>
void checkUrResult (ur_result_t ur_result) const
 
std::vector< ur_platform_handle_t > & getUrPlatforms ()
 
ur_adapter_handle_t getUrAdapter ()
 
template<UrApiKind UrApiOffset, typename... ArgsT>
ur_result_t call_nocheck (ArgsT... Args) const
 Calls the UR Api, traces the call, and returns the result. More...
 
template<UrApiKind UrApiOffset, typename... ArgsT>
void call (ArgsT... Args) const
 Calls the API, traces the call, checks the result. More...
 
template<sycl::errc errc, UrApiKind UrApiOffset, typename... ArgsT>
void call (ArgsT... Args) const
 
bool hasBackend (backend Backend) const
 Tells if this plugin can serve specified backend. More...
 
void release ()
 
int getPlatformId (ur_platform_handle_t Platform)
 
int getStartingDeviceId (ur_platform_handle_t Platform)
 
void setLastDeviceId (ur_platform_handle_t Platform, int Id)
 
void adjustLastDeviceId (ur_platform_handle_t Platform)
 
bool containsUrPlatform (ur_platform_handle_t Platform)
 
std::shared_ptr< std::mutex > getPluginMutex ()
 

Public Attributes

bool adapterReleased = false
 

Detailed Description

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

Definition at line 44 of file plugin.hpp.

Constructor & Destructor Documentation

◆ plugin() [1/4]

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

◆ plugin() [2/4]

sycl::_V1::detail::plugin::plugin ( ur_adapter_handle_t  adapter,
backend  UseBackend 
)
inline

Definition at line 48 of file plugin.hpp.

References sycl::_V1::detail::ur::getURLoaderLibrary().

◆ plugin() [3/4]

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

◆ plugin() [4/4]

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

◆ ~plugin()

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

Member Function Documentation

◆ adjustLastDeviceId()

void sycl::_V1::detail::plugin::adjustLastDeviceId ( ur_platform_handle_t  Platform)
inline

Definition at line 195 of file plugin.hpp.

References getPlatformId().

◆ call() [1/2]

template<UrApiKind UrApiOffset, 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 138 of file plugin.hpp.

References checkUrResult().

◆ call() [2/2]

template<sycl::errc errc, UrApiKind UrApiOffset, 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 145 of file plugin.hpp.

◆ call_nocheck()

template<UrApiKind UrApiOffset, typename... ArgsT>
ur_result_t sycl::_V1::detail::plugin::call_nocheck ( ArgsT...  Args) const
inline

Calls the UR Api, traces the call, and returns the result.

Usage:

ur_result_t Err = Plugin->call<UrApiKind::urEntryPoint>(Args);
Plugin->checkUrResult(Err); // Checks Result and throws a runtime_error
// exception.
See also
plugin::checkUrResult

Definition at line 124 of file plugin.hpp.

References adapterReleased.

◆ checkUrResult()

template<sycl::errc errc = sycl::errc::runtime>
void sycl::_V1::detail::plugin::checkUrResult ( ur_result_t  ur_result) const
inline
Exceptions
SYCL2020 exception(errc) if ur_result is not UR_RESULT_SUCCESS

Definition at line 69 of file plugin.hpp.

References __SYCL_UR_ERROR_REPORT, std::clog, sycl::_V1::detail::codeToString(), and sycl::_V1::detail::set_ur_error().

Referenced by call().

◆ containsUrPlatform()

bool sycl::_V1::detail::plugin::containsUrPlatform ( ur_platform_handle_t  Platform)
inline

Definition at line 202 of file plugin.hpp.

◆ getPlatformId()

int sycl::_V1::detail::plugin::getPlatformId ( ur_platform_handle_t  Platform)
inline

Definition at line 163 of file plugin.hpp.

Referenced by adjustLastDeviceId(), getStartingDeviceId(), and setLastDeviceId().

◆ getPluginMutex()

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

Definition at line 207 of file plugin.hpp.

◆ getStartingDeviceId()

int sycl::_V1::detail::plugin::getStartingDeviceId ( ur_platform_handle_t  Platform)
inline

Definition at line 178 of file plugin.hpp.

References getPlatformId().

◆ getUrAdapter()

ur_adapter_handle_t sycl::_V1::detail::plugin::getUrAdapter ( )
inline

Definition at line 111 of file plugin.hpp.

◆ getUrPlatforms()

std::vector<ur_platform_handle_t>& sycl::_V1::detail::plugin::getUrPlatforms ( )
inline

Definition at line 98 of file plugin.hpp.

◆ hasBackend()

bool sycl::_V1::detail::plugin::hasBackend ( backend  Backend) const
inline

Tells if this plugin can serve specified backend.

For example, Unified Runtime plugin will be able to serve multiple backends as determined by the platforms reported by the plugin.

Definition at line 153 of file plugin.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ release()

void sycl::_V1::detail::plugin::release ( )
inline

Definition at line 155 of file plugin.hpp.

References adapterReleased.

◆ setLastDeviceId()

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

Definition at line 187 of file plugin.hpp.

References getPlatformId().

Member Data Documentation

◆ adapterReleased

bool sycl::_V1::detail::plugin::adapterReleased = false

Definition at line 208 of file plugin.hpp.

Referenced by call_nocheck(), and release().


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