SWDEV-437702 - implement hipGetProcAddress
This should be used in place of dlsym or GetProcAddress (linux and windows respectively) Change-Id: I5501b538e03892e8e5a2282678d848fcaf21d911
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user