We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// a.cpp #include <CL/sycl.hpp> #include <iostream> int main(void) { sycl::device d; try { sycl::device pd = d.get_info<sycl::info::device::parent_device>(); } catch (const sycl::runtime_error &re) { std::cerr << "No parent" << std::endl; } return 0; }
Compiling this with clang++ -fsycl a.cpp generates lots of SYCL_2020 deprecation warnings.
clang++ -fsycl a.cpp
A way to change this code to conform to SYCL 2020 spec is as follows:
// a_sycl2020_conformant.cpp #include <CL/sycl.hpp> #include <iostream> int main(void) { sycl::device d; try { sycl::device pd = d.get_info<sycl::info::device::parent_device>(); } catch (const sycl::exception &e) { if (e.category() == sycl::sycl_category() && e.code() == sycl::errc::runtime) { std::cerr << "No parent" << std::endl; } else { std::cerr << "Unknown exception occurred: " << ex.what() << std::endl; std::terminate(); } } return 0; }
The text was updated successfully, but these errors were encountered:
This is consistent with example code snippet from SYCL-2020 spec repo, https://github.com/KhronosGroup/SYCL-Docs/blob/SYCL-2020/master/adoc/code/handlingException.cpp
Sorry, something went wrong.
libsyclinterface
This is done via #683
diptorupd
No branches or pull requests
Compiling this with
clang++ -fsycl a.cpp
generates lots of SYCL_2020 deprecation warnings.A way to change this code to conform to SYCL 2020 spec is as follows:
The text was updated successfully, but these errors were encountered: