2
0

P4 to Git Change 1550486 by cpaquot@cpaquot-ocl-lc-lnx on 2018/05/04 14:00:33

SWDEV-145570 - [HIP] Fix multithread init
	Make the g_ihipInitialized variable per thread
	And make sure to assign a default g_context

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_context.cpp#10 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_internal.hpp#9 edit
Este cometimento está contido em:
foreman
2018-05-04 14:13:13 -04:00
ascendente 0508a4ed37
cometimento 9129aa17f6
2 ficheiros modificados com 11 adições e 9 eliminações
+1 -2
Ver ficheiro
@@ -28,12 +28,12 @@ THE SOFTWARE.
#include <thread>
std::vector<amd::Context*> g_devices;
std::once_flag g_ihipInitialized;
namespace hip {
thread_local amd::Context* g_context = nullptr;
thread_local std::stack<amd::Context*> g_ctxtStack;
std::once_flag g_ihipInitialized;
std::map<amd::Context*,amd::HostQueue*> g_nullStreams;
@@ -53,7 +53,6 @@ void init() {
context->release();
} else {
g_devices.push_back(context);
g_context = context;
}
}
}