From 56b2686f0d5f5a74c033df0a68c930e428f9a262 Mon Sep 17 00:00:00 2001 From: Jaime Arteaga Date: Sat, 20 Mar 2021 18:31:26 +0000 Subject: [PATCH] Add method to get internal copy engine Related-To: LOCI-2010 Signed-off-by: Jaime Arteaga --- opencl/source/cl_device/cl_device.h | 1 + .../test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl | 10 ++++++++++ shared/source/device/device.h | 1 + shared/source/device/device_get_engine.cpp | 5 +++++ 4 files changed, 17 insertions(+) diff --git a/opencl/source/cl_device/cl_device.h b/opencl/source/cl_device/cl_device.h index 1d1f49ceb2..946a9743ea 100644 --- a/opencl/source/cl_device/cl_device.h +++ b/opencl/source/cl_device/cl_device.h @@ -68,6 +68,7 @@ class ClDevice : public BaseObject<_cl_device_id> { EngineControl &getEngine(aub_stream::EngineType engineType, EngineUsage engineUsage); EngineControl &getDefaultEngine(); EngineControl &getInternalEngine(); + EngineControl *getInternalCopyEngine(); std::atomic &getSelectorCopyEngine(); MemoryManager *getMemoryManager() const; GmmHelper *getGmmHelper() const; diff --git a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl index d25a7133a0..f9173d6973 100644 --- a/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/hw_helper_tests_gen12lp.inl @@ -152,6 +152,16 @@ GEN12LPTEST_F(HwHelperTestGen12Lp, givenFtrCcsNodeNotSetWhenGetGpgpuEnginesThenR EXPECT_EQ(aub_stream::ENGINE_RCS, engines[2].first); } +GEN12LPTEST_F(HwHelperTestGen12Lp, + whenCallingGetInternalCopyEngineThenNullptrIsReturned) { + HardwareInfo hwInfo = *defaultHwInfo; + hwInfo.featureTable.ftrBcsInfo = 1; + auto device = std::unique_ptr(MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); + + auto internalCopyEngine = device->getInternalCopyEngine(); + EXPECT_EQ(internalCopyEngine, nullptr); +} + GEN12LPTEST_F(HwHelperTestGen12Lp, givenEvenContextCountRequiredWhenGetGpgpuEnginesIsCalledThenInsertAdditionalEngineAtTheEndIfNeeded) { struct MockHwInfoConfig : HwInfoConfigHw { MockHwInfoConfig() {} diff --git a/shared/source/device/device.h b/shared/source/device/device.h index c6a2449679..586429ea75 100644 --- a/shared/source/device/device.h +++ b/shared/source/device/device.h @@ -57,6 +57,7 @@ class Device : public ReferenceTrackedObject { EngineControl &getEngine(uint32_t index); EngineControl &getDefaultEngine(); EngineControl &getInternalEngine(); + EngineControl *getInternalCopyEngine(); std::atomic &getSelectorCopyEngine(); MemoryManager *getMemoryManager() const; GmmHelper *getGmmHelper() const; diff --git a/shared/source/device/device_get_engine.cpp b/shared/source/device/device_get_engine.cpp index f4dea03611..8ea345a461 100644 --- a/shared/source/device/device_get_engine.cpp +++ b/shared/source/device/device_get_engine.cpp @@ -20,4 +20,9 @@ EngineControl &Device::getInternalEngine() { return this->getDeviceById(0)->getEngine(engineType, EngineUsage::Internal); } + +EngineControl *Device::getInternalCopyEngine() { + return nullptr; +} + } // namespace NEO