17 #include <string_view>
22 using namespace detail;
49 ContextImpl->get_async_handler(), backend::opencl);
55 const std::string &Extension) {
56 if (SyclPlatform.get_backend() != sycl::backend::opencl) {
57 throw sycl::exception(
58 errc::backend_mismatch,
59 "has_extension can only be used with an OpenCL backend");
62 std::shared_ptr<sycl::detail::platform_impl> PlatformImpl =
65 const plugin &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) {
88 throw sycl::exception(
89 errc::backend_mismatch,
90 "has_extension can only be used with an OpenCL backend");
93 std::shared_ptr<sycl::detail::device_impl> DeviceImpl =
96 const plugin &Plugin = DeviceImpl->getPlugin();
100 size_t ResultSize = 0;
103 nullptr, &ResultSize);
107 std::unique_ptr<char[]> Result(
new char[ResultSize]);
110 Result.get(),
nullptr);
112 std::string_view ExtensionsString(Result.get());
113 return ExtensionsString.find(Extension) != std::string::npos;