tra added a comment.

I think the root cause of the problem here is that CUDA compilation assumes 
that the GPU-side looks identical to the host side of the compilation. The test 
was intended to verify that and, AFAICT, it did its job flagging the issue here.

AFAICT, __GCC_ATOMIC_LLONG_LOCK_FREE=1 is the correct setting for the GPU.

In this particular case host and GPU do have different capabilities and the 
compiler will see a different subset of preprocessed sources, that's 
unfortunate, but unavoidable, unless we force the host to have value of 1.

Setting _GCC_ATOMIC_LLONG_LOCK_FREE=2 on the GPU side would result in an 
invalid code and we definitely do not want to do that.

I think the right thing to do here is to add `__GCC_ATOMIC_LLONG_LOCK_FREE=` to 
the list of ignored differences in the clang/test/Preprocessor/cuda-types.cu, 
similar to how we handle `LONG_DOUBLE`-related macros there.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127267/new/

https://reviews.llvm.org/D127267

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to