P4 to Git Change 1620765 by skudchad@skudchad_test2_win_opencl on 2018/10/17 16:58:04

SWDEV-145570 - [HIP] Track last used event and use last enqueued command in a stream rather than creating a new event

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/15996/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_context.cpp#15 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_event.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_stream.cpp#14 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#90 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.cpp#28 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.hpp#20 edit
Цей коміт міститься в:
foreman
2018-10-18 13:41:32 -04:00
джерело 0a8d4ee78d
коміт 133447a412
3 змінених файлів з 13 додано та 5 видалено
+5 -1
Переглянути файл
@@ -69,7 +69,8 @@ amd::HostQueue* getNullStream() {
auto stream = g_nullStreams.find(getCurrentContext());
if (stream == g_nullStreams.end()) {
amd::Device* device = getCurrentContext()->devices()[0];
amd::HostQueue* queue = new amd::HostQueue(*hip::getCurrentContext(), *device, 0,
cl_command_queue_properties properties = CL_QUEUE_PROFILING_ENABLE;
amd::HostQueue* queue = new amd::HostQueue(*hip::getCurrentContext(), *device, properties,
amd::CommandQueue::RealTimeDisabled,
amd::CommandQueue::Priority::Normal);
g_nullStreams[getCurrentContext()] = queue;
@@ -159,6 +160,9 @@ hipError_t hipCtxDestroy(hipCtx_t ctx) {
HIP_RETURN(hipErrorInvalidValue);
}
// Release last tracked command
hip::getNullStream()->setLastQueuedCommand(nullptr);
// Need to remove the ctx of calling thread if its the top one
if (!g_ctxtStack.empty() && g_ctxtStack.top() == amdContext) {
g_ctxtStack.pop();