This is needed to compile some headers in CUDA-11 that assume that threadIdx is
implicitly convertible to dim3. With NVCC, threadIdx is uint3 and there's
dim3(uint3) constructor, so that works. Clang uses a special type for the threadIdx,
so dim3 can't be constructed from it. Instead, this patch adds conversion function to the
builtin variable classes.
Details
- Reviewers
jlebar - Commits
- rG30514f0afa3e: [CUDA] Added conversion functions to builtin vars.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I know it comes in a separate change, but can we add a check to the test-suite?
clang/lib/Headers/__clang_cuda_runtime_wrapper.h | ||
---|---|---|
381 | This is a C++11-ism (right?). Do we support compiling without C++11? |
clang-tidy: error: 'declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for declspec attributes [clang-diagnostic-error]
not useful
clang-tidy: error: use of undeclared identifier '__nvvm_read_ptx_sreg_tid_x' [clang-diagnostic-error]
not useful