Encapsulates a SYCL platform on which kernels may be executed. More...
#include <CL/sycl/platform.hpp>
Public Member Functions | |
platform () | |
Constructs a SYCL platform as a host platform. More... | |
platform (const device_selector &DeviceSelector) | |
Constructs a SYCL platform instance from an OpenCL cl_platform_id. 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<info::platform param> | |
info::param_traits< info::platform, 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... | |
template<backend Backend> | |
backend_return_t< Backend, platform > | get_native () const |
Gets the native handle of the SYCL platform. More... | |
bool | has (aspect Aspect) const |
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... | |
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) |
Encapsulates a SYCL platform on which kernels may be executed.
Definition at line 34 of file platform.hpp.
cl::sycl::platform::platform | ( | ) |
Constructs a SYCL platform as a host platform.
Definition at line 22 of file platform.cpp.
|
explicit |
Constructs a SYCL platform instance from an OpenCL cl_platform_id.
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 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 SYCL device_selector. |
Definition at line 30 of file platform.cpp.
References cl::sycl::device::get_platform(), and cl::sycl::device_selector::select_device().
|
default |
|
default |
context cl::sycl::platform::ext_oneapi_get_default_context | ( | ) | const |
Return this platform's default context.
Definition at line 70 of file platform.cpp.
References get_devices(), cl::sycl::detail::GlobalHandler::getPlatformToDefaultContextCache(), cl::sycl::detail::GlobalHandler::getPlatformToDefaultContextCacheMutex(), cl::sycl::detail::getSyclObjImpl(), cl::sycl::detail::GlobalHandler::instance(), and cl::sycl::detail::tie().
|
noexcept |
Returns the backend associated with this platform.
Definition at line 50 of file platform.cpp.
References cl::sycl::detail::getImplBackend().
Referenced by cl::sycl::detail::enqueue_kernel_launch::handleInvalidWorkGroupSize().
std::vector< device > cl::sycl::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 42 of file platform.cpp.
Referenced by ext_oneapi_get_default_context(), and cl::sycl::detail::platform_impl::get_platforms().
info::param_traits< info::platform, param >::return_type cl::sycl::platform::get_info |
Queries this SYCL platform for info.
The return type depends on information being queried.
Definition at line 54 of file platform.cpp.
Referenced by cl::sycl::detail::get_device_info< bool, info::device::kernel_kernel_pipe_support >::get(), cl::sycl::detail::IsBannedPlatform(), cl::sycl::detail::isDeviceBinaryTypeSupported(), and cl::sycl::ext::intel::platform_selector::operator()().
|
inline |
Gets the native handle of the SYCL platform.
Definition at line 125 of file platform.hpp.
|
static |
Returns all available SYCL platforms in the system.
The resulting vector always contains a single SYCL host platform instance.
Definition at line 46 of file platform.cpp.
References cl::sycl::detail::platform_impl::get_platforms().
Referenced by cl::sycl::device::get_devices().
bool cl::sycl::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 60 of file platform.cpp.
|
inline |
Definition at line 68 of file platform.hpp.
|
inline |
Definition at line 66 of file platform.hpp.
|
friend |