Skip to content
New issue

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

unconditional use of std::optional breaks portability #239

Open
jeffhammond opened this issue Feb 20, 2019 · 2 comments
Open

unconditional use of std::optional breaks portability #239

jeffhammond opened this issue Feb 20, 2019 · 2 comments

Comments

@jeffhammond
Copy link

I am using Clang 6.0.1 on FreeBSD. This compiler, or rather the STL it uses by default, lacks support for std::optional. The compiler warning correctly suggests I use boost::optional instead.

triSYCL can achieve greater compiler/runtime portability if it uses std::optional when available but falls back on boost::optional when not.

The relatively easy fix would need to be applied to TRISYCL_PROPERTY_CREATE in include/CL/sycl/property_list.hpp. I would paste it here except that I have not figured out how to copy and paste from my FreeBSD VM into my host environment 🤦‍♂️

@keryell
Copy link
Member

keryell commented Feb 21, 2019

According to https://clang.llvm.org/cxx_status.html Clang 6 supports C++17 so I agree it is probably an STL problem.
While I am compassionate about supporting old environments, triSYCL is also a research prototype to investigate modern/future features and provide feedback to Khronos and ISO C++.
The internal branch we have about Xilinx ACAP devices is even more modern. At some point we will open-source it and it won't compile with Clang 6 anyway...
But the fact you are using a FreeBSD VM means to me you are more a virtual user than a real user. ;-)
What about fixing the STL of FreeBSD? That seems like a great contribution. :-)
Good news: Intel has an implementation relying on C++11 only features I think. So you have an open-source alternative that should run on your system: https://github.com/intel/llvm/blob/sycl/sycl/doc/GetStartedWithSYCLCompiler.md

@jeffhammond
Copy link
Author

@keryell I agree with all of this. I just thought it was something easy to fix. While Clang 6 is older, I am using the latest version of FreeBSD (12.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants