Encapsulates a SYCL platform on which kernels may be executed. More...
#include <sycl/platform.hpp>
Public Member Functions | |
platform () | |
Constructs a SYCL platform using the default device. More... | |
__SYCL2020_DEPRECATED ("SYCL 1.2.1 device selectors are deprecated. Please " "use SYCL 2020 device selectors instead.") explicit platform(const device_selector &DeviceSelector) | |
Constructs a SYCL platform instance from an OpenCL cl_platform_id. More... | |
template<typename DeviceSelector , typename = detail::EnableIfSYCL2020DeviceSelectorInvocable<DeviceSelector>> | |
platform (const DeviceSelector &deviceSelector) | |
Constructs a SYCL platform instance using the platform of the device identified by the device selector provided. More... | |
platform (const platform &rhs)=default | |
platform (platform &&rhs)=default | |
platform & | operator= (const platform &rhs)=default |
platform & | operator= (platform &&rhs)=default |
bool | operator== (const platform &rhs) const |
bool | operator!= (const platform &rhs) const |
std::vector< device > | get_devices (info::device_type DeviceType=info::device_type::all) const |
Returns all SYCL devices associated with this platform. More... | |
template<typename Param > | |
detail::is_platform_info_desc< Param >::return_type | get_info () const |
Queries this SYCL platform for info. More... | |
backend | get_backend () const noexcept |
Returns the backend associated with this platform. More... | |
bool | has (aspect Aspect) const __SYCL_WARN_IMAGE_ASPECT(Aspect) |
Indicates if all of the SYCL devices on this platform have the given feature. More... | |
context | ext_oneapi_get_default_context () const |
Return this platform's default context. More... | |
![]() | |
bool | ext_oneapi_owner_before (const ext::oneapi::detail::weak_object_base< platform > &Other) const noexcept |
Compares the object against a weak object using an owner-based implementation-defined ordering. More... | |
bool | ext_oneapi_owner_before (const platform &Other) const noexcept |
Compares the object against another object using an owner-based implementation-defined ordering. More... | |
Static Public Member Functions | |
static std::vector< platform > | get_platforms () |
Returns all available SYCL platforms in the system. More... | |
Friends | |
template<class T > | |
T | detail::createSyclObjFromImpl (decltype(T::impl) ImplObj) |
template<backend BackendName, class SyclObjectT > | |
auto | get_native (const SyclObjectT &Obj) -> backend_return_t< BackendName, SyclObjectT > |
Encapsulates a SYCL platform on which kernels may be executed.
Definition at line 45 of file platform.hpp.
sycl::_V1::platform::platform | ( | ) |
Constructs a SYCL platform using the default device.
Definition at line 21 of file platform.cpp.
|
inlineexplicit |
Constructs a SYCL platform instance using the platform of the device identified by the device selector provided.
DeviceSelector | is SYCL 2020 Device Selector, a simple callable that takes a device and returns an int |
Definition at line 78 of file platform.hpp.
|
default |
|
default |
sycl::_V1::platform::__SYCL2020_DEPRECATED | ( | "SYCL 1.2.1 device selectors are deprecated. Please " "use SYCL 2020 device selectors instead." | ) | const & |
Constructs a SYCL platform instance from an OpenCL cl_platform_id.
Returns an OpenCL interoperability platform.
The provided OpenCL platform handle is retained on SYCL platform construction.
PlatformId | is an OpenCL cl_platform_id instance. Constructs a SYCL platform instance using a device_selector. |
One of the SYCL devices that is associated with the constructed SYCL platform instance must be the SYCL device that is produced from the provided device selector.
DeviceSelector | is an instance of a SYCL 1.2.1 device_selector |
ExtensionName | is a string containing extension name. |
context sycl::_V1::platform::ext_oneapi_get_default_context | ( | ) | const |
Return this platform's default context.
Definition at line 76 of file platform.cpp.
References get_devices(), sycl::_V1::detail::GlobalHandler::getPlatformToDefaultContextCache(), sycl::_V1::detail::GlobalHandler::getPlatformToDefaultContextCacheMutex(), sycl::_V1::detail::getSyclObjImpl(), sycl::_V1::detail::GlobalHandler::instance(), and sycl::_V1::detail::tie().
|
noexcept |
Returns the backend associated with this platform.
Definition at line 57 of file platform.cpp.
std::vector< device > sycl::_V1::platform::get_devices | ( | info::device_type | DeviceType = info::device_type::all | ) | const |
Returns all SYCL devices associated with this platform.
If this SYCL platform is a host platform, resulting vector contains only a single SYCL host device. If there are no devices that match given device type, resulting vector is empty.
DeviceType | is a SYCL device type. |
Definition at line 49 of file platform.cpp.
Referenced by ext_oneapi_get_default_context(), and sycl::_V1::detail::platform_impl::get_platforms().
detail::is_platform_info_desc< Param >::return_type sycl::_V1::platform::get_info |
Queries this SYCL platform for info.
The return type depends on information being queried.
Definition at line 61 of file platform.cpp.
Referenced by sycl::_V1::detail::get_device_info_impl< bool, info::device::kernel_kernel_pipe_support >::get(), sycl::_V1::detail::IsBannedPlatform(), sycl::_V1::detail::isDeviceBinaryTypeSupported(), and sycl::_V1::ext::intel::detail::selectDeviceByPlatform().
|
static |
Returns all available SYCL platforms in the system.
The resulting vector always contains a single SYCL host platform instance.
Definition at line 53 of file platform.cpp.
References sycl::_V1::detail::platform_impl::get_platforms().
Referenced by sycl::_V1::device::get_devices().
bool sycl::_V1::platform::has | ( | aspect | Aspect | ) | const |
Indicates if all of the SYCL devices on this platform have the given feature.
Aspect | is one of the values in Table 4.20 of the SYCL 2020 Provisional Spec. |
Definition at line 67 of file platform.cpp.
|
inline |
Definition at line 91 of file platform.hpp.
|
inline |
Definition at line 89 of file platform.hpp.
|
friend |
|
friend |
Definition at line 127 of file backend.hpp.