From 831233a8d299776ce802878d64a5cb266a9dc557 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Tue, 28 Apr 2020 10:52:20 +0200 Subject: [PATCH] Minor cleanup of Context class Change-Id: I1d9169ce0019162b20d573a315d006c6a0913e4f Signed-off-by: Mateusz Jablonski --- opencl/source/context/context.cpp | 7 ------- opencl/source/context/context.h | 17 ++++++++--------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/opencl/source/context/context.cpp b/opencl/source/context/context.cpp index 92c959c122..33a8f7bcc1 100644 --- a/opencl/source/context/context.cpp +++ b/opencl/source/context/context.cpp @@ -41,14 +41,8 @@ namespace NEO { Context::Context( void(CL_CALLBACK *funcNotify)(const char *, const void *, size_t, void *), void *data) { - properties = nullptr; - numProperties = 0; contextCallback = funcNotify; userData = data; - memoryManager = nullptr; - specialQueue = nullptr; - defaultDeviceQueue = nullptr; - driverDiagnostics = nullptr; sharingFunctions.resize(SharingType::MAX_SHARING_VALUE); schedulerBuiltIn = std::make_unique(); } @@ -422,5 +416,4 @@ ClDevice *Context::getSubDeviceByIndex(uint32_t subDeviceIndex) const { AsyncEventsHandler &Context::getAsyncEventsHandler() { return *static_cast(devices[0]->getExecutionEnvironment())->getAsyncEventsHandler(); } - } // namespace NEO diff --git a/opencl/source/context/context.h b/opencl/source/context/context.h index aff0d58680..539296b0b4 100644 --- a/opencl/source/context/context.h +++ b/opencl/source/context/context.h @@ -20,7 +20,6 @@ namespace NEO { class AsyncEventsHandler; struct BuiltInKernel; -class CommandStreamReceiver; class CommandQueue; class Device; class DeviceQueue; @@ -156,20 +155,20 @@ class Context : public BaseObject<_cl_context> { cl_int processExtraProperties(cl_context_properties propertyType, cl_context_properties propertyValue); - const cl_context_properties *properties; - size_t numProperties; - void(CL_CALLBACK *contextCallback)(const char *, const void *, size_t, void *); - void *userData; + const cl_context_properties *properties = nullptr; + size_t numProperties = 0u; + void(CL_CALLBACK *contextCallback)(const char *, const void *, size_t, void *) = nullptr; + void *userData = nullptr; std::unique_ptr schedulerBuiltIn; ClDeviceVector devices; - MemoryManager *memoryManager; + MemoryManager *memoryManager = nullptr; SVMAllocsManager *svmAllocsManager = nullptr; - CommandQueue *specialQueue; - DeviceQueue *defaultDeviceQueue; + CommandQueue *specialQueue = nullptr; + DeviceQueue *defaultDeviceQueue = nullptr; std::vector> sharingFunctions; - DriverDiagnostics *driverDiagnostics; + DriverDiagnostics *driverDiagnostics = nullptr; bool interopUserSync = false; cl_bool preferD3dSharedResources = 0u; ContextType contextType = ContextType::CONTEXT_TYPE_DEFAULT;