mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 18:06:32 +08:00
feature: Add support for MTL
Related-To: NEO-7111 Signed-off-by: Naklicki, Mateusz <mateusz.naklicki@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ceda3f65c2
commit
a7d8a93b4e
23
opencl/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt
Normal file
23
opencl/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
#
|
||||
# Copyright (C) 2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(TESTS_MTL)
|
||||
set(IGDRCL_SRCS_tests_xe_hpg_core_mtl_excludes
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/excludes_ocl_mtl.cpp
|
||||
)
|
||||
set_property(GLOBAL APPEND PROPERTY IGDRCL_SRCS_tests_excludes ${IGDRCL_SRCS_tests_xe_hpg_core_mtl_excludes})
|
||||
|
||||
set(IGDRCL_SRCS_tests_xe_hpg_core_mtl
|
||||
${IGDRCL_SRCS_tests_xe_hpg_core_mtl_excludes}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/get_device_info_mtl.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/image_tests_mtl.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_cl_device_caps_mtl.cpp
|
||||
)
|
||||
|
||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_xe_hpg_core_mtl})
|
||||
add_subdirectories()
|
||||
endif()
|
||||
12
opencl/test/unit_test/xe_hpg_core/mtl/excludes_ocl_mtl.cpp
Normal file
12
opencl/test/unit_test/xe_hpg_core/mtl/excludes_ocl_mtl.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/test_macros/hw_test_base.h"
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(CommandStreamReceiverFlushTaskDg2AndLaterTests, givenProgramExtendedPipeControlPriorToNonPipelinedStateCommandEnabledWhenPerDssBackedBufferThenThereIsPipeControlPriorToIt_MatcherIsRTCapable, IGFX_METEORLAKE);
|
||||
HWTEST_EXCLUDE_PRODUCT(CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenProgramExtendedPipeControlPriorToNonPipelinedStateCommandEnabledAndStateSipWhenItIsRequiredThenThereIsPipeControlPriorToIt, IGFX_METEORLAKE);
|
||||
HWTEST_EXCLUDE_PRODUCT(CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenProgramExtendedPipeControlPriorToNonPipelinedStateCommandEnabledAndStateBaseAddressWhenItIsRequiredThenThereIsPipeControlPriorToIt, IGFX_METEORLAKE);
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/device_info_fixture.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(GetDeviceInfoMemCapabilitiesTest, GivenValidParametersWhenGetDeviceInfoIsCalledForXE_HP_COREThenClSuccessIsReturned, IGFX_METEORLAKE);
|
||||
|
||||
MTLTEST_F(GetDeviceInfoMemCapabilitiesTest, GivenValidParametersWhenGetDeviceInfoIsCalledForMTLThenClSuccessIsReturned) {
|
||||
std::vector<TestParams> params = {
|
||||
{CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL | CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL},
|
||||
{CL_DEVICE_DEVICE_MEM_CAPABILITIES_INTEL,
|
||||
(CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL | CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL)},
|
||||
{CL_DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTEL,
|
||||
(CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL | CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL)},
|
||||
{CL_DEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTEL,
|
||||
(CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL | CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL)},
|
||||
{CL_DEVICE_SHARED_SYSTEM_MEM_CAPABILITIES_INTEL, 0}};
|
||||
|
||||
check(params);
|
||||
}
|
||||
13
opencl/test/unit_test/xe_hpg_core/mtl/image_tests_mtl.cpp
Normal file
13
opencl/test/unit_test/xe_hpg_core/mtl/image_tests_mtl.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(XeHPAndLaterImageTests, givenCompressionWhenAppendingImageFromBufferThenTwoIsSetAsCompressionFormat, IGFX_METEORLAKE);
|
||||
HWTEST_EXCLUDE_PRODUCT(XeHPAndLaterImageTests, givenImageFromBufferWhenSettingSurfaceStateThenPickCompressionFormatFromDebugVariable, IGFX_METEORLAKE);
|
||||
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Copyright (C) 2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(UNIX)
|
||||
add_subdirectories()
|
||||
endif()
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Copyright (C) 2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(IGDRCL_SRCS_linux_dll_tests_xe_hpg_core_mtl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/${BRANCH_DIR_SUFFIX}/device_id_tests_mtl.cpp
|
||||
)
|
||||
target_sources(igdrcl_linux_dll_tests PRIVATE ${IGDRCL_SRCS_linux_dll_tests_xe_hpg_core_mtl})
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/fixtures/linux/device_id_fixture.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
TEST_F(DeviceIdTests, givenMtlSupportedDeviceIdThenDeviceDescriptorTableExists) {
|
||||
std::array<DeviceDescriptor, 5> expectedDescriptors = {{{0x7D40, &MtlHwConfig::hwInfo, &MtlHwConfig::setupHardwareInfo},
|
||||
{0x7D55, &MtlHwConfig::hwInfo, &MtlHwConfig::setupHardwareInfo},
|
||||
{0x7DD5, &MtlHwConfig::hwInfo, &MtlHwConfig::setupHardwareInfo},
|
||||
{0x7D45, &MtlHwConfig::hwInfo, &MtlHwConfig::setupHardwareInfo},
|
||||
{0x7D60, &MtlHwConfig::hwInfo, &MtlHwConfig::setupHardwareInfo}}};
|
||||
|
||||
testImpl(expectedDescriptors);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hpg_core/hw_cmds_mtl.h"
|
||||
#include "shared/test/common/helpers/gtest_helpers.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/ult_cl_device_factory.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using MtlDeviceCapsTest = ::testing::Test;
|
||||
|
||||
MTLTEST_F(MtlDeviceCapsTest, whenCheckingExtensionThenCorrectExtensionsAreReported) {
|
||||
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
|
||||
unsigned int gmdReleases[] = {70, 71, 72, 73};
|
||||
defaultHwInfo->ipVersion.architecture = 12;
|
||||
|
||||
for (auto gmdRelease : gmdReleases) {
|
||||
defaultHwInfo->ipVersion.release = gmdRelease;
|
||||
UltClDeviceFactory deviceFactory{1, 0};
|
||||
auto &extensions = deviceFactory.rootDevices[0]->deviceExtensions;
|
||||
|
||||
EXPECT_EQ(!MTL::isLpg(*defaultHwInfo), hasSubstr(extensions, std::string("cl_intel_bfloat16_conversions")));
|
||||
EXPECT_EQ(!MTL::isLpg(*defaultHwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_matrix_multiply_accumulate")));
|
||||
EXPECT_EQ(!MTL::isLpg(*defaultHwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_split_matrix_multiply_accumulate")));
|
||||
}
|
||||
}
|
||||
|
||||
using MtlPlatformCaps = Test<PlatformFixture>;
|
||||
|
||||
MTLTEST_F(MtlPlatformCaps, givenSkuWhenCheckingExtensionThenFp64IsReported) {
|
||||
const auto &caps = pPlatform->getPlatformInfo();
|
||||
|
||||
EXPECT_NE(std::string::npos, caps.extensions.find(std::string("cl_khr_fp64")));
|
||||
}
|
||||
Reference in New Issue
Block a user