This repository has been archived by the owner on Jan 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3322316
commit 7bfd851
Showing
8 changed files
with
91 additions
and
151 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
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,43 @@ | ||
#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_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_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"; | ||
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
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