P4 to Git Change 2044310 by cpaquot@cpaquot-ocl-lc-lnx on 2019/12/11 19:20:38
SWDEV-213526 - [hip] OOM issue Clean up a bit from Laurent's comments. Affected files ... ... //depot/stg/opencl/drivers/opencl/api/hip/hip_internal.hpp#50 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_platform.cpp#56 edit
Этот коммит содержится в:
@@ -124,10 +124,10 @@ struct ihipExec_t {
|
||||
};
|
||||
|
||||
class PlatformState {
|
||||
amd::Monitor lock_;
|
||||
amd::Monitor lock_{"Guards global function map"};
|
||||
|
||||
std::unordered_map<const void*, std::vector<std::pair<hipModule_t, bool>>> modules_;
|
||||
bool initialized_;
|
||||
bool initialized_{false};
|
||||
|
||||
void digestFatBinary(const void* data, std::vector<std::pair<hipModule_t, bool>>& programs);
|
||||
public:
|
||||
@@ -181,7 +181,7 @@ private:
|
||||
|
||||
static PlatformState* platform_;
|
||||
|
||||
PlatformState() : lock_("Guards global function map"), initialized_(false) {}
|
||||
PlatformState() {}
|
||||
~PlatformState() {}
|
||||
public:
|
||||
static PlatformState& instance() {
|
||||
|
||||
@@ -137,6 +137,10 @@ extern "C" std::vector<std::pair<hipModule_t, bool>>* __hipRegisterFatBinary(con
|
||||
|
||||
void PlatformState::digestFatBinary(const void* data, std::vector<std::pair<hipModule_t, bool>>& programs)
|
||||
{
|
||||
if (programs.size() > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<std::pair<const void*, size_t>> code_objs;
|
||||
std::vector<const char*> devices;
|
||||
for (size_t dev = 0; dev < g_devices.size(); ++dev) {
|
||||
@@ -164,6 +168,8 @@ void PlatformState::digestFatBinary(const void* data, std::vector<std::pair<hipM
|
||||
|
||||
void PlatformState::init()
|
||||
{
|
||||
amd::ScopedLock lock(lock_);
|
||||
|
||||
if(initialized_ || g_devices.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user