#include <detail/device_impl.hpp>
Public Member Functions | |
device_impl () | |
Constructs a SYCL device instance as a host device. More... | |
device_impl (ur_native_handle_t, const PluginPtr &Plugin) | |
Constructs a SYCL device instance using the provided raw device handle. More... | |
device_impl (ur_device_handle_t Device, PlatformImplPtr Platform) | |
Constructs a SYCL device instance using the provided UR device instance. More... | |
device_impl (ur_device_handle_t Device, const PluginPtr &Plugin) | |
Constructs a SYCL device instance using the provided UR device instance. More... | |
~device_impl () | |
cl_device_id | get () const |
Get instance of OpenCL device. More... | |
ur_device_handle_t & | getHandleRef () |
Get reference to UR device. More... | |
const ur_device_handle_t & | getHandleRef () const |
Get constant reference to UR device. More... | |
bool | is_cpu () const |
Check if device is a CPU device. More... | |
bool | is_gpu () const |
Check if device is a GPU device. More... | |
bool | is_accelerator () const |
Check if device is an accelerator device. More... | |
ur_device_type_t | get_device_type () const |
Return device type. More... | |
platform | get_platform () const |
Get associated SYCL platform. More... | |
const PluginPtr & | getPlugin () const |
bool | has_extension (const std::string &ExtensionName) const |
Check SYCL extension support by device. More... | |
std::vector< device > | create_sub_devices (const ur_device_partition_properties_t *Properties, size_t SubDevicesCount) const |
std::vector< device > | create_sub_devices (size_t ComputeUnits) const |
Partition device into sub devices. More... | |
std::vector< device > | create_sub_devices (const std::vector< size_t > &Counts) const |
Partition device into sub devices. More... | |
std::vector< device > | create_sub_devices (info::partition_affinity_domain AffinityDomain) const |
Partition device into sub devices. More... | |
std::vector< device > | create_sub_devices () const |
Partition device into sub devices. More... | |
bool | is_partition_supported (info::partition_property Prop) const |
Check if desired partition property supported by device. More... | |
template<typename Param > | |
Param::return_type | get_info () const |
Queries this SYCL device for information requested by the template parameter param. More... | |
template<typename Param > | |
Param::return_type | get_backend_info () const |
Queries SYCL queue for SYCL backend-specific information. More... | |
bool | is_affinity_supported (info::partition_affinity_domain AffinityDomain) const |
Check if affinity partitioning by specified domain is supported by device. More... | |
ur_native_handle_t | getNative () const |
Gets the native handle of the SYCL device. More... | |
bool | has (aspect Aspect) const |
Indicates if the SYCL device has the given feature. More... | |
bool | isAssertFailSupported () const |
bool | isRootDevice () const |
std::string | getDeviceName () const |
bool | extOneapiArchitectureIs (ext::oneapi::experimental::architecture Arch) const |
bool | extOneapiArchitectureIs (ext::oneapi::experimental::arch_category Category) const |
bool | extOneapiCanCompile (ext::oneapi::experimental::source_language Language) |
sycl::ext::oneapi::experimental::forward_progress_guarantee | getProgressGuarantee (ext::oneapi::experimental::execution_scope threadScope, ext::oneapi::experimental::execution_scope coordinationScope) const |
bool | supportsForwardProgress (ext::oneapi::experimental::forward_progress_guarantee guarantee, ext::oneapi::experimental::execution_scope threadScope, ext::oneapi::experimental::execution_scope coordinationScope) const |
ext::oneapi::experimental::forward_progress_guarantee | getImmediateProgressGuarantee (ext::oneapi::experimental::execution_scope coordination_scope) const |
uint64_t | getCurrentDeviceTime () |
Gets the current device timestamp. More... | |
bool | isGetDeviceAndHostTimerSupported () |
Check clGetDeviceAndHostTimer is available for fallback profiling. More... | |
backend | getBackend () const |
Get the backend of this device. More... | |
PlatformImplPtr | getPlatformImpl () const |
Get the platform impl serving this device. More... | |
std::string | get_device_info_string (ur_device_info_t InfoCode) const |
Get device info string. More... | |
ext::oneapi::experimental::architecture | getDeviceArch () const |
Get device architecture. More... | |
Static Public Member Functions | |
template<typename ReturnT > | |
static ReturnT | getProgressGuaranteesUpTo (ext::oneapi::experimental::forward_progress_guarantee guarantee) |
static sycl::ext::oneapi::experimental::forward_progress_guarantee | getHostProgressGuarantee (sycl::ext::oneapi::experimental::execution_scope threadScope, sycl::ext::oneapi::experimental::execution_scope coordinationScope) |
Definition at line 36 of file device_impl.hpp.
sycl::_V1::detail::device_impl::device_impl | ( | ) |
Constructs a SYCL device instance as a host device.
|
explicit |
Constructs a SYCL device instance using the provided raw device handle.
Definition at line 21 of file device_impl.cpp.
|
explicit |
Constructs a SYCL device instance using the provided UR device instance.
Definition at line 27 of file device_impl.cpp.
|
explicit |
Constructs a SYCL device instance using the provided UR device instance.
Definition at line 32 of file device_impl.cpp.
sycl::_V1::detail::device_impl::~device_impl | ( | ) |
Definition at line 78 of file device_impl.cpp.
References __SYCL_CHECK_OCL_CODE_NO_EXC, and getPlugin().
std::vector< device > sycl::_V1::detail::device_impl::create_sub_devices | ( | ) | const |
Partition device into sub devices.
If this SYCL device does not support info::partition_property::ext_intel_partition_by_cslice a feature_not_supported exception must be thrown.
Definition at line 308 of file device_impl.cpp.
References sycl::_V1::info::ext_intel_partition_by_cslice, sycl::_V1::feature_not_supported, getPlugin(), is_partition_supported(), and sycl::_V1::make_error_code().
Referenced by create_sub_devices().
std::vector< device > sycl::_V1::detail::device_impl::create_sub_devices | ( | const std::vector< size_t > & | Counts | ) | const |
Partition device into sub devices.
If this SYCL device does not support info::partition_property::partition_by_counts a feature_not_supported exception must be thrown.
Counts | is a std::vector of desired compute units in sub devices. |
Definition at line 231 of file device_impl.cpp.
References create_sub_devices(), sycl::_V1::feature_not_supported, sycl::_V1::invalid, is_partition_supported(), sycl::_V1::make_error_code(), and sycl::_V1::info::partition_by_counts.
std::vector< device > sycl::_V1::detail::device_impl::create_sub_devices | ( | const ur_device_partition_properties_t * | Properties, |
size_t | SubDevicesCount | ||
) | const |
Definition at line 175 of file device_impl.cpp.
References sycl::_V1::detail::for_each(), getPlugin(), and sycl::_V1::invalid.
std::vector< device > sycl::_V1::detail::device_impl::create_sub_devices | ( | info::partition_affinity_domain | AffinityDomain | ) | const |
Partition device into sub devices.
If this SYCL device does not support info::partition_property::partition_by_affinity_domain or the SYCL device does not support info::affinity_domain provided a feature_not_supported exception must be thrown.
AffinityDomain | is one of the values described in Table 4.20 of SYCL Spec |
Definition at line 275 of file device_impl.cpp.
References sycl::_V1::detail::affinityDomainToString(), create_sub_devices(), sycl::_V1::feature_not_supported, getPlugin(), is_affinity_supported(), is_partition_supported(), sycl::_V1::make_error_code(), and sycl::_V1::info::partition_by_affinity_domain.
std::vector< device > sycl::_V1::detail::device_impl::create_sub_devices | ( | size_t | ComputeUnits | ) | const |
Partition device into sub devices.
If this SYCL device does not support info::partition_property::partition_equally a feature_not_supported exception must be thrown.
ComputeUnits | is a desired count of compute units in each sub device. |
Definition at line 203 of file device_impl.cpp.
References create_sub_devices(), sycl::_V1::feature_not_supported, sycl::_V1::invalid, is_partition_supported(), sycl::_V1::make_error_code(), and sycl::_V1::info::partition_equally.
|
inline |
Definition at line 223 of file device_impl.hpp.
References sycl::_V1::detail::get_category_max_architecture(), sycl::_V1::detail::get_category_min_architecture(), and getDeviceArch().
|
inline |
Definition at line 219 of file device_impl.hpp.
References getDeviceArch().
bool sycl::_V1::detail::device_impl::extOneapiCanCompile | ( | ext::oneapi::experimental::source_language | Language | ) |
Definition at line 868 of file device_impl.cpp.
References getBackend(), and sycl::_V1::ext::oneapi::experimental::detail::is_source_kernel_bundle_supported().
cl_device_id sycl::_V1::detail::device_impl::get | ( | ) | const |
Get instance of OpenCL device.
Definition at line 92 of file device_impl.cpp.
References getNative(), and getPlugin().
Referenced by has().
Param::return_type sycl::_V1::detail::device_impl::get_backend_info | ( | ) | const |
Queries SYCL queue for SYCL backend-specific information.
The return type depends on information being queried.
|
inline |
Get device info string.
Definition at line 170 of file device_info.hpp.
References getHandleRef(), and getPlugin().
Referenced by has_extension().
|
inline |
Param::return_type sycl::_V1::detail::device_impl::get_info |
Queries this SYCL device for information requested by the template parameter param.
Specializations of info::param_traits must be defined in accordance with the info parameters in Table 4.20 of SYCL Spec to facilitate returning the type associated with the param parameter.
Definition at line 103 of file device_impl.cpp.
Referenced by sycl::_V1::detail::enqueue_kernel_launch::handleInvalidWorkGroupSize(), sycl::_V1::detail::enqueue_kernel_launch::handleOutOfResources(), and has().
platform sycl::_V1::detail::device_impl::get_platform | ( | ) | const |
Get associated SYCL platform.
If this SYCL device is an OpenCL device then the SYCL platform must encapsulate the OpenCL cl_plaform_id associated with the underlying OpenCL cl_device_id of this SYCL device. If this SYCL device is a host device then the SYCL platform must be a host platform. The value returned must be equal to that returned by get_info<info::device::platform>().
Definition at line 98 of file device_impl.cpp.
Referenced by sycl::_V1::detail::enqueue_kernel_launch::handleInvalidWorkGroupSize(), and sycl::_V1::detail::enqueue_kernel_launch::handleOutOfResources().
|
inline |
Get the backend of this device.
Definition at line 284 of file device_impl.hpp.
Referenced by extOneapiCanCompile(), getImmediateProgressGuarantee(), getNative(), and has().
uint64_t sycl::_V1::detail::device_impl::getCurrentDeviceTime | ( | ) |
Gets the current device timestamp.
sycl::feature_not_supported | if feature is not supported on device |
Definition at line 809 of file device_impl.cpp.
References sycl::_V1::feature_not_supported, getPlugin(), sycl::_V1::make_error_code(), and sycl::_V1::detail::set_ur_error().
ext::oneapi::experimental::architecture sycl::_V1::detail::device_impl::getDeviceArch | ( | ) | const |
Get device architecture.
Definition at line 789 of file device_impl.cpp.
Referenced by extOneapiArchitectureIs().
std::string sycl::_V1::detail::device_impl::getDeviceName | ( | ) | const |
Definition at line 782 of file device_impl.cpp.
|
inline |
Get reference to UR device.
For host device an exception is thrown
Definition at line 65 of file device_impl.hpp.
Referenced by sycl::_V1::detail::adjustNDRangePerKernel(), sycl::_V1::detail::usm::alignedAllocInternal(), get_device_info_string(), getNative(), sycl::_V1::detail::enqueue_kernel_launch::handleInvalidValue(), sycl::_V1::detail::enqueue_kernel_launch::handleInvalidWorkGroupSize(), sycl::_V1::detail::enqueue_kernel_launch::handleInvalidWorkItemSize(), and has().
|
inline |
Get constant reference to UR device.
For host device an exception is thrown
Definition at line 72 of file device_impl.hpp.
|
static |
Definition at line 882 of file device_impl.cpp.
ext::oneapi::experimental::forward_progress_guarantee sycl::_V1::detail::device_impl::getImmediateProgressGuarantee | ( | ext::oneapi::experimental::execution_scope | coordination_scope | ) | const |
Definition at line 935 of file device_impl.cpp.
References sycl::_V1::ext_oneapi_level_zero, getBackend(), is_cpu(), is_gpu(), and sycl::_V1::opencl.
Referenced by getProgressGuarantee().
ur_native_handle_t sycl::_V1::detail::device_impl::getNative | ( | ) | const |
Gets the native handle of the SYCL device.
Definition at line 333 of file device_impl.cpp.
References getBackend(), getHandleRef(), getPlugin(), and sycl::_V1::opencl.
Referenced by get().
|
inline |
Get the platform impl serving this device.
Definition at line 288 of file device_impl.hpp.
|
inline |
Definition at line 107 of file device_impl.hpp.
Referenced by sycl::_V1::detail::adjustNDRangePerKernel(), create_sub_devices(), get(), get_device_info_string(), getCurrentDeviceTime(), getNative(), sycl::_V1::detail::enqueue_kernel_launch::handleErrorOrWarning(), sycl::_V1::detail::enqueue_kernel_launch::handleInvalidValue(), sycl::_V1::detail::enqueue_kernel_launch::handleInvalidWorkGroupSize(), sycl::_V1::detail::enqueue_kernel_launch::handleInvalidWorkItemSize(), sycl::_V1::detail::enqueue_kernel_launch::handleOutOfResources(), has(), isGetDeviceAndHostTimerSupported(), and ~device_impl().
sycl::ext::oneapi::experimental::forward_progress_guarantee sycl::_V1::detail::device_impl::getProgressGuarantee | ( | ext::oneapi::experimental::execution_scope | threadScope, |
ext::oneapi::experimental::execution_scope | coordinationScope | ||
) | const |
Definition at line 893 of file device_impl.cpp.
References getImmediateProgressGuarantee().
Referenced by supportsForwardProgress().
|
inlinestatic |
Definition at line 241 of file device_impl.hpp.
bool sycl::_V1::detail::device_impl::has | ( | aspect | Aspect | ) | const |
Indicates if the SYCL device has the given feature.
Aspect | is one of the values in Table 4.20 of the SYCL 2020 Provisional Spec. |
Definition at line 342 of file device_impl.cpp.
References any_of(), sycl::_V1::ext_oneapi_cuda, sycl::_V1::ext_oneapi_level_zero, get(), get_info(), getBackend(), getHandleRef(), getPlugin(), has_extension(), is_accelerator(), is_cpu(), is_gpu(), isAssertFailSupported(), and sycl::_V1::opencl.
Referenced by sycl::_V1::detail::usm::alignedAllocInternal().
bool sycl::_V1::detail::device_impl::has_extension | ( | const std::string & | ExtensionName | ) | const |
Check SYCL extension support by device.
ExtensionName | is a name of queried extension. |
Definition at line 163 of file device_impl.cpp.
References get_device_info_string().
Referenced by sycl::_V1::detail::usm::alignedAllocInternal(), and has().
|
inline |
Check if device is an accelerator device.
Definition at line 87 of file device_impl.hpp.
Referenced by has().
bool sycl::_V1::detail::device_impl::is_affinity_supported | ( | info::partition_affinity_domain | AffinityDomain | ) | const |
Check if affinity partitioning by specified domain is supported by device.
AffinityDomain | is one of the values described in Table 4.20 of SYCL Spec |
Definition at line 85 of file device_impl.cpp.
Referenced by create_sub_devices().
|
inline |
Check if device is a CPU device.
Definition at line 77 of file device_impl.hpp.
Referenced by getImmediateProgressGuarantee(), and has().
|
inline |
Check if device is a GPU device.
Definition at line 82 of file device_impl.hpp.
Referenced by getImmediateProgressGuarantee(), and has().
bool sycl::_V1::detail::device_impl::is_partition_supported | ( | info::partition_property | Prop | ) | const |
Check if desired partition property supported by device.
Prop | is one of info::partition_property::(partition_equally, partition_by_counts, partition_by_affinity_domain) |
Definition at line 169 of file device_impl.cpp.
Referenced by create_sub_devices().
bool sycl::_V1::detail::device_impl::isAssertFailSupported | ( | ) | const |
Definition at line 778 of file device_impl.cpp.
Referenced by has().
bool sycl::_V1::detail::device_impl::isGetDeviceAndHostTimerSupported | ( | ) |
Check clGetDeviceAndHostTimer is available for fallback profiling.
Definition at line 860 of file device_impl.cpp.
References getPlugin().
|
inline |
Definition at line 214 of file device_impl.hpp.
bool sycl::_V1::detail::device_impl::supportsForwardProgress | ( | ext::oneapi::experimental::forward_progress_guarantee | guarantee, |
ext::oneapi::experimental::execution_scope | threadScope, | ||
ext::oneapi::experimental::execution_scope | coordinationScope | ||
) | const |
Definition at line 917 of file device_impl.cpp.
References getProgressGuarantee().