30 #include <type_traits>
36 inline namespace _V1 {
39 template <backend BackendName,
class SyclObjectT>
41 -> backend_return_t<BackendName, SyclObjectT>;
49 namespace ext::oneapi {
51 class filter_selector;
73 #ifdef __SYCL_INTERNAL_API
74 explicit device(cl_device_id DeviceId);
82 "use SYCL 2020 device selectors instead.")
89 template <typename DeviceSelector,
92 explicit
device(const DeviceSelector &deviceSelector)
107 void ext_oneapi_enable_peer_access(
const device &peer);
108 void ext_oneapi_disable_peer_access(
const device &peer);
110 ext_oneapi_can_access_peer(
const device &peer,
118 #ifdef __SYCL_INTERNAL_API
119 cl_device_id
get()
const;
135 bool is_accelerator()
const;
159 template <info::partition_property prop>
160 std::vector<device> create_sub_devices(
size_t ComputeUnits)
const;
172 template <info::partition_property prop>
174 create_sub_devices(
const std::vector<size_t> &Counts)
const;
189 template <info::partition_property prop>
203 template <info::partition_property prop>
204 std::vector<device> create_sub_devices()
const;
214 template <
typename Param>
222 template <
typename Param>
224 get_backend_info()
const;
240 static std::vector<device>
252 #if defined(__clang__)
253 #pragma clang diagnostic push
254 #pragma clang diagnostic ignored "-Wgcc-compat"
316 bool ext_oneapi_supports_cl_c_version(
326 const std::string &name,
339 std::string ext_oneapi_cl_profile()
const;
342 #if defined(__clang__)
343 #pragma clang diagnostic pop
347 std::shared_ptr<detail::device_impl> impl;
348 device(std::shared_ptr<detail::device_impl> impl) : impl(impl) {}
350 ur_native_handle_t getNative()
const;
353 friend const decltype(Obj::impl) &
359 template <backend BackendName,
class SyclObjectT>
360 friend auto get_native(
const SyclObjectT &Obj)
363 template <
typename Param>
366 get_info_impl()
const;
370 bool ext_oneapi_supports_cl_extension(
379 template <>
struct hash<
sycl::device> {
381 return hash<std::shared_ptr<sycl::detail::device_impl>>()(
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
bool ext_oneapi_supports_cl_extension(const std::string &name, ext::oneapi::experimental::cl_version *version=nullptr) const
If the device supports kernel bundles using the OpenCL extension identified by name and if version is...
device(device &&rhs)=default
__SYCL2020_DEPRECATED("SYCL 1.2.1 device selectors are deprecated. Please " "use SYCL 2020 device selectors instead.") explicit device(const device_selector &DeviceSelector)
Constructs a SYCL device instance from an OpenCL cl_device_id in accordance with the requirements des...
device & operator=(const device &rhs)=default
device & operator=(device &&rhs)=default
detail::is_device_info_desc< Param >::return_type get_info() const
Queries this SYCL device for information requested by the template parameter param.
bool ext_oneapi_supports_cl_c_feature(const std::string &Feature)
Indicates if the device supports a given feature when compiling the OpenCL C language.
device(const device &rhs)=default
bool operator!=(const device &rhs) const
bool operator==(const device &rhs) const
#define __SYCL_WARN_IMAGE_ASPECT(aspect)
decltype(Obj::impl) const & getSyclObjImpl(const Obj &SyclObject)
auto getDeviceComparisonLambda()
auto convert_from_abi_neutral(ParamT &&Info)
T createSyclObjFromImpl(decltype(T::impl) ImplObj)
typename ABINeutralT< T >::type ABINeutralT_t
std::enable_if_t< std::is_invocable_r_v< int, DeviceSelector &, const device & > &&!std::is_base_of_v< ext::oneapi::filter_selector, DeviceSelector > &&!std::is_base_of_v< device_selector, DeviceSelector > > EnableIfSYCL2020DeviceSelectorInvocable
partition_affinity_domain
bool has_extension(const sycl::platform &SyclPlatform, const std::string &Extension)
signed char __SYCL2020_DEPRECATED
auto get_native(const SyclObjectT &Obj) -> backend_return_t< BackendName, SyclObjectT >
typename backend_traits< Backend >::template return_type< SyclType > backend_return_t
static std::enable_if_t< std::is_invocable_r_v< int, DeviceSelector, const sycl::device & > > select_device(const DeviceSelector &selector=sycl::gpu_selector_v)
_Abi const simd< _Tp, _Abi > & noexcept
size_t operator()(const sycl::device &Device) const