Add HIP_DB=fatbin for debugging fat binary issues
[ROCm/hip commit: 1299b65e15]
This commit is contained in:
@@ -58,6 +58,7 @@ __hipRegisterFatBinary(const void* data)
|
||||
{
|
||||
HIP_INIT();
|
||||
|
||||
tprintf(DB_FB, "Enter __hipRegisterFatBinary(%p)\n", data);
|
||||
const __CudaFatBinaryWrapper* fbwrapper = reinterpret_cast<const __CudaFatBinaryWrapper*>(data);
|
||||
if (fbwrapper->magic != __hipFatMAGIC2 || fbwrapper->version != 1) {
|
||||
return nullptr;
|
||||
@@ -113,6 +114,7 @@ __hipRegisterFatBinary(const void* data)
|
||||
}
|
||||
}
|
||||
|
||||
tprintf(DB_FB, "__hipRegisterFatBinary succeeds and returns %p\n", modules);
|
||||
return modules;
|
||||
}
|
||||
|
||||
|
||||
@@ -1228,7 +1228,7 @@ void HipReadEnv() {
|
||||
|
||||
READ_ENV_C(release, HIP_DB, 0,
|
||||
"Print debug info. Bitmask (HIP_DB=0xff) or flags separated by '+' "
|
||||
"(HIP_DB=api+sync+mem+copy)",
|
||||
"(HIP_DB=api+sync+mem+copy+fatbin)",
|
||||
HIP_DB_callback);
|
||||
if ((HIP_DB & (1 << DB_API)) && (HIP_TRACE_API == 0)) {
|
||||
// Set HIP_TRACE_API default before we read it, so it is printed correctly.
|
||||
|
||||
@@ -223,7 +223,8 @@ extern const char* API_COLOR_END;
|
||||
#define DB_MEM 2 /* 0x04 - trace memory allocation / deallocation */
|
||||
#define DB_COPY 3 /* 0x08 - trace memory copy and peer commands. . */
|
||||
#define DB_WARN 4 /* 0x10 - warn about sub-optimal or shady behavior */
|
||||
#define DB_MAX_FLAG 5
|
||||
#define DB_FB 5 /* 0x20 - trace loading fat binary */
|
||||
#define DB_MAX_FLAG 6
|
||||
// When adding a new debug flag, also add to the char name table below.
|
||||
//
|
||||
//
|
||||
@@ -237,6 +238,7 @@ struct DbName {
|
||||
static const DbName dbName[] = {
|
||||
{KGRN, "api"}, // not used,
|
||||
{KYEL, "sync"}, {KCYN, "mem"}, {KMAG, "copy"}, {KRED, "warn"},
|
||||
{KBLU, "fatbin"},
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user