Skip to content

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

Closed
@pkeir

Description

@pkeir

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions