Skip to content

Commit

Permalink
[OpenMP] Only put retain for NVPTX so it can be optimized out for AMD
Browse files Browse the repository at this point in the history
Summary:
This is a hack that only NVPTX needs.
  • Loading branch information
jhuber6 committed Dec 17, 2024
1 parent 7f2fb80 commit b0fbddd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions offload/DeviceRTL/src/Misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,12 @@ void *indirectCallLookup(void *HstPtr) {
/// The openmp client instance used to communicate with the server.
/// FIXME: This is marked as 'retain' so that it is not removed via
/// `-mlink-builtin-bitcode`
#ifdef __NVPTX__
[[gnu::visibility("protected"), gnu::weak,
gnu::retain]] rpc::Client Client asm("__llvm_rpc_client");
#else
[[gnu::visibility("protected"), gnu::weak]] rpc::Client Client asm("__llvm_rpc_client");
#endif

} // namespace impl
} // namespace ompx
Expand Down

0 comments on commit b0fbddd

Please sign in to comment.