Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libomptarget][amdgpu] Improve diagnostics on arch mismatch
- Loading branch information
1 parent
e6a1187
commit cab9f69
Showing
4 changed files
with
120 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
openmp/libomptarget/plugins/amdgpu/impl/get_elf_mach_gfx_name.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include "get_elf_mach_gfx_name.h" | ||
|
||
// This header conflicts with the system elf.h (macros vs enums of the same | ||
// identifier) and contains more up to date values for the enum checked here. | ||
// rtl.cpp uses the system elf.h. | ||
#include "llvm/BinaryFormat/ELF.h" | ||
|
||
const char *get_elf_mach_gfx_name(uint32_t EFlags) { | ||
using namespace llvm::ELF; | ||
uint32_t Gfx = (EFlags & EF_AMDGPU_MACH); | ||
switch (Gfx) { | ||
case EF_AMDGPU_MACH_AMDGCN_GFX801: | ||
return "gfx801"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX802: | ||
return "gfx802"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX803: | ||
return "gfx803"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX805: | ||
return "gfx805"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX810: | ||
return "gfx810"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX900: | ||
return "gfx900"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX902: | ||
return "gfx902"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX904: | ||
return "gfx904"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX906: | ||
return "gfx906"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX908: | ||
return "gfx908"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX909: | ||
return "gfx909"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX90C: | ||
return "gfx90c"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX1010: | ||
return "gfx1010"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX1011: | ||
return "gfx1011"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX1012: | ||
return "gfx1012"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX1030: | ||
return "gfx1030"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX1031: | ||
return "gfx1031"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX1032: | ||
return "gfx1032"; | ||
case EF_AMDGPU_MACH_AMDGCN_GFX1033: | ||
return "gfx1033"; | ||
default: | ||
return "--unknown gfx"; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
openmp/libomptarget/plugins/amdgpu/impl/get_elf_mach_gfx_name.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef GET_ELF_MACH_GFX_NAME_H_INCLUDED | ||
#define GET_ELF_MACH_GFX_NAME_H_INCLUDED | ||
|
||
#include <stdint.h> | ||
|
||
const char *get_elf_mach_gfx_name(uint32_t EFlags); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters