diff --git a/runtime/sharings/d3d/enable_d3d.cpp b/runtime/sharings/d3d/enable_d3d.cpp index 8b9ed665b3..1b46cfff34 100644 --- a/runtime/sharings/d3d/enable_d3d.cpp +++ b/runtime/sharings/d3d/enable_d3d.cpp @@ -23,7 +23,7 @@ namespace NEO { bool D3DSharingContextBuilder::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue, cl_int &errcodeRet) { if (contextData.get() == nullptr) { - contextData.reset(new D3DCreateContextProperties); + contextData = std::make_unique>(); } bool res = false; @@ -44,7 +44,7 @@ bool D3DSharingContextBuilder::processProperties(cl_contex bool D3DSharingContextBuilder::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue, cl_int &errcodeRet) { if (contextData.get() == nullptr) { - contextData.reset(new D3DCreateContextProperties); + contextData = std::make_unique>(); } bool res = false; @@ -60,7 +60,7 @@ bool D3DSharingContextBuilder::processProperties(cl_conte bool D3DSharingContextBuilder::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue, cl_int &errcodeRet) { if (contextData.get() == nullptr) { - contextData.reset(new D3DCreateContextProperties); + contextData = std::make_unique>(); } bool res = false; switch (propertyType) { @@ -99,7 +99,7 @@ bool D3DSharingContextBuilder::finalizeProperties(Context &context, int32_t template std::unique_ptr D3DSharingBuilderFactory::createContextBuilder() { - return std::unique_ptr(new D3DSharingContextBuilder()); + return std::make_unique>(); }; std::string D3DSharingBuilderFactory::getExtensions() { diff --git a/runtime/sharings/gl/cl_gl_api.cpp b/runtime/sharings/gl/cl_gl_api.cpp index a71404459c..685fbb4e81 100644 --- a/runtime/sharings/gl/cl_gl_api.cpp +++ b/runtime/sharings/gl/cl_gl_api.cpp @@ -337,7 +337,7 @@ cl_int CL_API_CALL clGetGLContextInfoKHR(const cl_context_properties *properties return retVal; } - std::unique_ptr glSharing(new GLSharingFunctions); + auto glSharing = std::make_unique(); glSharing->initGLFunctions(); if (glSharing->isOpenGlSharingSupported() == false) { retVal = CL_INVALID_CONTEXT; diff --git a/runtime/sharings/gl/gl_arb_sync_event.cpp b/runtime/sharings/gl/gl_arb_sync_event.cpp index 0016ce1bdc..b87039f9a4 100644 --- a/runtime/sharings/gl/gl_arb_sync_event.cpp +++ b/runtime/sharings/gl/gl_arb_sync_event.cpp @@ -21,7 +21,7 @@ namespace NEO { GlArbSyncEvent::GlArbSyncEvent(Context &context) : Event(&context, nullptr, CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR, eventNotReady, eventNotReady), - glSyncInfo(new CL_GL_SYNC_INFO{}) { + glSyncInfo(std::make_unique()) { } bool GlArbSyncEvent::setBaseEvent(Event &ev) { diff --git a/runtime/sharings/gl/gl_sync_event.cpp b/runtime/sharings/gl/gl_sync_event.cpp index 4a6ec289a6..c1fb046f0a 100644 --- a/runtime/sharings/gl/gl_sync_event.cpp +++ b/runtime/sharings/gl/gl_sync_event.cpp @@ -21,7 +21,8 @@ namespace NEO { GlSyncEvent::GlSyncEvent(Context &context, const GL_CL_SYNC_INFO &sync) - : Event(&context, nullptr, CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR, eventNotReady, eventNotReady), glSync(new GL_CL_SYNC_INFO(sync)) { + : Event(&context, nullptr, CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR, eventNotReady, eventNotReady), + glSync(std::make_unique(sync)) { transitionExecutionStatus(CL_SUBMITTED); } diff --git a/runtime/sharings/gl/win_enable_gl.cpp b/runtime/sharings/gl/win_enable_gl.cpp index db03424525..bd5bd15c4e 100644 --- a/runtime/sharings/gl/win_enable_gl.cpp +++ b/runtime/sharings/gl/win_enable_gl.cpp @@ -21,7 +21,7 @@ namespace NEO { bool GlSharingContextBuilder::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue, cl_int &errcodeRet) { if (contextData.get() == nullptr) { - contextData.reset(new GlCreateContextProperties); + contextData = std::make_unique(); } bool res = false; @@ -67,7 +67,7 @@ bool GlSharingContextBuilder::finalizeProperties(Context &context, int32_t &errc } std::unique_ptr GlSharingBuilderFactory::createContextBuilder() { - return std::unique_ptr(new GlSharingContextBuilder()); + return std::make_unique(); }; void GlSharingBuilderFactory::fillGlobalDispatchTable() { diff --git a/runtime/sharings/sharing_factory.cpp b/runtime/sharings/sharing_factory.cpp index a1da81c4d8..8bd293b016 100644 --- a/runtime/sharings/sharing_factory.cpp +++ b/runtime/sharings/sharing_factory.cpp @@ -13,7 +13,7 @@ namespace NEO { std::unique_ptr SharingFactory::build() { - std::unique_ptr res(new SharingFactory()); + auto res = std::make_unique(); for (auto &builder : sharingContextBuilder) { if (builder == nullptr) diff --git a/runtime/sharings/va/enable_va.cpp b/runtime/sharings/va/enable_va.cpp index 9022835f49..fc18a65b4f 100644 --- a/runtime/sharings/va/enable_va.cpp +++ b/runtime/sharings/va/enable_va.cpp @@ -23,7 +23,7 @@ namespace NEO { bool VaSharingContextBuilder::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue, cl_int &errcodeRet) { if (contextData.get() == nullptr) { - contextData.reset(new VaCreateContextProperties); + contextData = std::make_unique(); } bool res = false; @@ -53,7 +53,7 @@ bool VaSharingContextBuilder::finalizeProperties(Context &context, int32_t &errc } std::unique_ptr VaSharingBuilderFactory::createContextBuilder() { - return std::unique_ptr(new VaSharingContextBuilder()); + return std::make_unique(); }; std::string VaSharingBuilderFactory::getExtensions() {