mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Add per platform toggle for integer 64bit atomic extensions
Related-To: NEO-3649 Change-Id: Ic97566a91d50911c006e24a23d448281a8d2df64 Signed-off-by: Cencelewska <katarzyna.cencelewska@intel.com>
This commit is contained in:
@@ -178,8 +178,6 @@ TEST_F(clGetDeviceInfoTests, GivenClDeviceExtensionsParamWhenGettingDeviceInfoTh
|
||||
"cl_intel_accelerator ",
|
||||
"cl_intel_media_block_io ",
|
||||
"cl_intel_driver_diagnostics ",
|
||||
"cl_khr_int64_base_atomics ",
|
||||
"cl_khr_int64_extended_atomics ",
|
||||
};
|
||||
|
||||
for (auto element = 0u; element < sizeof(supportedExtensions) / sizeof(supportedExtensions[0]); element++) {
|
||||
|
||||
@@ -8,6 +8,7 @@ if(TESTS_ICLLP)
|
||||
set(IGDRCL_SRCS_tests_gen11_icllp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_icllp.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_icllp.cpp
|
||||
)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen11_icllp})
|
||||
add_subdirectories()
|
||||
|
||||
17
unit_tests/gen11/icllp/test_device_caps_icllp.cpp
Normal file
17
unit_tests/gen11/icllp/test_device_caps_icllp.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using IcllpTest = Test<DeviceFixture>;
|
||||
|
||||
ICLLPTEST_F(IcllpTest, givenIcllpWhenSlmSizeIsRequiredThenReturnCorrectValue) {
|
||||
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
|
||||
}
|
||||
@@ -8,6 +8,7 @@ if(TESTS_LKF)
|
||||
set(IGDRCL_SRCS_tests_gen11_lkf
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_lkf.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps_lkf.cpp
|
||||
)
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_gen11_lkf})
|
||||
add_subdirectories()
|
||||
|
||||
17
unit_tests/gen11/lkf/test_device_caps_lkf.cpp
Normal file
17
unit_tests/gen11/lkf/test_device_caps_lkf.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using LkfTest = Test<DeviceFixture>;
|
||||
|
||||
LKFTEST_F(LkfTest, givenLkfWhenSlmSizeIsRequiredThenReturnCorrectValue) {
|
||||
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
|
||||
}
|
||||
@@ -40,6 +40,7 @@ LKFTEST_F(Gen11DeviceCaps, givenLkfWhenExtensionStringIsCheckedThenFP64IsNotRepo
|
||||
LKFTEST_F(Gen11DeviceCaps, givenLkfWhenSlmSizeIsRequiredThenReturnCorrectValue) {
|
||||
EXPECT_EQ(64u, pDevice->getHardwareInfo().capabilityTable.slmSize);
|
||||
}
|
||||
|
||||
ICLLPTEST_F(Gen11DeviceCaps, lpSkusDontSupportFP64) {
|
||||
const auto &caps = pDevice->getDeviceInfo();
|
||||
std::string extensionString = caps.deviceExtensions;
|
||||
|
||||
@@ -49,3 +49,7 @@ GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckSupportCacheFlushAfterWalkerThenFal
|
||||
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckBlitterOperationsSupportThenReturnFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.blitterOperationsSupported);
|
||||
}
|
||||
|
||||
GEN8TEST_F(Gen8DeviceCaps, givenGen8WhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
||||
}
|
||||
@@ -47,6 +47,10 @@ BXTTEST_F(BxtDeviceCaps, GivenBXTWhenCheckftr64KBpagesThenFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
|
||||
}
|
||||
|
||||
BXTTEST_F(BxtDeviceCaps, givenBXTWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
||||
}
|
||||
|
||||
typedef Test<DeviceFixture> BxtUsDeviceIdTest;
|
||||
|
||||
BXTTEST_F(BxtUsDeviceIdTest, isSimulationCap) {
|
||||
|
||||
@@ -21,3 +21,7 @@ CFLTEST_F(CflDeviceCaps, reportsOcl21) {
|
||||
CFLTEST_F(CflDeviceCaps, GivenCFLWhenCheckftr64KBpagesThenTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
|
||||
}
|
||||
|
||||
CFLTEST_F(CflDeviceCaps, givenCflWhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
||||
}
|
||||
@@ -59,3 +59,7 @@ GLKTEST_F(GlkUsDeviceIdTest, isSimulationCap) {
|
||||
GLKTEST_F(GlkUsDeviceIdTest, GivenGLKWhenCheckftr64KBpagesThenFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
|
||||
}
|
||||
|
||||
GLKTEST_F(GlkUsDeviceIdTest, givenGlkWhenCheckFtrSupportsInteger64BitAtomicsThenReturnFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
||||
}
|
||||
@@ -21,3 +21,7 @@ KBLTEST_F(KblDeviceCaps, reportsOcl21) {
|
||||
KBLTEST_F(KblDeviceCaps, GivenKBLWhenCheckftr64KBpagesThenTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
|
||||
}
|
||||
|
||||
KBLTEST_F(KblDeviceCaps, givenKblWhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
||||
}
|
||||
@@ -69,3 +69,7 @@ SKLTEST_F(SklUsDeviceIdTest, isSimulationCap) {
|
||||
SKLTEST_F(SklUsDeviceIdTest, GivenSKLWhenCheckftr64KBpagesThenTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftr64KBpages);
|
||||
}
|
||||
|
||||
SKLTEST_F(SklUsDeviceIdTest, givenSklWhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
||||
}
|
||||
@@ -66,4 +66,4 @@ GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckSupportCacheFlushAfterWalkerThenFal
|
||||
|
||||
GEN9TEST_F(Gen9DeviceCaps, givenGen9WhenCheckBlitterOperationsSupportThenReturnFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.blitterOperationsSupported);
|
||||
}
|
||||
}
|
||||
@@ -252,6 +252,21 @@ TEST_F(PlatformTest, givenNotSupportingCl21WhenPlatformNotSupportFp64ThenNotFill
|
||||
EXPECT_THAT(compilerExtensions, ::testing::EndsWith(std::string(" ")));
|
||||
}
|
||||
|
||||
TEST_F(PlatformTest, givenFtrSupportAtomicsWhenCreateExtentionsListThenGetMatchingSubstrings) {
|
||||
const HardwareInfo *hwInfo;
|
||||
hwInfo = platformDevices[0];
|
||||
std::string extensionsList = getExtensionsList(*hwInfo);
|
||||
std::string compilerExtensions = convertEnabledExtensionsToCompilerInternalOptions(extensionsList.c_str());
|
||||
|
||||
if (hwInfo->capabilityTable.ftrSupportsInteger64BitAtomics) {
|
||||
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_int64_base_atomics")));
|
||||
EXPECT_THAT(compilerExtensions, ::testing::HasSubstr(std::string("cl_khr_int64_extended_atomics")));
|
||||
} else {
|
||||
EXPECT_THAT(compilerExtensions, ::testing::Not(::testing::HasSubstr(std::string("cl_khr_int64_base_atomics"))));
|
||||
EXPECT_THAT(compilerExtensions, ::testing::Not(::testing::HasSubstr(std::string("cl_khr_int64_extended_atomics"))));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(PlatformTest, testRemoveLastSpace) {
|
||||
std::string emptyString = "";
|
||||
removeLastSpace(emptyString);
|
||||
|
||||
Reference in New Issue
Block a user