SWDEV-437702 - implement hipGetProcAddress

This should be used in place of dlsym or GetProcAddress (linux and windows respectively)

Change-Id: I5501b538e03892e8e5a2282678d848fcaf21d911


[ROCm/clr commit: 0479cdb3dd]
This commit is contained in:
jiabaxie
2023-12-15 18:19:58 -05:00
کامیت شده توسط Jiabao Xie
والد fe3c0a3fdc
کامیت b251260e2a
10فایلهای تغییر یافته به همراه238 افزوده شده و 18 حذف شده
@@ -958,4 +958,27 @@ bool PlatformState::CloseUniqueFileHandle(const std::shared_ptr<UniqueFD>& ufd)
}
return true;
}
void* PlatformState::getDynamicLibraryHandle() {
amd::ScopedLock lock(lock_);
if (dynamicLibraryHandle_ != nullptr) {
return dynamicLibraryHandle_;
}
#ifdef _WIN32
const char* libName = "amdhip64.dll";
#else
const char* libName = "libamdhip64.so";
#endif
dynamicLibraryHandle_ = amd::Os::loadLibrary(libName);
return dynamicLibraryHandle_;
}
void PlatformState::setDynamicLibraryHandle(void* handle){
amd::ScopedLock lock(lock_);
dynamicLibraryHandle_ = handle;
}
} //namespace hip