Skip to content

[SYCL] Add namespace alias for cl::sycl namespace#969

Closed
bader wants to merge 1 commit intointel:syclfrom
bader:sycl-namespace-alias
Closed

[SYCL] Add namespace alias for cl::sycl namespace#969
bader wants to merge 1 commit intointel:syclfrom
bader:sycl-namespace-alias

Conversation

@bader
Copy link
Contributor

@bader bader commented Dec 24, 2019

The alias is enabled by default and make using SYCL API a little bit
easier.

Unfortunately it's not compatible with the following valid C++ code:

namespace sycl {
  using namespace cl::sycl;
}

In order to disable namespace alias user should define
__SYCL_DISABLE_NAMESPACE_ALIAS__ macro.

Signed-off-by: Alexey Bader alexey.bader@intel.com

The alias is enabled by default and make using SYCL API a little bit
easier.

Unfortunately it's not compatible with the following valid C++ code:

namespace sycl {
  using namespace cl::sycl;
}

In order to disable namespace alias user should define
__SYCL_DISABLE_NAMESPACE_ALIAS__ macro.

Signed-off-by: Alexey Bader <alexey.bader@intel.com>
@keryell
Copy link
Contributor

keryell commented Dec 26, 2019

This seems dangerous.
If you want to use some alternate namespaces, why not including alternate headers instead of breaking existing code since you decide anyway to change the code to use for example ::sycl instead of cl::sycl::
Look at for example https://github.com/triSYCL/triSYCL/blob/master/tests/sycl_namespace/demo_parallel_matrix_add.cpp

@bader bader deleted the sycl-namespace-alias branch December 28, 2019 11:40
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Feb 23, 2023
Renamed `acc` to `accelerator` and removed from the tests where possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants