================ @@ -188,6 +190,28 @@ void SPIRVTargetCodeGenInfo::setCUDAKernelCallingConvention( } } +LangAS +SPIRVTargetCodeGenInfo::getGlobalVarAddressSpace(CodeGenModule &CGM, + const VarDecl *D) const { + assert(!CGM.getLangOpts().OpenCL && + !(CGM.getLangOpts().CUDA && CGM.getLangOpts().CUDAIsDevice) && + "Address space agnostic languages only"); + // If we're here it means that we're using the SPIRDefIsGen ASMap, hence for + // the global AS we can rely on either cuda_device or sycl_global to be + // correct; however, since this is not a CUDA Device context, we use + // sycl_global to prevent confusion with the assertion. + LangAS DefaultGlobalAS = getLangASFromTargetAS( + CGM.getContext().getTargetAddressSpace(LangAS::sycl_global)); ---------------- asudarsa wrote:
Are there any tests available to check this behavior? Thanks https://github.com/llvm/llvm-project/pull/109415 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits