[Openmp-dev] OpenMP defines __CUDA_ARCH__ for offloading, should it?

Johannes Doerfert via Openmp-dev openmp-dev at lists.llvm.org
Wed Jul 22 10:17:40 PDT 2020


On 7/22/20 12:15 PM, Hal Finkel via Openmp-dev wrote:
>
> On 7/22/20 11:34 AM, Jon Chesterfield via Openmp-dev wrote:
>> Discovered by accident while looking into a bug for Ron (cc'd).
>>
>> OpenMP running on nvptx defines the __CUDA_ARCH__ macro. Do we think 
>> it should? OpenMP target offloading is somewhat implemented in terms 
>> of cuda but that seems incidental.
>
>
> Shouldn't it do this only when compiling device code for NVIDIA 
> architectures?
>
Yes, I implicitly assumed that given that we only compile for NVIDIA 
right now.

FWIW, I don't assume __CUDA_ARCH__ to be present for non-NVIDIA targets.



>  -Hal
>
>
>>
>> I'd like a __GPU_ARCH__ macro which expands to something useful for 
>> nvptx, amdgcn, other. And to not define CUDA_ARCH when compiling 
>> openmp offloading code.
>>
>> Thoughts?
>>
>> Jon
>>
>> _______________________________________________
>> Openmp-dev mailing list
>> Openmp-dev at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev
>
>
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev


More information about the Openmp-dev mailing list