diff --git a/level_zero/core/source/builtin/builtin_functions_lib_impl.h b/level_zero/core/source/builtin/builtin_functions_lib_impl.h index 1c55a1b9f6..36ced78c8e 100644 --- a/level_zero/core/source/builtin/builtin_functions_lib_impl.h +++ b/level_zero/core/source/builtin/builtin_functions_lib_impl.h @@ -49,7 +49,7 @@ struct BuiltinFunctionsLibImpl::BuiltinData { module.reset(); } BuiltinData() = default; - BuiltinData(std::unique_ptr mod, std::unique_ptr ker) { + BuiltinData(std::unique_ptr &&mod, std::unique_ptr &&ker) { module = std::move(mod); func = std::move(ker); } diff --git a/level_zero/core/test/unit_tests/sources/builtin/builtin_functions_tests.cpp b/level_zero/core/test/unit_tests/sources/builtin/builtin_functions_tests.cpp index 8e0241ddc6..acc3c938f5 100644 --- a/level_zero/core/test/unit_tests/sources/builtin/builtin_functions_tests.cpp +++ b/level_zero/core/test/unit_tests/sources/builtin/builtin_functions_tests.cpp @@ -60,7 +60,7 @@ class TestBuiltinFunctionsLibImpl : public DeviceFixture, public testing::Test { struct MockBuiltinData : BuiltinFunctionsLibImpl::BuiltinData { using BuiltinFunctionsLibImpl::BuiltinData::func; using BuiltinFunctionsLibImpl::BuiltinData::module; - MockBuiltinData(std::unique_ptr mod, std::unique_ptr ker) { + MockBuiltinData(std::unique_ptr &&mod, std::unique_ptr &&ker) { module = std::move(mod); func = std::move(ker); } diff --git a/opencl/source/command_queue/command_queue_hw.h b/opencl/source/command_queue/command_queue_hw.h index 39dd93b1bf..02a6f4c897 100644 --- a/opencl/source/command_queue/command_queue_hw.h +++ b/opencl/source/command_queue/command_queue_hw.h @@ -398,7 +398,7 @@ class CommandQueueHw : public CommandQueue { const EnqueueProperties &enqueueProperties, EventsRequest &eventsRequest, EventBuilder &externalEventBuilder, - std::unique_ptr printfHandler, + std::unique_ptr &&printfHandler, CommandStreamReceiver *bcsCsr); CompletionStamp enqueueCommandWithoutKernel(Surface **surfaces, diff --git a/opencl/source/command_queue/enqueue_common.h b/opencl/source/command_queue/enqueue_common.h index eee19a1db0..e68af66c05 100644 --- a/opencl/source/command_queue/enqueue_common.h +++ b/opencl/source/command_queue/enqueue_common.h @@ -944,7 +944,7 @@ void CommandQueueHw::enqueueBlocked( const EnqueueProperties &enqueueProperties, EventsRequest &eventsRequest, EventBuilder &externalEventBuilder, - std::unique_ptr printfHandler, + std::unique_ptr &&printfHandler, CommandStreamReceiver *bcsCsr) { TakeOwnershipWrapper> queueOwnership(*this); diff --git a/opencl/source/dll/linux/drm_neo_create.cpp b/opencl/source/dll/linux/drm_neo_create.cpp index 209f56a50e..bf05c08421 100644 --- a/opencl/source/dll/linux/drm_neo_create.cpp +++ b/opencl/source/dll/linux/drm_neo_create.cpp @@ -31,7 +31,7 @@ const DeviceDescriptor deviceDescriptorTable[] = { #undef NAMEDDEVICE {0, nullptr, nullptr, GTTYPE_UNDEFINED}}; -Drm *Drm::create(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) { +Drm *Drm::create(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) { std::unique_ptr drmObject; if (DebugManager.flags.EnableNullHardware.get() == true) { drmObject.reset(new DrmNullDevice(std::move(hwDeviceId), rootDeviceEnvironment)); diff --git a/opencl/source/helpers/task_information.cpp b/opencl/source/helpers/task_information.cpp index a1d90a8868..3013008918 100644 --- a/opencl/source/helpers/task_information.cpp +++ b/opencl/source/helpers/task_information.cpp @@ -112,7 +112,7 @@ CompletionStamp &CommandMapUnmap::submit(uint32_t taskLevel, bool terminated) { } CommandComputeKernel::CommandComputeKernel(CommandQueue &commandQueue, std::unique_ptr &kernelOperation, std::vector &surfaces, - bool flushDC, bool usesSLM, bool ndRangeKernel, std::unique_ptr printfHandler, + bool flushDC, bool usesSLM, bool ndRangeKernel, std::unique_ptr &&printfHandler, PreemptionMode preemptionMode, Kernel *kernel, uint32_t kernelCount) : Command(commandQueue, kernelOperation), flushDC(flushDC), slmUsed(usesSLM), NDRangeKernel(ndRangeKernel), printfHandler(std::move(printfHandler)), kernel(kernel), diff --git a/opencl/source/helpers/task_information.h b/opencl/source/helpers/task_information.h index dd6bfb8a30..d524f594a7 100644 --- a/opencl/source/helpers/task_information.h +++ b/opencl/source/helpers/task_information.h @@ -130,7 +130,7 @@ class CommandMapUnmap : public Command { class CommandComputeKernel : public Command { public: CommandComputeKernel(CommandQueue &commandQueue, std::unique_ptr &kernelOperation, std::vector &surfaces, - bool flushDC, bool usesSLM, bool ndRangeKernel, std::unique_ptr printfHandler, + bool flushDC, bool usesSLM, bool ndRangeKernel, std::unique_ptr &&printfHandler, PreemptionMode preemptionMode, Kernel *kernel, uint32_t kernelCount); ~CommandComputeKernel() override; diff --git a/opencl/source/program/create.inl b/opencl/source/program/create.inl index bcfe8d7175..db94b76d86 100644 --- a/opencl/source/program/create.inl +++ b/opencl/source/program/create.inl @@ -127,7 +127,7 @@ T *Program::createBuiltInFromGenBinary( program = new T(context, true, deviceVector); for (const auto &device : deviceVector) { if (program->buildInfos[device->getRootDeviceIndex()].packedDeviceBinarySize == 0) { - program->replaceDeviceBinary(makeCopy(binary, size), size, device->getRootDeviceIndex()); + program->replaceDeviceBinary(std::move(makeCopy(binary, size)), size, device->getRootDeviceIndex()); } } program->setBuildStatusSuccess(deviceVector, CL_PROGRAM_BINARY_TYPE_EXECUTABLE); diff --git a/opencl/source/program/program.cpp b/opencl/source/program/program.cpp index 68cf274825..b05c4cba75 100644 --- a/opencl/source/program/program.cpp +++ b/opencl/source/program/program.cpp @@ -424,7 +424,7 @@ void Program::updateNonUniformFlag(const Program **inputPrograms, size_t numInpu this->allowNonUniform = allowNonUniform; } -void Program::replaceDeviceBinary(std::unique_ptr newBinary, size_t newBinarySize, uint32_t rootDeviceIndex) { +void Program::replaceDeviceBinary(std::unique_ptr &&newBinary, size_t newBinarySize, uint32_t rootDeviceIndex) { if (isAnyPackedDeviceBinaryFormat(ArrayRef(reinterpret_cast(newBinary.get()), newBinarySize))) { this->buildInfos[rootDeviceIndex].packedDeviceBinary = std::move(newBinary); this->buildInfos[rootDeviceIndex].packedDeviceBinarySize = newBinarySize; diff --git a/opencl/source/program/program.h b/opencl/source/program/program.h index 07263ddf38..946202411e 100644 --- a/opencl/source/program/program.h +++ b/opencl/source/program/program.h @@ -250,7 +250,7 @@ class Program : public BaseObject<_cl_program> { buildInfos[rootDeviceIndex].linkerInput = std::move(linkerInput); } - MOCKABLE_VIRTUAL void replaceDeviceBinary(std::unique_ptr newBinary, size_t newBinarySize, uint32_t rootDeviceIndex); + MOCKABLE_VIRTUAL void replaceDeviceBinary(std::unique_ptr &&newBinary, size_t newBinarySize, uint32_t rootDeviceIndex); static bool isValidCallback(void(CL_CALLBACK *funcNotify)(cl_program program, void *userData), void *userData); void invokeCallback(void(CL_CALLBACK *funcNotify)(cl_program program, void *userData), void *userData); diff --git a/opencl/test/unit_test/mocks/mock_program.h b/opencl/test/unit_test/mocks/mock_program.h index 1f2c0aaa5a..fe27202468 100644 --- a/opencl/test/unit_test/mocks/mock_program.h +++ b/opencl/test/unit_test/mocks/mock_program.h @@ -148,7 +148,7 @@ class MockProgram : public Program { return this->build(getDevices(), this->options.c_str(), false, builtins); } - void replaceDeviceBinary(std::unique_ptr newBinary, size_t newBinarySize, uint32_t rootDeviceIndex) override { + void replaceDeviceBinary(std::unique_ptr &&newBinary, size_t newBinarySize, uint32_t rootDeviceIndex) override { if (replaceDeviceBinaryCalledPerRootDevice.find(rootDeviceIndex) == replaceDeviceBinaryCalledPerRootDevice.end()) { replaceDeviceBinaryCalledPerRootDevice.insert({rootDeviceIndex, 1}); } else { diff --git a/opencl/test/unit_test/os_interface/linux/drm_neo_create.cpp b/opencl/test/unit_test/os_interface/linux/drm_neo_create.cpp index a4c014e72f..9dd3b7f876 100644 --- a/opencl/test/unit_test/os_interface/linux/drm_neo_create.cpp +++ b/opencl/test/unit_test/os_interface/linux/drm_neo_create.cpp @@ -30,7 +30,7 @@ class DrmMockDefault : public DrmMock { Drm **pDrmToReturnFromCreateFunc = nullptr; bool disableBindDefaultInTests = true; -Drm *Drm::create(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) { +Drm *Drm::create(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) { rootDeviceEnvironment.setHwInfo(defaultHwInfo.get()); if (pDrmToReturnFromCreateFunc) { return *pDrmToReturnFromCreateFunc; diff --git a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp index 0d5e186757..2b44a37b3c 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm20_tests.cpp @@ -100,7 +100,7 @@ TEST_F(Wddm20Tests, givenNullPageTableManagerAndRenderCompressedResourceWhenMapp TEST(WddmDiscoverDevices, WhenNoHwDeviceIdIsProvidedToWddmThenWddmIsNotCreated) { struct MockWddm : public Wddm { - MockWddm(std::unique_ptr hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::move(hwDeviceIdIn), rootDeviceEnvironment) {} + MockWddm(std::unique_ptr &&hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::move(hwDeviceIdIn), rootDeviceEnvironment) {} }; MockExecutionEnvironment executionEnvironment; diff --git a/opencl/test/unit_test/os_interface/windows/wddm_create.cpp b/opencl/test/unit_test/os_interface/windows/wddm_create.cpp index 4a5b221939..c8a6ab766f 100644 --- a/opencl/test/unit_test/os_interface/windows/wddm_create.cpp +++ b/opencl/test/unit_test/os_interface/windows/wddm_create.cpp @@ -8,7 +8,7 @@ #include "shared/test/common/mocks/mock_wddm.h" namespace NEO { -Wddm *Wddm::createWddm(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) { +Wddm *Wddm::createWddm(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) { return new WddmMock(rootDeviceEnvironment); } } // namespace NEO diff --git a/shared/generate_cpp_array/source/generate_cpp_array.cpp b/shared/generate_cpp_array/source/generate_cpp_array.cpp index 284443d5a6..b2220a4852 100644 --- a/shared/generate_cpp_array/source/generate_cpp_array.cpp +++ b/shared/generate_cpp_array/source/generate_cpp_array.cpp @@ -20,7 +20,7 @@ static void show_usage(std::string name) { << "\t -p, --platform\t\tOPTIONAL - Family name with type\n" << "\t -a, --array\t\tName of an uin32_t type array containing parsed input file" << std::endl; } -std::string parseToCharArray(std::unique_ptr binary, size_t size, std::string &builtinName, std::string &platform, std::string revisionId, bool isSpirV) { +std::string parseToCharArray(std::unique_ptr &binary, size_t size, std::string &builtinName, std::string &platform, std::string revisionId, bool isSpirV) { std::ostringstream out; out << "#include \n"; @@ -113,7 +113,7 @@ int main(int argc, char *argv[]) { inputFile.read(reinterpret_cast(memblock.get()), size); inputFile.close(); isSpirV = fileName.find(".spv") != std::string::npos; - std::string cpp = parseToCharArray(move(memblock), size, arrayName, platform, revisionId, isSpirV); + std::string cpp = parseToCharArray(memblock, size, arrayName, platform, revisionId, isSpirV); std::fstream(cppOutputName.c_str(), std::ios::out | std::ios::binary).write(cpp.c_str(), cpp.size()); } else { std::cerr << "File cannot be opened!" << std::endl; diff --git a/shared/source/compiler_interface/compiler_interface.cpp b/shared/source/compiler_interface/compiler_interface.cpp index 5dc7f82a18..8d9799d379 100644 --- a/shared/source/compiler_interface/compiler_interface.cpp +++ b/shared/source/compiler_interface/compiler_interface.cpp @@ -354,7 +354,7 @@ bool CompilerInterface::loadIgc() { return NEO::loadCompiler(Os::igcDllName, igcLib, igcMain); } -bool CompilerInterface::initialize(std::unique_ptr cache, bool requireFcl) { +bool CompilerInterface::initialize(std::unique_ptr &&cache, bool requireFcl) { bool fclAvailable = requireFcl ? this->loadFcl() : false; bool igcAvailable = this->loadIgc(); diff --git a/shared/source/compiler_interface/compiler_interface.h b/shared/source/compiler_interface/compiler_interface.h index a07c06a992..1cc6f37df2 100644 --- a/shared/source/compiler_interface/compiler_interface.h +++ b/shared/source/compiler_interface/compiler_interface.h @@ -105,7 +105,7 @@ class CompilerInterface { virtual ~CompilerInterface(); template - static CompilerInterfaceT *createInstance(std::unique_ptr cache, bool requireFcl) { + static CompilerInterfaceT *createInstance(std::unique_ptr &&cache, bool requireFcl) { auto instance = new CompilerInterfaceT(); if (!instance->initialize(std::move(cache), requireFcl)) { delete instance; @@ -137,7 +137,7 @@ class CompilerInterface { std::vector &stateSaveAreaHeader); protected: - MOCKABLE_VIRTUAL bool initialize(std::unique_ptr cache, bool requireFcl); + MOCKABLE_VIRTUAL bool initialize(std::unique_ptr &&cache, bool requireFcl); MOCKABLE_VIRTUAL bool loadFcl(); MOCKABLE_VIRTUAL bool loadIgc(); diff --git a/shared/source/memory_manager/internal_allocation_storage.cpp b/shared/source/memory_manager/internal_allocation_storage.cpp index 9129acbd3b..57b562953a 100644 --- a/shared/source/memory_manager/internal_allocation_storage.cpp +++ b/shared/source/memory_manager/internal_allocation_storage.cpp @@ -18,7 +18,7 @@ InternalAllocationStorage::InternalAllocationStorage(CommandStreamReceiver &comm temporaryAllocations(TEMPORARY_ALLOCATION), allocationsForReuse(REUSABLE_ALLOCATION){}; -void InternalAllocationStorage::storeAllocation(std::unique_ptr gfxAllocation, uint32_t allocationUsage) { +void InternalAllocationStorage::storeAllocation(std::unique_ptr &&gfxAllocation, uint32_t allocationUsage) { uint32_t taskCount = gfxAllocation->getTaskCount(commandStreamReceiver.getOsContext().getContextId()); if (allocationUsage == REUSABLE_ALLOCATION) { @@ -27,7 +27,7 @@ void InternalAllocationStorage::storeAllocation(std::unique_ptr gfxAllocation, uint32_t allocationUsage, uint32_t taskCount) { +void InternalAllocationStorage::storeAllocationWithTaskCount(std::unique_ptr &&gfxAllocation, uint32_t allocationUsage, uint32_t taskCount) { if (allocationUsage == REUSABLE_ALLOCATION) { if (DebugManager.flags.DisableResourceRecycling.get()) { commandStreamReceiver.getMemoryManager()->freeGraphicsMemory(gfxAllocation.release()); diff --git a/shared/source/memory_manager/internal_allocation_storage.h b/shared/source/memory_manager/internal_allocation_storage.h index bd2251782f..44fced44d9 100644 --- a/shared/source/memory_manager/internal_allocation_storage.h +++ b/shared/source/memory_manager/internal_allocation_storage.h @@ -16,8 +16,8 @@ class InternalAllocationStorage { MOCKABLE_VIRTUAL ~InternalAllocationStorage() = default; InternalAllocationStorage(CommandStreamReceiver &commandStreamReceiver); MOCKABLE_VIRTUAL void cleanAllocationList(uint32_t waitTaskCount, uint32_t allocationUsage); - void storeAllocation(std::unique_ptr gfxAllocation, uint32_t allocationUsage); - void storeAllocationWithTaskCount(std::unique_ptr gfxAllocation, uint32_t allocationUsage, uint32_t taskCount); + void storeAllocation(std::unique_ptr &&gfxAllocation, uint32_t allocationUsage); + void storeAllocationWithTaskCount(std::unique_ptr &&gfxAllocation, uint32_t allocationUsage, uint32_t taskCount); std::unique_ptr obtainReusableAllocation(size_t requiredSize, GraphicsAllocation::AllocationType allocationType); std::unique_ptr obtainTemporaryAllocationWithPtr(size_t requiredSize, const void *requiredPtr, GraphicsAllocation::AllocationType allocationType); AllocationsList &getTemporaryAllocations() { return temporaryAllocations; } diff --git a/shared/source/os_interface/linux/drm_neo.cpp b/shared/source/os_interface/linux/drm_neo.cpp index d6ae53cdba..6f4d631d1c 100644 --- a/shared/source/os_interface/linux/drm_neo.cpp +++ b/shared/source/os_interface/linux/drm_neo.cpp @@ -191,7 +191,7 @@ std::string getIoctlString(unsigned long request) { } // namespace IoctlHelper -Drm::Drm(std::unique_ptr hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment) +Drm::Drm(std::unique_ptr &&hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment) : DriverModel(DriverModelType::DRM), hwDeviceId(std::move(hwDeviceIdIn)), rootDeviceEnvironment(rootDeviceEnvironment) { pagingFence.fill(0u); diff --git a/shared/source/os_interface/linux/drm_neo.h b/shared/source/os_interface/linux/drm_neo.h index ad1d164fd0..5e154c9949 100644 --- a/shared/source/os_interface/linux/drm_neo.h +++ b/shared/source/os_interface/linux/drm_neo.h @@ -206,7 +206,7 @@ class Drm : public DriverModel { static bool isi915Version(int fd); - static Drm *create(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment); + static Drm *create(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment); static void overrideBindSupport(bool &useVmBind); std::string getPciPath() { return hwDeviceId->getPciPath(); @@ -243,7 +243,7 @@ class Drm : public DriverModel { } protected: - Drm(std::unique_ptr hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment); + Drm(std::unique_ptr &&hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment); uint32_t createDrmContextExt(drm_i915_gem_context_create_ext &gcc, uint32_t drmVmId, bool isSpecialContextRequested); int getQueueSliceCount(drm_i915_gem_context_param_sseu *sseu); diff --git a/shared/source/os_interface/linux/drm_null_device.h b/shared/source/os_interface/linux/drm_null_device.h index 5b826f0118..875b42a0f5 100644 --- a/shared/source/os_interface/linux/drm_null_device.h +++ b/shared/source/os_interface/linux/drm_null_device.h @@ -38,7 +38,7 @@ class DrmNullDevice : public Drm { } } - DrmNullDevice(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::move(hwDeviceId), rootDeviceEnvironment), gpuTimestamp(0){}; + DrmNullDevice(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Drm(std::move(hwDeviceId), rootDeviceEnvironment), gpuTimestamp(0){}; protected: uint64_t gpuTimestamp; diff --git a/shared/source/os_interface/windows/wddm/wddm.cpp b/shared/source/os_interface/windows/wddm/wddm.cpp index ec4078c6e0..83e32c44b1 100644 --- a/shared/source/os_interface/windows/wddm/wddm.cpp +++ b/shared/source/os_interface/windows/wddm/wddm.cpp @@ -52,7 +52,7 @@ Wddm::DXCoreCreateAdapterFactoryFcn Wddm::dXCoreCreateAdapterFactory = getDXCore Wddm::CreateDXGIFactoryFcn Wddm::createDxgiFactory = getCreateDxgiFactory(); Wddm::GetSystemInfoFcn Wddm::getSystemInfo = getGetSystemInfo(); -Wddm::Wddm(std::unique_ptr hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment) +Wddm::Wddm(std::unique_ptr &&hwDeviceIdIn, RootDeviceEnvironment &rootDeviceEnvironment) : DriverModel(DriverModelType::WDDM), hwDeviceId(std::move(hwDeviceIdIn)), rootDeviceEnvironment(rootDeviceEnvironment) { UNRECOVERABLE_IF(!hwDeviceId); featureTable.reset(new FeatureTable()); diff --git a/shared/source/os_interface/windows/wddm/wddm.h b/shared/source/os_interface/windows/wddm/wddm.h index 64a03b3ff8..fe519638eb 100644 --- a/shared/source/os_interface/windows/wddm/wddm.h +++ b/shared/source/os_interface/windows/wddm/wddm.h @@ -63,7 +63,7 @@ class Wddm : public DriverModel { virtual ~Wddm(); - static Wddm *createWddm(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment); + static Wddm *createWddm(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment); bool init(); MOCKABLE_VIRTUAL bool evict(const D3DKMT_HANDLE *handleList, uint32_t numOfHandles, uint64_t &sizeToTrim); @@ -226,7 +226,7 @@ class Wddm : public DriverModel { std::unique_ptr gmmMemory; uintptr_t minAddress = 0; - Wddm(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment); + Wddm(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment); MOCKABLE_VIRTUAL bool waitOnGPU(D3DKMT_HANDLE context); bool createDevice(PreemptionMode preemptionMode); bool createPagingQueue(); diff --git a/shared/source/os_interface/windows/wddm/wddm_create.cpp b/shared/source/os_interface/windows/wddm/wddm_create.cpp index 5762b92c28..f92b334ab0 100644 --- a/shared/source/os_interface/windows/wddm/wddm_create.cpp +++ b/shared/source/os_interface/windows/wddm/wddm_create.cpp @@ -8,7 +8,7 @@ #include "shared/source/os_interface/windows/wddm/wddm.h" namespace NEO { -Wddm *Wddm::createWddm(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) { +Wddm *Wddm::createWddm(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) { return new Wddm(std::move(hwDeviceId), rootDeviceEnvironment); } } // namespace NEO diff --git a/shared/source/utilities/perf_profiler.cpp b/shared/source/utilities/perf_profiler.cpp index 81b99d24e3..39b81ddfc6 100644 --- a/shared/source/utilities/perf_profiler.cpp +++ b/shared/source/utilities/perf_profiler.cpp @@ -53,7 +53,7 @@ void PerfProfiler::destroyAll() { gPerfProfiler = nullptr; } -PerfProfiler::PerfProfiler(int id, std::unique_ptr logOut, std::unique_ptr sysLogOut) : totalSystemTime(0) { +PerfProfiler::PerfProfiler(int id, std::unique_ptr &&logOut, std::unique_ptr &&sysLogOut) : totalSystemTime(0) { ApiTimer.setFreq(); systemLogs.reserve(20); diff --git a/shared/source/utilities/perf_profiler.h b/shared/source/utilities/perf_profiler.h index 1cb5df5223..f35428e0ec 100644 --- a/shared/source/utilities/perf_profiler.h +++ b/shared/source/utilities/perf_profiler.h @@ -36,8 +36,8 @@ class PerfProfiler { static void readAndVerify(std::istream &stream, const std::string &token); - PerfProfiler(int id, std::unique_ptr logOut = {nullptr}, - std::unique_ptr sysLogOut = {nullptr}); + PerfProfiler(int id, std::unique_ptr &&logOut = {nullptr}, + std::unique_ptr &&sysLogOut = {nullptr}); ~PerfProfiler(); void apiEnter() { diff --git a/shared/test/common/mocks/mock_wddm.h b/shared/test/common/mocks/mock_wddm.h index 2bdec539c7..49b23d9642 100644 --- a/shared/test/common/mocks/mock_wddm.h +++ b/shared/test/common/mocks/mock_wddm.h @@ -48,7 +48,7 @@ class WddmMock : public Wddm { using Wddm::timestampFrequency; using Wddm::wddmInterface; - WddmMock(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::move(hwDeviceId), rootDeviceEnvironment) {} + WddmMock(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : Wddm(std::move(hwDeviceId), rootDeviceEnvironment) {} WddmMock(RootDeviceEnvironment &rootDeviceEnvironment); ~WddmMock(); diff --git a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp index 24ca803a69..a0b1e8bb06 100644 --- a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp +++ b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp @@ -139,7 +139,7 @@ TEST(CompilerInterface, WhenInitializeIsCalledThenFailIfOneOfRequiredCompilersIs TEST(CompilerInterfaceCreateInstance, WhenInitializeFailedThenReturnNull) { struct FailInitializeCompilerInterface : CompilerInterface { - bool initialize(std::unique_ptr cache, bool requireFcl) override { + bool initialize(std::unique_ptr &&cache, bool requireFcl) override { return false; } }; diff --git a/shared/test/unit_test/os_interface/windows/wddm_shared_allocations_test.cpp b/shared/test/unit_test/os_interface/windows/wddm_shared_allocations_test.cpp index afed2337e5..90f4db9391 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_shared_allocations_test.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_shared_allocations_test.cpp @@ -17,7 +17,7 @@ using namespace NEO; class WddmSharedAllocationsMock : public WddmMock { public: WddmSharedAllocationsMock(RootDeviceEnvironment &rootDeviceEnvironment) : WddmMock(rootDeviceEnvironment) {} - WddmSharedAllocationsMock(std::unique_ptr hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : WddmMock(std::move(hwDeviceId), rootDeviceEnvironment) {} + WddmSharedAllocationsMock(std::unique_ptr &&hwDeviceId, RootDeviceEnvironment &rootDeviceEnvironment) : WddmMock(std::move(hwDeviceId), rootDeviceEnvironment) {} NTSTATUS createNTHandle(const D3DKMT_HANDLE *resourceHandle, HANDLE *ntHandle) override { return static_cast(0xfff); }