<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59543>59543</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            arm64/amdgpu/src/rtl.cpp: use of undeclared identifier 'HSA_AMD_MEMORY_FAULT_PAGE_NOT_PRESENT'
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            openmp,
            build-problem
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sylvestre
      </td>
    </tr>
</table>

<pre>
    This doesn't build on arm64:

```

FAILED: projects/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeFiles/omptarget.rtl.amdgpu.nextgen.dir/src/rtl.cpp.o 
"/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/build-llvm/./bin/clang++" -DDEBUG_PREFIX="\"TARGET AMDGPU RTL\"" -DLITTLEENDIAN_CPU=1 -DOMPT_SUPPORT=1 -DTARGET_NAME=AMDGPU -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iprojects/openmp/libomptarget/plugins-nextgen/amdgpu -I"/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu" -Iinclude -I"/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/llvm/include" -Iprojects/openmp/runtime/src -I"/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/../../plugins/amdgpu/dynamic_hsa" -I"/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/include" -I"/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/utils" -I"/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins/common/elf_common" -I"/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins/common/MemoryManager" -I"/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/common/PluginInterface" -fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -ffile-prefix-map=/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/build-llvm/tools/clang/stage2-bins=build-llvm/tools/clang/stage2-bins -ffile-prefix-map=/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/= -no-canonical-prefixes -Wall -Wcast-qual -Wformat-pedantic -Wimplicit-fallthrough -Wsign-compare -Wno-enum-constexpr-conversion -Wno-extra -Wno-pedantic -std=c++17 -O2 -DNDEBUG -g1 -fPIC -fvisibility=protected  -fno-exceptions -std=c++17 -MD -MT projects/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeFiles/omptarget.rtl.amdgpu.nextgen.dir/src/rtl.cpp.o -MF projects/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeFiles/omptarget.rtl.amdgpu.nextgen.dir/src/rtl.cpp.o.d -o projects/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeFiles/omptarget.rtl.amdgpu.nextgen.dir/src/rtl.cpp.o -c '/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp'
/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:117:8: warning: 'llvm::omp::target::plugin::AMDGPUResourceRef<llvm::omp::target::plugin::AMDGPUSignalTy>' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
struct AMDGPUResourceRef : public GenericDeviceResourceRef {
 ^
/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:864:38: note: in instantiation of template class 'llvm::omp::target::plugin::AMDGPUResourceRef<llvm::omp::target::plugin::AMDGPUSignalTy>' requested here
 SignalManager.returnResource(Slots[Slot].Signal);
 ^
/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:117:8: warning: 'llvm::omp::target::plugin::AMDGPUResourceRef<llvm::omp::target::plugin::AMDGPUStreamTy>' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
struct AMDGPUResourceRef : public GenericDeviceResourceRef {
 ^
/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:1646:36: note: in instantiation of template class 'llvm::omp::target::plugin::AMDGPUResourceRef<llvm::omp::target::plugin::AMDGPUStreamTy>' requested here
      Stream = AMDGPUStreamManager.getResource();
 ^
/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:117:8: warning: 'llvm::omp::target::plugin::AMDGPUResourceRef<llvm::omp::target::plugin::AMDGPUEventTy>' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
struct AMDGPUResourceRef : public GenericDeviceResourceRef {
 ^
/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:1892:33: note: in instantiation of template class 'llvm::omp::target::plugin::AMDGPUResourceRef<llvm::omp::target::plugin::AMDGPUEventTy>' requested here
    *Event = AMDGPUEventManager.getResource();
 ^
/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:2339:23: error: use of undeclared identifier 'HSA_AMD_MEMORY_FAULT_PAGE_NOT_PRESENT'
    if (ReasonsMask & HSA_AMD_MEMORY_FAULT_PAGE_NOT_PRESENT)
 ^
/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:2341:23: error: use of undeclared identifier 'HSA_AMD_MEMORY_FAULT_READ_ONLY'
 if (ReasonsMask & HSA_AMD_MEMORY_FAULT_READ_ONLY)
 ^
/build/llvm-toolchain-snapshot-16~++20221216092829+31f4859c3e4d/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp:2343:23: error: use of undeclared identifier 'HSA_AMD_MEMORY_FAULT_NX'; did you mean 'HSA_AMD_GPU_MEMORY_FAULT_EVENT'?
    if (ReasonsMask & HSA_AMD_MEMORY_FAULT_NX)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWVtv47oR_jX0C0Ejonx98INiWamB-ALHac4-CbQ4ktmlSB2SysZ96G8vKMmJ091TnN3mNFlgg8CSyLlxZr7RUGTWikIBzNDwGg3jHqvdUZuZPclHsM5A76D5abY_Cou5BqsQHTt8qIXkWCvMTDkaoDBCVzG6Ov-Orrr_i8EkWt4uYhRGuDL6H5A5i2iiK1BlhWgixUGXlWOmAIdoUsm6EMoSBU-uAIVowkpeVDWiyXzFPkMiJDT8Z56-cbLf0vQ7pj4XBtHEmgzRxE9nVdXXuLOJUkSTZhVeu3wsidNaZkcmFLGKVfaoHQlG_0L0GtFrekVpQIPR1ZRO6BTR6zDIB5PhNAthwM-CiBeDaNL3A8IbnUmmilYCohSTOF5c39-k290iWf6GwthbMZwjSvfR7maxx9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