From af2fe237b42c27ed18faf2cedaa127ed147bfe88 Mon Sep 17 00:00:00 2001 From: Raiyan Latif Date: Fri, 5 Jun 2020 01:32:00 -0700 Subject: [PATCH] Add supportsOnDemandPageFaults to HW capability table Change-Id: I99a2ed9cfaadb60d049628b03bc3abdfde4877b1 Signed-off-by: Raiyan Latif --- level_zero/core/source/device/device_imp.cpp | 2 +- .../test/unit_tests/gen12lp/CMakeLists.txt | 1 + .../gen12lp/test_device_gen12lp.cpp | 30 ++++++++++++++ .../core/test/unit_tests/gen9/CMakeLists.txt | 1 + .../test/unit_tests/gen9/test_device_gen9.cpp | 40 +++++++++++++++++++ opencl/source/gen11/hw_info_ehl.inl | 1 + opencl/source/gen11/hw_info_icllp.inl | 1 + opencl/source/gen11/hw_info_lkf.inl | 1 + opencl/source/gen12lp/hw_info_tgllp.inl | 1 + opencl/source/gen8/hw_info_bdw.inl | 1 + opencl/source/gen9/hw_info_bxt.inl | 1 + opencl/source/gen9/hw_info_cfl.inl | 1 + opencl/source/gen9/hw_info_glk.inl | 1 + opencl/source/gen9/hw_info_kbl.inl | 1 + opencl/source/gen9/hw_info_skl.inl | 1 + shared/source/helpers/hw_info.h | 1 + 16 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp create mode 100644 level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index 1a0c722713..8b1a5f6a30 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -340,7 +340,7 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties) pDeviceProperties->eccMemorySupported = this->neoDevice->getDeviceInfo().errorCorrectionSupport; - pDeviceProperties->onDemandPageFaultsSupported = true; + pDeviceProperties->onDemandPageFaultsSupported = hardwareInfo.capabilityTable.supportsOnDemandPageFaults; pDeviceProperties->maxCommandQueues = 1; diff --git a/level_zero/core/test/unit_tests/gen12lp/CMakeLists.txt b/level_zero/core/test/unit_tests/gen12lp/CMakeLists.txt index 838c36cf16..894d3d6b65 100644 --- a/level_zero/core/test/unit_tests/gen12lp/CMakeLists.txt +++ b/level_zero/core/test/unit_tests/gen12lp/CMakeLists.txt @@ -8,6 +8,7 @@ if(TESTS_GEN12LP) target_sources(${TARGET_NAME} PRIVATE ${COMPUTE_RUNTIME_ULT_GEN12LP} ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/test_device_gen12lp.cpp ) target_include_directories(${TARGET_NAME} PRIVATE ${COMPUTE_RUNTIME_DIR}/level_zero/core/source/gen12lp/definitions${BRANCH_DIR_SUFFIX}/) diff --git a/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp b/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp new file mode 100644 index 0000000000..e2aa385c7e --- /dev/null +++ b/level_zero/core/test/unit_tests/gen12lp/test_device_gen12lp.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "test.h" + +#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h" + +namespace L0 { +namespace ult { + +using ::testing::_; +using ::testing::AnyNumber; +using ::testing::Return; + +using DevicePropertyTest = Test; + +HWTEST2_F(DevicePropertyTest, givenReturnedDevicePropertiesThenExpectedPageFaultSupportReturned, IsGen12LP) { + ze_device_properties_t deviceProps; + deviceProps.version = ZE_DEVICE_PROPERTIES_VERSION_CURRENT; + + device->getProperties(&deviceProps); + EXPECT_FALSE(deviceProps.onDemandPageFaultsSupported); +} + +} // namespace ult +} // namespace L0 diff --git a/level_zero/core/test/unit_tests/gen9/CMakeLists.txt b/level_zero/core/test/unit_tests/gen9/CMakeLists.txt index 1ca5b7d556..2d7d503ebb 100644 --- a/level_zero/core/test/unit_tests/gen9/CMakeLists.txt +++ b/level_zero/core/test/unit_tests/gen9/CMakeLists.txt @@ -10,5 +10,6 @@ if(TESTS_GEN9) ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/test_cmdlist_append_launch_kernel_gen9.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_cmdqueue_thread_arbitration_policy_gen9.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_device_gen9.cpp ) endif() diff --git a/level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp b/level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp new file mode 100644 index 0000000000..9e762d1e75 --- /dev/null +++ b/level_zero/core/test/unit_tests/gen9/test_device_gen9.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "test.h" + +#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h" + +namespace L0 { +namespace ult { + +using ::testing::_; +using ::testing::AnyNumber; +using ::testing::Return; + +using KernelPropertyTest = Test; + +HWTEST2_F(KernelPropertyTest, givenReturnedKernelPropertiesThenExpectedDp4aSupportReturned, IsGen9) { + ze_device_kernel_properties_t kernelProps; + kernelProps.version = ZE_DEVICE_KERNEL_PROPERTIES_VERSION_CURRENT; + + device->getKernelProperties(&kernelProps); + EXPECT_FALSE(kernelProps.dp4aSupported); +} + +using DevicePropertyTest = Test; + +HWTEST2_F(DevicePropertyTest, givenReturnedDevicePropertiesThenExpectedPageFaultSupportReturned, IsGen9) { + ze_device_properties_t deviceProps; + deviceProps.version = ZE_DEVICE_PROPERTIES_VERSION_CURRENT; + + device->getProperties(&deviceProps); + EXPECT_FALSE(deviceProps.onDemandPageFaultsSupported); +} + +} // namespace ult +} // namespace L0 diff --git a/opencl/source/gen11/hw_info_ehl.inl b/opencl/source/gen11/hw_info_ehl.inl index 3bf7fe45f2..aee367e758 100644 --- a/opencl/source/gen11/hw_info_ehl.inl +++ b/opencl/source/gen11/hw_info_ehl.inl @@ -72,6 +72,7 @@ const RuntimeCapabilityTable EHL::capabilityTable{ true, // supportsDeviceEnqueue false, // supportsPipes false, // supportsOcl21Features + false, // supportsOnDemandPageFaults true, // hostPtrTrackingEnabled false // levelZeroSupported }; diff --git a/opencl/source/gen11/hw_info_icllp.inl b/opencl/source/gen11/hw_info_icllp.inl index 49672d5048..200e853797 100644 --- a/opencl/source/gen11/hw_info_icllp.inl +++ b/opencl/source/gen11/hw_info_icllp.inl @@ -73,6 +73,7 @@ const RuntimeCapabilityTable ICLLP::capabilityTable{ true, // supportsDeviceEnqueue true, // supportsPipes true, // supportsOcl21Features + false, // supportsOnDemandPageFaults true, // hostPtrTrackingEnabled true // levelZeroSupported }; diff --git a/opencl/source/gen11/hw_info_lkf.inl b/opencl/source/gen11/hw_info_lkf.inl index 6aa3009fdd..2065931428 100644 --- a/opencl/source/gen11/hw_info_lkf.inl +++ b/opencl/source/gen11/hw_info_lkf.inl @@ -72,6 +72,7 @@ const RuntimeCapabilityTable LKF::capabilityTable{ true, // supportsDeviceEnqueue false, // supportsPipes false, // supportsOcl21Features + false, // supportsOnDemandPageFaults true, // hostPtrTrackingEnabled false // levelZeroSupported }; diff --git a/opencl/source/gen12lp/hw_info_tgllp.inl b/opencl/source/gen12lp/hw_info_tgllp.inl index 912107edc3..f1cf153a61 100644 --- a/opencl/source/gen12lp/hw_info_tgllp.inl +++ b/opencl/source/gen12lp/hw_info_tgllp.inl @@ -74,6 +74,7 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{ false, // supportsDeviceEnqueue false, // supportsPipes true, // supportsOcl21Features + false, // supportsOnDemandPageFaults false, // hostPtrTrackingEnabled true // levelZeroSupported }; diff --git a/opencl/source/gen8/hw_info_bdw.inl b/opencl/source/gen8/hw_info_bdw.inl index 82701a73d0..6271bedafc 100644 --- a/opencl/source/gen8/hw_info_bdw.inl +++ b/opencl/source/gen8/hw_info_bdw.inl @@ -77,6 +77,7 @@ const RuntimeCapabilityTable BDW::capabilityTable{ true, // supportsDeviceEnqueue true, // supportsPipes true, // supportsOcl21Features + false, // supportsOnDemandPageFaults true, // hostPtrTrackingEnabled false // levelZeroSupported }; diff --git a/opencl/source/gen9/hw_info_bxt.inl b/opencl/source/gen9/hw_info_bxt.inl index 434a342b00..dadc6847f2 100644 --- a/opencl/source/gen9/hw_info_bxt.inl +++ b/opencl/source/gen9/hw_info_bxt.inl @@ -74,6 +74,7 @@ const RuntimeCapabilityTable BXT::capabilityTable{ false, // supportsDeviceEnqueue false, // supportsPipes false, // supportsOcl21Features + false, // supportsOnDemandPageFaults true, // hostPtrTrackingEnabled false // levelZeroSupported }; diff --git a/opencl/source/gen9/hw_info_cfl.inl b/opencl/source/gen9/hw_info_cfl.inl index 303f8cc826..bbca64f6e7 100644 --- a/opencl/source/gen9/hw_info_cfl.inl +++ b/opencl/source/gen9/hw_info_cfl.inl @@ -69,6 +69,7 @@ const RuntimeCapabilityTable CFL::capabilityTable{ true, // supportsDeviceEnqueue true, // supportsPipes true, // supportsOcl21Features + false, // supportsOnDemandPageFaults true, // hostPtrTrackingEnabled true // levelZeroSupported }; diff --git a/opencl/source/gen9/hw_info_glk.inl b/opencl/source/gen9/hw_info_glk.inl index 4739145301..80a6e8bfb2 100644 --- a/opencl/source/gen9/hw_info_glk.inl +++ b/opencl/source/gen9/hw_info_glk.inl @@ -69,6 +69,7 @@ const RuntimeCapabilityTable GLK::capabilityTable{ false, // supportsDeviceEnqueue false, // supportsPipes false, // supportsOcl21Features + false, // supportsOnDemandPageFaults true, // hostPtrTrackingEnabled false // levelZeroSupported }; diff --git a/opencl/source/gen9/hw_info_kbl.inl b/opencl/source/gen9/hw_info_kbl.inl index cb120cdd17..6822a07158 100644 --- a/opencl/source/gen9/hw_info_kbl.inl +++ b/opencl/source/gen9/hw_info_kbl.inl @@ -69,6 +69,7 @@ const RuntimeCapabilityTable KBL::capabilityTable{ true, // supportsDeviceEnqueue true, // supportsPipes true, // supportsOcl21Features + false, // supportsOnDemandPageFaults true, // hostPtrTrackingEnabled true // levelZeroSupported }; diff --git a/opencl/source/gen9/hw_info_skl.inl b/opencl/source/gen9/hw_info_skl.inl index e2d5f9f282..605b840af3 100644 --- a/opencl/source/gen9/hw_info_skl.inl +++ b/opencl/source/gen9/hw_info_skl.inl @@ -77,6 +77,7 @@ const RuntimeCapabilityTable SKL::capabilityTable{ true, // supportsDeviceEnqueue true, // supportsPipes true, // supportsOcl21Features + false, // supportsOnDemandPageFaults true, // hostPtrTrackingEnabled true // levelZeroSupported }; diff --git a/shared/source/helpers/hw_info.h b/shared/source/helpers/hw_info.h index 4895c3f87e..4b8816eb40 100644 --- a/shared/source/helpers/hw_info.h +++ b/shared/source/helpers/hw_info.h @@ -56,6 +56,7 @@ struct RuntimeCapabilityTable { bool supportsDeviceEnqueue; bool supportsPipes; bool supportsOcl21Features; + bool supportsOnDemandPageFaults; bool hostPtrTrackingEnabled; bool levelZeroSupported; };