17 #include <string_view>
20 inline namespace _V1 {
22 using namespace detail;
55 const std::string &Extension) {
56 if (SyclPlatform.
get_backend() != sycl::backend::opencl) {
59 "has_extension can only be used with an OpenCL backend");
62 std::shared_ptr<sycl::detail::platform_impl> PlatformImpl =
65 const PluginPtr &Plugin = PlatformImpl->getPlugin();
69 size_t ResultSize = 0;
72 nullptr, &ResultSize);
76 std::unique_ptr<char[]> Result(
new char[ResultSize]);
79 ResultSize, Result.get(),
nullptr);
81 std::string_view ExtensionsString(Result.get());
82 return ExtensionsString.find(Extension) != std::string::npos;
86 const std::string &Extension) {
87 if (SyclDevice.
get_backend() != sycl::backend::opencl) {
90 "has_extension can only be used with an OpenCL backend");
93 std::shared_ptr<sycl::detail::device_impl> DeviceImpl =
96 const PluginPtr &Plugin = DeviceImpl->getPlugin();
100 size_t ResultSize = 0;
103 nullptr, &ResultSize);
107 std::unique_ptr<char[]> Result(
new char[ResultSize]);
110 ResultSize, Result.get(),
nullptr);
112 std::string_view ExtensionsString(Result.get());
113 return ExtensionsString.find(Extension) != std::string::npos;
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.
backend get_backend() const noexcept
Returns the backend associated with this device.
Encapsulates a single SYCL queue which schedules kernels on a SYCL device.
context make_context(pi_native_handle NativeHandle, const async_handler &Handler, backend Backend)
void defaultAsyncHandler(exception_list Exceptions)
queue make_queue(pi_native_handle NativeHandle, int32_t nativeHandleDesc, const context &TargetContext, const device *TargetDevice, bool KeepOwnership, const property_list &PropList, const async_handler &Handler, backend Backend)
platform make_platform(pi_native_handle NativeHandle, backend Backend)
decltype(Obj::impl) getSyclObjImpl(const Obj &SyclObject)
device make_device(pi_native_handle NativeHandle, backend Backend)
std::shared_ptr< plugin > PluginPtr
device make_device(pi_native_handle NativeHandle)
platform make_platform(pi_native_handle NativeHandle)
bool has_extension(const sycl::platform &SyclPlatform, const std::string &Extension)
context make_context(pi_native_handle NativeHandle)
queue make_queue(const context &Context, pi_native_handle InteropHandle)
uintptr_t pi_native_handle
@ PI_DEVICE_INFO_EXTENSIONS
@ PI_PLATFORM_INFO_EXTENSIONS
pi_result piDeviceGetInfo(pi_device device, pi_device_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)
Returns requested info for provided native device Return PI_DEVICE_INFO_EXTENSION_DEVICELIB_ASSERT fo...
pi_result piPlatformGetInfo(pi_platform platform, pi_platform_info param_name, size_t param_value_size, void *param_value, size_t *param_value_size_ret)