Skip to content

Commit

Permalink
[Libomptarget] Fix warnings on address space attributes
Browse files Browse the repository at this point in the history
The device runtime uses the address space attribute to control the
placement of important constants on the GPU. The changes made in D126061
caused these to start emitting errors as they were not applied to the
type. This patch fixes the issues to make the warnings go away.

Reviewed By: ye-luo

Differential Revision: https://reviews.llvm.org/D129896
  • Loading branch information
jhuber6 committed Jul 15, 2022
1 parent 4a40fa8 commit cdea437
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openmp/libomptarget/DeviceRTL/include/Types.h
Expand Up @@ -202,12 +202,12 @@ enum OMPTgtExecModeFlags : int8_t {
// TODO: clang should use address space 5 for omp_thread_mem_alloc, but right
// now that's not the case.
#define THREAD_LOCAL(NAME) \
NAME [[clang::loader_uninitialized, clang::address_space(5)]]
[[clang::address_space(5)]] NAME [[clang::loader_uninitialized]]

// TODO: clang should use address space 4 for omp_const_mem_alloc, maybe it
// does?
#define CONSTANT(NAME) \
NAME [[clang::loader_uninitialized, clang::address_space(4)]]
[[clang::address_space(4)]] NAME [[clang::loader_uninitialized]]

// Attribute to keep alive certain definition for the bitcode library.
#ifdef LIBOMPTARGET_BC_TARGET
Expand Down

0 comments on commit cdea437

Please sign in to comment.