From: Artem Belevich Date: Wed, 6 Jun 2018 17:52:55 +0000 (+0000) Subject: [CUDA] Replace 'nv_weak' attributes in CUDA headers with 'weak'. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0511c542a483e4dc6933fbab1e6477be16de2d0;p=clang [CUDA] Replace 'nv_weak' attributes in CUDA headers with 'weak'. Differential Revision: https://reviews.llvm.org/D47804 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334108 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Headers/__clang_cuda_runtime_wrapper.h b/lib/Headers/__clang_cuda_runtime_wrapper.h index ed6cefb295..09705a273a 100644 --- a/lib/Headers/__clang_cuda_runtime_wrapper.h +++ b/lib/Headers/__clang_cuda_runtime_wrapper.h @@ -100,11 +100,17 @@ #include "host_config.h" #include "host_defines.h" +// Temporarily replace "nv_weak" with weak, so __attribute__((nv_weak)) in +// cuda_device_runtime_api.h ends up being __attribute__((weak)) which is the +// functional equivalent of what we need. +#pragma push_macro("nv_weak") +#define nv_weak weak #undef __CUDABE__ #undef __CUDA_LIBDEVICE__ #define __CUDACC__ #include "cuda_runtime.h" +#pragma pop_macro("nv_weak") #undef __CUDACC__ #define __CUDABE__