mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 06:23:01 +08:00
Use make_unique in sharings
Change-Id: If4fa5e748d673dedf85bc96d4311fcaf8c88a64e Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
9bb625185f
commit
ff0d1327f0
@@ -23,7 +23,7 @@ namespace NEO {
|
||||
|
||||
bool D3DSharingContextBuilder<D3DTypesHelper::D3D9>::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue, cl_int &errcodeRet) {
|
||||
if (contextData.get() == nullptr) {
|
||||
contextData.reset(new D3DCreateContextProperties<D3DTypesHelper::D3D9>);
|
||||
contextData = std::make_unique<D3DCreateContextProperties<D3DTypesHelper::D3D9>>();
|
||||
}
|
||||
bool res = false;
|
||||
|
||||
@@ -44,7 +44,7 @@ bool D3DSharingContextBuilder<D3DTypesHelper::D3D9>::processProperties(cl_contex
|
||||
|
||||
bool D3DSharingContextBuilder<D3DTypesHelper::D3D10>::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue, cl_int &errcodeRet) {
|
||||
if (contextData.get() == nullptr) {
|
||||
contextData.reset(new D3DCreateContextProperties<D3DTypesHelper::D3D10>);
|
||||
contextData = std::make_unique<D3DCreateContextProperties<D3DTypesHelper::D3D10>>();
|
||||
}
|
||||
bool res = false;
|
||||
|
||||
@@ -60,7 +60,7 @@ bool D3DSharingContextBuilder<D3DTypesHelper::D3D10>::processProperties(cl_conte
|
||||
|
||||
bool D3DSharingContextBuilder<D3DTypesHelper::D3D11>::processProperties(cl_context_properties &propertyType, cl_context_properties &propertyValue, cl_int &errcodeRet) {
|
||||
if (contextData.get() == nullptr) {
|
||||
contextData.reset(new D3DCreateContextProperties<D3DTypesHelper::D3D11>);
|
||||
contextData = std::make_unique<D3DCreateContextProperties<D3DTypesHelper::D3D11>>();
|
||||
}
|
||||
bool res = false;
|
||||
switch (propertyType) {
|
||||
@@ -99,7 +99,7 @@ bool D3DSharingContextBuilder<D3D>::finalizeProperties(Context &context, int32_t
|
||||
|
||||
template <typename D3D>
|
||||
std::unique_ptr<SharingContextBuilder> D3DSharingBuilderFactory<D3D>::createContextBuilder() {
|
||||
return std::unique_ptr<SharingContextBuilder>(new D3DSharingContextBuilder<D3D>());
|
||||
return std::make_unique<D3DSharingContextBuilder<D3D>>();
|
||||
};
|
||||
|
||||
std::string D3DSharingBuilderFactory<D3DTypesHelper::D3D9>::getExtensions() {
|
||||
|
||||
@@ -337,7 +337,7 @@ cl_int CL_API_CALL clGetGLContextInfoKHR(const cl_context_properties *properties
|
||||
return retVal;
|
||||
}
|
||||
|
||||
std::unique_ptr<GLSharingFunctions> glSharing(new GLSharingFunctions);
|
||||
auto glSharing = std::make_unique<GLSharingFunctions>();
|
||||
glSharing->initGLFunctions();
|
||||
if (glSharing->isOpenGlSharingSupported() == false) {
|
||||
retVal = CL_INVALID_CONTEXT;
|
||||
|
||||
@@ -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<CL_GL_SYNC_INFO>()) {
|
||||
}
|
||||
|
||||
bool GlArbSyncEvent::setBaseEvent(Event &ev) {
|
||||
|
||||
@@ -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<GL_CL_SYNC_INFO>(sync)) {
|
||||
transitionExecutionStatus(CL_SUBMITTED);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<GlCreateContextProperties>();
|
||||
}
|
||||
bool res = false;
|
||||
|
||||
@@ -67,7 +67,7 @@ bool GlSharingContextBuilder::finalizeProperties(Context &context, int32_t &errc
|
||||
}
|
||||
|
||||
std::unique_ptr<SharingContextBuilder> GlSharingBuilderFactory::createContextBuilder() {
|
||||
return std::unique_ptr<SharingContextBuilder>(new GlSharingContextBuilder());
|
||||
return std::make_unique<GlSharingContextBuilder>();
|
||||
};
|
||||
|
||||
void GlSharingBuilderFactory::fillGlobalDispatchTable() {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
namespace NEO {
|
||||
|
||||
std::unique_ptr<SharingFactory> SharingFactory::build() {
|
||||
std::unique_ptr<SharingFactory> res(new SharingFactory());
|
||||
auto res = std::make_unique<SharingFactory>();
|
||||
|
||||
for (auto &builder : sharingContextBuilder) {
|
||||
if (builder == nullptr)
|
||||
|
||||
@@ -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<VaCreateContextProperties>();
|
||||
}
|
||||
bool res = false;
|
||||
|
||||
@@ -53,7 +53,7 @@ bool VaSharingContextBuilder::finalizeProperties(Context &context, int32_t &errc
|
||||
}
|
||||
|
||||
std::unique_ptr<SharingContextBuilder> VaSharingBuilderFactory::createContextBuilder() {
|
||||
return std::unique_ptr<SharingContextBuilder>(new VaSharingContextBuilder());
|
||||
return std::make_unique<VaSharingContextBuilder>();
|
||||
};
|
||||
|
||||
std::string VaSharingBuilderFactory::getExtensions() {
|
||||
|
||||
Reference in New Issue
Block a user