================ @@ -104,3 +106,14 @@ void fun() { (void) b<double>; (void) var_host_only; } + +extern __global__ void external_func(); +extern void* const external_dep[] = { ---------------- yxsamliu wrote:
It seems nvcc allows non-array type const var to be used in device code but not array type const var https://godbolt.org/z/xjvbjPK77 I don't see why we cannot use array type const var in device code if we are able to emit them on device side. There may be CUDA/HIP code already using this feature. Disabling it may cause regressions. On the other hand, I think disallow extern const var in device code is reasonable, since we do not know how it is initialized. https://github.com/llvm/llvm-project/pull/73549 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits