From 896abd6d89aae19832ee016d483334a250e26cbe Mon Sep 17 00:00:00 2001
From: foreman
Date: Tue, 7 Apr 2015 12:03:48 -0400
Subject: [PATCH] P4 to Git Change 1138047 by gandryey@gera-w8 on 2015/04/07
11:38:28
ECR #304775 - Some code clean-up
- Remove amd::Context reference from the event object. Runtime can use queue to get the context for the limited number of use cases
- User/GL events will keep the context as a member
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_event.cpp#8 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#69 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.hpp#75 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#120 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#91 edit
[ROCm/clr commit: 0fd491cbb453b2890262ba841fdecf442dc88d5f]
---
projects/clr/opencl/api/opencl/amdocl/cl_event.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/projects/clr/opencl/api/opencl/amdocl/cl_event.cpp b/projects/clr/opencl/api/opencl/amdocl/cl_event.cpp
index 542ffc450e..fb5037bf35 100644
--- a/projects/clr/opencl/api/opencl/amdocl/cl_event.cpp
+++ b/projects/clr/opencl/api/opencl/amdocl/cl_event.cpp
@@ -81,7 +81,7 @@ RUNTIME_ENTRY(cl_int, clWaitForEvents, (
}
// Make sure all the events are associated with the same context
- amd::Context* context = &as_amd(event)->context();
+ const amd::Context* context = &as_amd(event)->context();
if (prevContext != NULL && prevContext != context) {
return CL_INVALID_CONTEXT;
}
@@ -147,7 +147,8 @@ RUNTIME_ENTRY(cl_int, clGetEventInfo, (
switch(param_name) {
case CL_EVENT_CONTEXT: {
- cl_context context = as_cl(&as_amd(event)->context());
+ amd::Context& amdCtx = const_cast(as_amd(event)->context());
+ cl_context context = as_cl(&amdCtx);
return amd::clGetInfo(
context, param_value_size, param_value, param_value_size_ret);
}