mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 02:18:05 +08:00
feature: add query for additional device properties
Related-To: NEO-12590 Signed-off-by: Alicja Lukaszewicz <alicja.lukaszewicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
637541ba93
commit
654fdc1345
@@ -3315,3 +3315,24 @@ TEST(MemoryManagerTest, givenIsCompressionSupportedForShareableThenReturnTrue) {
|
||||
EXPECT_TRUE(memoryManager.isCompressionSupportedForShareable(true));
|
||||
EXPECT_TRUE(memoryManager.isCompressionSupportedForShareable(false));
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, WhenGettingExtraDevicePropertiesThenNoExceptionIsThrown) {
|
||||
MockMemoryManager memoryManager;
|
||||
uint32_t moduleId = 0;
|
||||
uint16_t serverType = 0;
|
||||
|
||||
EXPECT_NO_THROW(memoryManager.getExtraDeviceProperties(0, &moduleId, &serverType));
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, WhenGettingExtraDevicePropertiesThenPropertiesRemainUnchanged) {
|
||||
NEO::ExecutionEnvironment executionEnvironment;
|
||||
OsAgnosticMemoryManager memoryManager(executionEnvironment);
|
||||
|
||||
uint32_t moduleId = 0;
|
||||
uint16_t serverType = 0;
|
||||
|
||||
memoryManager.getExtraDeviceProperties(0, &moduleId, &serverType);
|
||||
|
||||
EXPECT_EQ(moduleId, 0u);
|
||||
EXPECT_EQ(serverType, 0u);
|
||||
}
|
||||
@@ -1850,6 +1850,21 @@ TEST_F(DrmMemoryManagerTest, whenCallingGetNumMediaThenCallIoctlHelper) {
|
||||
EXPECT_EQ(1u, mockIoctlHelper->getNumMediaEncodersCalled);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, whenCallingGetExtraDevicePropertiesThenCallIoctlHelper) {
|
||||
auto mockIoctlHelper = new MockIoctlHelper(*mock);
|
||||
|
||||
auto &drm = static_cast<DrmMockCustom &>(memoryManager->getDrm(rootDeviceIndex));
|
||||
drm.ioctlHelper.reset(mockIoctlHelper);
|
||||
|
||||
uint32_t moduleId = 0;
|
||||
uint16_t serverType = 0;
|
||||
|
||||
EXPECT_EQ(0u, mockIoctlHelper->queryDeviceParamsCalled);
|
||||
|
||||
memoryManager->getExtraDeviceProperties(rootDeviceIndex, &moduleId, &serverType);
|
||||
EXPECT_EQ(1u, mockIoctlHelper->queryDeviceParamsCalled);
|
||||
}
|
||||
|
||||
TEST_F(DrmMemoryManagerTest, GivenShareableEnabledWhenAskedToCreateGraphicsAllocationThenValidAllocationIsReturnedAndStandard64KBHeapIsUsed) {
|
||||
mock->ioctlHelper.reset(new MockIoctlHelper(*mock));
|
||||
mock->queryMemoryInfo();
|
||||
|
||||
@@ -406,6 +406,12 @@ TEST_F(IoctlPrelimHelperTests, givenPrelimWhenGettingEuStallFdParameterThenCorre
|
||||
EXPECT_EQ(static_cast<uint32_t>(PRELIM_I915_PERF_FLAG_FD_EU_STALL), ioctlHelper.getEuStallFdParameter());
|
||||
}
|
||||
|
||||
TEST_F(IoctlPrelimHelperTests, givenPrelimWhenQueryDeviceParamsIsCalledThenFalseIsReturned) {
|
||||
uint32_t moduleId = 0;
|
||||
uint16_t serverType = 0;
|
||||
EXPECT_FALSE(ioctlHelper.queryDeviceParams(&moduleId, &serverType));
|
||||
}
|
||||
|
||||
struct MockIoctlHelperPrelim20 : IoctlHelperPrelim20 {
|
||||
using IoctlHelperPrelim20::createGemExt;
|
||||
using IoctlHelperPrelim20::IoctlHelperPrelim20;
|
||||
|
||||
@@ -879,3 +879,13 @@ TEST(IoctlHelperTestsUpstream, whenCallingGetStatusAndFlagsForResetStatsThenZero
|
||||
|
||||
EXPECT_FALSE(ioctlHelper.validPageFault(0u));
|
||||
}
|
||||
|
||||
TEST(IoctlHelperTestsUpstream, givenUpstreamWhenQueryDeviceParamsIsCalledThenFalseIsReturned) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
auto drm = std::make_unique<DrmTipMock>(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
IoctlHelperUpstream ioctlHelper{*drm};
|
||||
|
||||
uint32_t moduleId = 0;
|
||||
uint16_t serverType = 0;
|
||||
EXPECT_FALSE(ioctlHelper.queryDeviceParams(&moduleId, &serverType));
|
||||
}
|
||||
@@ -2532,3 +2532,13 @@ TEST(IoctlHelperXeTest, givenIoctlHelperWhenGettingFenceAddressThenReturnCorrect
|
||||
fenceAddr = ioctlHelper.getPagingFenceAddress(0, &osContext);
|
||||
EXPECT_EQ(osContext.getFenceAddr(0), fenceAddr);
|
||||
}
|
||||
|
||||
TEST(IoctlHelperXeTest, givenIoctlWhenQueryDeviceParamsIsCalledThenFalseIsReturned) {
|
||||
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
|
||||
auto drm = DrmMockXe::create(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
|
||||
|
||||
uint32_t moduleId = 0;
|
||||
uint16_t serverType = 0;
|
||||
EXPECT_FALSE(xeIoctlHelper->queryDeviceParams(&moduleId, &serverType));
|
||||
}
|
||||
Reference in New Issue
Block a user