Skip to content

Commit

Permalink
[CUDA] Replace 'nv_weak' attributes in CUDA headers with 'weak'.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D47804

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334108 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Artem-B committed Jun 6, 2018
1 parent 29aed50 commit c0511c5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Headers/__clang_cuda_runtime_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__

Expand Down

0 comments on commit c0511c5

Please sign in to comment.