DPC++ Runtime
Runtime libraries for oneAPI DPC++
|
|
Go to the documentation of this file.
25 detail::pi::cast<detail::RT::PiPlatform>(PlatformId),
26 detail::RT::getPlugin<backend::opencl>());
33 *
this = dev_selector.select_device().get_platform();
39 return impl->has_extension(ExtensionName);
42 bool platform::is_host()
const {
43 bool IsHost = impl->is_host();
45 "platform::is_host should not be called in implementation.");
50 return impl->get_devices(DeviceType);
59 template <
typename Param>
62 return impl->get_info<Param>();
69 #define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, PiCode) \
70 template __SYCL_EXPORT ReturnT platform::get_info<info::platform::Desc>() \
73 #include <sycl/info/platform_traits.def>
74 #undef __SYCL_PARAM_TRAITS_SPEC
78 throw std::runtime_error(
"SYCL default contexts are not enabled");
82 std::unordered_map<detail::PlatformImplPtr, detail::ContextImplPtr>
83 &PlatformToDefaultContextCache =
86 std::lock_guard<std::mutex> Lock{
90 auto It = PlatformToDefaultContextCache.find(impl);
91 if (PlatformToDefaultContextCache.end() == It)
92 std::tie(It, std::ignore) = PlatformToDefaultContextCache.insert(
95 return detail::createSyclObjFromImpl<context>(It->second);
std::mutex & getPlatformToDefaultContextCacheMutex()
bool has_extension(const sycl::platform &SyclPlatform, const std::string &Extension)
#define __SYCL_INLINE_VER_NAMESPACE(X)
static GlobalHandler & instance()
---— Error handling, matching OpenCL plugin semantics.
class __SYCL2020_DEPRECATED("Host device is no longer supported.") host_selector int default_selector_v(const device &dev)
Selects SYCL host device.
constexpr tuple_element< I, tuple< Types... > >::type & get(sycl::detail::tuple< Types... > &Arg) noexcept
std::unordered_map< PlatformImplPtr, ContextImplPtr > & getPlatformToDefaultContextCache()
uintptr_t pi_native_handle
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
The context class represents a SYCL context on which kernel functions may be executed.