25 #ifdef __SYCL_INTERNAL_API
36 inline namespace _V1 {
43 template <backend BackendName,
class SyclObjectT>
45 -> backend_return_t<BackendName, SyclObjectT>;
59 using ParamNoRef = std::remove_reference_t<ParamT>;
60 if constexpr (std::is_same_v<ParamNoRef, std::string>) {
62 }
else if constexpr (std::is_same_v<ParamNoRef, std::vector<std::string>>) {
63 std::vector<detail::string> Res;
64 Res.reserve(Info.size());
65 for (std::string &Str : Info) {
70 return std::forward<ParamT>(Info);
75 using ParamNoRef = std::remove_reference_t<ParamT>;
76 if constexpr (std::is_same_v<ParamNoRef, detail::string>) {
78 }
else if constexpr (std::is_same_v<ParamNoRef,
79 std::vector<detail::string>>) {
80 std::vector<std::string> Res;
81 Res.reserve(Info.size());
83 Res.push_back(Str.c_str());
87 return std::forward<ParamT>(Info);
91 namespace ext::oneapi {
93 class filter_selector;
110 #ifdef __SYCL_INTERNAL_API
111 explicit platform(cl_platform_id PlatformId);
122 "use SYCL 2020 device selectors instead.")
129 template <typename DeviceSelector,
132 explicit
platform(const DeviceSelector &deviceSelector)
150 #ifdef __SYCL_INTERNAL_API
151 cl_platform_id
get()
const;
159 "use platform::has() function with aspects APIs instead")
166 "is_host() is deprecated as the host
device is no longer supported.")
167 bool is_host() const;
183 template <typename Param>
184 typename detail::is_platform_info_desc<Param>::return_type get_info()
const {
191 template <
typename Param>
193 get_backend_info()
const;
200 static std::vector<platform> get_platforms();
211 #if defined(__clang__)
212 #pragma clang diagnostic push
213 #pragma clang diagnostic ignored "-Wgcc-compat"
227 #if defined(__clang__)
228 #pragma clang diagnostic pop
234 context ext_oneapi_get_default_context()
const;
236 std::vector<device> ext_oneapi_get_composite_devices()
const;
241 std::shared_ptr<detail::platform_impl> impl;
242 platform(std::shared_ptr<detail::platform_impl> impl) : impl(impl) {}
251 template <backend BackendName,
class SyclObjectT>
252 friend auto get_native(
const SyclObjectT &Obj)
255 template <
typename Param>
258 get_info_impl()
const;
264 template <>
struct hash<
sycl::platform> {
266 return hash<std::shared_ptr<sycl::detail::platform_impl>>()(
The context class represents a SYCL context on which kernel functions may be executed.
The SYCL device class encapsulates a single SYCL device on which kernels may be executed.
#define __SYCL_WARN_IMAGE_ASPECT(aspect)
auto convert_to_abi_neutral(ParamT &&Info)
void enable_ext_oneapi_default_context(bool Val)
Allows to enable/disable "Default Context" extension.
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
auto convert_from_abi_neutral(ParamT &&Info)
T createSyclObjFromImpl(decltype(T::impl) ImplObj)
device select_device(const DSelectorInvocableType &DeviceSelectorInvocable)
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
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
uintptr_t pi_native_handle
_Abi const simd< _Tp, _Abi > & noexcept