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

[SYCL] Using an aliased type as the type of a non-type template parameter used naming a SYCL kernel #130

Closed
pkeir opened this issue May 10, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@pkeir
Copy link
Contributor

pkeir commented May 10, 2019

Using a typedef'd type as a non-type template parameter (to name a kernel) produces a compilation error. The error indicates that two declarations are seen - with the second using int rather than the alias name (here sz_t). The code below produces the error.

#include <CL/sycl.hpp>

using sz_t = unsigned long;

namespace kernels {
  template <sz_t> class K;  // Could be size_t         
}

int main(int argc, char *argv[])
{
  using namespace cl::sycl;
  queue q;

  q.submit([&](handler &cgh) {
    cgh.parallel_for<kernels::K<0>>(range<1>{64}, [=](id<1> ix) {
      ix[0];
    });
  });

  return 0;
}
@pkeir pkeir changed the title Using an aliased type as the type of a non-type template parameter [SYCL] Using an aliased type as the type of a non-type template parameter used naming a SYCL kernel May 31, 2019
@bader bader added the bug Something isn't working label May 31, 2019
@j-stephan
Copy link
Contributor

I believe this bug is related: triSYCL/sycl#64. Note that this also extends to compiler-defined types (such as _Bool).

@keryell
Copy link
Contributor

keryell commented Aug 1, 2019

We should add such an example in the SYCL CTS...

@bader
Copy link
Contributor

bader commented Aug 27, 2019

Should be fixed by #535.
@pkeir, could you confirm that the problem is fixed, please?

@pkeir
Copy link
Contributor Author

pkeir commented Aug 27, 2019

Nice work guys, that's fixed it for me.

@bader bader closed this as completed Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants