Similarly to NVIDIA and Intel GPUs, we now detect microarchitecture, also with manufacturing process and specific chip name. We infer all of this from the gfx name (in the code we use the term llvm_target), altough it's not clear yet that this method is completely reliable (see comments for more details). In the future we might want to replace that with a better way. Once we have the gfx name, we *should* be able to infer the specific chip, and from the chip we can easily infer the microarchitecture. This commit also includes some refactorings and code improvements on the HSA backend.
35 lines
528 B
C++
35 lines
528 B
C++
#ifndef __COMMON_UARCH__
|
|
#define __COMMON_UARCH__
|
|
|
|
// Data not available
|
|
#define NA -1
|
|
|
|
// Unknown manufacturing process
|
|
#define UNK -1
|
|
|
|
typedef uint32_t GPUCHIP;
|
|
typedef uint32_t MICROARCH;
|
|
|
|
struct uarch {
|
|
// NVIDIA specific
|
|
int32_t cc_major;
|
|
int32_t cc_minor;
|
|
int32_t compute_capability;
|
|
|
|
// HSA specific
|
|
int32_t llvm_target;
|
|
|
|
// Intel specific
|
|
int32_t gt;
|
|
int32_t eu;
|
|
|
|
MICROARCH uarch;
|
|
GPUCHIP chip;
|
|
|
|
int32_t process;
|
|
char* uarch_str;
|
|
char* chip_str;
|
|
};
|
|
|
|
#endif
|