oneapi-src / oneDPL

oneAPI DPC++ Library (oneDPL) https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/dpc-library.html
Apache License 2.0
720 stars 114 forks source link

Resolve compilation errors with sycl::queue default device selection for older icpx compilers #1734

Closed mmichel11 closed 1 month ago

mmichel11 commented 1 month ago

Currently, we create our default sycl::queue through providing sycl::default_selector_v to its constructor. Despite being apart of SYCL2020, this is problematic for some older compilers we still support and test with where this feature has not been implemented (e.g. icpx 2022.3):

error: no type named 'default_selector_v' in namespace 'sycl'; did you mean 'default_selector'?
    static sycl::queue __q(sycl::default_selector_v);

The default constructor of sycl::queue guarantees that the default device will be selected, so relying on this resolves our issue.

dmitriy-sobolev commented 1 month ago

I see that Sergey has just left comments. It might be safer to address them than to merge it as is, but I have no strong opinion here.