diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp index 75df46ae23..b27d49b2a5 100644 --- a/opencl/source/command_queue/command_queue.cpp +++ b/opencl/source/command_queue/command_queue.cpp @@ -903,7 +903,7 @@ void CommandQueue::enqueueBlockedMapUnmapOperation(const cl_event *eventWaitList } // store task data in event - auto cmd = std::make_unique(opType, *memObj, copySize, copyOffset, readOnly, *this); + auto cmd = std::unique_ptr(new CommandMapUnmap(opType, *memObj, copySize, copyOffset, readOnly, *this)); eventBuilder->getEvent()->setCommand(std::move(cmd)); // bind output event with input events diff --git a/opencl/source/sharings/va/va_sharing_functions.cpp b/opencl/source/sharings/va/va_sharing_functions.cpp index f03cf1c192..2139a9eb8a 100644 --- a/opencl/source/sharings/va/va_sharing_functions.cpp +++ b/opencl/source/sharings/va/va_sharing_functions.cpp @@ -78,7 +78,7 @@ void VASharingFunctions::initFunctions() { void VASharingFunctions::querySupportedVaImageFormats(VADisplay vaDisplay) { int maxFormats = this->maxNumImageFormats(vaDisplay); if (maxFormats > 0) { - auto allVaFormats = std::make_unique(maxFormats); + std::unique_ptr allVaFormats(new VAImageFormat[maxFormats]); auto result = this->queryImageFormats(vaDisplay, allVaFormats.get(), &maxFormats); if (result == VA_STATUS_SUCCESS) { for (int i = 0; i < maxFormats; i++) { diff --git a/opencl/source/utilities/cl_logger.cpp b/opencl/source/utilities/cl_logger.cpp index f598e68f41..8a757b822d 100644 --- a/opencl/source/utilities/cl_logger.cpp +++ b/opencl/source/utilities/cl_logger.cpp @@ -79,7 +79,7 @@ void ClFileLogger::dumpKernelArgs(const MultiDispatchInfo *multiDisp type = "immediate"; auto crossThreadData = kernel->getCrossThreadData(); auto crossThreadDataSize = kernel->getCrossThreadDataSize(); - argVal = std::make_unique(crossThreadDataSize); + argVal = std::unique_ptr(new char[crossThreadDataSize]); size_t totalArgSize = 0; for (const auto &element : arg.as().elements) { diff --git a/shared/offline_compiler/source/ocloc_arg_helper.cpp b/shared/offline_compiler/source/ocloc_arg_helper.cpp index c84c0c8513..31be1166fa 100644 --- a/shared/offline_compiler/source/ocloc_arg_helper.cpp +++ b/shared/offline_compiler/source/ocloc_arg_helper.cpp @@ -143,7 +143,7 @@ std::vector OclocArgHelper::readBinaryFile(const std::string &filename) { std::unique_ptr OclocArgHelper::loadDataFromFile(const std::string &filename, size_t &retSize) { if (Source *s = findSourceFile(filename)) { auto size = s->length; - auto ret = std::make_unique(size); + std::unique_ptr ret(new char[size]()); memcpy_s(ret.get(), size, s->data, s->length); retSize = s->length; return ret; diff --git a/shared/source/ail/ail_configuration.h b/shared/source/ail/ail_configuration.h index db760fd6cb..93caa011ce 100644 --- a/shared/source/ail/ail_configuration.h +++ b/shared/source/ail/ail_configuration.h @@ -120,7 +120,8 @@ template class AILConfigurationHw : public AILConfiguration { public: static std::unique_ptr create() { - return std::make_unique(); + auto ailConfiguration = std::unique_ptr(new AILConfigurationHw()); + return ailConfiguration; } void applyExt(RuntimeCapabilityTable &runtimeCapabilityTable) override; diff --git a/shared/source/built_ins/built_ins_storage.cpp b/shared/source/built_ins/built_ins_storage.cpp index 63013d2023..2023503054 100644 --- a/shared/source/built_ins/built_ins_storage.cpp +++ b/shared/source/built_ins/built_ins_storage.cpp @@ -173,8 +173,8 @@ BuiltinResourceT EmbeddedStorage::loadImpl(const std::string &fullResourceName) } BuiltinsLib::BuiltinsLib() { - allStorages.push_back(std::make_unique("")); - allStorages.push_back(std::make_unique(getDriverInstallationPath())); + allStorages.push_back(std::unique_ptr(new EmbeddedStorage(""))); + allStorages.push_back(std::unique_ptr(new FileStorage(getDriverInstallationPath()))); } BuiltinCode BuiltinsLib::getBuiltinCode(EBuiltInOps::Type builtin, BuiltinCode::ECodeType requestedCodeType, Device &device) { diff --git a/shared/source/command_container/cmdcontainer.cpp b/shared/source/command_container/cmdcontainer.cpp index 6a827da855..7d403296ac 100644 --- a/shared/source/command_container/cmdcontainer.cpp +++ b/shared/source/command_container/cmdcontainer.cpp @@ -120,7 +120,7 @@ CommandContainer::ErrorCode CommandContainer::initialize(Device *device, Allocat addToResidencyContainer(cmdBufferAllocation); if (requireHeaps) { - heapHelper = std::make_unique(device->getMemoryManager(), device->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage(), device->getNumGenericSubDevices() > 1u); + heapHelper = std::unique_ptr(new HeapHelper(device->getMemoryManager(), device->getDefaultEngine().commandStreamReceiver->getInternalAllocationStorage(), device->getNumGenericSubDevices() > 1u)); for (uint32_t i = 0; i < IndirectHeap::Type::numTypes; i++) { auto heapType = static_cast(i); diff --git a/shared/source/dll/create_deferred_deleter.cpp b/shared/source/dll/create_deferred_deleter.cpp index 70428f5ab6..223e1bfe3b 100644 --- a/shared/source/dll/create_deferred_deleter.cpp +++ b/shared/source/dll/create_deferred_deleter.cpp @@ -9,6 +9,6 @@ namespace NEO { std::unique_ptr createDeferredDeleter() { - return std::make_unique(); + return std::unique_ptr(new DeferredDeleter()); } } // namespace NEO diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index 894fa470e8..fd9b2989ed 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -792,7 +792,7 @@ GraphicsAllocation *DrmMemoryManager::allocatePhysicalDeviceMemory(const Allocat auto isCoherent = productHelper.isCoherentAllocation(patIndex); uint32_t handle = ioctlHelper->createGem(bufferSize, static_cast(allocationData.storageInfo.memoryBanks.to_ulong()), isCoherent); - auto bo = std::make_unique(allocationData.rootDeviceIndex, &drm, patIndex, handle, bufferSize, maxOsContextCount); + std::unique_ptr bo(new BufferObject(allocationData.rootDeviceIndex, &drm, patIndex, handle, bufferSize, maxOsContextCount)); auto allocation = new DrmAllocation(allocationData.rootDeviceIndex, 1u /*num gmms*/, allocationData.type, bo.get(), nullptr, 0u, bufferSize, memoryPool); allocation->setDefaultGmm(gmm.release()); @@ -841,7 +841,7 @@ GraphicsAllocation *DrmMemoryManager::allocateMemoryByKMD(const AllocationData & boType = BufferObject::BOType::legacy; } - auto bo = std::make_unique(allocationData.rootDeviceIndex, &drm, patIndex, handle, bufferSize, maxOsContextCount); + std::unique_ptr bo(new BufferObject(allocationData.rootDeviceIndex, &drm, patIndex, handle, bufferSize, maxOsContextCount)); bo->setAddress(gpuRange); bo->setBOType(boType); @@ -2682,7 +2682,7 @@ GraphicsAllocation *DrmMemoryManager::createSharedUnifiedMemoryAllocation(const return nullptr; } - auto bo = std::make_unique(allocationData.rootDeviceIndex, &drm, patIndex, handle, currentSize, maxOsContextCount); + std::unique_ptr bo(new BufferObject(allocationData.rootDeviceIndex, &drm, patIndex, handle, currentSize, maxOsContextCount)); if (vmAdviseAttribute.has_value() && !ioctlHelper->setVmBoAdvise(bo->peekHandle(), vmAdviseAttribute.value(), nullptr)) { ioctlHelper->munmapFunction(*this, cpuBasePointer, totalSizeToAlloc); diff --git a/shared/source/os_interface/linux/ioctl_helper_prelim.cpp b/shared/source/os_interface/linux/ioctl_helper_prelim.cpp index e054cfa521..e8b18c1c6e 100644 --- a/shared/source/os_interface/linux/ioctl_helper_prelim.cpp +++ b/shared/source/os_interface/linux/ioctl_helper_prelim.cpp @@ -503,7 +503,7 @@ std::unique_ptr IoctlHelperPrelim20::prepareVmBindExt(const StackVec< "Alignment of a buffer returned via new[] operator must allow storing the required type!"); const auto bufferSize{sizeof(prelim_drm_i915_vm_bind_ext_uuid) * bindExtHandles.size()}; - auto extensionsBuffer = std::make_unique(bufferSize); + std::unique_ptr extensionsBuffer{new uint8_t[bufferSize]}; auto extensions = new (extensionsBuffer.get()) prelim_drm_i915_vm_bind_ext_uuid[bindExtHandles.size()]; std::memset(extensionsBuffer.get(), 0, bufferSize); diff --git a/shared/source/os_interface/linux/os_thread_linux.cpp b/shared/source/os_interface/linux/os_thread_linux.cpp index 442da45cb5..f5bf4c21e7 100644 --- a/shared/source/os_interface/linux/os_thread_linux.cpp +++ b/shared/source/os_interface/linux/os_thread_linux.cpp @@ -17,7 +17,7 @@ decltype(&Thread::create) Thread::createFunc = Thread::create; std::unique_ptr Thread::create(void *(*func)(void *), void *arg) { pthread_t threadId; pthread_create(&threadId, nullptr, func, arg); - return std::make_unique(threadId); + return std::unique_ptr(new ThreadLinux(threadId)); } void ThreadLinux::join() { diff --git a/shared/source/os_interface/linux/os_time_linux.cpp b/shared/source/os_interface/linux/os_time_linux.cpp index 223551b1cb..e569dd34b9 100644 --- a/shared/source/os_interface/linux/os_time_linux.cpp +++ b/shared/source/os_interface/linux/os_time_linux.cpp @@ -71,7 +71,7 @@ uint64_t OSTimeLinux::getCpuRawTimestamp() { } std::unique_ptr OSTimeLinux::create(OSInterface &osInterface, std::unique_ptr deviceTime) { - return std::make_unique(osInterface, std::move(deviceTime)); + return std::unique_ptr(new OSTimeLinux(osInterface, std::move(deviceTime))); } } // namespace NEO diff --git a/shared/source/os_interface/windows/wddm/wddm.cpp b/shared/source/os_interface/windows/wddm/wddm.cpp index d9d1d668dc..2659e0cace 100644 --- a/shared/source/os_interface/windows/wddm/wddm.cpp +++ b/shared/source/os_interface/windows/wddm/wddm.cpp @@ -67,7 +67,7 @@ Wddm::Wddm(std::unique_ptr &&hwDeviceIdIn, RootDeviceEnvironment memset(gtSystemInfo.get(), 0, sizeof(*gtSystemInfo)); memset(gfxPlatform.get(), 0, sizeof(*gfxPlatform)); this->enablePreemptionRegValue = NEO::readEnablePreemptionRegKey(); - kmDafListener = std::make_unique(); + kmDafListener = std::unique_ptr(new KmDafListener); temporaryResources = std::make_unique(this); osMemory = OSMemory::create(); bool forceCheck = false; @@ -864,10 +864,10 @@ bool Wddm::openSharedHandle(const MemoryManager::OsHandleData &osHandleData, Wdd return false; } - auto allocPrivateData = std::make_unique(queryResourceInfo.TotalPrivateDriverDataSize); - auto resPrivateData = std::make_unique(queryResourceInfo.ResourcePrivateDriverDataSize); - auto resPrivateRuntimeData = std::make_unique(queryResourceInfo.PrivateRuntimeDataSize); - auto allocationInfo = std::make_unique(queryResourceInfo.NumAllocations); + std::unique_ptr allocPrivateData(new char[queryResourceInfo.TotalPrivateDriverDataSize]); + std::unique_ptr resPrivateData(new char[queryResourceInfo.ResourcePrivateDriverDataSize]); + std::unique_ptr resPrivateRuntimeData(new char[queryResourceInfo.PrivateRuntimeDataSize]); + std::unique_ptr allocationInfo(new D3DDDI_OPENALLOCATIONINFO[queryResourceInfo.NumAllocations]); D3DKMT_OPENRESOURCE openResource = {}; @@ -914,10 +914,10 @@ bool Wddm::openNTHandle(const MemoryManager::OsHandleData &osHandleData, WddmAll return false; } - auto allocPrivateData = std::make_unique(queryResourceInfoFromNtHandle.TotalPrivateDriverDataSize); - auto resPrivateData = std::make_unique(queryResourceInfoFromNtHandle.ResourcePrivateDriverDataSize); - auto resPrivateRuntimeData = std::make_unique(queryResourceInfoFromNtHandle.PrivateRuntimeDataSize); - auto allocationInfo2 = std::make_unique(queryResourceInfoFromNtHandle.NumAllocations); + std::unique_ptr allocPrivateData(new char[queryResourceInfoFromNtHandle.TotalPrivateDriverDataSize]); + std::unique_ptr resPrivateData(new char[queryResourceInfoFromNtHandle.ResourcePrivateDriverDataSize]); + std::unique_ptr resPrivateRuntimeData(new char[queryResourceInfoFromNtHandle.PrivateRuntimeDataSize]); + std::unique_ptr allocationInfo2(new D3DDDI_OPENALLOCATIONINFO2[queryResourceInfoFromNtHandle.NumAllocations]); D3DKMT_OPENRESOURCEFROMNTHANDLE openResourceFromNtHandle = {}; diff --git a/shared/source/program/print_formatter.cpp b/shared/source/program/print_formatter.cpp index 41f9ef36c6..9775bc57ae 100644 --- a/shared/source/program/print_formatter.cpp +++ b/shared/source/program/print_formatter.cpp @@ -59,7 +59,7 @@ void PrintFormatter::printString(const char *formatString, const std::function(length + 1); + std::unique_ptr dataFormat(new char[length + 1]); for (size_t i = 0; i <= length; i++) { if (formatString[i] == '\\') diff --git a/shared/source/utilities/idlist.h b/shared/source/utilities/idlist.h index e20c97b0e6..1f56e885d3 100644 --- a/shared/source/utilities/idlist.h +++ b/shared/source/utilities/idlist.h @@ -463,7 +463,7 @@ template , threadSafe, ownsNodes> { public: void pushRefFrontOne(NodeObjectType &node) { - auto refNode = std::make_unique>(&node); + auto refNode = std::unique_ptr>(new IDNodeRef(&node)); this->pushFrontOne(*refNode); refNode.release(); } diff --git a/shared/source/utilities/iflist.h b/shared/source/utilities/iflist.h index b0d0cca2ad..f49c249c25 100644 --- a/shared/source/utilities/iflist.h +++ b/shared/source/utilities/iflist.h @@ -189,7 +189,7 @@ template , threadSafe, ownsNodes> { public: void pushRefFrontOne(NodeObjectType &node) { - auto up = std::make_unique>(&node); + auto up = std::unique_ptr>(new IFNodeRef(&node)); this->pushFrontOne(*up); up.release(); } // NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks) diff --git a/shared/source/utilities/perf_profiler.cpp b/shared/source/utilities/perf_profiler.cpp index bdc08d20d6..f79e1cfa04 100644 --- a/shared/source/utilities/perf_profiler.cpp +++ b/shared/source/utilities/perf_profiler.cpp @@ -29,8 +29,8 @@ PerfProfiler *PerfProfiler::create(bool dumpToFile) { if (gPerfProfiler == nullptr) { int old = counter.fetch_add(1); if (!dumpToFile) { - auto logs = std::make_unique(); - auto sysLogs = std::make_unique(); + std::unique_ptr logs = std::unique_ptr(new std::stringstream()); + std::unique_ptr sysLogs = std::unique_ptr(new std::stringstream()); gPerfProfiler = new PerfProfiler(old, std::move(logs), std::move(sysLogs)); } else { gPerfProfiler = new PerfProfiler(old); @@ -63,7 +63,7 @@ PerfProfiler::PerfProfiler(int id, std::unique_ptr &&logOut, std:: std::stringstream filename; filename << "PerfReport_Thread_" << id << ".xml"; - auto logToFile = std::make_unique(); + std::unique_ptr logToFile = std::unique_ptr(new std::ofstream()); logToFile->exceptions(std::ios::failbit | std::ios::badbit); logToFile->open(filename.str().c_str(), std::ios::trunc); this->logFile = std::move(logToFile); @@ -77,7 +77,7 @@ PerfProfiler::PerfProfiler(int id, std::unique_ptr &&logOut, std:: std::stringstream filename; filename << "SysPerfReport_Thread_" << id << ".xml"; - auto sysLogToFile = std::make_unique(); + std::unique_ptr sysLogToFile = std::unique_ptr(new std::ofstream()); sysLogToFile->exceptions(std::ios::failbit | std::ios::badbit); sysLogToFile->open(filename.str().c_str(), std::ios::trunc); this->sysLogFile = std::move(sysLogToFile);