extern "C" void **__hipRegisterFatBinary(const void *Data) {
CHIP_TRY
// Increment before calling potentially exception throwing functions.
CHIPNumRegisteredFatBinaries++;
logDebug("__hipRegisterFatBinary");
// NOTE: CHIP backend initialization is undesired here. This is done
// for avoiding start-up lag and other unexpected issues that
// may come from the backend before a client makes any HIP API
// function call.
// FIXME: There are segfaults that occur sometimes at program exit
// in some cases (e.g. in Unit_hipStreamPerThread_DeviceReset_1 test
// case) and they go away if we have the CHIP runtime initialized
// early. Should find the causes, fix them and then and then remove the
// CHIPInitialize() call.
LOCK(ApiMtx);