[PATCH] D45061: [NVPTX, CUDA] Use custom feature detection to handle NVPTX target builtins.
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 30 09:29:21 PDT 2018
tra added inline comments.
================
Comment at: clang/include/clang/Basic/Cuda.h:55
+static inline const std::vector<CudaArch> CudaKnownArchList() {
+ return {CudaArch::SM_20, CudaArch::SM_21, CudaArch::SM_30, CudaArch::SM_32,
----------------
jlebar wrote:
> Why 'static'?
Old habits. Just 'inline' should do.
================
Comment at: clang/include/clang/Basic/Cuda.h:59
+ CudaArch::SM_53, CudaArch::SM_60, CudaArch::SM_61, CudaArch::SM_62,
+ CudaArch::SM_70, CudaArch::SM_72};
+}
----------------
jlebar wrote:
> Could we instead rely on the fact that the CudaArch enum is dense and goes from UNKNOWN to LAST? One less bug to make...
Actually this function is not needed. It's a leftover from an old iteration of the code. I'll remove it.
As for why array -- that's what I wanted to do. Turns out that iterating over enums is a pain. I can't increment/decrement it and had to cast to an int for that. And then back, in order to use it.
https://reviews.llvm.org/D45061
More information about the cfe-commits
mailing list