refactor: remove not needed code
Related-To: NEO-7527 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
parent
cb730d11f4
commit
3a21b3b228
|
@ -19,7 +19,6 @@ else()
|
|||
SET_FLAGS_FOR("GEN9" "SKL" "KBL" "BXT" "GLK" "CFL")
|
||||
SET_FLAGS_FOR("GEN11" "ICLLP" "LKF" "EHL")
|
||||
endif()
|
||||
DISABLE_FLAGS_FOR("XE_HP_CORE" "XE_HP_SDV")
|
||||
SET_FLAGS_FOR("GEN12LP" "TGLLP" "RKL" "ADLS" "ADLP" "DG1" "ADLN")
|
||||
SET_FLAGS_FOR("XE_HPG_CORE" "DG2" "MTL")
|
||||
SET_FLAGS_FOR("XE_HPC_CORE" "PVC")
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
#include "shared/source/program/kernel_info.h"
|
||||
#include "shared/source/unified_memory/unified_memory.h"
|
||||
#include "shared/source/utilities/software_tags_manager.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
#include "shared/source/xe_hp_core/hw_info.h"
|
||||
|
||||
#include "level_zero/core/source/cmdlist/cmdlist_hw.h"
|
||||
#include "level_zero/core/source/driver/driver_handle_imp.h"
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2021-2023 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(SUPPORT_XE_HP_CORE)
|
||||
target_sources(${L0_STATIC_LIB_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xe_hp_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_xe_hp_core.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/image_xe_hp_core.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sampler_xe_hp_core.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/enable_family_full_l0_xe_hp_core.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/l0_gfx_core_helper_xe_hp_core.cpp
|
||||
)
|
||||
|
||||
add_subdirectories()
|
||||
|
||||
endif()
|
|
@ -1,23 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
#include "level_zero/core/source/cmdlist/cmdlist_hw.h"
|
||||
#include "level_zero/core/source/cmdlist/cmdlist_hw.inl"
|
||||
#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.h"
|
||||
#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.inl"
|
||||
#include "level_zero/core/source/cmdlist/cmdlist_hw_xehp_and_later.inl"
|
||||
|
||||
#include "cmdlist_extended.inl"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
template struct CommandListCoreFamily<IGFX_XE_HP_CORE>;
|
||||
template struct CommandListCoreFamilyImmediate<IGFX_XE_HP_CORE>;
|
||||
|
||||
} // namespace L0
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
#include "level_zero/core/source/cmdlist/cmdlist_hw.h"
|
||||
#include "level_zero/core/source/cmdlist/cmdlist_hw_immediate.h"
|
||||
|
||||
namespace L0 {
|
||||
template <PRODUCT_FAMILY productFamily>
|
||||
struct CommandListProductFamily : public CommandListCoreFamily<IGFX_XE_HP_CORE> {
|
||||
using CommandListCoreFamily::CommandListCoreFamily;
|
||||
};
|
||||
|
||||
template <PRODUCT_FAMILY gfxProductFamily>
|
||||
struct CommandListImmediateProductFamily : public CommandListCoreFamilyImmediate<IGFX_XE_HP_CORE> {
|
||||
using CommandListCoreFamilyImmediate::CommandListCoreFamilyImmediate;
|
||||
};
|
||||
} // namespace L0
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
#include "level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper.h"
|
||||
#include "level_zero/core/source/helpers/l0_populate_factory.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using Family = XeHpFamily;
|
||||
|
||||
struct EnableL0XeHpCore {
|
||||
EnableL0XeHpCore() {
|
||||
L0::populateFactoryTable<L0::L0GfxCoreHelperHw<Family>>();
|
||||
}
|
||||
};
|
||||
|
||||
static EnableL0XeHpCore enable;
|
||||
} // namespace NEO
|
|
@ -1,11 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
#include "shared/source/xe_hp_core/hw_info.h"
|
||||
|
||||
#include "level_zero/core/source/image/image_hw.inl"
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
#include "level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_base.inl"
|
||||
#include "level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_tgllp_to_dg2.inl"
|
||||
#include "level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper_xehp_and_later.inl"
|
||||
#include "level_zero/core/source/helpers/l0_populate_factory.h"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
using Family = NEO::XeHpFamily;
|
||||
static auto gfxCore = IGFX_XE_HP_CORE;
|
||||
|
||||
template <>
|
||||
void populateFactoryTable<L0GfxCoreHelperHw<Family>>() {
|
||||
extern L0GfxCoreHelper *l0GfxCoreHelperFactory[IGFX_MAX_CORE];
|
||||
l0GfxCoreHelperFactory[gfxCore] = &L0GfxCoreHelperHw<Family>::get();
|
||||
}
|
||||
|
||||
template <>
|
||||
bool L0GfxCoreHelperHw<Family>::isResumeWARequired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool L0GfxCoreHelperHw<Family>::multiTileCapablePlatform() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
void L0GfxCoreHelperHw<Family>::setAdditionalGroupProperty(ze_command_queue_group_properties_t &groupProperty, NEO::EngineGroupT &group) const {
|
||||
}
|
||||
|
||||
template <>
|
||||
bool L0GfxCoreHelperHw<Family>::platformSupportsRayTracing() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
zet_debug_regset_type_intel_gpu_t L0GfxCoreHelperHw<Family>::getRegsetTypeForLargeGrfDetection() const {
|
||||
return ZET_DEBUG_REGSET_TYPE_CR_INTEL_GPU;
|
||||
}
|
||||
|
||||
template class L0GfxCoreHelperHw<Family>;
|
||||
|
||||
} // namespace L0
|
|
@ -1,11 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
#include "shared/source/xe_hp_core/hw_info.h"
|
||||
|
||||
#include "level_zero/core/source/sampler/sampler_hw.inl"
|
|
@ -5,23 +5,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/built_ins/sip.h"
|
||||
#include "shared/source/device/root_device.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/libult/linux/drm_mock.h"
|
||||
#include "shared/test/common/mocks/linux/mock_drm_allocation.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_memory_manager.h"
|
||||
#include "shared/test/common/mocks/ult_device_factory.h"
|
||||
#include "shared/test/common/os_interface/linux/sys_calls_linux_ult.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_built_ins.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_cmdlist.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_cmdqueue.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_context.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_memory_manager.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
|
@ -34,110 +21,6 @@ struct TestDeviceUuid : public ::testing::Test {
|
|||
DebugManagerStateRestore restorer;
|
||||
};
|
||||
|
||||
HWTEST2_F(TestDeviceUuid, GivenCorrectTelemetryNodesAreAvailableWhenRetrievingDeviceAndSubDevicePropertiesThenCorrectUuidIsReceived, IsXEHP) {
|
||||
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsReadlink)> mockReadLink(&NEO::SysCalls::sysCallsReadlink, [](const char *path, char *buf, size_t bufsize) -> int {
|
||||
std::map<std::string, std::string> fileNameLinkMap = {
|
||||
{"/sys/dev/char/226:128", "../../devices/pci0000:37/0000:37:01.0/0000:38:00.0/0000:39:01.0/0000:3a:00.0/drm/renderD128"},
|
||||
{"/sys/class/intel_pmt/telem3", "./../devices/pci0000:37/0000:37:01.0/0000:38:00.0/0000:39:02.0/0000:3c:00.1/intel-dvsec-2.1.auto/intel_pmt/telem3/"},
|
||||
{"/sys/class/intel_pmt/telem1", "./../devices/pci0000:37/0000:37:01.0/0000:38:00.0/0000:39:02.0/0000:3c:00.1/intel-dvsec-2.1.auto/intel_pmt/telem1/"},
|
||||
{"/sys/class/intel_pmt/telem2", "./../devices/pci0000:37/0000:37:01.0/0000:38:00.0/0000:39:02.0/0000:3c:00.1/intel-dvsec-2.1.auto/intel_pmt/telem2/"},
|
||||
};
|
||||
|
||||
auto it = fileNameLinkMap.find(std::string(path));
|
||||
if (it != fileNameLinkMap.end()) {
|
||||
std::memcpy(buf, it->second.c_str(), it->second.size());
|
||||
return static_cast<int>(it->second.size());
|
||||
}
|
||||
return -1;
|
||||
});
|
||||
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsOpen)> mockOpen(&NEO::SysCalls::sysCallsOpen, [](const char *pathname, int flags) -> int {
|
||||
std::vector<std::string> supportedFiles = {
|
||||
"/sys/class/intel_pmt/telem1/guid",
|
||||
"/sys/class/intel_pmt/telem1/offset",
|
||||
"/sys/class/intel_pmt/telem1/telem",
|
||||
};
|
||||
|
||||
auto itr = std::find(supportedFiles.begin(), supportedFiles.end(), std::string(pathname));
|
||||
if (itr != supportedFiles.end()) {
|
||||
// skipping "0"
|
||||
return static_cast<int>(std::distance(supportedFiles.begin(), itr)) + 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsPread)> mockPread(&NEO::SysCalls::sysCallsPread, [](int fd, void *buf, size_t count, off_t offset) -> ssize_t {
|
||||
std::vector<std::pair<std::string, std::string>> supportedFiles = {
|
||||
{"/sys/class/intel_pmt/telem1/guid", "0xfdc76195"},
|
||||
{"/sys/class/intel_pmt/telem1/offset", "0\n"},
|
||||
{"/sys/class/intel_pmt/telem1/telem", "dummy"},
|
||||
};
|
||||
|
||||
fd -= 1;
|
||||
|
||||
if ((fd >= 0) && (fd < static_cast<int>(supportedFiles.size()))) {
|
||||
if (supportedFiles[fd].second == "dummy") {
|
||||
uint64_t data = 0xFEEDBEADDEABDEEF;
|
||||
memcpy(buf, &data, sizeof(data));
|
||||
return sizeof(data);
|
||||
}
|
||||
memcpy(buf, supportedFiles[fd].second.c_str(), supportedFiles[fd].second.size());
|
||||
return supportedFiles[fd].second.size();
|
||||
}
|
||||
|
||||
return -1;
|
||||
});
|
||||
DebugManager.flags.EnableChipsetUniqueUUID.set(1);
|
||||
DebugManager.flags.CreateMultipleSubDevices.set(2);
|
||||
|
||||
std::unique_ptr<Mock<L0::DriverHandleImp>> driverHandle;
|
||||
NEO::MockDevice *neoDevice = nullptr;
|
||||
L0::Device *device = nullptr;
|
||||
DrmMockResources *drmMock = nullptr;
|
||||
|
||||
auto executionEnvironment = new NEO::ExecutionEnvironment();
|
||||
auto mockBuiltIns = new MockBuiltins();
|
||||
executionEnvironment->prepareRootDeviceEnvironments(1);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltIns);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->setHwInfoAndInitHelpers(defaultHwInfo.get());
|
||||
auto osInterface = new OSInterface();
|
||||
drmMock = new DrmMockResources(*executionEnvironment->rootDeviceEnvironments[0]);
|
||||
executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(osInterface);
|
||||
std::vector<std::string> pciPaths = {
|
||||
"0000:3a:00.0"};
|
||||
drmMock->setPciPath(pciPaths[0].c_str());
|
||||
executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr<Drm>(drmMock));
|
||||
|
||||
neoDevice = NEO::MockDevice::create<NEO::MockDevice>(executionEnvironment, 0u);
|
||||
|
||||
NEO::DeviceVector devices;
|
||||
devices.push_back(std::unique_ptr<NEO::Device>(neoDevice));
|
||||
driverHandle = std::make_unique<Mock<L0::DriverHandleImp>>();
|
||||
driverHandle->initialize(std::move(devices));
|
||||
device = driverHandle->devices[0];
|
||||
|
||||
uint64_t expectedVal = 0xFEEDBEADDEABDEEF;
|
||||
ze_device_properties_t deviceProps;
|
||||
deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, device->getProperties(&deviceProps));
|
||||
EXPECT_TRUE(0 == std::memcmp(deviceProps.uuid.id, &expectedVal, sizeof(expectedVal)));
|
||||
|
||||
uint32_t subdeviceCount = neoDevice->getNumGenericSubDevices();
|
||||
std::vector<ze_device_handle_t> subdevices;
|
||||
subdevices.resize(subdeviceCount);
|
||||
device->getSubDevices(&subdeviceCount, subdevices.data());
|
||||
|
||||
uint8_t expectedUuid[16] = {0};
|
||||
std::memcpy(expectedUuid, &expectedVal, sizeof(uint64_t));
|
||||
expectedUuid[15] = 1;
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, static_cast<Device *>(subdevices[0])->getProperties(&deviceProps));
|
||||
EXPECT_TRUE(0 == std::memcmp(deviceProps.uuid.id, expectedUuid, sizeof(expectedUuid)));
|
||||
expectedUuid[15] = 2;
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, static_cast<Device *>(subdevices[1])->getProperties(&deviceProps));
|
||||
EXPECT_TRUE(0 == std::memcmp(deviceProps.uuid.id, expectedUuid, sizeof(expectedUuid)));
|
||||
}
|
||||
|
||||
TEST_F(TestDeviceUuid, GivenEnableChipsetUniqueUuidIsSetWhenOsInterfaceIsNotSetThenUuidOfFallbackPathIsReceived) {
|
||||
|
||||
DebugManager.flags.EnableChipsetUniqueUUID.set(1);
|
||||
|
@ -157,4 +40,4 @@ TEST_F(TestDeviceUuid, GivenEnableChipsetUniqueUuidIsSetWhenOsInterfaceIsNotSetT
|
|||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
||||
} // namespace L0
|
||||
|
|
|
@ -3361,35 +3361,6 @@ TEST_F(KernelImplicitArgTests, givenKernelWithImplicitArgsWhenSettingKernelParam
|
|||
EXPECT_EQ(0, memcmp(pImplicitArgs, &expectedImplicitArgs, sizeof(ImplicitArgs)));
|
||||
}
|
||||
|
||||
using MultiTileModuleTest = Test<MultiTileModuleFixture>;
|
||||
|
||||
HWTEST2_F(MultiTileModuleTest, GivenMultiTileDeviceWhenSettingKernelArgAndSurfaceStateThenMultiTileFlagsAreSetCorrectly, IsXeHpCore) {
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
ze_kernel_desc_t desc = {};
|
||||
desc.pKernelName = kernelName.c_str();
|
||||
|
||||
WhiteBoxKernelHw<gfxCoreFamily> mockKernel;
|
||||
mockKernel.module = modules[0].get();
|
||||
mockKernel.initialize(&desc);
|
||||
|
||||
auto &arg = const_cast<NEO::ArgDescPointer &>(mockKernel.kernelImmData->getDescriptor().payloadMappings.explicitArgs[0].template as<NEO::ArgDescPointer>());
|
||||
arg.bindless = undefined<CrossThreadDataOffset>;
|
||||
arg.bindful = 0x40;
|
||||
|
||||
constexpr size_t size = 128;
|
||||
uint64_t gpuAddress = 0x2000;
|
||||
char bufferArray[size] = {};
|
||||
void *buffer = reinterpret_cast<void *>(bufferArray);
|
||||
NEO::MockGraphicsAllocation mockAllocation(buffer, gpuAddress, size);
|
||||
|
||||
mockKernel.setBufferSurfaceState(0, buffer, &mockAllocation);
|
||||
|
||||
void *surfaceStateAddress = ptrOffset(mockKernel.surfaceStateHeapData.get(), arg.bindful);
|
||||
RENDER_SURFACE_STATE *surfaceState = reinterpret_cast<RENDER_SURFACE_STATE *>(surfaceStateAddress);
|
||||
EXPECT_FALSE(surfaceState->getDisableSupportForMultiGpuAtomics());
|
||||
EXPECT_FALSE(surfaceState->getDisableSupportForMultiGpuPartialWrites());
|
||||
}
|
||||
|
||||
using BindlessKernelTest = Test<DeviceFixture>;
|
||||
|
||||
TEST_F(BindlessKernelTest, givenBindlessKernelWhenPatchingCrossThreadDataThenCorrectBindlessOffsetsAreWritten) {
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2021-2023 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
|
@ -1,829 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/l3_range.h"
|
||||
#include "shared/source/helpers/register_offsets.h"
|
||||
#include "shared/source/helpers/state_base_address.h"
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
#include "shared/test/common/mocks/mock_timestamp_packet.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.h"
|
||||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||
#include "level_zero/core/test/unit_tests/fixtures/module_fixture.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_cmdlist.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_kernel.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_module.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
|
||||
using CommandListCreate = Test<DeviceFixture>;
|
||||
using CommandListAppendLaunchKernel = Test<ModuleFixture>;
|
||||
|
||||
using CommandListAppendLaunchKernelWithAtomics = Test<ModuleFixture>;
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithNoGlobalAtomicsThenLastSentGlobalAtomicsInContainerStaysFalse, IsXeHpCore) {
|
||||
Mock<::L0::KernelImp> kernel;
|
||||
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
||||
kernel.module = pMockModule.get();
|
||||
|
||||
kernel.setGroupSize(1, 1, 1);
|
||||
ze_group_count_t groupCount{8, 1, 1};
|
||||
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
pCommandList->partitionCount = 2;
|
||||
|
||||
auto &kernelAttributes = kernel.immutableData.kernelDescriptor->kernelAttributes;
|
||||
kernelAttributes.flags.useGlobalAtomics = false;
|
||||
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
|
||||
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithGlobalAtomicsThenLastSentGlobalAtomicsInContainerIsSetToTrue, IsXeHpCore) {
|
||||
Mock<::L0::KernelImp> kernel;
|
||||
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
||||
kernel.module = pMockModule.get();
|
||||
|
||||
kernel.setGroupSize(1, 1, 1);
|
||||
ze_group_count_t groupCount{8, 1, 1};
|
||||
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
pCommandList->partitionCount = 2;
|
||||
|
||||
auto &kernelAttributes = kernel.immutableData.kernelDescriptor->kernelAttributes;
|
||||
kernelAttributes.flags.useGlobalAtomics = true;
|
||||
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
|
||||
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
EXPECT_TRUE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithGlobalAtomicsAndLastSentGlobalAtomicsInContainerTrueThenLastSentGlobalAtomicsStaysTrue, IsXeHpCore) {
|
||||
Mock<::L0::KernelImp> kernel;
|
||||
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
||||
kernel.module = pMockModule.get();
|
||||
|
||||
kernel.setGroupSize(1, 1, 1);
|
||||
ze_group_count_t groupCount{8, 1, 1};
|
||||
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
pCommandList->partitionCount = 2;
|
||||
|
||||
auto &kernelAttributes = kernel.immutableData.kernelDescriptor->kernelAttributes;
|
||||
kernelAttributes.flags.useGlobalAtomics = true;
|
||||
pCommandList->commandContainer.lastSentUseGlobalAtomics = true;
|
||||
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
EXPECT_TRUE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithNoGlobalAtomicsAndLastSentGlobalAtomicsInContainerTrueThenLastSentGlobalAtomicsIsSetToFalse, IsXeHpCore) {
|
||||
Mock<::L0::KernelImp> kernel;
|
||||
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
||||
kernel.module = pMockModule.get();
|
||||
|
||||
kernel.setGroupSize(1, 1, 1);
|
||||
ze_group_count_t groupCount{8, 1, 1};
|
||||
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
pCommandList->partitionCount = 2;
|
||||
|
||||
auto &kernelAttributes = kernel.immutableData.kernelDescriptor->kernelAttributes;
|
||||
kernelAttributes.flags.useGlobalAtomics = false;
|
||||
pCommandList->commandContainer.lastSentUseGlobalAtomics = true;
|
||||
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernelWithAtomics, givenKernelWithGlobalAtomicsAndNoImplicitScalingThenLastSentGlobalAtomicsInContainerStaysFalse, IsXeHpCore) {
|
||||
Mock<::L0::KernelImp> kernel;
|
||||
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
||||
kernel.module = pMockModule.get();
|
||||
|
||||
kernel.setGroupSize(1, 1, 1);
|
||||
ze_group_count_t groupCount{8, 1, 1};
|
||||
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
auto &kernelAttributes = kernel.immutableData.kernelDescriptor->kernelAttributes;
|
||||
kernelAttributes.flags.useGlobalAtomics = true;
|
||||
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
|
||||
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, nullptr, launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
EXPECT_FALSE(pCommandList->commandContainer.lastSentUseGlobalAtomics);
|
||||
}
|
||||
|
||||
struct MultTileCommandListAppendLaunchKernelL3FlushFixture : public MultiTileCommandListFixture<false, false, false> {
|
||||
using BaseClass = MultiTileCommandListFixture<false, false, false>;
|
||||
void setUp() {
|
||||
DebugManager.flags.CompactL3FlushEventPacket.set(0);
|
||||
BaseClass::setUp();
|
||||
}
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
};
|
||||
|
||||
using MultTileCommandListAppendLaunchKernelL3Flush = Test<MultTileCommandListAppendLaunchKernelL3FlushFixture>;
|
||||
|
||||
HWTEST2_F(MultTileCommandListAppendLaunchKernelL3Flush, givenKernelWithRegularEventAndWithWalkerPartitionThenProperCommandsEncoded, IsXeHpCore) {
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION;
|
||||
|
||||
Mock<::L0::KernelImp> kernel;
|
||||
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
||||
kernel.module = pMockModule.get();
|
||||
|
||||
kernel.setGroupSize(1, 1, 1);
|
||||
ze_group_count_t groupCount{8, 1, 1};
|
||||
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
pCommandList->partitionCount = 2;
|
||||
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.count = 1;
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
eventDesc.wait = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
|
||||
auto eventPool = std::unique_ptr<L0::EventPool>(L0::EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result));
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
auto gpuAddress = event->getGpuAddress(device) +
|
||||
(pCommandList->partitionCount * event->getSinglePacketSize()) +
|
||||
event->getContextEndOffset();
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(pCommandList->commandContainer.getCommandStream()->getCpuBase(), 0), pCommandList->commandContainer.getCommandStream()->getUsed()));
|
||||
|
||||
EXPECT_EQ(2u, pCommandList->partitionCount);
|
||||
auto itorLri = find<MI_LOAD_REGISTER_IMM *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_EQ(cmdList.end(), itorLri);
|
||||
auto itorPC = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(0u, itorPC.size());
|
||||
uint32_t postSyncCount = 0u;
|
||||
for (auto it : itorPC) {
|
||||
auto cmd = genCmdCast<PIPE_CONTROL *>(*it);
|
||||
if (cmd->getPostSyncOperation() == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
|
||||
EXPECT_EQ(gpuAddress, NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*cmd));
|
||||
EXPECT_TRUE(cmd->getWorkloadPartitionIdOffsetEnable());
|
||||
postSyncCount++;
|
||||
}
|
||||
}
|
||||
ASSERT_LE(1u, postSyncCount);
|
||||
}
|
||||
|
||||
HWTEST2_F(MultTileCommandListAppendLaunchKernelL3Flush, givenKernelWithTimestampEventAndWithWalkerPartitionThenProperCommandsEncoded, IsXeHpCore) {
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION;
|
||||
|
||||
Mock<::L0::KernelImp> kernel;
|
||||
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
||||
kernel.module = pMockModule.get();
|
||||
|
||||
kernel.setGroupSize(1, 1, 1);
|
||||
ze_group_count_t groupCount{8, 1, 1};
|
||||
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
pCommandList->partitionCount = 2;
|
||||
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.count = 1;
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
eventDesc.wait = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
|
||||
auto eventPool = std::unique_ptr<L0::EventPool>(L0::EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result));
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
auto gpuAddress = event->getGpuAddress(device) +
|
||||
(pCommandList->partitionCount * event->getSinglePacketSize()) +
|
||||
event->getContextEndOffset();
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(pCommandList->commandContainer.getCommandStream()->getCpuBase(), 0), pCommandList->commandContainer.getCommandStream()->getUsed()));
|
||||
|
||||
EXPECT_EQ(2u, pCommandList->partitionCount);
|
||||
auto itorLri = findAll<MI_LOAD_REGISTER_IMM *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_EQ(0u, itorLri.size());
|
||||
auto itorPC = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(0u, itorPC.size());
|
||||
uint32_t postSyncCount = 0u;
|
||||
for (auto it : itorPC) {
|
||||
auto cmd = genCmdCast<PIPE_CONTROL *>(*it);
|
||||
if (cmd->getPostSyncOperation() == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
|
||||
EXPECT_EQ(gpuAddress, NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*cmd));
|
||||
EXPECT_TRUE(cmd->getWorkloadPartitionIdOffsetEnable());
|
||||
postSyncCount++;
|
||||
}
|
||||
}
|
||||
ASSERT_LE(1u, postSyncCount);
|
||||
}
|
||||
|
||||
struct CommandListAppendLaunchKernelL3FlushFixture : public ModuleFixture {
|
||||
void setUp() {
|
||||
DebugManager.flags.CompactL3FlushEventPacket.set(0);
|
||||
ModuleFixture::setUp();
|
||||
}
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
};
|
||||
|
||||
using CommandListAppendLaunchKernelL3Flush = Test<CommandListAppendLaunchKernelL3FlushFixture>;
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventAndWithoutWalkerPartitionThenProperCommandsEncoded, IsXeHpCore) {
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
|
||||
Mock<::L0::KernelImp> kernel;
|
||||
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
||||
kernel.module = pMockModule.get();
|
||||
|
||||
kernel.setGroupSize(1, 1, 1);
|
||||
ze_group_count_t groupCount{8, 1, 1};
|
||||
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.count = 1;
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
|
||||
auto eventPool = std::unique_ptr<L0::EventPool>(L0::EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result));
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(pCommandList->commandContainer.getCommandStream()->getCpuBase(), 0), pCommandList->commandContainer.getCommandStream()->getUsed()));
|
||||
|
||||
EXPECT_EQ(1u, pCommandList->partitionCount);
|
||||
auto itorLri = find<MI_LOAD_REGISTER_IMM *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_EQ(cmdList.end(), itorLri);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventHostScopeWithoutWalkerPartitionThenEventL3FlushWaSet, IsXeHpCore) {
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
|
||||
Mock<::L0::KernelImp> kernel;
|
||||
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
||||
kernel.module = pMockModule.get();
|
||||
|
||||
kernel.setGroupSize(1, 1, 1);
|
||||
ze_group_count_t groupCount{8, 1, 1};
|
||||
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.count = 1;
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
|
||||
auto eventPool = std::unique_ptr<L0::EventPool>(L0::EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result));
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
EXPECT_EQ(true, event->getL3FlushForCurrenKernel());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventZeroScopeWithoutWalkerPartitionThenEventL3FlushNotSet, IsXeHpCore) {
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
|
||||
Mock<::L0::KernelImp> kernel;
|
||||
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
||||
kernel.module = pMockModule.get();
|
||||
|
||||
kernel.setGroupSize(1, 1, 1);
|
||||
ze_group_count_t groupCount{8, 1, 1};
|
||||
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.count = 1;
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
|
||||
auto eventPool = std::unique_ptr<L0::EventPool>(L0::EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result));
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
EXPECT_EQ(false, event->getL3FlushForCurrenKernel());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernelL3Flush, givenKernelWithEventHostScopeWithoutWalkerPartitionThenSkipOddPacketsDuringQuery, IsXeHpCore) {
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
|
||||
Mock<::L0::KernelImp> kernel;
|
||||
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
||||
kernel.module = pMockModule.get();
|
||||
|
||||
kernel.setGroupSize(1, 1, 1);
|
||||
ze_group_count_t groupCount{8, 1, 1};
|
||||
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.count = 1;
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE | ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
|
||||
auto eventPool = std::unique_ptr<L0::EventPool>(L0::EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result));
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
result = pCommandList->appendLaunchKernelWithParams(&kernel, &groupCount, event.get(), launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
EXPECT_EQ(true, event->getL3FlushForCurrenKernel());
|
||||
EXPECT_EQ(2u, event->getPacketsInUse());
|
||||
|
||||
typename MockTimestampPackets32::Packet data[3] = {};
|
||||
data[0].contextStart = 3u;
|
||||
data[0].contextEnd = 4u;
|
||||
data[0].globalStart = 5u;
|
||||
data[0].globalEnd = 6u;
|
||||
data[1].contextStart = 2u;
|
||||
data[1].contextEnd = 6u;
|
||||
data[1].globalStart = 4u;
|
||||
data[1].globalEnd = 8u;
|
||||
event->hostAddress = &data;
|
||||
|
||||
ze_kernel_timestamp_result_t tsResult = {};
|
||||
|
||||
event->queryKernelTimestamp(&tsResult);
|
||||
EXPECT_EQ(data[0].contextStart, tsResult.context.kernelStart);
|
||||
EXPECT_EQ(data[0].contextEnd, tsResult.context.kernelEnd);
|
||||
EXPECT_EQ(data[0].globalStart, tsResult.global.kernelStart);
|
||||
EXPECT_EQ(data[0].globalEnd, tsResult.global.kernelEnd);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListCreate, WhenCreatingCommandListThenBindingTablePoolAllocAddedToBatchBuffer, IsXeHpCore) {
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
ze_result_t returnValue;
|
||||
std::unique_ptr<L0::CommandList> commandList(CommandList::create(productFamily, device, NEO::EngineGroupType::Compute, 0u, returnValue));
|
||||
auto &commandContainer = commandList->commandContainer;
|
||||
auto gmmHelper = commandContainer.getDevice()->getGmmHelper();
|
||||
|
||||
ASSERT_NE(nullptr, commandContainer.getCommandStream());
|
||||
auto usedSpaceBefore = commandContainer.getCommandStream()->getUsed();
|
||||
|
||||
auto result = commandList->close();
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
auto usedSpaceAfter = commandContainer.getCommandStream()->getUsed();
|
||||
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(cmdList,
|
||||
ptrOffset(commandContainer.getCommandStream()->getCpuBase(), 0),
|
||||
usedSpaceAfter));
|
||||
|
||||
auto itor = find<_3DSTATE_BINDING_TABLE_POOL_ALLOC *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(cmdList.end(), itor);
|
||||
|
||||
{
|
||||
|
||||
uint32_t streamBuffer[50] = {};
|
||||
NEO::LinearStream linearStream(streamBuffer, sizeof(streamBuffer));
|
||||
|
||||
NEO::StateBaseAddressHelper<FamilyType>::programBindingTableBaseAddress(
|
||||
linearStream,
|
||||
*commandContainer.getIndirectHeap(NEO::HeapType::SURFACE_STATE),
|
||||
gmmHelper);
|
||||
|
||||
auto expectedCommand = reinterpret_cast<_3DSTATE_BINDING_TABLE_POOL_ALLOC *>(streamBuffer);
|
||||
|
||||
auto programmedCommand = genCmdCast<_3DSTATE_BINDING_TABLE_POOL_ALLOC *>(*itor);
|
||||
|
||||
EXPECT_EQ(0, memcmp(expectedCommand, programmedCommand, sizeof(_3DSTATE_BINDING_TABLE_POOL_ALLOC)));
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListCreate, givenNotCopyCommandListWhenProfilingEventBeforeCommandThenStoreRegMemAdded, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using MI_LOAD_REGISTER_REG = typename GfxFamily::MI_LOAD_REGISTER_REG;
|
||||
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.count = 1;
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
eventDesc.signal = 0;
|
||||
eventDesc.wait = 0;
|
||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||
auto eventPool = std::unique_ptr<L0::EventPool>(L0::EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result));
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
commandList->appendEventForProfiling(event.get(), true);
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
|
||||
|
||||
auto itor = find<MI_LOAD_REGISTER_REG *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itor);
|
||||
auto cmd = genCmdCast<MI_LOAD_REGISTER_REG *>(*itor);
|
||||
EXPECT_EQ(cmd->getSourceRegisterAddress(), REG_GLOBAL_TIMESTAMP_LDW);
|
||||
itor++;
|
||||
itor = find<MI_LOAD_REGISTER_REG *>(itor, cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itor);
|
||||
cmd = genCmdCast<MI_LOAD_REGISTER_REG *>(*itor);
|
||||
EXPECT_EQ(cmd->getSourceRegisterAddress(), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListCreate, givenNotCopyCommandListWhenProfilingEventAfterCommandThenPipeControlAndStoreRegMemAdded, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using MI_LOAD_REGISTER_REG = typename GfxFamily::MI_LOAD_REGISTER_REG;
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
|
||||
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.count = 1;
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
eventDesc.signal = 0;
|
||||
eventDesc.wait = 0;
|
||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||
auto eventPool = std::unique_ptr<L0::EventPool>(L0::EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result));
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
commandList->appendEventForProfiling(event.get(), false);
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
|
||||
|
||||
auto itor = find<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itor);
|
||||
itor++;
|
||||
itor = find<MI_LOAD_REGISTER_REG *>(itor, cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itor);
|
||||
auto cmd = genCmdCast<MI_LOAD_REGISTER_REG *>(*itor);
|
||||
EXPECT_EQ(cmd->getSourceRegisterAddress(), REG_GLOBAL_TIMESTAMP_LDW);
|
||||
itor++;
|
||||
itor = find<MI_LOAD_REGISTER_REG *>(itor, cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itor);
|
||||
cmd = genCmdCast<MI_LOAD_REGISTER_REG *>(*itor);
|
||||
EXPECT_EQ(cmd->getSourceRegisterAddress(), GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListCreate, givenCopyCommandListWhenProfilingEventThenStoreRegCommandIsAdded, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using MI_STORE_REGISTER_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM;
|
||||
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
commandList->initialize(device, NEO::EngineGroupType::Copy, 0u);
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.count = 1;
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||
auto eventPool = std::unique_ptr<L0::EventPool>(L0::EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, result));
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
auto event = std::unique_ptr<L0::Event>(L0::Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
commandList->appendEventForProfiling(event.get(), false);
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
|
||||
auto itor = find<MI_STORE_REGISTER_MEM *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itor);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListCreate, givenAllocationsWhenAppendRangesBarrierThenL3ControlIsProgrammed, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using L3_CONTROL = typename GfxFamily::L3_CONTROL;
|
||||
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
commandList->initialize(device, NEO::EngineGroupType::Copy, 0u);
|
||||
uint64_t gpuAddress = 0x1200;
|
||||
void *buffer = reinterpret_cast<void *>(gpuAddress);
|
||||
size_t size = 0x1100;
|
||||
|
||||
NEO::MockGraphicsAllocation mockAllocation(buffer, gpuAddress, size);
|
||||
NEO::SvmAllocationData allocData(0);
|
||||
allocData.size = size;
|
||||
allocData.gpuAllocations.addAllocation(&mockAllocation);
|
||||
device->getDriverHandle()->getSvmAllocsManager()->insertSVMAlloc(allocData);
|
||||
const void *ranges[] = {buffer};
|
||||
const size_t sizes[] = {size};
|
||||
commandList->applyMemoryRangesBarrier(1, sizes, ranges);
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
|
||||
auto itor = find<L3_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itor);
|
||||
EXPECT_EQ(cmdList.end(), ++itor);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListCreate, givenAllocationWithSizeTooBigForL3ControlWhenAppendRangesBarrierThenTwoL3ControlAreProgrammed, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using L3_CONTROL = typename GfxFamily::L3_CONTROL;
|
||||
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
commandList->initialize(device, NEO::EngineGroupType::Copy, 0u);
|
||||
uint64_t gpuAddress = 0x2000;
|
||||
void *buffer = reinterpret_cast<void *>(gpuAddress);
|
||||
size_t size = NEO::L3Range::maxSingleRange * (NEO::maxFlushSubrangeCount + 1);
|
||||
|
||||
NEO::MockGraphicsAllocation mockAllocation(buffer, gpuAddress, size);
|
||||
NEO::SvmAllocationData allocData(0);
|
||||
allocData.size = size;
|
||||
allocData.gpuAllocations.addAllocation(&mockAllocation);
|
||||
device->getDriverHandle()->getSvmAllocsManager()->insertSVMAlloc(allocData);
|
||||
const void *ranges[] = {buffer};
|
||||
const size_t sizes[] = {size};
|
||||
commandList->applyMemoryRangesBarrier(1, sizes, ranges);
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
|
||||
auto itor = find<L3_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itor);
|
||||
EXPECT_NE(cmdList.end(), ++itor);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListCreate, givenRangeSizeTwiceBiggerThanAllocWhenAppendRangesBarrierThenL3ControlIsNotProgrammed, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using L3_CONTROL = typename GfxFamily::L3_CONTROL;
|
||||
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
commandList->initialize(device, NEO::EngineGroupType::Copy, 0u);
|
||||
uint64_t gpuAddress = 0x1200;
|
||||
void *buffer = reinterpret_cast<void *>(gpuAddress);
|
||||
size_t size = 0x1000;
|
||||
|
||||
NEO::MockGraphicsAllocation mockAllocation(buffer, gpuAddress, size);
|
||||
NEO::SvmAllocationData allocData(0);
|
||||
allocData.size = size;
|
||||
allocData.gpuAllocations.addAllocation(&mockAllocation);
|
||||
device->getDriverHandle()->getSvmAllocsManager()->insertSVMAlloc(allocData);
|
||||
const void *ranges[] = {buffer};
|
||||
const size_t sizes[] = {2 * size};
|
||||
commandList->applyMemoryRangesBarrier(1, sizes, ranges);
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
|
||||
auto itor = find<L3_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_EQ(cmdList.end(), itor);
|
||||
}
|
||||
HWTEST2_F(CommandListCreate, givenRangeNotInSvmManagerThanAllocWhenAppendRangesBarrierThenL3ControlIsNotProgrammed, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using L3_CONTROL = typename GfxFamily::L3_CONTROL;
|
||||
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
commandList->initialize(device, NEO::EngineGroupType::Copy, 0u);
|
||||
uint64_t gpuAddress = 0x1200;
|
||||
void *buffer = reinterpret_cast<void *>(gpuAddress);
|
||||
size_t size = 0x1000;
|
||||
|
||||
const void *ranges[] = {buffer};
|
||||
const size_t sizes[] = {size};
|
||||
commandList->applyMemoryRangesBarrier(1, sizes, ranges);
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
|
||||
auto itor = find<L3_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_EQ(cmdList.end(), itor);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListCreate, givenRangeNotAlignedToPageWhenAppendRangesBarrierThenCommandAddressIsAligned, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using L3_CONTROL = typename GfxFamily::L3_CONTROL;
|
||||
using L3_FLUSH_ADDRESS_RANGE = typename GfxFamily::L3_FLUSH_ADDRESS_RANGE;
|
||||
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
commandList->initialize(device, NEO::EngineGroupType::Copy, 0u);
|
||||
uint64_t gpuAddress = 0x1200;
|
||||
void *buffer = reinterpret_cast<void *>(gpuAddress);
|
||||
size_t size = 0x1100;
|
||||
|
||||
NEO::MockGraphicsAllocation mockAllocation(buffer, gpuAddress, size);
|
||||
NEO::SvmAllocationData allocData(0);
|
||||
allocData.size = size;
|
||||
allocData.gpuAllocations.addAllocation(&mockAllocation);
|
||||
device->getDriverHandle()->getSvmAllocsManager()->insertSVMAlloc(allocData);
|
||||
const void *ranges[] = {buffer};
|
||||
const size_t sizes[] = {size};
|
||||
commandList->applyMemoryRangesBarrier(1, sizes, ranges);
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
|
||||
auto itor = find<L3_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itor);
|
||||
auto programmedCommand = genCmdCast<L3_CONTROL *>(*itor);
|
||||
programmedCommand++;
|
||||
L3_FLUSH_ADDRESS_RANGE *l3Ranges = reinterpret_cast<L3_FLUSH_ADDRESS_RANGE *>(programmedCommand);
|
||||
EXPECT_EQ(l3Ranges->getAddress(), alignDown(gpuAddress, MemoryConstants::pageSize));
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListCreate, givenRangeBetweenTwoPagesWhenAppendRangesBarrierThenAddressMaskIsCorrect, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using L3_CONTROL = typename GfxFamily::L3_CONTROL;
|
||||
using L3_FLUSH_ADDRESS_RANGE = typename GfxFamily::L3_FLUSH_ADDRESS_RANGE;
|
||||
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||
commandList->initialize(device, NEO::EngineGroupType::Copy, 0u);
|
||||
uint64_t gpuAddress = 2 * MemoryConstants::pageSize + MemoryConstants::pageSize / 2;
|
||||
void *buffer = reinterpret_cast<void *>(gpuAddress);
|
||||
size_t size = MemoryConstants::pageSize / 2 + 1;
|
||||
|
||||
NEO::MockGraphicsAllocation mockAllocation(buffer, gpuAddress, size);
|
||||
NEO::SvmAllocationData allocData(0);
|
||||
allocData.size = size;
|
||||
allocData.gpuAllocations.addAllocation(&mockAllocation);
|
||||
device->getDriverHandle()->getSvmAllocsManager()->insertSVMAlloc(allocData);
|
||||
const void *ranges[] = {buffer};
|
||||
const size_t sizes[] = {size};
|
||||
commandList->applyMemoryRangesBarrier(1, sizes, ranges);
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), commandList->commandContainer.getCommandStream()->getUsed()));
|
||||
auto itor = find<L3_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itor);
|
||||
auto programmedCommand = genCmdCast<L3_CONTROL *>(*itor);
|
||||
programmedCommand++;
|
||||
L3_FLUSH_ADDRESS_RANGE *l3Ranges = reinterpret_cast<L3_FLUSH_ADDRESS_RANGE *>(programmedCommand);
|
||||
EXPECT_EQ(l3Ranges->getAddressMask(), NEO::L3Range::getMaskFromSize(2 * MemoryConstants::pageSize));
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernel, givenEventWhenInvokingAppendLaunchKernelThenPostSyncIsAdded, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using POSTSYNC_DATA = typename FamilyType::POSTSYNC_DATA;
|
||||
using WALKER_TYPE = typename FamilyType::WALKER_TYPE;
|
||||
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.CompactL3FlushEventPacket.set(0);
|
||||
|
||||
createKernel();
|
||||
ze_result_t returnValue;
|
||||
std::unique_ptr<L0::CommandList> commandList(L0::CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue));
|
||||
auto usedSpaceBefore = commandList->commandContainer.getCommandStream()->getUsed();
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE;
|
||||
eventPoolDesc.count = 1;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
eventDesc.signal = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
eventDesc.wait = ZE_EVENT_SCOPE_FLAG_HOST;
|
||||
|
||||
auto eventPool = std::unique_ptr<EventPool>(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, returnValue));
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
|
||||
auto event = std::unique_ptr<Event>(Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
|
||||
ze_group_count_t groupCount{1, 1, 1};
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
auto result = commandList->appendLaunchKernel(kernel->toHandle(), &groupCount, event->toHandle(), 0, nullptr, launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
auto usedSpaceAfter = commandList->commandContainer.getCommandStream()->getUsed();
|
||||
EXPECT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
GenCmdList cmdList;
|
||||
EXPECT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), usedSpaceAfter));
|
||||
|
||||
bool postSyncFound = false;
|
||||
auto gpuAddress = event->getGpuAddress(device);
|
||||
|
||||
auto itorPS = findAll<WALKER_TYPE *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(0u, itorPS.size());
|
||||
|
||||
for (auto it : itorPS) {
|
||||
auto cmd = genCmdCast<WALKER_TYPE *>(*it);
|
||||
auto &postSync = cmd->getPostSync();
|
||||
EXPECT_EQ(POSTSYNC_DATA::OPERATION_WRITE_TIMESTAMP, postSync.getOperation());
|
||||
EXPECT_EQ(gpuAddress, postSync.getDestinationAddress());
|
||||
postSyncFound = true;
|
||||
}
|
||||
EXPECT_TRUE(postSyncFound);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandListAppendLaunchKernel, givenTimestampEventWhenInvokingAppendLaunchKernelThenPostSyncIsAdded, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using POSTSYNC_DATA = typename FamilyType::POSTSYNC_DATA;
|
||||
using WALKER_TYPE = typename FamilyType::WALKER_TYPE;
|
||||
|
||||
createKernel();
|
||||
ze_result_t returnValue;
|
||||
std::unique_ptr<L0::CommandList> commandList(L0::CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue));
|
||||
auto usedSpaceBefore = commandList->commandContainer.getCommandStream()->getUsed();
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.count = 1;
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
|
||||
auto eventPool = std::unique_ptr<EventPool>(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, returnValue));
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
|
||||
auto event = std::unique_ptr<Event>(Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
|
||||
ze_group_count_t groupCount{1, 1, 1};
|
||||
CmdListKernelLaunchParams launchParams = {};
|
||||
auto result = commandList->appendLaunchKernel(kernel->toHandle(), &groupCount, event->toHandle(), 0, nullptr, launchParams);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
auto usedSpaceAfter = commandList->commandContainer.getCommandStream()->getUsed();
|
||||
EXPECT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
GenCmdList cmdList;
|
||||
EXPECT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandList->commandContainer.getCommandStream()->getCpuBase(), 0), usedSpaceAfter));
|
||||
|
||||
bool postSyncFound = false;
|
||||
auto gpuAddress = event->getGpuAddress(device);
|
||||
|
||||
auto itorPS = findAll<WALKER_TYPE *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(0u, itorPS.size());
|
||||
|
||||
for (auto it : itorPS) {
|
||||
auto cmd = genCmdCast<WALKER_TYPE *>(*it);
|
||||
auto &postSync = cmd->getPostSync();
|
||||
EXPECT_EQ(POSTSYNC_DATA::OPERATION_WRITE_TIMESTAMP, postSync.getOperation());
|
||||
EXPECT_EQ(gpuAddress, postSync.getDestinationAddress());
|
||||
postSyncFound = true;
|
||||
}
|
||||
EXPECT_TRUE(postSyncFound);
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
|
@ -1,100 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/linear_stream.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_cmdlist.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_cmdqueue.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_device.h"
|
||||
#include "level_zero/core/test/unit_tests/mocks/mock_memory_manager.h"
|
||||
#include <level_zero/ze_api.h>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
|
||||
using CommandQueueExecuteCommandListsXE_HP_CORE = Test<DeviceFixture>;
|
||||
|
||||
XE_HP_CORE_TEST_F(CommandQueueExecuteCommandListsXE_HP_CORE, WhenExecutingCmdListsThenPipelineSelectAndCfeStateAreAddedToCmdBuffer) {
|
||||
const ze_command_queue_desc_t desc = {};
|
||||
ze_result_t returnValue;
|
||||
auto commandQueue = whiteboxCast(CommandQueue::create(
|
||||
productFamily,
|
||||
device, neoDevice->getDefaultEngine().commandStreamReceiver, &desc, false, false, returnValue));
|
||||
ASSERT_NE(nullptr, commandQueue);
|
||||
auto usedSpaceBefore = commandQueue->commandStream.getUsed();
|
||||
|
||||
ze_command_list_handle_t commandLists[] = {
|
||||
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
|
||||
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
|
||||
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
|
||||
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
auto usedSpaceAfter = commandQueue->commandStream.getUsed();
|
||||
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter));
|
||||
|
||||
using CFE_STATE = typename FamilyType::CFE_STATE;
|
||||
auto itorCFE = find<CFE_STATE *>(cmdList.begin(), cmdList.end());
|
||||
ASSERT_NE(itorCFE, cmdList.end());
|
||||
|
||||
// Should have a PS before a CFE
|
||||
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
|
||||
auto itorPS = find<PIPELINE_SELECT *>(cmdList.begin(), itorCFE);
|
||||
ASSERT_NE(itorPS, itorCFE);
|
||||
{
|
||||
auto cmd = genCmdCast<PIPELINE_SELECT *>(*itorPS);
|
||||
EXPECT_EQ(cmd->getMaskBits() & 3u, 3u);
|
||||
EXPECT_EQ(cmd->getPipelineSelection(), PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU);
|
||||
}
|
||||
|
||||
CommandList::fromHandle(commandLists[0])->destroy();
|
||||
commandQueue->destroy();
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(CommandQueueExecuteCommandListsXE_HP_CORE, WhenExecutingCmdListsThenStateBaseAddressForGeneralStateBaseAddressIsNotAdded) {
|
||||
const ze_command_queue_desc_t desc = {};
|
||||
ze_result_t returnValue;
|
||||
auto commandQueue = whiteboxCast(CommandQueue::create(
|
||||
productFamily,
|
||||
device, neoDevice->getDefaultEngine().commandStreamReceiver, &desc, false, false, returnValue));
|
||||
ASSERT_NE(nullptr, commandQueue);
|
||||
auto usedSpaceBefore = commandQueue->commandStream.getUsed();
|
||||
|
||||
ze_command_list_handle_t commandLists[] = {
|
||||
CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)->toHandle()};
|
||||
uint32_t numCommandLists = sizeof(commandLists) / sizeof(commandLists[0]);
|
||||
auto result = commandQueue->executeCommandLists(numCommandLists, commandLists, nullptr, true);
|
||||
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||
|
||||
auto usedSpaceAfter = commandQueue->commandStream.getUsed();
|
||||
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(commandQueue->commandStream.getCpuBase(), 0), usedSpaceAfter));
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
|
||||
auto itorSba = find<STATE_BASE_ADDRESS *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_EQ(itorSba, cmdList.end());
|
||||
|
||||
CommandList::fromHandle(commandLists[0])->destroy();
|
||||
commandQueue->destroy();
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
|
@ -1,147 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
|
||||
using DeviceFixtureXeHpCore = Test<DeviceFixture>;
|
||||
|
||||
HWTEST2_F(DeviceFixtureXeHpCore, GivenTargetXeHpCoreaWhenGettingMemoryPropertiesThenMemoryNameComesAsHBM, IsXeHpCore) {
|
||||
ze_device_memory_properties_t memProperties = {};
|
||||
uint32_t pCount = 1u;
|
||||
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, device->getMemoryProperties(&pCount, &memProperties));
|
||||
EXPECT_EQ(0, strcmp(memProperties.name, "HBM"));
|
||||
}
|
||||
|
||||
HWTEST2_F(DeviceFixtureXeHpCore, givenReturnedDevicePropertiesThenExpectedPropertyFlagsSet, IsXeHpCore) {
|
||||
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
|
||||
|
||||
device->getProperties(&deviceProps);
|
||||
EXPECT_EQ(0u, deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_ONDEMANDPAGING);
|
||||
EXPECT_EQ(0u, deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_ECC);
|
||||
EXPECT_EQ(0u, deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_SUBDEVICE);
|
||||
EXPECT_EQ(0u, deviceProps.flags & ZE_DEVICE_PROPERTY_FLAG_INTEGRATED);
|
||||
}
|
||||
|
||||
using CommandQueueGroupTest = Test<DeviceFixture>;
|
||||
|
||||
HWTEST2_F(CommandQueueGroupTest, givenNoBlitterSupportAndNoCCSThenOneQueueGroupIsReturned, IsXeHpCore) {
|
||||
const uint32_t rootDeviceIndex = 0u;
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
|
||||
hwInfo.featureTable.flags.ftrCCSNode = false;
|
||||
hwInfo.capabilityTable.blitterOperationsSupported = false;
|
||||
auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, rootDeviceIndex);
|
||||
Mock<L0::DeviceImp> deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment());
|
||||
|
||||
uint32_t count = 0;
|
||||
ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
EXPECT_GE(count, 1u);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandQueueGroupTest, givenNoBlitterSupportAndCCSThenTwoQueueGroupsAreReturned, IsXeHpCore) {
|
||||
const uint32_t rootDeviceIndex = 0u;
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
|
||||
hwInfo.featureTable.flags.ftrCCSNode = true;
|
||||
hwInfo.capabilityTable.blitterOperationsSupported = false;
|
||||
auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, rootDeviceIndex);
|
||||
Mock<L0::DeviceImp> deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment());
|
||||
|
||||
uint32_t count = 0;
|
||||
ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
EXPECT_GE(count, 2u);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandQueueGroupTest, givenBlitterSupportAndCCSThenThreeQueueGroupsAreReturned, IsXeHpCore) {
|
||||
const uint32_t rootDeviceIndex = 0u;
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
|
||||
hwInfo.featureTable.flags.ftrCCSNode = true;
|
||||
hwInfo.capabilityTable.blitterOperationsSupported = true;
|
||||
hwInfo.featureTable.ftrBcsInfo.set(0);
|
||||
auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, rootDeviceIndex);
|
||||
Mock<L0::DeviceImp> deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment());
|
||||
|
||||
uint32_t count = 0;
|
||||
ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
EXPECT_GE(count, 3u);
|
||||
|
||||
std::vector<ze_command_queue_group_properties_t> properties(count);
|
||||
res = deviceImp.getCommandQueueGroupProperties(&count, properties.data());
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
|
||||
auto &engineGroups = neoMockDevice->getRegularEngineGroups();
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
if (engineGroups[i].engineGroupType == NEO::EngineGroupType::RenderCompute) {
|
||||
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE);
|
||||
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
|
||||
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS);
|
||||
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_METRICS);
|
||||
EXPECT_EQ(properties[i].numQueues, 1u);
|
||||
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
|
||||
} else if (engineGroups[i].engineGroupType == NEO::EngineGroupType::Compute) {
|
||||
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COMPUTE);
|
||||
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
|
||||
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COOPERATIVE_KERNELS);
|
||||
uint32_t numerOfCCSEnabled = hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled;
|
||||
EXPECT_EQ(properties[i].numQueues, numerOfCCSEnabled);
|
||||
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, std::numeric_limits<size_t>::max());
|
||||
} else if (engineGroups[i].engineGroupType == NEO::EngineGroupType::Copy) {
|
||||
EXPECT_TRUE(properties[i].flags & ZE_COMMAND_QUEUE_GROUP_PROPERTY_FLAG_COPY);
|
||||
EXPECT_EQ(properties[i].numQueues, hwInfo.featureTable.ftrBcsInfo.count());
|
||||
EXPECT_EQ(properties[i].maxMemoryFillPatternSize, 4 * sizeof(uint32_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class DeviceCopyQueueGroupXeHpCoreFixture : public DeviceFixture {
|
||||
public:
|
||||
void setUp() {
|
||||
DebugManager.flags.EnableBlitterOperationsSupport.set(0);
|
||||
DeviceFixture::setUp();
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
DeviceFixture::tearDown();
|
||||
}
|
||||
DebugManagerStateRestore restorer;
|
||||
};
|
||||
|
||||
using DeviceCopyQueueGroupXeHpCoreTest = Test<DeviceCopyQueueGroupXeHpCoreFixture>;
|
||||
|
||||
HWTEST2_F(DeviceCopyQueueGroupXeHpCoreTest,
|
||||
givenBlitterSupportAndEnableBlitterOperationsSupportSetToZeroThenNoCopyEngineIsReturned, IsXeHpCore) {
|
||||
const uint32_t rootDeviceIndex = 0u;
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
|
||||
hwInfo.featureTable.flags.ftrCCSNode = false;
|
||||
hwInfo.capabilityTable.blitterOperationsSupported = true;
|
||||
hwInfo.featureTable.ftrBcsInfo.set(0);
|
||||
auto *neoMockDevice = NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo,
|
||||
rootDeviceIndex);
|
||||
Mock<L0::DeviceImp> deviceImp(neoMockDevice, neoMockDevice->getExecutionEnvironment());
|
||||
|
||||
uint32_t count = 0;
|
||||
ze_result_t res = deviceImp.getCommandQueueGroupProperties(&count, nullptr);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
|
||||
std::vector<ze_command_queue_group_properties_t> properties(count);
|
||||
res = deviceImp.getCommandQueueGroupProperties(&count, properties.data());
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
|
||||
for (auto &engineGroup : neoMockDevice->getRegularEngineGroups()) {
|
||||
EXPECT_NE(NEO::EngineGroupType::Copy, engineGroup.engineGroupType);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/kernel/kernel_properties.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "level_zero/core/test/unit_tests/fixtures/device_fixture.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
|
||||
using KernelPropertyTest = Test<DeviceFixture>;
|
||||
|
||||
HWTEST2_F(KernelPropertyTest, givenKernelExtendedPropertiesStructureWhenKernelPropertiesCalledThenPropertiesAreCorrectlySet, IsXeHpCore) {
|
||||
ze_device_module_properties_t kernelProperties = {};
|
||||
ze_float_atomic_ext_properties_t kernelExtendedProperties = {};
|
||||
kernelExtendedProperties.stype = ZE_STRUCTURE_TYPE_FLOAT_ATOMIC_EXT_PROPERTIES;
|
||||
kernelProperties.pNext = &kernelExtendedProperties;
|
||||
|
||||
ze_result_t res = device->getKernelProperties(&kernelProperties);
|
||||
EXPECT_EQ(res, ZE_RESULT_SUCCESS);
|
||||
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp16Flags & FP_ATOMIC_EXT_FLAG_GLOBAL_LOAD_STORE);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp16Flags & FP_ATOMIC_EXT_FLAG_GLOBAL_ADD);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp16Flags & FP_ATOMIC_EXT_FLAG_GLOBAL_MIN_MAX);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp16Flags & FP_ATOMIC_EXT_FLAG_LOCAL_LOAD_STORE);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp16Flags & FP_ATOMIC_EXT_FLAG_LOCAL_ADD);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp16Flags & FP_ATOMIC_EXT_FLAG_LOCAL_MIN_MAX);
|
||||
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp32Flags & FP_ATOMIC_EXT_FLAG_GLOBAL_LOAD_STORE);
|
||||
EXPECT_TRUE(kernelExtendedProperties.fp32Flags & FP_ATOMIC_EXT_FLAG_GLOBAL_ADD);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp32Flags & FP_ATOMIC_EXT_FLAG_GLOBAL_MIN_MAX);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp32Flags & FP_ATOMIC_EXT_FLAG_LOCAL_LOAD_STORE);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp32Flags & FP_ATOMIC_EXT_FLAG_LOCAL_ADD);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp32Flags & FP_ATOMIC_EXT_FLAG_LOCAL_MIN_MAX);
|
||||
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp64Flags & FP_ATOMIC_EXT_FLAG_GLOBAL_LOAD_STORE);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp64Flags & FP_ATOMIC_EXT_FLAG_GLOBAL_ADD);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp64Flags & FP_ATOMIC_EXT_FLAG_GLOBAL_MIN_MAX);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp64Flags & FP_ATOMIC_EXT_FLAG_LOCAL_LOAD_STORE);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp64Flags & FP_ATOMIC_EXT_FLAG_LOCAL_ADD);
|
||||
EXPECT_FALSE(kernelExtendedProperties.fp64Flags & FP_ATOMIC_EXT_FLAG_LOCAL_MIN_MAX);
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
|
@ -103,4 +103,4 @@ None.
|
|||
# Known Issues and Limitations
|
||||
|
||||
* Currently supported only on Linux.
|
||||
* Mainly implemented for and validated on Xe HPC (PVC) and XeHP_SDV platforms.
|
||||
* Mainly implemented for and validated on Xe HPC (PVC) platforms.
|
||||
|
|
|
@ -137,48 +137,6 @@ const std::map<std::string, std::map<std::string, uint64_t>> guidToKeyOffsetMap
|
|||
{"DISPLAY_VC1_READS[13]", 1456},
|
||||
{"DISPLAY_VC1_READS[14]", 1464},
|
||||
{"DISPLAY_VC1_READS[15]", 1472}}},
|
||||
{"0xfdc76194", // For XeHP_SDV device
|
||||
{{"HBM0MaxDeviceTemperature", 28},
|
||||
{"HBM1MaxDeviceTemperature", 36},
|
||||
{"TileMinTemperature", 40},
|
||||
{"TileMaxTemperature", 44},
|
||||
{"GTMinTemperature", 48},
|
||||
{"GTMaxTemperature", 52},
|
||||
{"VF0_VFID", 88},
|
||||
{"VF0_HBM0_READ", 92},
|
||||
{"VF0_HBM0_WRITE", 96},
|
||||
{"VF0_HBM1_READ", 104},
|
||||
{"VF0_HBM1_WRITE", 108},
|
||||
{"VF0_TIMESTAMP_L", 168},
|
||||
{"VF0_TIMESTAMP_H", 172},
|
||||
{"VF1_VFID", 176},
|
||||
{"VF1_HBM0_READ", 180},
|
||||
{"VF1_HBM0_WRITE", 184},
|
||||
{"VF1_HBM1_READ", 192},
|
||||
{"VF1_HBM1_WRITE", 196},
|
||||
{"VF1_TIMESTAMP_L", 256},
|
||||
{"VF1_TIMESTAMP_H", 260}}},
|
||||
{"0xfdc76196", // For XeHP_SDV B0 device
|
||||
{{"HBM0MaxDeviceTemperature", 28},
|
||||
{"HBM1MaxDeviceTemperature", 36},
|
||||
{"TileMinTemperature", 40},
|
||||
{"TileMaxTemperature", 44},
|
||||
{"GTMinTemperature", 48},
|
||||
{"GTMaxTemperature", 52},
|
||||
{"VF0_VFID", 88},
|
||||
{"VF0_HBM0_READ", 92},
|
||||
{"VF0_HBM0_WRITE", 96},
|
||||
{"VF0_HBM1_READ", 104},
|
||||
{"VF0_HBM1_WRITE", 108},
|
||||
{"VF0_TIMESTAMP_L", 168},
|
||||
{"VF0_TIMESTAMP_H", 172},
|
||||
{"VF1_VFID", 176},
|
||||
{"VF1_HBM0_READ", 180},
|
||||
{"VF1_HBM0_WRITE", 184},
|
||||
{"VF1_HBM1_READ", 192},
|
||||
{"VF1_HBM1_WRITE", 196},
|
||||
{"VF1_TIMESTAMP_L", 256},
|
||||
{"VF1_TIMESTAMP_H", 260}}},
|
||||
{"0xb15a0edc", // For PVC device
|
||||
{{"HBM0MaxDeviceTemperature", 28},
|
||||
{"HBM1MaxDeviceTemperature", 36},
|
||||
|
|
|
@ -989,23 +989,6 @@ class SysmanGlobalOperationsUuidFixture : public SysmanDeviceFixture {
|
|||
}
|
||||
};
|
||||
|
||||
HWTEST2_F(SysmanGlobalOperationsUuidFixture, GivenValidDeviceFDWhenRetrievingUuidThenDeviceFDIsVerifiedSuccessfully, IsXEHP) {
|
||||
initGlobalOps();
|
||||
|
||||
static bool receivedValidDeviceFd = false;
|
||||
VariableBackup<decltype(NEO::SysCalls::sysCallsGetDevicePath)> mockGetDevicePath(&NEO::SysCalls::sysCallsGetDevicePath, [](int deviceFd, char *buf, size_t &bufSize) -> int {
|
||||
if (deviceFd >= 0) {
|
||||
receivedValidDeviceFd = true;
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
|
||||
std::array<uint8_t, NEO::ProductHelper::uuidSize> uuid;
|
||||
pGlobalOperationsImp->pOsGlobalOperations->getUuid(uuid);
|
||||
EXPECT_EQ(true, receivedValidDeviceFd);
|
||||
receivedValidDeviceFd = false;
|
||||
}
|
||||
|
||||
struct MockGlobalOperationsProductHelper : public ProductHelperHw<IGFX_UNKNOWN> {
|
||||
MockGlobalOperationsProductHelper() = default;
|
||||
bool getUuid(DriverModel *driverModel, const uint32_t subDeviceCount, const uint32_t deviceIndex, std::array<uint8_t, ProductHelper::uuidSize> &uuid) const override {
|
||||
|
|
|
@ -61,7 +61,7 @@ struct MockPmtFsAccess : public L0::Sysman::FsAccess {
|
|||
std::string guidPathForSubdevice1 = baseTelemSysFSNodeForSubdevice1 + std::string("/guid");
|
||||
if ((file.compare(guidPathForSubdevice0) == 0) ||
|
||||
(file.compare(guidPathForSubdevice1) == 0)) {
|
||||
val = "0xfdc76194";
|
||||
val = "0x490e01";
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
return ZE_RESULT_ERROR_NOT_AVAILABLE;
|
||||
|
|
|
@ -136,48 +136,6 @@ const std::map<std::string, std::map<std::string, uint64_t>> guidToKeyOffsetMap
|
|||
{"DISPLAY_VC1_READS[13]", 1456},
|
||||
{"DISPLAY_VC1_READS[14]", 1464},
|
||||
{"DISPLAY_VC1_READS[15]", 1472}}},
|
||||
{"0xfdc76194", // For XeHP_SDV device
|
||||
{{"HBM0MaxDeviceTemperature", 28},
|
||||
{"HBM1MaxDeviceTemperature", 36},
|
||||
{"TileMinTemperature", 40},
|
||||
{"TileMaxTemperature", 44},
|
||||
{"GTMinTemperature", 48},
|
||||
{"GTMaxTemperature", 52},
|
||||
{"VF0_VFID", 88},
|
||||
{"VF0_HBM0_READ", 92},
|
||||
{"VF0_HBM0_WRITE", 96},
|
||||
{"VF0_HBM1_READ", 104},
|
||||
{"VF0_HBM1_WRITE", 108},
|
||||
{"VF0_TIMESTAMP_L", 168},
|
||||
{"VF0_TIMESTAMP_H", 172},
|
||||
{"VF1_VFID", 176},
|
||||
{"VF1_HBM0_READ", 180},
|
||||
{"VF1_HBM0_WRITE", 184},
|
||||
{"VF1_HBM1_READ", 192},
|
||||
{"VF1_HBM1_WRITE", 196},
|
||||
{"VF1_TIMESTAMP_L", 256},
|
||||
{"VF1_TIMESTAMP_H", 260}}},
|
||||
{"0xfdc76196", // For XeHP_SDV B0 device
|
||||
{{"HBM0MaxDeviceTemperature", 28},
|
||||
{"HBM1MaxDeviceTemperature", 36},
|
||||
{"TileMinTemperature", 40},
|
||||
{"TileMaxTemperature", 44},
|
||||
{"GTMinTemperature", 48},
|
||||
{"GTMaxTemperature", 52},
|
||||
{"VF0_VFID", 88},
|
||||
{"VF0_HBM0_READ", 92},
|
||||
{"VF0_HBM0_WRITE", 96},
|
||||
{"VF0_HBM1_READ", 104},
|
||||
{"VF0_HBM1_WRITE", 108},
|
||||
{"VF0_TIMESTAMP_L", 168},
|
||||
{"VF0_TIMESTAMP_H", 172},
|
||||
{"VF1_VFID", 176},
|
||||
{"VF1_HBM0_READ", 180},
|
||||
{"VF1_HBM0_WRITE", 184},
|
||||
{"VF1_HBM1_READ", 192},
|
||||
{"VF1_HBM1_WRITE", 196},
|
||||
{"VF1_TIMESTAMP_L", 256},
|
||||
{"VF1_TIMESTAMP_H", 260}}},
|
||||
{"0xb15a0edc", // For PVC device
|
||||
{{"HBM0MaxDeviceTemperature", 28},
|
||||
{"HBM1MaxDeviceTemperature", 36},
|
||||
|
|
|
@ -60,7 +60,7 @@ struct MockPmtFsAccess : public FsAccess {
|
|||
std::string guidPathForSubdevice1 = baseTelemSysFSNodeForSubdevice1 + std::string("/guid");
|
||||
if ((file.compare(guidPathForSubdevice0) == 0) ||
|
||||
(file.compare(guidPathForSubdevice1) == 0)) {
|
||||
val = "0xfdc76194";
|
||||
val = "0x490e01";
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
return ZE_RESULT_ERROR_NOT_AVAILABLE;
|
||||
|
|
|
@ -604,68 +604,6 @@ HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanM
|
|||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthWhenVFID0IsActiveThenSuccessIsReturnedAndBandwidthIsValid, IsXEHP) {
|
||||
setLocalSupportedAndReinit(true);
|
||||
auto handles = getMemoryHandles(memoryHandleComponentCount);
|
||||
|
||||
for (auto &handle : handles) {
|
||||
zes_mem_bandwidth_t bandwidth{};
|
||||
uint64_t expectedReadCounters = 0, expectedWriteCounters = 0;
|
||||
uint64_t expectedBandwidth = 0;
|
||||
zes_mem_properties_t properties = {ZES_STRUCTURE_TYPE_MEM_PROPERTIES};
|
||||
zesMemoryGetProperties(handle, &properties);
|
||||
|
||||
auto hwInfo = pLinuxSysmanImp->getDeviceHandle()->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
auto &productHelper = pLinuxSysmanImp->getDeviceHandle()->getNEODevice()->getProductHelper();
|
||||
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo);
|
||||
auto pPmt = static_cast<MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId));
|
||||
|
||||
pPmt->mockVfid0Status = true;
|
||||
pSysfsAccess->mockReadUInt64Value.push_back(hbmRP0Frequency);
|
||||
pSysfsAccess->mockReadReturnStatus.push_back(ZE_RESULT_SUCCESS);
|
||||
|
||||
EXPECT_EQ(zesMemoryGetBandwidth(handle, &bandwidth), ZE_RESULT_SUCCESS);
|
||||
expectedReadCounters = vF0Hbm0ReadValue + vF0Hbm1ReadValue + vF0Hbm2ReadValue + vF0Hbm3ReadValue;
|
||||
EXPECT_EQ(bandwidth.readCounter, expectedReadCounters);
|
||||
expectedWriteCounters = vF0Hbm0WriteValue + vF0Hbm1WriteValue + vF0Hbm2WriteValue + vF0Hbm3WriteValue;
|
||||
EXPECT_EQ(bandwidth.writeCounter, expectedWriteCounters);
|
||||
EXPECT_GT(bandwidth.timestamp, 0u);
|
||||
expectedBandwidth = 128 * hbmRP0Frequency * 1000 * 1000 * 4;
|
||||
EXPECT_EQ(bandwidth.maxBandwidth, expectedBandwidth);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidMemoryHandleWhenCallingzesSysmanMemoryGetBandwidthWhenVFID1IsActiveThenSuccessIsReturnedAndBandwidthIsValid, IsXEHP) {
|
||||
setLocalSupportedAndReinit(true);
|
||||
auto handles = getMemoryHandles(memoryHandleComponentCount);
|
||||
|
||||
for (auto &handle : handles) {
|
||||
zes_mem_bandwidth_t bandwidth{};
|
||||
uint64_t expectedReadCounters = 0, expectedWriteCounters = 0;
|
||||
uint64_t expectedBandwidth = 0;
|
||||
zes_mem_properties_t properties = {ZES_STRUCTURE_TYPE_MEM_PROPERTIES};
|
||||
zesMemoryGetProperties(handle, &properties);
|
||||
|
||||
auto hwInfo = pLinuxSysmanImp->getDeviceHandle()->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
auto &productHelper = pLinuxSysmanImp->getDeviceHandle()->getNEODevice()->getProductHelper();
|
||||
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo);
|
||||
auto pPmt = static_cast<MockMemoryPmt *>(pLinuxSysmanImp->getPlatformMonitoringTechAccess(properties.subdeviceId));
|
||||
|
||||
pPmt->mockVfid1Status = true;
|
||||
pSysfsAccess->mockReadUInt64Value.push_back(hbmRP0Frequency);
|
||||
pSysfsAccess->mockReadReturnStatus.push_back(ZE_RESULT_SUCCESS);
|
||||
|
||||
EXPECT_EQ(zesMemoryGetBandwidth(handle, &bandwidth), ZE_RESULT_SUCCESS);
|
||||
expectedReadCounters = vF1Hbm0ReadValue + vF1Hbm1ReadValue + vF1Hbm2ReadValue + vF1Hbm3ReadValue;
|
||||
EXPECT_EQ(bandwidth.readCounter, expectedReadCounters);
|
||||
expectedWriteCounters = vF1Hbm0WriteValue + vF1Hbm1WriteValue + vF1Hbm2WriteValue + vF1Hbm3WriteValue;
|
||||
EXPECT_EQ(bandwidth.writeCounter, expectedWriteCounters);
|
||||
EXPECT_GT(bandwidth.timestamp, 0u);
|
||||
expectedBandwidth = 128 * hbmRP0Frequency * 1000 * 1000 * 4;
|
||||
EXPECT_EQ(bandwidth.maxBandwidth, expectedBandwidth);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(SysmanDeviceMemoryFixture, GivenValidUsRevIdForRevisionBWhenCallingzesSysmanMemoryGetBandwidthThenSuccessIsReturnedAndBandwidthIsValid, IsPVC) {
|
||||
setLocalSupportedAndReinit(true);
|
||||
auto handles = getMemoryHandles(memoryHandleComponentCount);
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(SUPPORT_XE_HP_CORE)
|
||||
add_subdirectories()
|
||||
endif()
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
#include "opencl/source/mem_obj/buffer_base.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
typedef XeHpFamily Family;
|
||||
static auto gfxCore = IGFX_XE_HP_CORE;
|
||||
|
||||
template class BufferHw<Family>;
|
||||
|
||||
#include "opencl/source/mem_obj/buffer_factory_init.inl"
|
||||
} // namespace NEO
|
|
@ -1,79 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
#include "opencl/source/context/context.h"
|
||||
#include "opencl/source/helpers/cl_gfx_core_helper_base.inl"
|
||||
#include "opencl/source/helpers/cl_gfx_core_helper_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using Family = XeHpFamily;
|
||||
static auto gfxCore = IGFX_XE_HP_CORE;
|
||||
|
||||
template <>
|
||||
void populateFactoryTable<ClGfxCoreHelperHw<Family>>() {
|
||||
extern ClGfxCoreHelper *clGfxCoreHelperFactory[IGFX_MAX_CORE];
|
||||
clGfxCoreHelperFactory[gfxCore] = &ClGfxCoreHelperHw<Family>::get();
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ClGfxCoreHelperHw<Family>::requiresNonAuxMode(const ArgDescPointer &argAsPtr, const RootDeviceEnvironment &rootDeviceEnvironment) const {
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
||||
|
||||
if (productHelper.allowStatelessCompression(hwInfo)) {
|
||||
return false;
|
||||
} else {
|
||||
return !argAsPtr.isPureStateful();
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ClGfxCoreHelperHw<Family>::requiresAuxResolves(const KernelInfo &kernelInfo, const RootDeviceEnvironment &rootDeviceEnvironment) const {
|
||||
auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
||||
|
||||
if (productHelper.allowStatelessCompression(hwInfo)) {
|
||||
return false;
|
||||
} else {
|
||||
return hasStatelessAccessToBuffer(kernelInfo);
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
inline bool ClGfxCoreHelperHw<Family>::allowCompressionForContext(const ClDevice &clDevice, const Context &context) const {
|
||||
auto rootDeviceIndex = clDevice.getRootDeviceIndex();
|
||||
auto &hwInfo = clDevice.getHardwareInfo();
|
||||
auto &productHelper = clDevice.getDevice().getProductHelper();
|
||||
if (context.containsMultipleSubDevices(rootDeviceIndex) && GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_A1, hwInfo, productHelper)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ClGfxCoreHelperHw<Family>::isSupportedKernelThreadArbitrationPolicy() const { return false; }
|
||||
|
||||
template <>
|
||||
std::vector<uint32_t> ClGfxCoreHelperHw<Family>::getSupportedThreadArbitrationPolicies() const {
|
||||
return {};
|
||||
}
|
||||
|
||||
template <>
|
||||
cl_version ClGfxCoreHelperHw<Family>::getDeviceIpVersion(const HardwareInfo &hwInfo) const {
|
||||
return makeDeviceIpVersion(12, 5, makeDeviceRevision(hwInfo));
|
||||
}
|
||||
|
||||
template class ClGfxCoreHelperHw<Family>;
|
||||
|
||||
} // namespace NEO
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
#include "opencl/source/command_queue/command_queue_hw.h"
|
||||
#include "opencl/source/command_queue/enqueue_resource_barrier.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using Family = XeHpFamily;
|
||||
static auto gfxCore = IGFX_XE_HP_CORE;
|
||||
} // namespace NEO
|
||||
|
||||
#include "opencl/source/command_queue/command_queue_hw_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
template <>
|
||||
void populateFactoryTable<CommandQueueHw<Family>>() {
|
||||
extern CommandQueueCreateFunc commandQueueFactory[IGFX_MAX_CORE];
|
||||
commandQueueFactory[gfxCore] = CommandQueueHw<Family>::create;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
template class NEO::CommandQueueHw<NEO::Family>;
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
#include "opencl/source/command_queue/command_queue_hw.h"
|
||||
#include "opencl/source/helpers/cl_gfx_core_helper.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/source/mem_obj/image.h"
|
||||
#include "opencl/source/sampler/sampler.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using Family = XeHpFamily;
|
||||
|
||||
struct EnableOCLXeHpCore {
|
||||
EnableOCLXeHpCore() {
|
||||
populateFactoryTable<BufferHw<Family>>();
|
||||
populateFactoryTable<ClGfxCoreHelperHw<Family>>();
|
||||
populateFactoryTable<CommandQueueHw<Family>>();
|
||||
populateFactoryTable<ImageHw<Family>>();
|
||||
populateFactoryTable<SamplerHw<Family>>();
|
||||
}
|
||||
};
|
||||
|
||||
static EnableOCLXeHpCore enable;
|
||||
} // namespace NEO
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
#include "opencl/source/command_queue/gpgpu_walker_xehp_and_later.inl"
|
||||
#include "opencl/source/command_queue/hardware_interface_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template class GpgpuWalkerHelper<XeHpFamily>;
|
||||
|
||||
template class HardwareInterface<XeHpFamily>;
|
||||
|
||||
template struct EnqueueOperation<XeHpFamily>;
|
||||
|
||||
} // namespace NEO
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
#include "opencl/source/gtpin/gtpin_gfx_core_helper.h"
|
||||
#include "opencl/source/gtpin/gtpin_gfx_core_helper.inl"
|
||||
#include "opencl/source/gtpin/gtpin_gfx_core_helper_xehp_and_later.inl"
|
||||
|
||||
#include "ocl_igc_shared/gtpin/gtpin_ocl_interface.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
extern GTPinGfxCoreHelperCreateFunctionType gtpinGfxCoreHelperFactory[IGFX_MAX_CORE];
|
||||
|
||||
typedef XeHpFamily Family;
|
||||
static const auto gfxFamily = IGFX_XE_HP_CORE;
|
||||
|
||||
template <>
|
||||
uint32_t GTPinGfxCoreHelperHw<Family>::getGenVersion() const {
|
||||
return gtpin::GTPIN_XEHP_CORE;
|
||||
}
|
||||
|
||||
template class GTPinGfxCoreHelperHw<Family>;
|
||||
|
||||
struct GTPinEnableXeHpCore {
|
||||
GTPinEnableXeHpCore() {
|
||||
gtpinGfxCoreHelperFactory[gfxFamily] = GTPinGfxCoreHelperHw<Family>::create;
|
||||
}
|
||||
};
|
||||
|
||||
static GTPinEnableXeHpCore gtpinEnable;
|
||||
|
||||
} // namespace NEO
|
|
@ -1,19 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/cache_flush_xehp_and_later.inl"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||
#include "opencl/source/helpers/hardware_commands_helper_base.inl"
|
||||
#include "opencl/source/helpers/hardware_commands_helper_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
using FamilyType = XeHpFamily;
|
||||
|
||||
template struct HardwareCommandsHelper<FamilyType>;
|
||||
} // namespace NEO
|
|
@ -1,31 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
#include "opencl/source/context/context.h"
|
||||
#include "opencl/source/mem_obj/image.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using Family = XeHpFamily;
|
||||
static auto gfxCore = IGFX_XE_HP_CORE;
|
||||
|
||||
template <>
|
||||
void ImageHw<Family>::appendSurfaceStateParams(Family::RENDER_SURFACE_STATE *surfaceState, uint32_t rootDeviceIndex, bool useGlobalAtomics) {
|
||||
EncodeSurfaceStateArgs args{};
|
||||
args.outMemory = surfaceState;
|
||||
args.useGlobalAtomics = useGlobalAtomics;
|
||||
args.areMultipleSubDevicesInContext = context->containsMultipleSubDevices(rootDeviceIndex);
|
||||
args.implicitScaling = args.areMultipleSubDevicesInContext;
|
||||
EncodeSurfaceState<Family>::encodeImplicitScalingParams(args);
|
||||
}
|
||||
} // namespace NEO
|
||||
#include "opencl/source/mem_obj/image_tgllp_and_later.inl"
|
||||
|
||||
// factory initializer
|
||||
#include "opencl/source/mem_obj/image_factory_init.inl"
|
|
@ -1,17 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
using Family = NEO::XeHpFamily;
|
||||
constexpr static auto gfxCore = IGFX_XE_HP_CORE;
|
||||
|
||||
#include "opencl/source/sampler/sampler.h"
|
||||
#include "opencl/source/sampler/sampler.inl"
|
||||
|
||||
namespace NEO {
|
||||
#include "opencl/source/sampler/sampler_factory_init.inl"
|
||||
} // namespace NEO
|
|
@ -1,5 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2022-2023 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/ult_hw_config.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
|
||||
#include "opencl/test/unit_test/aub_tests/command_stream/aub_mem_dump_tests.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
|
||||
namespace NEO {
|
||||
extern bool overrideCommandStreamReceiverCreation;
|
||||
using XeHpCoreAubMemDumpTests = Test<ClDeviceFixture>;
|
||||
|
||||
XE_HP_CORE_TEST_F(XeHpCoreAubMemDumpTests, GivenCcsThenExpectationsAreMet) {
|
||||
setupAUB<FamilyType>(pDevice, aub_stream::ENGINE_CCS);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XeHpCoreAubMemDumpTests, whenAubCsrIsCreatedThenCreateHardwareContext) {
|
||||
DebugManagerStateRestore restore;
|
||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||
ultHwConfig.useHwCsr = true;
|
||||
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB);
|
||||
|
||||
std::unique_ptr<MockDevice> device(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
|
||||
auto &baseCsr = device->getGpgpuCommandStreamReceiver();
|
||||
auto &aubCsr = static_cast<AUBCommandStreamReceiverHw<FamilyType> &>(baseCsr);
|
||||
|
||||
EXPECT_NE(nullptr, aubCsr.hardwareContextController.get());
|
||||
EXPECT_NE(0u, aubCsr.hardwareContextController->hardwareContexts.size());
|
||||
}
|
||||
} // namespace NEO
|
|
@ -1,571 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gmm_helper/resource_info.h"
|
||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "opencl/extensions/public/cl_ext_private.h"
|
||||
#include "opencl/source/api/api.h"
|
||||
#include "opencl/source/mem_obj/buffer.h"
|
||||
#include "opencl/source/platform/platform.h"
|
||||
#include "opencl/test/unit_test/aub_tests/fixtures/aub_fixture.h"
|
||||
#include "opencl/test/unit_test/aub_tests/fixtures/multicontext_aub_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/simple_arg_kernel_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct StatelessCompressionInSBA : public KernelAUBFixture<StatelessCopyKernelFixture>,
|
||||
public ::testing::Test,
|
||||
public ::testing::WithParamInterface<uint32_t /*EngineType*/> {
|
||||
void SetUp() override {
|
||||
DebugManager.flags.EnableStatelessCompression.set(1);
|
||||
DebugManager.flags.RenderCompressedBuffersEnabled.set(true);
|
||||
DebugManager.flags.RenderCompressedImagesEnabled.set(true);
|
||||
DebugManager.flags.EnableLocalMemory.set(true);
|
||||
DebugManager.flags.NodeOrdinal.set(GetParam());
|
||||
DebugManager.flags.ForceAuxTranslationMode.set(static_cast<int32_t>(AuxTranslationMode::Builtin));
|
||||
KernelAUBFixture<StatelessCopyKernelFixture>::setUp();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
KernelAUBFixture<StatelessCopyKernelFixture>::tearDown();
|
||||
}
|
||||
|
||||
DebugManagerStateRestore debugRestorer;
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
};
|
||||
|
||||
XE_HP_CORE_TEST_P(StatelessCompressionInSBA, GENERATEONLY_givenCompressedBuffersWhenStatelessAccessToLocalMemoryThenEnableCompressionInSBA) {
|
||||
const size_t bufferSize = 2048;
|
||||
uint8_t writePattern[bufferSize];
|
||||
std::fill(writePattern, writePattern + sizeof(writePattern), 1);
|
||||
|
||||
device->getGpgpuCommandStreamReceiver().overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
||||
|
||||
auto unCompressedBuffer = std::unique_ptr<Buffer>(Buffer::create(context, CL_MEM_UNCOMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal));
|
||||
auto unCompressedAllocation = unCompressedBuffer->getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
EXPECT_EQ(AllocationType::BUFFER, unCompressedAllocation->getAllocationType());
|
||||
EXPECT_FALSE(unCompressedAllocation->isCompressionEnabled());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, unCompressedAllocation->getMemoryPool());
|
||||
|
||||
auto compressedBuffer1 = std::unique_ptr<Buffer>(Buffer::create(context, CL_MEM_COMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal));
|
||||
auto compressedAllocation1 = compressedBuffer1->getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
EXPECT_TRUE(compressedAllocation1->isCompressionEnabled());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, compressedAllocation1->getMemoryPool());
|
||||
EXPECT_TRUE(compressedAllocation1->getDefaultGmm()->isCompressionEnabled);
|
||||
|
||||
auto compressedBuffer2 = std::unique_ptr<Buffer>(Buffer::create(context, CL_MEM_COMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal));
|
||||
auto compressedAllocation2 = compressedBuffer2->getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
EXPECT_TRUE(compressedAllocation2->isCompressionEnabled());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, compressedAllocation2->getMemoryPool());
|
||||
EXPECT_TRUE(compressedAllocation2->getDefaultGmm()->isCompressionEnabled);
|
||||
|
||||
retVal = pCmdQ->enqueueWriteBuffer(compressedBuffer1.get(), CL_FALSE, 0, bufferSize, writePattern, nullptr, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = kernel->setArg(0, compressedBuffer1.get());
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = kernel->setArg(1, compressedBuffer2.get());
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
size_t globalWorkSize[3] = {bufferSize, 1, 1};
|
||||
retVal = pCmdQ->enqueueKernel(kernel, 1, nullptr, globalWorkSize, nullptr, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
pCmdQ->finish();
|
||||
|
||||
expectNotEqualMemory<FamilyType>(AUBFixture::getGpuPointer(compressedAllocation1), writePattern, bufferSize);
|
||||
|
||||
expectNotEqualMemory<FamilyType>(AUBFixture::getGpuPointer(compressedAllocation2), writePattern, bufferSize);
|
||||
|
||||
retVal = pCmdQ->enqueueCopyBuffer(compressedBuffer2.get(), unCompressedBuffer.get(), 0, 0, bufferSize, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
pCmdQ->finish();
|
||||
|
||||
expectMemory<FamilyType>(AUBFixture::getGpuPointer(unCompressedAllocation), writePattern, bufferSize);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_P(StatelessCompressionInSBA, GENERATEONLY_givenCompressedDeviceMemoryWhenAccessedStatelesslyThenEnableCompressionInSBA) {
|
||||
const size_t bufferSize = 2048;
|
||||
uint8_t writePattern[bufferSize];
|
||||
std::fill(writePattern, writePattern + sizeof(writePattern), 1);
|
||||
|
||||
device->getGpgpuCommandStreamReceiver().overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
||||
|
||||
auto compressedDeviceMemAllocPtr1 = clDeviceMemAllocINTEL(context, device.get(), nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_NE(nullptr, compressedDeviceMemAllocPtr1);
|
||||
auto compressedDeviceMemAlloc1 = context->getSVMAllocsManager()->getSVMAllocs()->get(compressedDeviceMemAllocPtr1)->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
EXPECT_NE(nullptr, compressedDeviceMemAlloc1);
|
||||
EXPECT_TRUE(compressedDeviceMemAlloc1->isCompressionEnabled());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, compressedDeviceMemAlloc1->getMemoryPool());
|
||||
EXPECT_TRUE(compressedDeviceMemAlloc1->getDefaultGmm()->isCompressionEnabled);
|
||||
|
||||
auto compressedDeviceMemAllocPtr2 = clDeviceMemAllocINTEL(context, device.get(), nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_NE(nullptr, compressedDeviceMemAllocPtr2);
|
||||
auto compressedDeviceMemAlloc2 = context->getSVMAllocsManager()->getSVMAllocs()->get(compressedDeviceMemAllocPtr2)->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
EXPECT_NE(nullptr, compressedDeviceMemAlloc2);
|
||||
EXPECT_TRUE(compressedDeviceMemAlloc2->isCompressionEnabled());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, compressedDeviceMemAlloc2->getMemoryPool());
|
||||
EXPECT_TRUE(compressedDeviceMemAlloc2->getDefaultGmm()->isCompressionEnabled);
|
||||
|
||||
retVal = clEnqueueMemcpyINTEL(pCmdQ, true, compressedDeviceMemAllocPtr1, writePattern, bufferSize, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clSetKernelArgSVMPointer(multiDeviceKernel.get(), 0, compressedDeviceMemAllocPtr1);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clSetKernelArgSVMPointer(multiDeviceKernel.get(), 1, compressedDeviceMemAllocPtr2);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
size_t globalWorkSize[3] = {bufferSize, 1, 1};
|
||||
retVal = clEnqueueNDRangeKernel(pCmdQ, multiDeviceKernel.get(), 1, nullptr, globalWorkSize, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clFinish(pCmdQ);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
expectNotEqualMemory<FamilyType>(compressedDeviceMemAllocPtr2, writePattern, bufferSize);
|
||||
|
||||
expectNotEqualMemory<FamilyType>(compressedDeviceMemAllocPtr2, writePattern, bufferSize);
|
||||
|
||||
retVal = clMemFreeINTEL(context, compressedDeviceMemAllocPtr1);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clMemFreeINTEL(context, compressedDeviceMemAllocPtr2);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_P(StatelessCompressionInSBA, givenUncompressibleBufferInHostMemoryWhenAccessedStatelesslyThenDisableCompressionInSBA) {
|
||||
const size_t bufferSize = 2048;
|
||||
uint8_t writePattern[bufferSize];
|
||||
std::fill(writePattern, writePattern + sizeof(writePattern), 1);
|
||||
|
||||
device->getGpgpuCommandStreamReceiver().overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
||||
|
||||
auto unCompressedBuffer = std::unique_ptr<Buffer>(Buffer::create(context, CL_MEM_UNCOMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal));
|
||||
auto unCompressedAllocation = unCompressedBuffer->getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
EXPECT_EQ(AllocationType::BUFFER, unCompressedAllocation->getAllocationType());
|
||||
EXPECT_FALSE(unCompressedAllocation->isCompressionEnabled());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, unCompressedAllocation->getMemoryPool());
|
||||
|
||||
auto compressedBuffer = std::unique_ptr<Buffer>(Buffer::create(context, CL_MEM_COMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal));
|
||||
auto compressedAllocation = compressedBuffer->getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
EXPECT_TRUE(compressedAllocation->isCompressionEnabled());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, compressedAllocation->getMemoryPool());
|
||||
EXPECT_TRUE(compressedAllocation->getDefaultGmm()->isCompressionEnabled);
|
||||
|
||||
auto uncompressibleBufferInHostMemory = std::unique_ptr<Buffer>(Buffer::create(context, CL_MEM_FORCE_HOST_MEMORY_INTEL, bufferSize, nullptr, retVal));
|
||||
auto uncompressibleAllocationInHostMemory = uncompressibleBufferInHostMemory->getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType());
|
||||
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(uncompressibleAllocationInHostMemory->getMemoryPool()));
|
||||
|
||||
retVal = pCmdQ->enqueueWriteBuffer(compressedBuffer.get(), CL_FALSE, 0, bufferSize, writePattern, nullptr, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = kernel->setArg(0, compressedBuffer.get());
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = kernel->setArg(1, uncompressibleBufferInHostMemory.get());
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
size_t globalWorkSize[3] = {bufferSize, 1, 1};
|
||||
retVal = pCmdQ->enqueueKernel(kernel, 1, nullptr, globalWorkSize, nullptr, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
pCmdQ->finish();
|
||||
|
||||
expectNotEqualMemory<FamilyType>(AUBFixture::getGpuPointer(compressedAllocation), writePattern, bufferSize);
|
||||
|
||||
expectMemory<FamilyType>(AUBFixture::getGpuPointer(uncompressibleAllocationInHostMemory), writePattern, bufferSize);
|
||||
|
||||
retVal = pCmdQ->enqueueCopyBuffer(uncompressibleBufferInHostMemory.get(), unCompressedBuffer.get(), 0, 0, bufferSize, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
pCmdQ->finish();
|
||||
|
||||
expectMemory<FamilyType>(AUBFixture::getGpuPointer(unCompressedAllocation), writePattern, bufferSize);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_P(StatelessCompressionInSBA, givenUncompressibleHostMemoryAllocationWhenAccessedStatelesslyThenDisableCompressionInSBA) {
|
||||
const size_t bufferSize = 2048;
|
||||
uint8_t writePattern[bufferSize];
|
||||
std::fill(writePattern, writePattern + sizeof(writePattern), 1);
|
||||
|
||||
device->getGpgpuCommandStreamReceiver().overrideDispatchPolicy(DispatchMode::BatchedDispatch);
|
||||
|
||||
auto compressedDeviceMemAllocPtr = clDeviceMemAllocINTEL(context, device.get(), nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_NE(nullptr, compressedDeviceMemAllocPtr);
|
||||
auto compressedDeviceMemAlloc = context->getSVMAllocsManager()->getSVMAllocs()->get(compressedDeviceMemAllocPtr)->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
EXPECT_NE(nullptr, compressedDeviceMemAlloc);
|
||||
EXPECT_TRUE(compressedDeviceMemAlloc->isCompressionEnabled());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, compressedDeviceMemAlloc->getMemoryPool());
|
||||
EXPECT_TRUE(compressedDeviceMemAlloc->getDefaultGmm()->isCompressionEnabled);
|
||||
|
||||
auto uncompressibleHostMemAllocPtr = clHostMemAllocINTEL(context, nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
EXPECT_NE(nullptr, uncompressibleHostMemAllocPtr);
|
||||
auto uncompressibleHostMemAlloc = context->getSVMAllocsManager()->getSVMAllocs()->get(uncompressibleHostMemAllocPtr)->gpuAllocations.getGraphicsAllocation(device->getRootDeviceIndex());
|
||||
EXPECT_NE(nullptr, uncompressibleHostMemAlloc);
|
||||
EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleHostMemAlloc->getAllocationType());
|
||||
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(uncompressibleHostMemAlloc->getMemoryPool()));
|
||||
|
||||
retVal = clEnqueueMemcpyINTEL(pCmdQ, true, compressedDeviceMemAllocPtr, writePattern, bufferSize, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clSetKernelArgSVMPointer(multiDeviceKernel.get(), 0, compressedDeviceMemAllocPtr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clSetKernelArgSVMPointer(multiDeviceKernel.get(), 1, uncompressibleHostMemAllocPtr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
size_t globalWorkSize[3] = {bufferSize, 1, 1};
|
||||
retVal = clEnqueueNDRangeKernel(pCmdQ, multiDeviceKernel.get(), 1, nullptr, globalWorkSize, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clFinish(pCmdQ);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
expectNotEqualMemory<FamilyType>(compressedDeviceMemAllocPtr, writePattern, bufferSize);
|
||||
expectMemory<FamilyType>(uncompressibleHostMemAllocPtr, writePattern, bufferSize);
|
||||
|
||||
retVal = clMemFreeINTEL(context, compressedDeviceMemAllocPtr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clMemFreeINTEL(context, uncompressibleHostMemAllocPtr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(,
|
||||
StatelessCompressionInSBA,
|
||||
::testing::Values(aub_stream::ENGINE_RCS,
|
||||
aub_stream::ENGINE_CCS));
|
||||
|
||||
struct UmStatelessCompressionInSBA : public KernelAUBFixture<StatelessKernelWithIndirectAccessFixture>,
|
||||
public ::testing::Test,
|
||||
public ::testing::WithParamInterface<uint32_t /*EngineType*/> {
|
||||
void SetUp() override {
|
||||
DebugManager.flags.EnableStatelessCompression.set(1);
|
||||
DebugManager.flags.RenderCompressedBuffersEnabled.set(true);
|
||||
DebugManager.flags.RenderCompressedImagesEnabled.set(true);
|
||||
DebugManager.flags.EnableLocalMemory.set(true);
|
||||
DebugManager.flags.NodeOrdinal.set(GetParam());
|
||||
DebugManager.flags.ForceAuxTranslationMode.set(static_cast<int32_t>(AuxTranslationMode::Builtin));
|
||||
KernelAUBFixture<StatelessKernelWithIndirectAccessFixture>::setUp();
|
||||
EXPECT_TRUE(multiDeviceKernel->getKernel(rootDeviceIndex)->getKernelInfo().kernelDescriptor.kernelAttributes.hasIndirectStatelessAccess);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
KernelAUBFixture<StatelessKernelWithIndirectAccessFixture>::tearDown();
|
||||
}
|
||||
|
||||
DebugManagerStateRestore debugRestorer;
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
};
|
||||
|
||||
XE_HP_CORE_TEST_P(UmStatelessCompressionInSBA, GENERATEONLY_givenStatelessKernelWhenItHasIndirectDeviceAccessThenEnableCompressionInSBA) {
|
||||
const size_t bufferSize = MemoryConstants::kiloByte;
|
||||
uint8_t bufferData[bufferSize] = {};
|
||||
|
||||
auto uncompressibleHostMemAlloc = clHostMemAllocINTEL(context, nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, uncompressibleHostMemAlloc);
|
||||
|
||||
auto compressedDeviceMemAlloc1 = clDeviceMemAllocINTEL(context, device.get(), nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, compressedDeviceMemAlloc1);
|
||||
|
||||
auto compressedDeviceMemAlloc2 = clDeviceMemAllocINTEL(context, device.get(), nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, compressedDeviceMemAlloc2);
|
||||
|
||||
retVal = clEnqueueMemcpyINTEL(pCmdQ, true, compressedDeviceMemAlloc2, bufferData, bufferSize, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
reinterpret_cast<uint64_t *>(bufferData)[0] = reinterpret_cast<uint64_t>(compressedDeviceMemAlloc2);
|
||||
|
||||
retVal = clEnqueueMemcpyINTEL(pCmdQ, true, compressedDeviceMemAlloc1, bufferData, bufferSize, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clSetKernelArgSVMPointer(multiDeviceKernel.get(), 0, compressedDeviceMemAlloc1);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clSetKernelExecInfo(multiDeviceKernel.get(), CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL, sizeof(compressedDeviceMemAlloc2), &compressedDeviceMemAlloc2);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
size_t globalWorkSize[3] = {bufferSize, 1, 1};
|
||||
retVal = clEnqueueNDRangeKernel(pCmdQ, multiDeviceKernel.get(), 1, nullptr, globalWorkSize, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clFinish(pCmdQ);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
reinterpret_cast<uint64_t *>(bufferData)[0] = 1;
|
||||
expectNotEqualMemory<FamilyType>(compressedDeviceMemAlloc2, bufferData, bufferSize);
|
||||
|
||||
retVal = clEnqueueMemcpyINTEL(pCmdQ, true, uncompressibleHostMemAlloc, compressedDeviceMemAlloc2, bufferSize, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
expectMemory<FamilyType>(uncompressibleHostMemAlloc, bufferData, bufferSize);
|
||||
|
||||
retVal = clMemFreeINTEL(context, uncompressibleHostMemAlloc);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clMemFreeINTEL(context, compressedDeviceMemAlloc1);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clMemFreeINTEL(context, compressedDeviceMemAlloc2);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_P(UmStatelessCompressionInSBA, GENERATEONLY_givenKernelExecInfoWhenItHasIndirectDeviceAccessThenEnableCompressionInSBA) {
|
||||
const size_t bufferSize = MemoryConstants::kiloByte;
|
||||
uint8_t bufferData[bufferSize] = {};
|
||||
|
||||
auto uncompressibleHostMemAlloc = clHostMemAllocINTEL(context, nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, uncompressibleHostMemAlloc);
|
||||
|
||||
auto compressedDeviceMemAlloc1 = clDeviceMemAllocINTEL(context, device.get(), nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, compressedDeviceMemAlloc1);
|
||||
|
||||
auto compressedDeviceMemAlloc2 = clDeviceMemAllocINTEL(context, device.get(), nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, compressedDeviceMemAlloc2);
|
||||
|
||||
retVal = clEnqueueMemcpyINTEL(pCmdQ, true, compressedDeviceMemAlloc2, bufferData, bufferSize, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
reinterpret_cast<uint64_t *>(bufferData)[0] = reinterpret_cast<uint64_t>(compressedDeviceMemAlloc2);
|
||||
|
||||
retVal = clEnqueueMemcpyINTEL(pCmdQ, true, compressedDeviceMemAlloc1, bufferData, bufferSize, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clSetKernelArgSVMPointer(multiDeviceKernel.get(), 0, compressedDeviceMemAlloc1);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
cl_bool enableIndirectDeviceAccess = CL_TRUE;
|
||||
retVal = clSetKernelExecInfo(multiDeviceKernel.get(), CL_KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL, sizeof(cl_bool), &enableIndirectDeviceAccess);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
size_t globalWorkSize[3] = {bufferSize, 1, 1};
|
||||
retVal = clEnqueueNDRangeKernel(pCmdQ, multiDeviceKernel.get(), 1, nullptr, globalWorkSize, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clFinish(pCmdQ);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
reinterpret_cast<uint64_t *>(bufferData)[0] = 1;
|
||||
expectNotEqualMemory<FamilyType>(compressedDeviceMemAlloc2, bufferData, bufferSize);
|
||||
|
||||
retVal = clEnqueueMemcpyINTEL(pCmdQ, true, uncompressibleHostMemAlloc, compressedDeviceMemAlloc2, bufferSize, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
expectMemory<FamilyType>(uncompressibleHostMemAlloc, bufferData, bufferSize);
|
||||
|
||||
retVal = clMemFreeINTEL(context, uncompressibleHostMemAlloc);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clMemFreeINTEL(context, compressedDeviceMemAlloc1);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clMemFreeINTEL(context, compressedDeviceMemAlloc2);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_P(UmStatelessCompressionInSBA, givenStatelessKernelWhenItHasIndirectHostAccessThenDisableCompressionInSBA) {
|
||||
const size_t bufferSize = MemoryConstants::kiloByte;
|
||||
uint8_t bufferData[bufferSize] = {};
|
||||
|
||||
auto compressedDeviceMemAlloc = clDeviceMemAllocINTEL(context, device.get(), nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, compressedDeviceMemAlloc);
|
||||
|
||||
auto uncompressibleHostMemAlloc = clHostMemAllocINTEL(context, nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, uncompressibleHostMemAlloc);
|
||||
|
||||
memset(uncompressibleHostMemAlloc, 0, bufferSize);
|
||||
|
||||
reinterpret_cast<uint64_t *>(bufferData)[0] = reinterpret_cast<uint64_t>(uncompressibleHostMemAlloc);
|
||||
|
||||
retVal = clEnqueueMemcpyINTEL(pCmdQ, true, compressedDeviceMemAlloc, bufferData, bufferSize, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clSetKernelArgSVMPointer(multiDeviceKernel.get(), 0, compressedDeviceMemAlloc);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clSetKernelExecInfo(multiDeviceKernel.get(), CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL, sizeof(uncompressibleHostMemAlloc), &uncompressibleHostMemAlloc);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
size_t globalWorkSize[3] = {bufferSize, 1, 1};
|
||||
retVal = clEnqueueNDRangeKernel(pCmdQ, multiDeviceKernel.get(), 1, nullptr, globalWorkSize, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clFinish(pCmdQ);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
reinterpret_cast<uint64_t *>(bufferData)[0] = 1;
|
||||
expectMemory<FamilyType>(uncompressibleHostMemAlloc, bufferData, bufferSize);
|
||||
|
||||
retVal = clMemFreeINTEL(context, compressedDeviceMemAlloc);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clMemFreeINTEL(context, uncompressibleHostMemAlloc);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_P(UmStatelessCompressionInSBA, givenKernelExecInfoWhenItHasIndirectHostAccessThenDisableCompressionInSBA) {
|
||||
const size_t bufferSize = MemoryConstants::kiloByte;
|
||||
uint8_t bufferData[bufferSize] = {};
|
||||
|
||||
auto compressedDeviceMemAlloc = clDeviceMemAllocINTEL(context, device.get(), nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, compressedDeviceMemAlloc);
|
||||
|
||||
auto uncompressibleHostMemAlloc = clHostMemAllocINTEL(context, nullptr, bufferSize, 0, &retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
ASSERT_NE(nullptr, uncompressibleHostMemAlloc);
|
||||
|
||||
memset(uncompressibleHostMemAlloc, 0, bufferSize);
|
||||
|
||||
reinterpret_cast<uint64_t *>(bufferData)[0] = reinterpret_cast<uint64_t>(uncompressibleHostMemAlloc);
|
||||
|
||||
retVal = clEnqueueMemcpyINTEL(pCmdQ, true, compressedDeviceMemAlloc, bufferData, bufferSize, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clSetKernelArgSVMPointer(multiDeviceKernel.get(), 0, compressedDeviceMemAlloc);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
cl_bool enableIndirectHostAccess = CL_TRUE;
|
||||
retVal = clSetKernelExecInfo(multiDeviceKernel.get(), CL_KERNEL_EXEC_INFO_INDIRECT_HOST_ACCESS_INTEL, sizeof(cl_bool), &enableIndirectHostAccess);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
size_t globalWorkSize[3] = {bufferSize, 1, 1};
|
||||
retVal = clEnqueueNDRangeKernel(pCmdQ, multiDeviceKernel.get(), 1, nullptr, globalWorkSize, nullptr, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clFinish(pCmdQ);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
reinterpret_cast<uint64_t *>(bufferData)[0] = 1;
|
||||
expectMemory<FamilyType>(uncompressibleHostMemAlloc, bufferData, bufferSize);
|
||||
|
||||
retVal = clMemFreeINTEL(context, compressedDeviceMemAlloc);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = clMemFreeINTEL(context, uncompressibleHostMemAlloc);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(,
|
||||
UmStatelessCompressionInSBA,
|
||||
::testing::Values(aub_stream::ENGINE_RCS,
|
||||
aub_stream::ENGINE_CCS));
|
||||
|
||||
struct StatelessCompressionInSBAWithBCS : public MulticontextAubFixture,
|
||||
public StatelessCopyKernelFixture,
|
||||
public ::testing::Test {
|
||||
void SetUp() override {
|
||||
DebugManager.flags.EnableStatelessCompression.set(1);
|
||||
DebugManager.flags.ForceAuxTranslationMode.set(static_cast<int32_t>(AuxTranslationMode::Blit));
|
||||
DebugManager.flags.EnableBlitterOperationsSupport.set(true);
|
||||
MulticontextAubFixture::setUp(1, EnabledCommandStreamers::Single, true);
|
||||
StatelessCopyKernelFixture::setUp(tileDevices[0], context.get());
|
||||
if (!tileDevices[0]->getHardwareInfo().featureTable.flags.ftrLocalMemory) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
MulticontextAubFixture::tearDown();
|
||||
StatelessCopyKernelFixture::tearDown();
|
||||
}
|
||||
|
||||
DebugManagerStateRestore debugRestorer;
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
};
|
||||
|
||||
XE_HP_CORE_TEST_F(StatelessCompressionInSBAWithBCS, GENERATEONLY_givenCompressedBufferInDeviceMemoryWhenAccessedStatelesslyThenEnableCompressionInSBA) {
|
||||
const size_t bufferSize = 2048;
|
||||
uint8_t writePattern[bufferSize];
|
||||
std::fill(writePattern, writePattern + sizeof(writePattern), 1);
|
||||
|
||||
auto unCompressedBuffer = std::unique_ptr<Buffer>(Buffer::create(context.get(), CL_MEM_UNCOMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal));
|
||||
auto unCompressedAllocation = unCompressedBuffer->getGraphicsAllocation(tileDevices[0]->getRootDeviceIndex());
|
||||
EXPECT_EQ(AllocationType::BUFFER, unCompressedAllocation->getAllocationType());
|
||||
EXPECT_FALSE(unCompressedAllocation->isCompressionEnabled());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, unCompressedAllocation->getMemoryPool());
|
||||
|
||||
auto compressedBuffer = std::unique_ptr<Buffer>(Buffer::create(context.get(), CL_MEM_COMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal));
|
||||
auto compressedAllocation = compressedBuffer->getGraphicsAllocation(tileDevices[0]->getRootDeviceIndex());
|
||||
EXPECT_TRUE(compressedAllocation->isCompressionEnabled());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, compressedAllocation->getMemoryPool());
|
||||
EXPECT_TRUE(compressedAllocation->getDefaultGmm()->isCompressionEnabled);
|
||||
|
||||
retVal = commandQueues[0][0]->enqueueWriteBuffer(compressedBuffer.get(), CL_FALSE, 0, bufferSize, writePattern, nullptr, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = kernel->setArg(0, compressedBuffer.get());
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = kernel->setArg(1, unCompressedBuffer.get());
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
size_t globalWorkSize[3] = {bufferSize, 1, 1};
|
||||
retVal = commandQueues[0][0]->enqueueKernel(kernel, 1, nullptr, globalWorkSize, nullptr, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
commandQueues[0][0]->finish();
|
||||
|
||||
expectMemoryNotEqual<FamilyType>(AUBFixture::getGpuPointer(compressedAllocation, compressedBuffer->getOffset()), writePattern, bufferSize, 0, 0);
|
||||
|
||||
expectMemory<FamilyType>(AUBFixture::getGpuPointer(unCompressedAllocation, unCompressedBuffer->getOffset()), writePattern, bufferSize, 0, 0);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(StatelessCompressionInSBAWithBCS, givenUncompressibleBufferInHostMemoryWhenAccessedStatelesslyThenDisableCompressionInSBA) {
|
||||
const size_t bufferSize = 2048;
|
||||
uint8_t writePattern[bufferSize];
|
||||
std::fill(writePattern, writePattern + sizeof(writePattern), 1);
|
||||
|
||||
auto compressedBuffer = std::unique_ptr<Buffer>(Buffer::create(context.get(), CL_MEM_COMPRESSED_HINT_INTEL, bufferSize, nullptr, retVal));
|
||||
auto compressedAllocation = compressedBuffer->getGraphicsAllocation(tileDevices[0]->getRootDeviceIndex());
|
||||
EXPECT_TRUE(compressedAllocation->isCompressionEnabled());
|
||||
EXPECT_EQ(MemoryPool::LocalMemory, compressedAllocation->getMemoryPool());
|
||||
EXPECT_TRUE(compressedAllocation->getDefaultGmm()->isCompressionEnabled);
|
||||
|
||||
auto uncompressibleBufferInHostMemory = std::unique_ptr<Buffer>(Buffer::create(context.get(), CL_MEM_FORCE_HOST_MEMORY_INTEL, bufferSize, nullptr, retVal));
|
||||
auto uncompressibleAllocationInHostMemory = uncompressibleBufferInHostMemory->getGraphicsAllocation(tileDevices[0]->getRootDeviceIndex());
|
||||
EXPECT_EQ(AllocationType::BUFFER_HOST_MEMORY, uncompressibleAllocationInHostMemory->getAllocationType());
|
||||
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(uncompressibleAllocationInHostMemory->getMemoryPool()));
|
||||
|
||||
retVal = commandQueues[0][0]->enqueueWriteBuffer(compressedBuffer.get(), CL_FALSE, 0, bufferSize, writePattern, nullptr, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = kernel->setArg(0, compressedBuffer.get());
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
retVal = kernel->setArg(1, uncompressibleBufferInHostMemory.get());
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
size_t globalWorkSize[3] = {bufferSize, 1, 1};
|
||||
retVal = commandQueues[0][0]->enqueueKernel(kernel, 1, nullptr, globalWorkSize, nullptr, 0, nullptr, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||
|
||||
commandQueues[0][0]->finish();
|
||||
|
||||
expectMemoryNotEqual<FamilyType>(AUBFixture::getGpuPointer(compressedAllocation, compressedBuffer->getOffset()), writePattern, bufferSize, 0, 0);
|
||||
|
||||
expectMemory<FamilyType>(AUBFixture::getGpuPointer(uncompressibleAllocationInHostMemory, uncompressibleBufferInHostMemory->getOffset()), writePattern, bufferSize, 0, 0);
|
||||
}
|
|
@ -129,55 +129,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverFlushTaskXeHPAndLaterTests, gi
|
|||
EXPECT_TRUE(UnitTestHelper<FamilyType>::getPipeControlHdcPipelineFlush(*pipeControlCmd));
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenProgramExtendedPipeControlPriorToNonPipelinedStateCommandEnabledAndStateSipWhenA0SteppingIsActivatedThenOnlyGlobalSipIsProgrammed, IsXEHP) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.set(true);
|
||||
|
||||
using STATE_SIP = typename FamilyType::STATE_SIP;
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getProductHelper();
|
||||
|
||||
hardwareInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled = 1;
|
||||
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
|
||||
|
||||
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hardwareInfo, 0u));
|
||||
auto &commandStreamReceiver = mockDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
||||
mockDevice->executionEnvironment->rootDeviceEnvironments[0]->debugger.reset(new MockDebugger);
|
||||
|
||||
auto sipType = SipKernel::getSipKernelType(*mockDevice);
|
||||
SipKernel::initSipKernel(sipType, *mockDevice);
|
||||
|
||||
configureCSRtoNonDirtyState<FamilyType>(false);
|
||||
ioh.replaceBuffer(ptrOffset(ioh.getCpuBase(), +1u), ioh.getMaxAvailableSpace() + MemoryConstants::pageSize * 3);
|
||||
|
||||
flushTaskFlags.preemptionMode = PreemptionHelper::getDefaultPreemptionMode(mockDevice->getHardwareInfo());
|
||||
|
||||
commandStreamReceiver.flushTask(
|
||||
commandStream,
|
||||
0,
|
||||
&dsh,
|
||||
&ioh,
|
||||
&ssh,
|
||||
taskLevel,
|
||||
flushTaskFlags,
|
||||
*mockDevice);
|
||||
|
||||
parseCommands<FamilyType>(commandStreamReceiver.getCS(0));
|
||||
|
||||
auto itorLRI = findMmio<FamilyType>(cmdList.begin(), cmdList.end(), 0xE42C);
|
||||
EXPECT_NE(cmdList.end(), itorLRI);
|
||||
|
||||
auto cmdLRI = genCmdCast<MI_LOAD_REGISTER_IMM *>(*itorLRI);
|
||||
auto sipAddress = cmdLRI->getDataDword() & 0xfffffff8;
|
||||
auto sipAllocation = SipKernel::getSipKernel(*mockDevice, nullptr).getSipAllocation();
|
||||
|
||||
EXPECT_EQ(sipAllocation->getGpuAddressToPatch(), sipAddress);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenSBACommandToProgramOnSingleCCSSetupThenThereIsPipeControlPriorToIt, IsWithinXeGfxFamily) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
|
|
|
@ -706,30 +706,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, WhenOsCont
|
|||
EXPECT_EQ(1u, commandStreamReceiverSingle.deviceBitfield.count());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTestXeHPAndLater, givenXE_HP_COREDefaultSupportEnabledWhenOsSupportsNewResourceImplicitFlushThenReturnOsSupportValue, IsXeHpCore) {
|
||||
MockCsrHw<FamilyType> commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
|
||||
commandStreamReceiver.setupContext(*osContext);
|
||||
|
||||
EXPECT_TRUE(ImplicitFlushSettings<FamilyType>::getSettingForNewResource());
|
||||
|
||||
VariableBackup<bool> defaultSettingForNewResourceBackup(&ImplicitFlushSettings<FamilyType>::getSettingForNewResource(), true);
|
||||
|
||||
if (commandStreamReceiver.getOSInterface()->newResourceImplicitFlush) {
|
||||
EXPECT_TRUE(commandStreamReceiver.checkPlatformSupportsNewResourceImplicitFlush());
|
||||
} else {
|
||||
EXPECT_FALSE(commandStreamReceiver.checkPlatformSupportsNewResourceImplicitFlush());
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTestXeHPAndLater, givenXE_HP_COREDefaultSupportDisabledWhenOsSupportsNewResourceImplicitFlushThenReturnOsSupportValue, IsXeHpCore) {
|
||||
MockCsrHw<FamilyType> commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
|
||||
commandStreamReceiver.setupContext(*osContext);
|
||||
|
||||
VariableBackup<bool> defaultSettingForNewResourceBackup(&ImplicitFlushSettings<FamilyType>::getSettingForNewResource(), false);
|
||||
|
||||
EXPECT_FALSE(commandStreamReceiver.checkPlatformSupportsNewResourceImplicitFlush());
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenPlatformSupportsImplicitFlushForNewResourceWhenCsrIsMultiContextThenExpectNoSupport) {
|
||||
VariableBackup<bool> defaultSettingForNewResourceBackup(&ImplicitFlushSettings<FamilyType>::getSettingForNewResource(), true);
|
||||
|
||||
|
@ -741,30 +717,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenPlatf
|
|||
EXPECT_FALSE(commandStreamReceiver.checkPlatformSupportsNewResourceImplicitFlush());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTestXeHPAndLater, givenXE_HP_COREDefaultSupportEnabledWhenOsSupportsGpuIdleImplicitFlushThenReturnOsSupportValue, IsXeHpCore) {
|
||||
MockCsrHw<FamilyType> commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
|
||||
commandStreamReceiver.setupContext(*osContext);
|
||||
|
||||
EXPECT_TRUE(ImplicitFlushSettings<FamilyType>::getSettingForGpuIdle());
|
||||
|
||||
VariableBackup<bool> defaultSettingForGpuIdleBackup(&ImplicitFlushSettings<FamilyType>::getSettingForGpuIdle(), true);
|
||||
|
||||
if (commandStreamReceiver.getOSInterface()->newResourceImplicitFlush) {
|
||||
EXPECT_TRUE(commandStreamReceiver.checkPlatformSupportsGpuIdleImplicitFlush());
|
||||
} else {
|
||||
EXPECT_FALSE(commandStreamReceiver.checkPlatformSupportsGpuIdleImplicitFlush());
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTestXeHPAndLater, givenXE_HP_COREDefaultSupportDisabledWhenOsSupportsGpuIdleImplicitFlushThenReturnOsSupportValue, IsXeHpCore) {
|
||||
MockCsrHw<FamilyType> commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
|
||||
commandStreamReceiver.setupContext(*osContext);
|
||||
|
||||
VariableBackup<bool> defaultSettingForGpuIdleBackup(&ImplicitFlushSettings<FamilyType>::getSettingForGpuIdle(), false);
|
||||
|
||||
EXPECT_FALSE(commandStreamReceiver.checkPlatformSupportsGpuIdleImplicitFlush());
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, givenPlatformSupportsImplicitFlushForIdleGpuWhenCsrIsMultiContextThenExpectNoSupport) {
|
||||
VariableBackup<bool> defaultSettingForGpuIdleBackup(&ImplicitFlushSettings<FamilyType>::getSettingForGpuIdle(), true);
|
||||
|
||||
|
@ -808,20 +760,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandStreamReceiverHwTestXeHPAndLater, whenCreati
|
|||
EXPECT_TRUE(workPartitionAllocationStorageInfo.tileInstanced);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTestXeHPAndLater, givenXeHpWhenRayTracingEnabledThenDoNotAddCommandBatchBuffer, IsXEHP) {
|
||||
MockCsrHw<FamilyType> commandStreamReceiver(*pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield());
|
||||
auto cmdSize = commandStreamReceiver.getCmdSizeForPerDssBackedBuffer(pDevice->getHardwareInfo());
|
||||
EXPECT_EQ(0u, cmdSize);
|
||||
std::unique_ptr<char[]> buffer(new char[cmdSize]);
|
||||
|
||||
LinearStream cs(buffer.get(), cmdSize);
|
||||
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
|
||||
dispatchFlags.usePerDssBackedBuffer = true;
|
||||
|
||||
commandStreamReceiver.programPerDssBackedBuffer(cs, *pDevice, dispatchFlags);
|
||||
EXPECT_EQ(0u, cs.getUsed());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTestXeHPAndLater, givenStaticPartitionEnabledWhenOnlySinglePartitionUsedThenExpectSinglePipeControlAsBarrier, IsAtLeastXeHpCore) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
|
||||
|
|
|
@ -447,29 +447,16 @@ void testGlobalAtomicsImpactOnSBA(StateBaseAddressXeHPAndLaterTests *sbaTest, bo
|
|||
|
||||
} /* namespace */
|
||||
|
||||
struct XeHpGlobalAtomicsStateBaseAddressTests : public StateBaseAddressXeHPAndLaterTests,
|
||||
public ::testing::WithParamInterface<std::tuple<bool, bool>> {};
|
||||
struct GlobalAtomicsStateBaseAddressTests : public StateBaseAddressXeHPAndLaterTests,
|
||||
public ::testing::WithParamInterface<std::tuple<bool, bool>> {};
|
||||
|
||||
HWTEST2_P(XeHpGlobalAtomicsStateBaseAddressTests, givenMultiOSContextOrMultiSubDeviceWhenLastSentUseGlobalAtomicsIsFlippedThenStatBaseAddressIsReprorammed, IsXEHP) {
|
||||
auto [multiOsCtx, multiSubDevices] = GetParam();
|
||||
testGlobalAtomicsImpactOnSBA<FamilyType>(this, multiOsCtx, multiSubDevices, multiOsCtx || multiSubDevices);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(XeHpGlobalAtomicsStateBaseAddress,
|
||||
XeHpGlobalAtomicsStateBaseAddressTests,
|
||||
::testing::Combine(
|
||||
::testing::Bool(),
|
||||
::testing::Bool()));
|
||||
|
||||
using NonXeHpGlobalAtomicsStateBaseAddressTests = XeHpGlobalAtomicsStateBaseAddressTests;
|
||||
|
||||
HWTEST2_P(NonXeHpGlobalAtomicsStateBaseAddressTests, givenAnyMultiOSContextValueWithAnySubDeviceNumberWhenLastSentUseGlobalAtomicsIsFlippedThenStatBaseAddressProgrammingIsNeverAffected, IsNotXEHP) {
|
||||
HWTEST_P(GlobalAtomicsStateBaseAddressTests, givenAnyMultiOSContextValueWithAnySubDeviceNumberWhenLastSentUseGlobalAtomicsIsFlippedThenStatBaseAddressProgrammingIsNeverAffected) {
|
||||
auto [multiOsCtx, multiSubDevices] = GetParam();
|
||||
testGlobalAtomicsImpactOnSBA<FamilyType>(this, multiOsCtx, multiSubDevices, false);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(NonXeHpGlobalAtomicsStateBaseAddress,
|
||||
NonXeHpGlobalAtomicsStateBaseAddressTests,
|
||||
INSTANTIATE_TEST_CASE_P(,
|
||||
GlobalAtomicsStateBaseAddressTests,
|
||||
::testing::Combine(
|
||||
::testing::Bool(),
|
||||
::testing::Bool()));
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2021-2023 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
|
@ -1,713 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/gmm_helper/client_context/gmm_client_context.h"
|
||||
#include "shared/source/gmm_helper/gmm.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/timestamp_packet.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/test/common/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/libult/ult_command_stream_receiver.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_gmm.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
#include "shared/test/common/utilities/base_object_utils.h"
|
||||
|
||||
#include "opencl/source/command_queue/command_queue_hw.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct BlitXE_HP_CORETests : public ::testing::Test {
|
||||
void SetUp() override {
|
||||
if (is32bit) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
DebugManager.flags.RenderCompressedBuffersEnabled.set(true);
|
||||
DebugManager.flags.EnableLocalMemory.set(true);
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
hwInfo.featureTable.ftrBcsInfo = 1;
|
||||
hwInfo.capabilityTable.blitterOperationsSupported = true;
|
||||
|
||||
clDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
|
||||
}
|
||||
|
||||
std::optional<TaskCountType> flushBcsTask(CommandStreamReceiver *csr, const BlitProperties &blitProperties, bool blocking, Device &device) {
|
||||
BlitPropertiesContainer blitPropertiesContainer;
|
||||
blitPropertiesContainer.push_back(blitProperties);
|
||||
|
||||
return csr->flushBcsTask(blitPropertiesContainer, blocking, false, device);
|
||||
}
|
||||
|
||||
std::unique_ptr<MockClDevice> clDevice;
|
||||
TimestampPacketContainer timestampPacketContainer;
|
||||
CsrDependencies csrDependencies;
|
||||
DebugManagerStateRestore debugRestorer;
|
||||
};
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenCompressedBufferWhenProgrammingBltCommandThenSetCompressionFields) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver);
|
||||
MockContext context(clDevice.get());
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto bufferCompressed = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 2048, nullptr, retVal));
|
||||
bufferCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getDefaultGmm()->isCompressionEnabled = true;
|
||||
auto bufferNotCompressed = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 2048, nullptr, retVal));
|
||||
bufferNotCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getDefaultGmm()->isCompressionEnabled = false;
|
||||
|
||||
auto gmmHelper = clDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->getGmmHelper();
|
||||
uint32_t compressionFormat = gmmHelper->getClientContext()->getSurfaceStateCompressionFormat(GMM_RESOURCE_FORMAT::GMM_FORMAT_GENERIC_8BIT);
|
||||
|
||||
{
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferNotCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_DISABLE);
|
||||
EXPECT_EQ(bltCmd->getDestinationAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_NONE);
|
||||
EXPECT_EQ(bltCmd->getDestinationCompressionFormat(), 0u);
|
||||
EXPECT_EQ(bltCmd->getSourceCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_ENABLE);
|
||||
EXPECT_EQ(bltCmd->getSourceAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
||||
EXPECT_EQ(bltCmd->getSourceCompressionFormat(), compressionFormat);
|
||||
}
|
||||
|
||||
{
|
||||
auto offset = csr->commandStream.getUsed();
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferNotCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream, offset);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_ENABLE);
|
||||
EXPECT_EQ(bltCmd->getDestinationAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
||||
EXPECT_EQ(bltCmd->getDestinationCompressionFormat(), compressionFormat);
|
||||
EXPECT_EQ(bltCmd->getSourceCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_DISABLE);
|
||||
EXPECT_EQ(bltCmd->getSourceAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_NONE);
|
||||
EXPECT_EQ(bltCmd->getSourceCompressionFormat(), 0u);
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenDebugFlagSetWhenCompressionEnabledThenForceCompressionFormat) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
|
||||
uint32_t compressionFormat = 3;
|
||||
DebugManager.flags.ForceBufferCompressionFormat.set(compressionFormat);
|
||||
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver);
|
||||
MockContext context(clDevice.get());
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto bufferCompressed = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 2048, nullptr, retVal));
|
||||
bufferCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getDefaultGmm()->isCompressionEnabled = true;
|
||||
auto bufferNotCompressed = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 2048, nullptr, retVal));
|
||||
bufferNotCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getDefaultGmm()->isCompressionEnabled = false;
|
||||
|
||||
{
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferNotCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_DISABLE);
|
||||
EXPECT_EQ(bltCmd->getDestinationAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_NONE);
|
||||
EXPECT_EQ(bltCmd->getDestinationCompressionFormat(), 0u);
|
||||
EXPECT_EQ(bltCmd->getSourceCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_ENABLE);
|
||||
EXPECT_EQ(bltCmd->getSourceAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
||||
EXPECT_EQ(bltCmd->getSourceCompressionFormat(), compressionFormat);
|
||||
}
|
||||
|
||||
{
|
||||
auto offset = csr->commandStream.getUsed();
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferNotCompressed->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream, offset);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_ENABLE);
|
||||
EXPECT_EQ(bltCmd->getDestinationAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
||||
EXPECT_EQ(bltCmd->getDestinationCompressionFormat(), compressionFormat);
|
||||
EXPECT_EQ(bltCmd->getSourceCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_DISABLE);
|
||||
EXPECT_EQ(bltCmd->getSourceAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_NONE);
|
||||
EXPECT_EQ(bltCmd->getSourceCompressionFormat(), 0u);
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenBufferWhenProgrammingBltCommandThenSetMocs) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
|
||||
auto &bcsEngine = clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular);
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(bcsEngine.commandStreamReceiver);
|
||||
MockContext context(clDevice.get());
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto buffer = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 1, nullptr, retVal));
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(buffer->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
buffer->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {1, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
auto mocs = clDevice->getRootDeviceEnvironment().getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED);
|
||||
|
||||
EXPECT_EQ(mocs, bltCmd->getDestinationMOCS());
|
||||
EXPECT_EQ(mocs, bltCmd->getSourceMOCS());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenBufferWhenProgrammingBltCommandThenSetMocsToValueOfDebugKey) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.OverrideBlitterMocs.set(0u);
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
|
||||
auto &bcsEngine = clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular);
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(bcsEngine.commandStreamReceiver);
|
||||
MockContext context(clDevice.get());
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto buffer = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 1, nullptr, retVal));
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(buffer->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
buffer->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {1, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(0u, bltCmd->getDestinationMOCS());
|
||||
EXPECT_EQ(0u, bltCmd->getSourceMOCS());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenCompressedBufferWhenResolveBlitIsCalledThenProgramSpecialOperationMode) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
|
||||
auto &bcsEngine = clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular);
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(bcsEngine.commandStreamReceiver);
|
||||
MockContext context(clDevice.get());
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto buffer = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 2048, nullptr, retVal));
|
||||
auto blitProperties = BlitProperties::constructPropertiesForAuxTranslation(AuxTranslationDirection::AuxToNonAux,
|
||||
buffer->getGraphicsAllocation(clDevice->getRootDeviceIndex()), csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, false, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(XY_COPY_BLT::SPECIAL_MODE_OF_OPERATION::SPECIAL_MODE_OF_OPERATION_FULL_RESOLVE, bltCmd->getSpecialModeOfOperation());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenCompressedBufferWhenNonAuxToAuxBlitIsCalledThenDontProgramSourceCompression) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
|
||||
auto &bcsEngine = clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular);
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(bcsEngine.commandStreamReceiver);
|
||||
MockContext context(clDevice.get());
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto buffer = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 2048, nullptr, retVal));
|
||||
auto blitProperties = BlitProperties::constructPropertiesForAuxTranslation(AuxTranslationDirection::NonAuxToAux,
|
||||
buffer->getGraphicsAllocation(clDevice->getRootDeviceIndex()), csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, false, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_DISABLE, bltCmd->getSourceCompressionEnable());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, given2dBlitCommandWhenDispatchingThenSetValidSurfaceType) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
|
||||
auto &bcsEngine = clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular);
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(bcsEngine.commandStreamReceiver);
|
||||
MockContext context(clDevice.get());
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto buffer = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 1, nullptr, retVal));
|
||||
auto allocation = buffer->getGraphicsAllocation(clDevice->getRootDeviceIndex());
|
||||
|
||||
size_t offset = 0;
|
||||
{
|
||||
// 1D
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(allocation, allocation,
|
||||
0, 0, {BlitterConstants::maxBlitWidth - 1, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
flushBcsTask(csr, blitProperties, false, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(XY_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_1D, bltCmd->getDestinationSurfaceType());
|
||||
EXPECT_EQ(XY_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_1D, bltCmd->getSourceSurfaceType());
|
||||
|
||||
EXPECT_EQ(bltCmd->getSourceSurfaceWidth(), bltCmd->getDestinationX2CoordinateRight());
|
||||
EXPECT_EQ(bltCmd->getSourceSurfaceHeight(), bltCmd->getDestinationY2CoordinateBottom());
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationSurfaceWidth(), bltCmd->getDestinationX2CoordinateRight());
|
||||
EXPECT_EQ(bltCmd->getDestinationSurfaceHeight(), bltCmd->getDestinationY2CoordinateBottom());
|
||||
|
||||
offset = csr->commandStream.getUsed();
|
||||
}
|
||||
|
||||
{
|
||||
// 2D
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(allocation, allocation,
|
||||
0, 0, {(2 * BlitterConstants::maxBlitWidth) + 1, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
flushBcsTask(csr, blitProperties, false, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream, offset);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(XY_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_2D, bltCmd->getDestinationSurfaceType());
|
||||
EXPECT_EQ(XY_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_2D, bltCmd->getSourceSurfaceType());
|
||||
|
||||
EXPECT_EQ(bltCmd->getSourceSurfaceWidth(), bltCmd->getDestinationX2CoordinateRight());
|
||||
EXPECT_EQ(bltCmd->getSourceSurfaceHeight(), bltCmd->getDestinationY2CoordinateBottom());
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationSurfaceWidth(), bltCmd->getDestinationX2CoordinateRight());
|
||||
EXPECT_EQ(bltCmd->getDestinationSurfaceHeight(), bltCmd->getDestinationY2CoordinateBottom());
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenBufferWhenProgrammingBltCommandThenSetTargetMemory) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver);
|
||||
MockContext context(clDevice.get());
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto bufferInSystemPool = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_FORCE_HOST_MEMORY_INTEL, 2048, nullptr, retVal));
|
||||
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getMemoryPool()));
|
||||
auto bufferInLocalPool = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 2048, nullptr, retVal));
|
||||
EXPECT_FALSE(MemoryPoolHelper::isSystemMemoryPool(bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getMemoryPool()));
|
||||
|
||||
{
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getSourceTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
EXPECT_EQ(bltCmd->getDestinationTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
|
||||
{
|
||||
auto offset = csr->commandStream.getUsed();
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream, offset);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
EXPECT_EQ(bltCmd->getSourceTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenBufferWhenProgrammingBltCommandThenSetTargetMemoryInCpuAccesingLocalMemoryMode) {
|
||||
DebugManagerStateRestore restorer;
|
||||
DebugManager.flags.ForceLocalMemoryAccessMode.set(1);
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
PLATFORM platform = clDevice->getHardwareInfo().platform;
|
||||
const auto &productHelper = *ProductHelper::get(platform.eProductFamily);
|
||||
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver);
|
||||
MockContext context(clDevice.get());
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto bufferInSystemPool = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_FORCE_HOST_MEMORY_INTEL, 2048, nullptr, retVal));
|
||||
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getMemoryPool()));
|
||||
auto bufferInLocalPool = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 2048, nullptr, retVal));
|
||||
EXPECT_FALSE(MemoryPoolHelper::isSystemMemoryPool(bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getMemoryPool()));
|
||||
|
||||
{
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getSourceTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
EXPECT_EQ(bltCmd->getDestinationTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
|
||||
{
|
||||
auto offset = csr->commandStream.getUsed();
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream, offset);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM);
|
||||
EXPECT_EQ(bltCmd->getSourceTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenBufferWhenProgrammingBltCommandThenSetTargetMemoryToSystemWhenDebugKeyPresent) {
|
||||
DebugManagerStateRestore restorer;
|
||||
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver);
|
||||
MockContext context(clDevice.get());
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto bufferInSystemPool = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_FORCE_HOST_MEMORY_INTEL, 2048, nullptr, retVal));
|
||||
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getMemoryPool()));
|
||||
auto bufferInLocalPool = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 2048, nullptr, retVal));
|
||||
EXPECT_FALSE(MemoryPoolHelper::isSystemMemoryPool(bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getMemoryPool()));
|
||||
|
||||
DebugManager.flags.OverrideBlitterTargetMemory.set(0u);
|
||||
{
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM);
|
||||
EXPECT_EQ(bltCmd->getSourceTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM);
|
||||
}
|
||||
DebugManager.flags.OverrideBlitterTargetMemory.set(1u);
|
||||
{
|
||||
auto offset = csr->commandStream.getUsed();
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream, offset);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
EXPECT_EQ(bltCmd->getSourceTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
|
||||
DebugManager.flags.OverrideBlitterTargetMemory.set(2u);
|
||||
{
|
||||
auto offset = csr->commandStream.getUsed();
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream, offset);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
EXPECT_EQ(bltCmd->getSourceTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenBufferWhenProgrammingBltCommandAndRevisionB0ThenSetTargetMemory) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
HardwareInfo *hwInfo = clDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
const auto &productHelper = *ProductHelper::get(hwInfo->platform.eProductFamily);
|
||||
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo);
|
||||
|
||||
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(clDevice->getEngine(aub_stream::EngineType::ENGINE_BCS, EngineUsage::Regular).commandStreamReceiver);
|
||||
MockContext context(clDevice.get());
|
||||
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto bufferInSystemPool = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_FORCE_HOST_MEMORY_INTEL, 2048, nullptr, retVal));
|
||||
EXPECT_TRUE(MemoryPoolHelper::isSystemMemoryPool(bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getMemoryPool()));
|
||||
auto bufferInLocalPool = clUniquePtr<Buffer>(Buffer::create(&context, CL_MEM_READ_WRITE, 2048, nullptr, retVal));
|
||||
EXPECT_FALSE(MemoryPoolHelper::isSystemMemoryPool(bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex())->getMemoryPool()));
|
||||
|
||||
{
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getSourceTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
EXPECT_EQ(bltCmd->getDestinationTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
|
||||
{
|
||||
auto offset = csr->commandStream.getUsed();
|
||||
auto blitProperties = BlitProperties::constructPropertiesForCopy(bufferInLocalPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
bufferInSystemPool->getGraphicsAllocation(clDevice->getRootDeviceIndex()),
|
||||
0, 0, {2048, 1, 1}, 0, 0, 0, 0, csr->getClearColorAllocation());
|
||||
|
||||
flushBcsTask(csr, blitProperties, true, clDevice->getDevice());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parseCommands<FamilyType>(csr->commandStream, offset);
|
||||
|
||||
auto bltCmd = genCmdCast<XY_COPY_BLT *>(*(hwParser.cmdList.begin()));
|
||||
EXPECT_NE(nullptr, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd->getDestinationTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
EXPECT_EQ(bltCmd->getSourceTargetMemory(), XY_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenDebugFlagSetWhenCompressionIsUsedThenForceCompressionEnableFields) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
auto blitCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
blitCmd.setDestinationX2CoordinateRight(1);
|
||||
blitCmd.setDestinationY2CoordinateBottom(1);
|
||||
|
||||
auto gmm = std::make_unique<MockGmm>(clDevice->getGmmHelper());
|
||||
gmm->isCompressionEnabled = true;
|
||||
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY, reinterpret_cast<void *>(0x1234),
|
||||
0x1000, 0, sizeof(uint32_t), MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
mockAllocation.setGmm(gmm.get(), 0);
|
||||
|
||||
BlitProperties properties = {};
|
||||
properties.srcAllocation = &mockAllocation;
|
||||
properties.dstAllocation = &mockAllocation;
|
||||
properties.clearColorAllocation = &mockAllocation;
|
||||
|
||||
{
|
||||
DebugManager.flags.ForceCompressionDisabledForCompressedBlitCopies.set(1);
|
||||
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForBuffer(properties, blitCmd, *clDevice->getExecutionEnvironment()->rootDeviceEnvironments[clDevice->getRootDeviceIndex()]);
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_ENABLE);
|
||||
EXPECT_EQ(blitCmd.getDestinationAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
||||
|
||||
EXPECT_EQ(blitCmd.getSourceCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_ENABLE);
|
||||
EXPECT_EQ(blitCmd.getSourceAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
||||
}
|
||||
|
||||
{
|
||||
DebugManager.flags.ForceCompressionDisabledForCompressedBlitCopies.set(0);
|
||||
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForBuffer(properties, blitCmd, *clDevice->getExecutionEnvironment()->rootDeviceEnvironments[clDevice->getRootDeviceIndex()]);
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_DISABLE);
|
||||
EXPECT_EQ(blitCmd.getDestinationAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
||||
|
||||
EXPECT_EQ(blitCmd.getSourceCompressionEnable(), XY_COPY_BLT::COMPRESSION_ENABLE::COMPRESSION_ENABLE_COMPRESSION_DISABLE);
|
||||
EXPECT_EQ(blitCmd.getSourceAuxiliarysurfacemode(), XY_COPY_BLT::AUXILIARY_SURFACE_MODE_AUX_CCS_E);
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenDebugFlagForClearColorNotSetWhenProgrammingBlitCommandForBuffersThenClearColorAddressIsNotProgrammed) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.UseClearColorAllocationForBlitter.set(false);
|
||||
auto blitCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
blitCmd.setDestinationX2CoordinateRight(1);
|
||||
blitCmd.setDestinationY2CoordinateBottom(1);
|
||||
|
||||
MockGraphicsAllocation mockAllocation;
|
||||
BlitProperties properties = {};
|
||||
properties.srcAllocation = &mockAllocation;
|
||||
properties.dstAllocation = &mockAllocation;
|
||||
properties.clearColorAllocation = &mockAllocation;
|
||||
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForBuffer(properties, blitCmd, *clDevice->getExecutionEnvironment()->rootDeviceEnvironments[clDevice->getRootDeviceIndex()]);
|
||||
|
||||
EXPECT_EQ(blitCmd.getSourceClearValueEnable(), XY_COPY_BLT::CLEAR_VALUE_ENABLE::CLEAR_VALUE_ENABLE_DISABLE);
|
||||
EXPECT_EQ(0u, blitCmd.getSourceClearAddressLow());
|
||||
EXPECT_EQ(0u, blitCmd.getSourceClearAddressHigh());
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationClearValueEnable(), XY_COPY_BLT::CLEAR_VALUE_ENABLE::CLEAR_VALUE_ENABLE_DISABLE);
|
||||
EXPECT_EQ(0u, blitCmd.getDestinationClearAddressLow());
|
||||
EXPECT_EQ(0u, blitCmd.getDestinationClearAddressHigh());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenDebugFlagForClearColorSetWhenProgrammingBlitCommandForBuffersThenClearColorAddressIsProgrammed) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.UseClearColorAllocationForBlitter.set(true);
|
||||
auto blitCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
blitCmd.setDestinationX2CoordinateRight(1);
|
||||
blitCmd.setDestinationY2CoordinateBottom(1);
|
||||
|
||||
MockGraphicsAllocation mockAllocation;
|
||||
BlitProperties properties = {};
|
||||
properties.srcAllocation = &mockAllocation;
|
||||
properties.dstAllocation = &mockAllocation;
|
||||
properties.clearColorAllocation = &mockAllocation;
|
||||
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForBuffer(properties, blitCmd, *clDevice->getExecutionEnvironment()->rootDeviceEnvironments[clDevice->getRootDeviceIndex()]);
|
||||
|
||||
auto addressLow = static_cast<uint32_t>(mockAllocation.getGpuAddress() & 0xFFFFFFFFULL);
|
||||
auto addressHigh = static_cast<uint32_t>(mockAllocation.getGpuAddress() >> 32);
|
||||
|
||||
EXPECT_EQ(blitCmd.getSourceClearValueEnable(), XY_COPY_BLT::CLEAR_VALUE_ENABLE::CLEAR_VALUE_ENABLE_ENABLE);
|
||||
EXPECT_EQ(addressLow, blitCmd.getSourceClearAddressLow());
|
||||
EXPECT_EQ(addressHigh, blitCmd.getSourceClearAddressHigh());
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationClearValueEnable(), XY_COPY_BLT::CLEAR_VALUE_ENABLE::CLEAR_VALUE_ENABLE_ENABLE);
|
||||
EXPECT_EQ(addressLow, blitCmd.getDestinationClearAddressLow());
|
||||
EXPECT_EQ(addressHigh, blitCmd.getDestinationClearAddressHigh());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenDebugFlagForClearColorNotSetWhenProgrammingBlitCommandForImagesThenClearColorAddressIsNotProgrammed) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.UseClearColorAllocationForBlitter.set(false);
|
||||
auto blitCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
|
||||
MockGraphicsAllocation mockAllocation;
|
||||
BlitProperties properties = {};
|
||||
properties.srcSize = {1, 1, 1};
|
||||
properties.dstSize = {1, 1, 1};
|
||||
properties.srcAllocation = &mockAllocation;
|
||||
properties.dstAllocation = &mockAllocation;
|
||||
properties.clearColorAllocation = &mockAllocation;
|
||||
uint32_t srcSlicePitch = 0u;
|
||||
uint32_t dstSlicePitch = 0u;
|
||||
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, blitCmd, *clDevice->getExecutionEnvironment()->rootDeviceEnvironments[clDevice->getRootDeviceIndex()], srcSlicePitch, dstSlicePitch);
|
||||
|
||||
EXPECT_EQ(blitCmd.getSourceClearValueEnable(), XY_COPY_BLT::CLEAR_VALUE_ENABLE::CLEAR_VALUE_ENABLE_DISABLE);
|
||||
EXPECT_EQ(0u, blitCmd.getSourceClearAddressLow());
|
||||
EXPECT_EQ(0u, blitCmd.getSourceClearAddressHigh());
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationClearValueEnable(), XY_COPY_BLT::CLEAR_VALUE_ENABLE::CLEAR_VALUE_ENABLE_DISABLE);
|
||||
EXPECT_EQ(0u, blitCmd.getDestinationClearAddressLow());
|
||||
EXPECT_EQ(0u, blitCmd.getDestinationClearAddressHigh());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenDebugFlagForClearColorSetWhenProgrammingBlitCommandForImagesThenClearColorAddressIsProgrammed) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.UseClearColorAllocationForBlitter.set(true);
|
||||
auto blitCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
|
||||
MockGraphicsAllocation mockAllocation;
|
||||
BlitProperties properties = {};
|
||||
properties.srcSize = {1, 1, 1};
|
||||
properties.dstSize = {1, 1, 1};
|
||||
properties.srcAllocation = &mockAllocation;
|
||||
properties.dstAllocation = &mockAllocation;
|
||||
properties.clearColorAllocation = &mockAllocation;
|
||||
uint32_t srcSlicePitch = 0;
|
||||
uint32_t dstSlicePitch = 0;
|
||||
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, blitCmd, *clDevice->getExecutionEnvironment()->rootDeviceEnvironments[clDevice->getRootDeviceIndex()], srcSlicePitch, dstSlicePitch);
|
||||
|
||||
auto addressLow = static_cast<uint32_t>(mockAllocation.getGpuAddress() & 0xFFFFFFFFULL);
|
||||
auto addressHigh = static_cast<uint32_t>(mockAllocation.getGpuAddress() >> 32);
|
||||
|
||||
EXPECT_EQ(blitCmd.getSourceClearValueEnable(), XY_COPY_BLT::CLEAR_VALUE_ENABLE::CLEAR_VALUE_ENABLE_ENABLE);
|
||||
EXPECT_EQ(addressLow, blitCmd.getSourceClearAddressLow());
|
||||
EXPECT_EQ(addressHigh, blitCmd.getSourceClearAddressHigh());
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationClearValueEnable(), XY_COPY_BLT::CLEAR_VALUE_ENABLE::CLEAR_VALUE_ENABLE_ENABLE);
|
||||
EXPECT_EQ(addressLow, blitCmd.getDestinationClearAddressLow());
|
||||
EXPECT_EQ(addressHigh, blitCmd.getDestinationClearAddressHigh());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(BlitXE_HP_CORETests, givenCommandQueueWhenAskingForCacheFlushOnBcsThenReturnTrue) {
|
||||
auto clDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||
MockContext context(clDevice.get());
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
auto cmdQ = std::unique_ptr<CommandQueue>(CommandQueue::create(&context, clDevice.get(), nullptr, false, retVal));
|
||||
|
||||
auto pHwQ = static_cast<CommandQueueHw<FamilyType> *>(cmdQ.get());
|
||||
|
||||
EXPECT_TRUE(pHwQ->isCacheFlushForBcsRequired());
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/implicit_scaling.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
#include "shared/test/common/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
#include "opencl/source/command_queue/hardware_interface.h"
|
||||
#include "opencl/test/unit_test/command_queue/hardware_interface_helper.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct EnqueueMultiTileFixture {
|
||||
void setUp() {
|
||||
DebugManager.flags.CreateMultipleSubDevices.set(2);
|
||||
DebugManager.flags.EnableImplicitScaling.set(1);
|
||||
|
||||
osLocalMemoryBackup = std::make_unique<VariableBackup<bool>>(&NEO::OSInterface::osEnableLocalMemory, true);
|
||||
apiSupportBackup = std::make_unique<VariableBackup<bool>>(&NEO::ImplicitScaling::apiSupport, true);
|
||||
|
||||
clDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get(), mockRootDeviceIndex));
|
||||
context = std::make_unique<MockContext>(clDevice.get());
|
||||
|
||||
mockKernel = std::make_unique<MockKernelWithInternals>(*clDevice, context.get());
|
||||
mockKernel->kernelInfo.createKernelAllocation(clDevice->getDevice(), false);
|
||||
|
||||
dispatchInfo = {clDevice.get(), mockKernel->mockKernel, 1, 0, 0, 0};
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
clDevice->getMemoryManager()->freeGraphicsMemory(mockKernel->kernelInfo.getGraphicsAllocation());
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
std::unique_ptr<MockCommandQueueHw<FamilyType>> createCommandQueue() {
|
||||
return std::make_unique<MockCommandQueueHw<FamilyType>>(context.get(), clDevice.get(), nullptr);
|
||||
}
|
||||
|
||||
DispatchInfo dispatchInfo;
|
||||
DebugManagerStateRestore restore;
|
||||
std::unique_ptr<MockClDevice> clDevice;
|
||||
std::unique_ptr<MockContext> context;
|
||||
std::unique_ptr<MockKernelWithInternals> mockKernel;
|
||||
std::unique_ptr<VariableBackup<bool>> apiSupportBackup;
|
||||
std::unique_ptr<VariableBackup<bool>> osLocalMemoryBackup;
|
||||
};
|
||||
|
||||
using EnqueueMultiTileXeHpCoreTest = Test<EnqueueMultiTileFixture>;
|
||||
|
||||
XE_HP_CORE_TEST_F(EnqueueMultiTileXeHpCoreTest, GivenMultiTileWhenDispatchingWalkerThenSynchronizationAfterWalkerHasProperFlag) {
|
||||
using COMPUTE_WALKER = typename FamilyType::COMPUTE_WALKER;
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
|
||||
mockKernel->kernelInfo.heapInfo.KernelHeapSize = 1;
|
||||
|
||||
auto commandQueue = createCommandQueue<FamilyType>();
|
||||
auto &commandStream = commandQueue->getCS(1024);
|
||||
|
||||
size_t offset[3] = {0, 0, 0};
|
||||
size_t gws[3] = {32, 1, 1};
|
||||
commandQueue->enqueueKernel(mockKernel->mockKernel, 3, offset, gws, nullptr, 0, nullptr, nullptr);
|
||||
|
||||
HardwareParse hwParse;
|
||||
hwParse.parseCommands<FamilyType>(commandStream, 0);
|
||||
|
||||
auto itorWalker = find<COMPUTE_WALKER *>(hwParse.cmdList.begin(), hwParse.cmdList.end());
|
||||
ASSERT_NE(hwParse.cmdList.end(), itorWalker);
|
||||
|
||||
auto walkerCmd = genCmdCast<COMPUTE_WALKER *>(*itorWalker);
|
||||
ASSERT_NE(nullptr, walkerCmd);
|
||||
EXPECT_EQ(FamilyType::COMPUTE_WALKER::PARTITION_TYPE::PARTITION_TYPE_X, walkerCmd->getPartitionType());
|
||||
|
||||
auto itorPipeControl = find<PIPE_CONTROL *>(itorWalker, hwParse.cmdList.end());
|
||||
ASSERT_NE(hwParse.cmdList.end(), itorPipeControl);
|
||||
|
||||
auto pipeControlCmd = genCmdCast<PIPE_CONTROL *>(*itorPipeControl);
|
||||
ASSERT_NE(nullptr, pipeControlCmd);
|
||||
EXPECT_TRUE(pipeControlCmd->getDcFlushEnable());
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/test_macros/hw_test_base.h"
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(BufferSetSurfaceTests, givenAlignedCacheableReadOnlyBufferThenChoseOclBufferPolicy, IGFX_XE_HP_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(BufferSetSurfaceTests, givenBufferSetSurfaceThatMemoryIsUnalignedToCachelineButReadOnlyThenL3CacheShouldBeStillOn, IGFX_XE_HP_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(CommandStreamReceiverFlushTaskXeHPAndLaterTests, givenProgramExtendedPipeControlPriorToNonPipelinedStateCommandEnabledAndStateSipWhenItIsRequiredThenThereIsPipeControlPriorToIt, IGFX_XE_HP_CORE);
|
|
@ -1,360 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/program/kernel_info.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/common/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/gfx_core_helper_tests.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "opencl/source/helpers/cl_gfx_core_helper.h"
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_cl_gfx_core_helper.h"
|
||||
|
||||
using ClGfxCoreHelperTestsXeHpCore = Test<ClDeviceFixture>;
|
||||
|
||||
XE_HP_CORE_TEST_F(ClGfxCoreHelperTestsXeHpCore, givenGenHelperWhenKernelArgumentIsNotPureStatefulThenRequireNonAuxMode) {
|
||||
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
|
||||
|
||||
for (auto isPureStateful : {false, true}) {
|
||||
ArgDescPointer argAsPtr{};
|
||||
argAsPtr.accessedUsingStatelessAddressingMode = !isPureStateful;
|
||||
|
||||
EXPECT_EQ(!argAsPtr.isPureStateful(), clGfxCoreHelper.requiresNonAuxMode(argAsPtr, getRootDeviceEnvironment()));
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(ClGfxCoreHelperTestsXeHpCore, givenGenHelperWhenEnableStatelessCompressionThenDontRequireNonAuxMode) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.EnableStatelessCompression.set(1);
|
||||
|
||||
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
|
||||
|
||||
for (auto isPureStateful : {false, true}) {
|
||||
ArgDescPointer argAsPtr{};
|
||||
argAsPtr.accessedUsingStatelessAddressingMode = !isPureStateful;
|
||||
EXPECT_FALSE(clGfxCoreHelper.requiresNonAuxMode(argAsPtr, getRootDeviceEnvironment()));
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(ClGfxCoreHelperTestsXeHpCore, givenXE_HP_COREThenAuxTranslationIsRequired) {
|
||||
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
|
||||
|
||||
for (auto isPureStateful : {false, true}) {
|
||||
KernelInfo kernelInfo{};
|
||||
kernelInfo.kernelDescriptor.payloadMappings.explicitArgs.resize(1);
|
||||
kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[0].as<ArgDescPointer>(true).accessedUsingStatelessAddressingMode = !isPureStateful;
|
||||
EXPECT_EQ(!isPureStateful, clGfxCoreHelper.requiresAuxResolves(kernelInfo, getRootDeviceEnvironment()));
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(ClGfxCoreHelperTestsXeHpCore, givenXE_HP_COREWhenEnableStatelessCompressionThenAuxTranslationIsNotRequired) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.EnableStatelessCompression.set(1);
|
||||
|
||||
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
|
||||
KernelInfo kernelInfo{};
|
||||
|
||||
EXPECT_FALSE(clGfxCoreHelper.requiresAuxResolves(kernelInfo, getRootDeviceEnvironment()));
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(ClGfxCoreHelperTestsXeHpCore, WhenGettingDeviceIpVersionThenMakeCorrectDeviceIpVersion) {
|
||||
auto &clGfxCoreHelper = getHelper<ClGfxCoreHelper>();
|
||||
EXPECT_EQ(ClGfxCoreHelperMock::makeDeviceIpVersion(12, 5, 1), clGfxCoreHelper.getDeviceIpVersion(*defaultHwInfo));
|
||||
}
|
||||
|
||||
using GfxCoreHelperTestXE_HP_CORE = GfxCoreHelperTest;
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE, givenDifferentBufferSizesWhenEnableStatelessCompressionThenEveryBufferSizeIsSuitableForCompression) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.EnableStatelessCompression.set(1);
|
||||
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
|
||||
const size_t sizesToCheck[] = {1, 128, 256, 1024, 2048};
|
||||
for (size_t size : sizesToCheck) {
|
||||
EXPECT_TRUE(gfxCoreHelper.isBufferSizeSuitableForCompression(size, *defaultHwInfo));
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE, givenStatelessCompressionEnabledWhenSetExtraAllocationDataThenDontRequireCpuAccessNorMakeResourceLocableForCompressedAllocations) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.EnableStatelessCompression.set(1);
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
|
||||
for (auto allocType : {AllocationType::CONSTANT_SURFACE, AllocationType::GLOBAL_SURFACE, AllocationType::PRINTF_SURFACE}) {
|
||||
AllocationData allocData;
|
||||
AllocationProperties allocProperties(mockRootDeviceIndex, true, allocType, mockDeviceBitfield);
|
||||
|
||||
gfxCoreHelper.setExtraAllocationData(allocData, allocProperties, hwInfo);
|
||||
EXPECT_FALSE(allocData.flags.requiresCpuAccess);
|
||||
EXPECT_FALSE(allocData.storageInfo.isLockable);
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE, givenRevisionEnumAndPlatformFamilyTypeThenProperValueForIsWorkaroundRequiredIsReturned) {
|
||||
uint32_t steppings[] = {
|
||||
REVISION_A0,
|
||||
REVISION_A1,
|
||||
REVISION_C,
|
||||
REVISION_D,
|
||||
CommonConstants::invalidStepping,
|
||||
};
|
||||
|
||||
const auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
for (auto stepping : steppings) {
|
||||
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(stepping, hardwareInfo);
|
||||
|
||||
EXPECT_FALSE(GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_D, hardwareInfo, productHelper));
|
||||
}
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE, givenRevisionEnumThenProperMaxThreadsForWorkgroupIsReturned) {
|
||||
const auto &productHelper = *ProductHelper::get(hardwareInfo.platform.eProductFamily);
|
||||
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, hardwareInfo);
|
||||
EXPECT_EQ(64u, productHelper.getMaxThreadsForWorkgroupInDSSOrSS(hardwareInfo, 64u, 64u));
|
||||
|
||||
hardwareInfo.platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, hardwareInfo);
|
||||
uint32_t numThreadsPerEU = hardwareInfo.gtSystemInfo.ThreadCount / hardwareInfo.gtSystemInfo.EUCount;
|
||||
EXPECT_EQ(64u * numThreadsPerEU, productHelper.getMaxThreadsForWorkgroupInDSSOrSS(hardwareInfo, 64u, 64u));
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE, givenDisablePipeControlFlagIsDefaultWhenLocalMemoryIsEnabledThenReturnFalseAndDoNotProgramPipeControl) {
|
||||
hardwareInfo.featureTable.flags.ftrLocalMemory = true;
|
||||
|
||||
EXPECT_FALSE(MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(hardwareInfo));
|
||||
|
||||
constexpr size_t bufferSize = 128u;
|
||||
uint8_t buffer[bufferSize];
|
||||
LinearStream cmdStream(buffer, bufferSize);
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWa(cmdStream, 0x1000, hardwareInfo);
|
||||
EXPECT_EQ(0u, cmdStream.getUsed());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE, givenDisablePipeControlFlagIsDisabledWhenLocalMemoryIsEnabledThenReturnFalseAndDoNotProgramPipeControl) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.DisablePipeControlPrecedingPostSyncCommand.set(0);
|
||||
|
||||
hardwareInfo.featureTable.flags.ftrLocalMemory = true;
|
||||
EXPECT_FALSE(MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(hardwareInfo));
|
||||
|
||||
constexpr size_t bufferSize = 128u;
|
||||
uint8_t buffer[bufferSize];
|
||||
LinearStream cmdStream(buffer, bufferSize);
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWa(cmdStream, 0x1000, hardwareInfo);
|
||||
EXPECT_EQ(0u, cmdStream.getUsed());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE, givenDisablePipeControlFlagIsEnabledWhenLocalMemoryIsEnabledThenReturnTrueAndProgramPipeControl) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.DisablePipeControlPrecedingPostSyncCommand.set(1);
|
||||
|
||||
hardwareInfo.featureTable.flags.ftrLocalMemory = true;
|
||||
EXPECT_TRUE(MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(hardwareInfo));
|
||||
|
||||
constexpr size_t bufferSize = 128u;
|
||||
uint8_t buffer[bufferSize];
|
||||
LinearStream cmdStream(buffer, bufferSize);
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWa(cmdStream, 0x1000, hardwareInfo);
|
||||
EXPECT_EQ(sizeof(PIPE_CONTROL), cmdStream.getUsed());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE, givenDisablePipeControlFlagIsEnabledWhenLocalMemoryIsDisabledThenReturnTrueAndDoNotProgramPipeControl) {
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.DisablePipeControlPrecedingPostSyncCommand.set(1);
|
||||
|
||||
hardwareInfo.featureTable.flags.ftrLocalMemory = false;
|
||||
EXPECT_FALSE(MemorySynchronizationCommands<FamilyType>::isBarrierWaRequired(hardwareInfo));
|
||||
|
||||
constexpr size_t bufferSize = 128u;
|
||||
uint8_t buffer[bufferSize];
|
||||
LinearStream cmdStream(buffer, bufferSize);
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWa(cmdStream, 0x1000, hardwareInfo);
|
||||
EXPECT_EQ(0u, cmdStream.getUsed());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE, givenXeHPAndLaterPlatformWhenCheckAssignEngineRoundRobinSupportedThenReturnFalse) {
|
||||
auto &gfxCoreHelper = GfxCoreHelperHw<FamilyType>::get();
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
EXPECT_FALSE(productHelper.isAssignEngineRoundRobinSupported());
|
||||
}
|
||||
|
||||
using ProductHelperTestXE_HP_CORE = Test<DeviceFixture>;
|
||||
|
||||
XE_HP_CORE_TEST_F(ProductHelperTestXE_HP_CORE, givenDebugVariableSetWhenConfigureIsCalledThenSetupBlitterOperationsSupportedFlag) {
|
||||
DebugManagerStateRestore restore;
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
|
||||
DebugManager.flags.EnableBlitterOperationsSupport.set(0);
|
||||
productHelper.configureHardwareCustom(&hwInfo, nullptr);
|
||||
EXPECT_FALSE(hwInfo.capabilityTable.blitterOperationsSupported);
|
||||
|
||||
DebugManager.flags.EnableBlitterOperationsSupport.set(1);
|
||||
productHelper.configureHardwareCustom(&hwInfo, nullptr);
|
||||
EXPECT_TRUE(hwInfo.capabilityTable.blitterOperationsSupported);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(ProductHelperTestXE_HP_CORE, givenMultitileConfigWhenConfiguringHwInfoThenEnableBlitter) {
|
||||
auto &productHelper = getHelper<ProductHelper>();
|
||||
|
||||
HardwareInfo hwInfo = *defaultHwInfo;
|
||||
|
||||
for (uint32_t tileCount = 0; tileCount <= 4; tileCount++) {
|
||||
hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = tileCount;
|
||||
productHelper.configureHardwareCustom(&hwInfo, nullptr);
|
||||
|
||||
EXPECT_EQ(true, hwInfo.capabilityTable.blitterOperationsSupported);
|
||||
}
|
||||
}
|
||||
|
||||
using LriHelperTestsXE_HP_CORE = ::testing::Test;
|
||||
|
||||
XE_HP_CORE_TEST_F(LriHelperTestsXE_HP_CORE, whenProgrammingLriCommandThenExpectMmioRemapEnableCorrectlySet) {
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
std::unique_ptr<uint8_t> buffer(new uint8_t[128]);
|
||||
|
||||
LinearStream stream(buffer.get(), 128);
|
||||
uint32_t address = 0x8888;
|
||||
uint32_t data = 0x1234;
|
||||
|
||||
auto expectedLri = FamilyType::cmdInitLoadRegisterImm;
|
||||
EXPECT_FALSE(expectedLri.getMmioRemapEnable());
|
||||
expectedLri.setRegisterOffset(address);
|
||||
expectedLri.setDataDword(data);
|
||||
expectedLri.setMmioRemapEnable(true);
|
||||
|
||||
LriHelper<FamilyType>::program(&stream, address, data, true);
|
||||
MI_LOAD_REGISTER_IMM *lri = genCmdCast<MI_LOAD_REGISTER_IMM *>(buffer.get());
|
||||
ASSERT_NE(nullptr, lri);
|
||||
|
||||
EXPECT_EQ(sizeof(MI_LOAD_REGISTER_IMM), stream.getUsed());
|
||||
EXPECT_EQ(lri, stream.getCpuBase());
|
||||
EXPECT_TRUE(memcmp(lri, &expectedLri, sizeof(MI_LOAD_REGISTER_IMM)) == 0);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE, GivenVariousValuesWhenAlignSlmSizeIsCalledThenCorrectValueIsReturned) {
|
||||
EXPECT_EQ(0u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(0));
|
||||
EXPECT_EQ(1024u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(1));
|
||||
EXPECT_EQ(1024u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(1024));
|
||||
EXPECT_EQ(2048u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(1025));
|
||||
EXPECT_EQ(2048u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(2048));
|
||||
EXPECT_EQ(4096u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(2049));
|
||||
EXPECT_EQ(4096u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(4096));
|
||||
EXPECT_EQ(8192u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(4097));
|
||||
EXPECT_EQ(8192u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(8192));
|
||||
EXPECT_EQ(16384u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(8193));
|
||||
EXPECT_EQ(16384u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(16384));
|
||||
EXPECT_EQ(32768u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(16385));
|
||||
EXPECT_EQ(32768u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(32768));
|
||||
EXPECT_EQ(65536u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(32769));
|
||||
EXPECT_EQ(65536u, GfxCoreHelperHw<FamilyType>::get().alignSlmSize(65536));
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE, givenGfxCoreHelperWhenGettingThreadsPerEUConfigsThenCorrectConfigsAreReturned) {
|
||||
auto &helper = pDevice->getGfxCoreHelper();
|
||||
auto &configs = helper.getThreadsPerEUConfigs();
|
||||
|
||||
EXPECT_EQ(2U, configs.size());
|
||||
EXPECT_EQ(4U, configs[0]);
|
||||
EXPECT_EQ(8U, configs[1]);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE,
|
||||
givenDebugFlagAndLocalMemoryIsNotAvailableWhenProgrammingPostSyncPipeControlThenExpectNotAddingWaPipeControl) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.DisablePipeControlPrecedingPostSyncCommand.set(1);
|
||||
|
||||
constexpr size_t bufferSize = 256u;
|
||||
uint8_t buffer[bufferSize];
|
||||
LinearStream cmdStream(buffer, bufferSize);
|
||||
|
||||
HardwareInfo hardwareInfo = *defaultHwInfo;
|
||||
hardwareInfo.featureTable.flags.ftrLocalMemory = false;
|
||||
|
||||
PipeControlArgs args;
|
||||
uint64_t gpuAddress = 0xABC0;
|
||||
uint64_t immediateValue = 0x10;
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWithPostSyncOperation(cmdStream,
|
||||
PostSyncMode::ImmediateData,
|
||||
gpuAddress,
|
||||
immediateValue,
|
||||
hardwareInfo,
|
||||
args);
|
||||
EXPECT_EQ(sizeof(PIPE_CONTROL), cmdStream.getUsed());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parsePipeControl = true;
|
||||
hwParser.parseCommands<FamilyType>(cmdStream, 0);
|
||||
hwParser.findHardwareCommands<FamilyType>();
|
||||
|
||||
ASSERT_EQ(1u, hwParser.pipeControlList.size());
|
||||
|
||||
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(*hwParser.pipeControlList.begin());
|
||||
EXPECT_EQ(gpuAddress, UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl));
|
||||
EXPECT_EQ(immediateValue, pipeControl->getImmediateData());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(GfxCoreHelperTestXE_HP_CORE,
|
||||
givenDebugFlagAndLocalMemoryIsAvailableWhenProgrammingPostSyncPipeControlThenExpectAddingWaPipeControl) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
|
||||
DebugManagerStateRestore restore;
|
||||
DebugManager.flags.DisablePipeControlPrecedingPostSyncCommand.set(1);
|
||||
|
||||
constexpr size_t bufferSize = 256u;
|
||||
uint8_t buffer[bufferSize];
|
||||
LinearStream cmdStream(buffer, bufferSize);
|
||||
|
||||
HardwareInfo hardwareInfo = *defaultHwInfo;
|
||||
hardwareInfo.featureTable.flags.ftrLocalMemory = true;
|
||||
|
||||
PipeControlArgs args;
|
||||
uint64_t gpuAddress = 0xABC0;
|
||||
uint64_t immediateValue = 0x10;
|
||||
MemorySynchronizationCommands<FamilyType>::addBarrierWithPostSyncOperation(cmdStream,
|
||||
PostSyncMode::ImmediateData,
|
||||
gpuAddress,
|
||||
immediateValue,
|
||||
hardwareInfo,
|
||||
args);
|
||||
EXPECT_EQ(sizeof(PIPE_CONTROL) * 2, cmdStream.getUsed());
|
||||
|
||||
HardwareParse hwParser;
|
||||
hwParser.parsePipeControl = true;
|
||||
hwParser.parseCommands<FamilyType>(cmdStream, 0);
|
||||
hwParser.findHardwareCommands<FamilyType>();
|
||||
|
||||
ASSERT_EQ(2u, hwParser.pipeControlList.size());
|
||||
|
||||
auto pipeControlItor = hwParser.pipeControlList.begin();
|
||||
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(*pipeControlItor);
|
||||
constexpr uint64_t zeroGpuAddress = 0;
|
||||
constexpr uint64_t zeroImmediateValue = 0;
|
||||
EXPECT_EQ(zeroGpuAddress, UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl));
|
||||
EXPECT_EQ(zeroImmediateValue, pipeControl->getImmediateData());
|
||||
|
||||
pipeControlItor++;
|
||||
pipeControl = reinterpret_cast<PIPE_CONTROL *>(*pipeControlItor);
|
||||
EXPECT_EQ(gpuAddress, UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*pipeControl));
|
||||
EXPECT_EQ(immediateValue, pipeControl->getImmediateData());
|
||||
}
|
|
@ -1,171 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/test/common/helpers/gtest_helpers.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> XE_HP_COREDeviceCaps;
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, XE_HP_COREDeviceCaps, givenKernelWhenCanTransformImagesIsCalledThenReturnsTrue) {
|
||||
MockKernelWithInternals mockKernel(*pClDevice);
|
||||
auto retVal = mockKernel.mockKernel->Kernel::canTransformImages();
|
||||
EXPECT_FALSE(retVal);
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, XE_HP_COREDeviceCaps, givenKernelThatDoesStatelessWritesWhenItIsCreatedThenItHasProperFieldSet) {
|
||||
MockKernelWithInternals mockKernel(*pClDevice);
|
||||
mockKernel.mockKernel->initialize();
|
||||
bool statelessWritesEmitted = mockKernel.mockKernel->getKernelInfo().kernelDescriptor.kernelAttributes.flags.usesStatelessWrites;
|
||||
EXPECT_EQ(statelessWritesEmitted, mockKernel.mockKernel->areStatelessWritesUsed());
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenXE_HP_COREWhenCheckFtrSupportsInteger64BitAtomicsThenReturnTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsInteger64BitAtomics);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenXE_HP_COREWhenCheckingImageSupportThenReturnTrue) {
|
||||
EXPECT_TRUE(pDevice->getHardwareInfo().capabilityTable.supportsImages);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenXE_HP_COREWhenCheckingCoherencySupportThenReturnFalse) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.ftrSupportsCoherency);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenXE_HP_COREWhenCheckExtensionsThenDeviceDoesNotReportClKhrSubgroupsExtension) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
|
||||
EXPECT_FALSE(hasSubstr(caps.deviceExtensions, std::string("cl_khr_subgroups")));
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenXE_HP_COREWhenDeviceCapsInitializedThenAddXE_HP_COREExtensions) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
|
||||
EXPECT_TRUE(hasSubstr(caps.deviceExtensions, std::string("cl_intel_dot_accumulate")));
|
||||
EXPECT_TRUE(hasSubstr(caps.deviceExtensions, std::string("cl_intel_subgroup_local_block_io")));
|
||||
EXPECT_TRUE(hasSubstr(caps.deviceExtensions, std::string("cl_intel_subgroup_matrix_multiply_accumulate")));
|
||||
EXPECT_TRUE(hasSubstr(caps.deviceExtensions, std::string("cl_intel_subgroup_split_matrix_multiply_accumulate")));
|
||||
EXPECT_TRUE(hasSubstr(caps.deviceExtensions, std::string("cl_intel_bfloat16_conversions")));
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenXE_HP_COREWhenCheckingCapsThenDeviceDoesNotSupportIndependentForwardProgress) {
|
||||
const auto &caps = pClDevice->getDeviceInfo();
|
||||
|
||||
EXPECT_FALSE(caps.independentForwardProgress);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenEnabledFtrPooledEuAndA0SteppingWhenCalculatingMaxEuPerSSThenDontIgnoreEuCountPerPoolMin) {
|
||||
HardwareInfo myHwInfo = *defaultHwInfo;
|
||||
GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo;
|
||||
FeatureTable &mySkuTable = myHwInfo.featureTable;
|
||||
PLATFORM &myPlatform = myHwInfo.platform;
|
||||
const auto &productHelper = *ProductHelper::get(myPlatform.eProductFamily);
|
||||
|
||||
mySysInfo.EUCount = 20;
|
||||
mySysInfo.EuCountPerPoolMin = 99999;
|
||||
mySkuTable.flags.ftrPooledEuEnabled = 1;
|
||||
myPlatform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, myHwInfo);
|
||||
|
||||
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo));
|
||||
|
||||
auto expectedMaxWGS = mySysInfo.EuCountPerPoolMin * (mySysInfo.ThreadCount / mySysInfo.EUCount) * 8;
|
||||
expectedMaxWGS = std::min(Math::prevPowerOfTwo(expectedMaxWGS), 512u);
|
||||
|
||||
EXPECT_EQ(expectedMaxWGS, device->getDeviceInfo().maxWorkGroupSize);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenDeviceThatHasHighNumberOfExecutionUnitsAndA0SteppingWhenMaxWorkgroupSizeIsComputedThenItIsLimitedTo512) {
|
||||
HardwareInfo myHwInfo = *defaultHwInfo;
|
||||
GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo;
|
||||
PLATFORM &myPlatform = myHwInfo.platform;
|
||||
const auto &productHelper = *ProductHelper::get(myPlatform.eProductFamily);
|
||||
|
||||
mySysInfo.EUCount = 32;
|
||||
mySysInfo.SubSliceCount = 2;
|
||||
mySysInfo.DualSubSliceCount = 2;
|
||||
mySysInfo.ThreadCount = 32 * 8;
|
||||
myPlatform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, myHwInfo);
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo));
|
||||
|
||||
EXPECT_EQ(512u, device->sharedDeviceInfo.maxWorkGroupSize);
|
||||
EXPECT_EQ(device->sharedDeviceInfo.maxWorkGroupSize / 8, device->getDeviceInfo().maxNumOfSubGroups);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenEnabledFtrPooledEuAndNotA0SteppingWhenCalculatingMaxEuPerSSThenDontIgnoreEuCountPerPoolMin) {
|
||||
HardwareInfo myHwInfo = *defaultHwInfo;
|
||||
GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo;
|
||||
FeatureTable &mySkuTable = myHwInfo.featureTable;
|
||||
PLATFORM &myPlatform = myHwInfo.platform;
|
||||
const auto &productHelper = *ProductHelper::get(myPlatform.eProductFamily);
|
||||
|
||||
mySysInfo.EUCount = 20;
|
||||
mySysInfo.EuCountPerPoolMin = 99999;
|
||||
mySkuTable.flags.ftrPooledEuEnabled = 1;
|
||||
myPlatform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, myHwInfo);
|
||||
|
||||
auto device = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo));
|
||||
|
||||
auto expectedMaxWGS = mySysInfo.EuCountPerPoolMin * (mySysInfo.ThreadCount / mySysInfo.EUCount) * 8;
|
||||
expectedMaxWGS = std::min(Math::prevPowerOfTwo(expectedMaxWGS), 1024u);
|
||||
|
||||
EXPECT_EQ(expectedMaxWGS, device->getDeviceInfo().maxWorkGroupSize);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenDeviceThatHasHighNumberOfExecutionUnitsAndNotA0SteppingWhenMaxWorkgroupSizeIsComputedThenItIsLimitedTo1024) {
|
||||
HardwareInfo myHwInfo = *defaultHwInfo;
|
||||
GT_SYSTEM_INFO &mySysInfo = myHwInfo.gtSystemInfo;
|
||||
PLATFORM &myPlatform = myHwInfo.platform;
|
||||
const auto &productHelper = *ProductHelper::get(myPlatform.eProductFamily);
|
||||
|
||||
mySysInfo.EUCount = 32;
|
||||
mySysInfo.SubSliceCount = 2;
|
||||
mySysInfo.DualSubSliceCount = 2;
|
||||
mySysInfo.ThreadCount = 32 * 8; // 128 threads per subslice, in simd 8 gives 1024
|
||||
myPlatform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, myHwInfo);
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&myHwInfo));
|
||||
|
||||
EXPECT_EQ(1024u, device->sharedDeviceInfo.maxWorkGroupSize);
|
||||
EXPECT_EQ(device->sharedDeviceInfo.maxWorkGroupSize / 8, device->getDeviceInfo().maxNumOfSubGroups);
|
||||
}
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenHwInfoWhenRequestedComputeUnitsUsedForScratchAndMaxSubSlicesSupportedIsSmallerThanMinMaxSubSlicesSupportedThenReturnValidValue) {
|
||||
HardwareInfo &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
GT_SYSTEM_INFO &testSysInfo = hwInfo.gtSystemInfo;
|
||||
testSysInfo.MaxSubSlicesSupported = 24;
|
||||
auto &gfxCoreHelper = pClDevice->getRootDeviceEnvironment().getHelper<GfxCoreHelper>();
|
||||
uint32_t minMaxSubSlicesSupported = 32;
|
||||
uint32_t minCalculation = minMaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice *
|
||||
hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
|
||||
|
||||
EXPECT_LE(testSysInfo.MaxSubSlicesSupported, minMaxSubSlicesSupported);
|
||||
EXPECT_EQ(minCalculation, gfxCoreHelper.getComputeUnitsUsedForScratch(pClDevice->getRootDeviceEnvironment()));
|
||||
}
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREDeviceCaps, givenHwInfoWhenRequestedComputeUnitsUsedForScratchAndMaxSubSlicesSupportedIsGreaterThanMinMaxSubSlicesSupportedThenReturnValidValue) {
|
||||
HardwareInfo &hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
|
||||
GT_SYSTEM_INFO &testSysInfo = hwInfo.gtSystemInfo;
|
||||
testSysInfo.MaxSubSlicesSupported = 40;
|
||||
|
||||
auto &gfxCoreHelper = pClDevice->getRootDeviceEnvironment().getHelper<GfxCoreHelper>();
|
||||
uint32_t minMaxSubSlicesSupported = 32;
|
||||
uint32_t minCalculation = minMaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice *
|
||||
hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
|
||||
uint32_t properCalculation = testSysInfo.MaxSubSlicesSupported * hwInfo.gtSystemInfo.MaxEuPerSubSlice *
|
||||
hwInfo.gtSystemInfo.ThreadCount / hwInfo.gtSystemInfo.EUCount;
|
||||
|
||||
EXPECT_GT(testSysInfo.MaxSubSlicesSupported, minMaxSubSlicesSupported);
|
||||
EXPECT_GT(properCalculation, minCalculation);
|
||||
EXPECT_EQ(properCalculation, gfxCoreHelper.getComputeUnitsUsedForScratch(pClDevice->getRootDeviceEnvironment()));
|
||||
}
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(DeviceGetCapsTest, givenEnabledFtrPooledEuWhenCalculatingMaxEuPerSSThenDontIgnoreEuCountPerPoolMin, IGFX_XE_HP_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(DeviceGetCapsTest, givenDeviceThatHasHighNumberOfExecutionUnitsWhenMaxWorkgroupSizeIsComputedItIsLimitedTo1024, IGFX_XE_HP_CORE);
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct XE_HP_COREPlatformCaps : public PlatformFixture, public ::testing::Test {
|
||||
void SetUp() override {
|
||||
PlatformFixture::setUp();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
PlatformFixture::tearDown();
|
||||
}
|
||||
};
|
||||
|
||||
HWTEST2_F(XE_HP_COREPlatformCaps, givenXeHPSkusThenItSupportFP64, IsXEHP) {
|
||||
const auto &caps = pPlatform->getPlatformInfo();
|
||||
|
||||
EXPECT_NE(std::string::npos, caps.extensions.find(std::string("cl_khr_fp64")));
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
typedef Test<ClDeviceFixture> XE_HP_COREOnlyTest;
|
||||
|
||||
XE_HP_CORE_TEST_F(XE_HP_COREOnlyTest, WhenGettingRenderCoreFamilyThenOnlyXeHpCoreIsReturned) {
|
||||
EXPECT_EQ(IGFX_XE_HP_CORE, pDevice->getRenderCoreFamily());
|
||||
}
|
|
@ -15,7 +15,7 @@ SPDX-License-Identifier: MIT
|
|||
|
||||
# Overview
|
||||
|
||||
Multi-tile devices, such as Xe HPC (PVC) and XeHP_SDV, contain smaller GPU devices called tiles. Each tile has its own dedicated set of resources.
|
||||
Multi-tile devices, such as Xe HPC (PVC), contain smaller GPU devices called tiles. Each tile has its own dedicated set of resources.
|
||||
|
||||
* Each tile has Execution Units (EUs) doing the actual computation work, which can be accessed using the available devices.
|
||||
* Similarly, copy engines (BCSs) may be present on each tile.
|
||||
|
@ -36,7 +36,7 @@ When doing allocations in implicit scaling mode, driver *colors* an allocation a
|
|||
|
||||
When scheduling a kernel for execution, driver distributes the kernel workgroups among the available tiles. Default mechanism is called *Static Partitioning*, where the workgroups are evenly distributed among tiles. For instance, in a 2-tile system, half of the workgroups go to tile 0, and the other half to tile 1.
|
||||
|
||||
The number of CCSs, or compute engines, currently available with implicit scaling on the root device is one. This is because with implicit scaling the driver automatically uses all the EUs available in the device, so no other CCSs are exposed. Even though only one CCS is exposed, multiple kernels submitted to the root device using implicit scaling may execute concurrently on PVC, depending on EU availability. On XeHP_SDV, they may be serialized. See [Limitations](#Limitations) section below.
|
||||
The number of CCSs, or compute engines, currently available with implicit scaling on the root device is one. This is because with implicit scaling the driver automatically uses all the EUs available in the device, so no other CCSs are exposed. Even though only one CCS is exposed, multiple kernels submitted to the root device using implicit scaling may execute concurrently on PVC, depending on EU availability.
|
||||
|
||||
No implicit scaling support is available for BCSs. Considering that, two models are followed in terms of discovery of copy engines:
|
||||
|
||||
|
@ -63,17 +63,3 @@ In OpenCL, implicit scaling is always enabled. To not use implicit scaling with
|
|||
## Coloring scheme
|
||||
|
||||
By default, allocations are equally split among available tiles. Allocations can also be colored by chunks and interleaved on each tile (`MultiStoragePolicy=1` or `MultiStoragePolicy=2`, respectively) with a size set on `MultiStorageGranularity`, which must be equal or greater than 64 kB, with 64 kB being the default.
|
||||
|
||||
# Limitations
|
||||
|
||||
## XeHP_SDV
|
||||
|
||||
For workloads with no coherent L3 caches among tiles, such as XeHP_SDV, the following considerations are made:
|
||||
|
||||
* Partial writes and atomics are moved to global memory. This can be controlled with:
|
||||
|
||||
* `ForceMultiGpuPartialWrites`: Set to `0` to handle partial writes on global memory (slow mode for multi-tile) and `1` to handle partial writes on L3 cache (fast mode for on tile).
|
||||
* `ForceMultiGpuAtomics`: Set to `0` to have global atomics (slow mode for multi-tile) and `1` to have atomics on L3 cache (fast mode for on tile).
|
||||
|
||||
* Caches are flushed after every kernel. This can be disabled with `DoNotFlushCaches=1`.
|
||||
* Kernels are serialized to maintain functional correctness of split execution.
|
||||
|
|
|
@ -103,7 +103,6 @@ struct CmdServicesMemTraceVersion {
|
|||
Ehl = 28,
|
||||
Dg1 = 30,
|
||||
Adls = 37,
|
||||
XeHP_SDV = 29,
|
||||
Adlp = 34,
|
||||
Adln = 34,
|
||||
Dg2 = 36,
|
||||
|
|
|
@ -61,27 +61,6 @@ DEVICE(0x7D60, MtlHwConfig)
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SUPPORT_XE_HP_CORE
|
||||
#ifdef SUPPORT_XE_HP_SDV
|
||||
DEVICE(0x0201, XehpSdvHwConfig)
|
||||
DEVICE(0x0202, XehpSdvHwConfig)
|
||||
DEVICE(0x0203, XehpSdvHwConfig)
|
||||
DEVICE(0x0204, XehpSdvHwConfig)
|
||||
DEVICE(0x0205, XehpSdvHwConfig)
|
||||
DEVICE(0x0206, XehpSdvHwConfig)
|
||||
DEVICE(0x0207, XehpSdvHwConfig)
|
||||
DEVICE(0x0208, XehpSdvHwConfig)
|
||||
DEVICE(0x0209, XehpSdvHwConfig)
|
||||
DEVICE(0x020A, XehpSdvHwConfig)
|
||||
DEVICE(0x020B, XehpSdvHwConfig)
|
||||
DEVICE(0x020C, XehpSdvHwConfig)
|
||||
DEVICE(0x020D, XehpSdvHwConfig)
|
||||
DEVICE(0x020E, XehpSdvHwConfig)
|
||||
DEVICE(0x020F, XehpSdvHwConfig)
|
||||
DEVICE(0x0210, XehpSdvHwConfig)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SUPPORT_GEN12LP
|
||||
|
||||
#ifdef SUPPORT_TGLLP
|
||||
|
|
|
@ -37,12 +37,6 @@ DEVICE_CONFIG(DG2_G12_A0, Dg2HwConfig, dg2G12DeviceIds, XE_FAMILY, XE_HPG_RELEAS
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SUPPORT_XE_HP_CORE
|
||||
#ifdef SUPPORT_XE_HP_SDV
|
||||
DEVICE_CONFIG(XEHP_SDV, XehpSdvHwConfig, xeHpSdvDeviceIds, XE_FAMILY, XE_HP_RELEASE)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SUPPORT_GEN12LP
|
||||
#ifdef SUPPORT_TGLLP
|
||||
DEVICE_CONFIG(TGL, TgllpHw1x6x16, tgllpDeviceIds, GEN12LP_FAMILY, GEN12LP_RELEASE)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -22,12 +22,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SUPPORT_XE_HP_CORE
|
||||
#ifdef SUPPORT_XE_HP_SDV
|
||||
#include "shared/source/xe_hp_core/xe_hp_sdv/device_ids_configs_xe_hp_sdv.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SUPPORT_GEN12LP
|
||||
#ifdef SUPPORT_TGLLP
|
||||
#include "shared/source/gen12lp/tgllp/device_ids_configs_tgllp.h"
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2021-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(SUPPORT_XE_HP_CORE)
|
||||
add_subdirectories()
|
||||
endif()
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/aub_command_stream_receiver.h"
|
||||
#include "shared/source/command_stream/aub_command_stream_receiver_hw_xehp_and_later.inl"
|
||||
#include "shared/source/helpers/array_count.h"
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
typedef XeHpFamily Family;
|
||||
static auto gfxCore = IGFX_XE_HP_CORE;
|
||||
|
||||
template <>
|
||||
void populateFactoryTable<AUBCommandStreamReceiverHw<Family>>() {
|
||||
extern AubCommandStreamReceiverCreateFunc aubCommandStreamReceiverFactory[IGFX_MAX_CORE];
|
||||
UNRECOVERABLE_IF(!isInRange(gfxCore, aubCommandStreamReceiverFactory));
|
||||
aubCommandStreamReceiverFactory[gfxCore] = AUBCommandStreamReceiverHw<Family>::create;
|
||||
}
|
||||
|
||||
template class AUBCommandStreamReceiverHw<Family>;
|
||||
} // namespace NEO
|
|
@ -1,31 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/aub/aub_mapper_base.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
#include "aubstream/engine_node.h"
|
||||
|
||||
namespace NEO {
|
||||
struct XeHpFamily;
|
||||
|
||||
template <>
|
||||
struct AUBFamilyMapper<XeHpFamily> {
|
||||
enum { device = AubMemDump::DeviceValues::XeHP_SDV };
|
||||
|
||||
using AubTraits = AubMemDump::Traits<device, MemoryConstants::GfxAddressBits>;
|
||||
|
||||
static const AubMemDump::LrcaHelper *const csTraits[aub_stream::NUM_ENGINES];
|
||||
|
||||
static const MMIOList globalMMIO;
|
||||
static const MMIOList *perEngineMMIO[aub_stream::NUM_ENGINES];
|
||||
|
||||
typedef AubMemDump::AubDump<AubTraits> AUB;
|
||||
};
|
||||
} // namespace NEO
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/aub/aub_helper_xehp_and_later.inl"
|
||||
#include "shared/source/aub_mem_dump/aub_mem_dump.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
namespace NEO {
|
||||
struct XeHpFamily;
|
||||
using Family = NEO::XeHpFamily;
|
||||
constexpr static auto deviceValue = AubMemDump::DeviceValues::XeHP_SDV;
|
||||
|
||||
template class AubHelperHw<Family>;
|
||||
} // namespace NEO
|
||||
|
||||
#include "shared/source/aub_mem_dump/aub_mem_dump_xehp_and_later.inl"
|
|
@ -1,105 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/command_container/command_encoder.inl"
|
||||
#include "shared/source/command_container/command_encoder_raytracing_xehp_and_later.inl"
|
||||
#include "shared/source/command_container/command_encoder_xehp_and_later.inl"
|
||||
#include "shared/source/command_container/encode_compute_mode_tgllp_and_later.inl"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
using Family = NEO::XeHpFamily;
|
||||
|
||||
#include "shared/source/command_container/command_encoder_tgllp_and_later.inl"
|
||||
#include "shared/source/command_container/image_surface_state/compression_params_tgllp_and_later.inl"
|
||||
#include "shared/source/command_container/image_surface_state/compression_params_xehp_and_later.inl"
|
||||
#include "shared/source/helpers/cache_flush_xehp_and_later.inl"
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
void EncodeDispatchKernel<Family>::adjustTimestampPacket(WALKER_TYPE &walkerCmd, const HardwareInfo &hwInfo) {
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void EncodeSurfaceState<Family>::encodeExtraCacheSettings(R_SURFACE_STATE *surfaceState, const EncodeSurfaceStateArgs &args) {
|
||||
}
|
||||
|
||||
template <>
|
||||
void EncodeSurfaceState<Family>::encodeImplicitScalingParams(const EncodeSurfaceStateArgs &args) {
|
||||
auto surfaceState = reinterpret_cast<R_SURFACE_STATE *>(args.outMemory);
|
||||
bool enablePartialWrites = args.implicitScaling;
|
||||
bool enableMultiGpuAtomics = enablePartialWrites;
|
||||
|
||||
if (DebugManager.flags.EnableMultiGpuAtomicsOptimization.get()) {
|
||||
enableMultiGpuAtomics = args.useGlobalAtomics && (enablePartialWrites || args.areMultipleSubDevicesInContext);
|
||||
}
|
||||
|
||||
surfaceState->setDisableSupportForMultiGpuAtomics(!enableMultiGpuAtomics);
|
||||
surfaceState->setDisableSupportForMultiGpuPartialWrites(!enablePartialWrites);
|
||||
|
||||
if (DebugManager.flags.ForceMultiGpuAtomics.get() != -1) {
|
||||
surfaceState->setDisableSupportForMultiGpuAtomics(!!DebugManager.flags.ForceMultiGpuAtomics.get());
|
||||
}
|
||||
|
||||
if (DebugManager.flags.ForceMultiGpuPartialWrites.get() != -1) {
|
||||
surfaceState->setDisableSupportForMultiGpuPartialWrites(!!DebugManager.flags.ForceMultiGpuPartialWrites.get());
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void EncodeDispatchKernel<Family>::appendAdditionalIDDFields(INTERFACE_DESCRIPTOR_DATA *pInterfaceDescriptor, const HardwareInfo &hwInfo, const uint32_t threadsPerThreadGroup, uint32_t slmTotalSize, SlmPolicy slmPolicy) {
|
||||
}
|
||||
|
||||
template <>
|
||||
void EncodeDispatchKernel<Family>::programBarrierEnable(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, uint32_t value, const HardwareInfo &hwInfo) {
|
||||
interfaceDescriptor.setBarrierEnable(value);
|
||||
}
|
||||
|
||||
template <>
|
||||
void EncodeDispatchKernel<Family>::adjustInterfaceDescriptorData(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, const Device &device, const HardwareInfo &hwInfo, const uint32_t threadGroupCount, const uint32_t numGrf) {
|
||||
const auto &productHelper = device.getProductHelper();
|
||||
if (productHelper.isDisableOverdispatchAvailable(hwInfo)) {
|
||||
interfaceDescriptor.setThreadGroupDispatchSize(INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE_TG_SIZE_1);
|
||||
}
|
||||
|
||||
if (DebugManager.flags.ForceThreadGroupDispatchSize.get() != -1) {
|
||||
interfaceDescriptor.setThreadGroupDispatchSize(static_cast<INTERFACE_DESCRIPTOR_DATA::THREAD_GROUP_DISPATCH_SIZE>(
|
||||
DebugManager.flags.ForceThreadGroupDispatchSize.get()));
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void adjustL3ControlField<Family>(void *l3ControlBuffer) { ; }
|
||||
|
||||
template void flushGpuCache<Family>(LinearStream *commandStream, const Range<L3Range> &ranges, uint64_t postSyncAddress, const HardwareInfo &hwInfo);
|
||||
|
||||
template struct EncodeDispatchKernel<Family>;
|
||||
template struct EncodeStates<Family>;
|
||||
template struct EncodeMath<Family>;
|
||||
template struct EncodeMathMMIO<Family>;
|
||||
template struct EncodeIndirectParams<Family>;
|
||||
template struct EncodeSetMMIO<Family>;
|
||||
template struct EncodeMediaInterfaceDescriptorLoad<Family>;
|
||||
template struct EncodeStateBaseAddress<Family>;
|
||||
template struct EncodeStoreMMIO<Family>;
|
||||
template struct EncodeSurfaceState<Family>;
|
||||
template struct EncodeComputeMode<Family>;
|
||||
template struct EncodeAtomic<Family>;
|
||||
template struct EncodeSemaphore<Family>;
|
||||
template struct EncodeBatchBufferStartOrEnd<Family>;
|
||||
template struct EncodeMiFlushDW<Family>;
|
||||
template struct EncodeMiPredicate<Family>;
|
||||
template struct EncodeMemoryPrefetch<Family>;
|
||||
template struct EncodeMiArbCheck<Family>;
|
||||
template struct EncodeWA<Family>;
|
||||
template struct EncodeEnableRayTracing<Family>;
|
||||
template struct EncodeNoop<Family>;
|
||||
template struct EncodeStoreMemory<Family>;
|
||||
template struct EncodeMemoryFence<Family>;
|
||||
template struct EnodeUserInterrupt<Family>;
|
||||
} // namespace NEO
|
|
@ -1,159 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
#include "shared/source/xe_hp_core/hw_info.h"
|
||||
|
||||
using Family = NEO::XeHpFamily;
|
||||
|
||||
#include "shared/source/command_stream/command_stream_receiver_hw_xehp_and_later.inl"
|
||||
#include "shared/source/helpers/blit_commands_helper_xehp_and_later.inl"
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
#include "shared/source/helpers/state_base_address_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
static auto gfxCore = IGFX_XE_HP_CORE;
|
||||
|
||||
template <>
|
||||
bool ImplicitFlushSettings<Family>::defaultSettingForNewResource = true;
|
||||
template <>
|
||||
bool ImplicitFlushSettings<Family>::defaultSettingForGpuIdle = true;
|
||||
template class ImplicitFlushSettings<Family>;
|
||||
|
||||
template <>
|
||||
void populateFactoryTable<CommandStreamReceiverHw<Family>>() {
|
||||
extern CommandStreamReceiverCreateFunc commandStreamReceiverFactory[2 * IGFX_MAX_CORE];
|
||||
commandStreamReceiverFactory[gfxCore] = DeviceCommandStreamReceiver<Family>::create;
|
||||
}
|
||||
|
||||
template <>
|
||||
MemoryCompressionState CommandStreamReceiverHw<Family>::getMemoryCompressionState(bool auxTranslationRequired, const HardwareInfo &hwInfo) const {
|
||||
auto memoryCompressionState = MemoryCompressionState::NotApplicable;
|
||||
const auto &productHelper = getProductHelper();
|
||||
if (productHelper.allowStatelessCompression(hwInfo)) {
|
||||
memoryCompressionState = auxTranslationRequired ? MemoryCompressionState::Disabled : MemoryCompressionState::Enabled;
|
||||
}
|
||||
return memoryCompressionState;
|
||||
}
|
||||
|
||||
template <>
|
||||
GraphicsAllocation *CommandStreamReceiverHw<Family>::getClearColorAllocation() {
|
||||
constexpr uint32_t clearColorSize = 16u;
|
||||
static uint8_t clearColorBuffer[clearColorSize];
|
||||
if (DebugManager.flags.UseClearColorAllocationForBlitter.get()) {
|
||||
if (clearColorAllocation == nullptr) {
|
||||
auto lock = this->obtainUniqueOwnership();
|
||||
if (clearColorAllocation == nullptr) {
|
||||
AllocationProperties properties{rootDeviceIndex, clearColorSize, AllocationType::BUFFER, osContext->getDeviceBitfield()};
|
||||
properties.flags.readOnlyMultiStorage = true;
|
||||
properties.flags.flushL3RequiredForRead = properties.flags.flushL3RequiredForWrite = false;
|
||||
clearColorAllocation = getMemoryManager()->allocateGraphicsMemoryWithProperties(properties, clearColorBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
return clearColorAllocation;
|
||||
}
|
||||
|
||||
template <>
|
||||
void CommandStreamReceiverHw<Family>::programPerDssBackedBuffer(LinearStream &commandStream, Device &device, DispatchFlags &dispatchFlags) {
|
||||
}
|
||||
|
||||
template <>
|
||||
size_t CommandStreamReceiverHw<Family>::getCmdSizeForPerDssBackedBuffer(const HardwareInfo &hwInfo) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
void CommandStreamReceiverHw<Family>::addPipeControlBefore3dState(LinearStream &commandStream, DispatchFlags &dispatchFlags) {}
|
||||
|
||||
template <>
|
||||
void BlitCommandsHelper<Family>::appendClearColor(const BlitProperties &blitProperties, typename Family::XY_BLOCK_COPY_BLT &blitCmd) {
|
||||
using XY_BLOCK_COPY_BLT = typename Family::XY_BLOCK_COPY_BLT;
|
||||
if (DebugManager.flags.UseClearColorAllocationForBlitter.get()) {
|
||||
blitCmd.setSourceClearValueEnable(XY_BLOCK_COPY_BLT::CLEAR_VALUE_ENABLE::CLEAR_VALUE_ENABLE_ENABLE);
|
||||
blitCmd.setDestinationClearValueEnable(XY_BLOCK_COPY_BLT::CLEAR_VALUE_ENABLE::CLEAR_VALUE_ENABLE_ENABLE);
|
||||
auto clearColorAddress = blitProperties.clearColorAllocation->getGpuAddress();
|
||||
blitCmd.setSourceClearAddressLow(static_cast<uint32_t>(clearColorAddress & 0xFFFFFFFFULL));
|
||||
blitCmd.setSourceClearAddressHigh(static_cast<uint32_t>(clearColorAddress >> 32));
|
||||
blitCmd.setDestinationClearAddressLow(static_cast<uint32_t>(clearColorAddress & 0xFFFFFFFFULL));
|
||||
blitCmd.setDestinationClearAddressHigh(static_cast<uint32_t>(clearColorAddress >> 32));
|
||||
}
|
||||
}
|
||||
|
||||
template class CommandStreamReceiverHw<Family>;
|
||||
|
||||
template <>
|
||||
void BlitCommandsHelper<Family>::appendExtraMemoryProperties(typename Family::XY_BLOCK_COPY_BLT &blitCmd, const RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
using XY_BLOCK_COPY_BLT = typename Family::XY_BLOCK_COPY_BLT;
|
||||
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
const auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
|
||||
if (GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, *hwInfo, productHelper) &&
|
||||
productHelper.getLocalMemoryAccessMode(*hwInfo) == LocalMemoryAccessMode::CpuAccessAllowed) {
|
||||
blitCmd.setSourceTargetMemory(XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM);
|
||||
blitCmd.setDestinationTargetMemory(XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM);
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void BlitCommandsHelper<Family>::appendExtraMemoryProperties(typename Family::XY_COLOR_BLT &blitCmd, const RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
using XY_COLOR_BLT = typename Family::XY_COLOR_BLT;
|
||||
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
const auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
||||
|
||||
if (GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, *hwInfo, productHelper) &&
|
||||
productHelper.getLocalMemoryAccessMode(*hwInfo) == LocalMemoryAccessMode::CpuAccessAllowed) {
|
||||
blitCmd.setDestinationTargetMemory(XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_SYSTEM_MEM);
|
||||
}
|
||||
}
|
||||
|
||||
template struct BlitCommandsHelper<Family>;
|
||||
template void BlitCommandsHelper<Family>::appendColorDepth<typename Family::XY_BLOCK_COPY_BLT>(const BlitProperties &blitProperties, typename Family::XY_BLOCK_COPY_BLT &blitCmd);
|
||||
template void BlitCommandsHelper<Family>::appendBlitCommandsForBuffer<typename Family::XY_BLOCK_COPY_BLT>(const BlitProperties &blitProperties, typename Family::XY_BLOCK_COPY_BLT &blitCmd, const RootDeviceEnvironment &rootDeviceEnvironment);
|
||||
|
||||
const Family::COMPUTE_WALKER Family::cmdInitGpgpuWalker = Family::COMPUTE_WALKER::sInit();
|
||||
const Family::CFE_STATE Family::cmdInitCfeState = Family::CFE_STATE::sInit();
|
||||
const Family::INTERFACE_DESCRIPTOR_DATA Family::cmdInitInterfaceDescriptorData = Family::INTERFACE_DESCRIPTOR_DATA::sInit();
|
||||
const Family::MI_BATCH_BUFFER_START Family::cmdInitBatchBufferStart = Family::MI_BATCH_BUFFER_START::sInit();
|
||||
const Family::MI_BATCH_BUFFER_END Family::cmdInitBatchBufferEnd = Family::MI_BATCH_BUFFER_END::sInit();
|
||||
const Family::PIPE_CONTROL Family::cmdInitPipeControl = Family::PIPE_CONTROL::sInit();
|
||||
const Family::STATE_COMPUTE_MODE Family::cmdInitStateComputeMode = Family::STATE_COMPUTE_MODE::sInit();
|
||||
const Family::_3DSTATE_BINDING_TABLE_POOL_ALLOC Family::cmdInitStateBindingTablePoolAlloc =
|
||||
Family::_3DSTATE_BINDING_TABLE_POOL_ALLOC::sInit();
|
||||
const Family::MI_SEMAPHORE_WAIT Family::cmdInitMiSemaphoreWait = Family::MI_SEMAPHORE_WAIT::sInit();
|
||||
const Family::RENDER_SURFACE_STATE Family::cmdInitRenderSurfaceState = Family::RENDER_SURFACE_STATE::sInit();
|
||||
const Family::POSTSYNC_DATA Family::cmdInitPostSyncData = Family::POSTSYNC_DATA::sInit();
|
||||
const Family::MI_SET_PREDICATE Family::cmdInitSetPredicate = Family::MI_SET_PREDICATE::sInit();
|
||||
const Family::MI_LOAD_REGISTER_IMM Family::cmdInitLoadRegisterImm = Family::MI_LOAD_REGISTER_IMM::sInit();
|
||||
const Family::MI_LOAD_REGISTER_REG Family::cmdInitLoadRegisterReg = Family::MI_LOAD_REGISTER_REG::sInit();
|
||||
const Family::MI_LOAD_REGISTER_MEM Family::cmdInitLoadRegisterMem = Family::MI_LOAD_REGISTER_MEM::sInit();
|
||||
const Family::MI_STORE_DATA_IMM Family::cmdInitStoreDataImm = Family::MI_STORE_DATA_IMM::sInit();
|
||||
const Family::MI_STORE_REGISTER_MEM Family::cmdInitStoreRegisterMem = Family::MI_STORE_REGISTER_MEM::sInit();
|
||||
const Family::MI_NOOP Family::cmdInitNoop = Family::MI_NOOP::sInit();
|
||||
const Family::MI_REPORT_PERF_COUNT Family::cmdInitReportPerfCount = Family::MI_REPORT_PERF_COUNT::sInit();
|
||||
const Family::MI_ATOMIC Family::cmdInitAtomic = Family::MI_ATOMIC::sInit();
|
||||
const Family::PIPELINE_SELECT Family::cmdInitPipelineSelect = Family::PIPELINE_SELECT::sInit();
|
||||
const Family::MI_ARB_CHECK Family::cmdInitArbCheck = Family::MI_ARB_CHECK::sInit();
|
||||
const Family::STATE_BASE_ADDRESS Family::cmdInitStateBaseAddress = Family::STATE_BASE_ADDRESS::sInit();
|
||||
const Family::MEDIA_SURFACE_STATE Family::cmdInitMediaSurfaceState = Family::MEDIA_SURFACE_STATE::sInit();
|
||||
const Family::SAMPLER_STATE Family::cmdInitSamplerState = Family::SAMPLER_STATE::sInit();
|
||||
const Family::BINDING_TABLE_STATE Family::cmdInitBindingTableState = Family::BINDING_TABLE_STATE::sInit();
|
||||
const Family::MI_USER_INTERRUPT Family::cmdInitUserInterrupt = Family::MI_USER_INTERRUPT::sInit();
|
||||
const Family::MI_CONDITIONAL_BATCH_BUFFER_END cmdInitConditionalBatchBufferEnd = Family::MI_CONDITIONAL_BATCH_BUFFER_END::sInit();
|
||||
const Family::L3_CONTROL Family::cmdInitL3Control = Family::L3_CONTROL::sInit();
|
||||
const Family::L3_FLUSH_ADDRESS_RANGE Family::cmdInitL3FlushAddressRange = Family::L3_FLUSH_ADDRESS_RANGE::sInit();
|
||||
const Family::MI_FLUSH_DW Family::cmdInitMiFlushDw = Family::MI_FLUSH_DW::sInit();
|
||||
const Family::XY_BLOCK_COPY_BLT Family::cmdInitXyBlockCopyBlt = Family::XY_BLOCK_COPY_BLT::sInit();
|
||||
const Family::XY_BLOCK_COPY_BLT Family::cmdInitXyCopyBlt = Family::XY_BLOCK_COPY_BLT::sInit();
|
||||
const Family::XY_FAST_COLOR_BLT Family::cmdInitXyColorBlt = Family::XY_FAST_COLOR_BLT::sInit();
|
||||
const Family::_3DSTATE_BTD Family::cmd3dStateBtd = Family::_3DSTATE_BTD::sInit();
|
||||
const Family::_3DSTATE_BTD_BODY Family::cmd3dStateBtdBody = Family::_3DSTATE_BTD_BODY::sInit();
|
||||
const Family::STATE_SIP Family::cmdInitStateSip = Family::STATE_SIP::sInit();
|
||||
} // namespace NEO
|
|
@ -1,14 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/command_stream_receiver_simulated_common_hw_xehp_and_later.inl"
|
||||
|
||||
namespace NEO {
|
||||
typedef XeHpFamily Family;
|
||||
|
||||
template class CommandStreamReceiverSimulatedCommonHw<Family>;
|
||||
} // namespace NEO
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/device_command_stream.h"
|
||||
#include "shared/source/execution_environment/execution_environment.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
#include "create_command_stream_receiver.inl"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
CommandStreamReceiver *createDeviceCommandStreamReceiver<XeHpFamily>(bool withAubDump,
|
||||
ExecutionEnvironment &executionEnvironment,
|
||||
uint32_t rootDeviceIndex,
|
||||
const DeviceBitfield deviceBitfield) {
|
||||
return createCommandStreamReceiver<XeHpFamily>(withAubDump, executionEnvironment, rootDeviceIndex, deviceBitfield);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/debugger/debugger_l0.inl"
|
||||
#include "shared/source/debugger/debugger_l0_tgllp_and_later.inl"
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using GfxFamily = NEO::XeHpFamily;
|
||||
static auto coreFamily = IGFX_XE_HP_CORE;
|
||||
|
||||
template <>
|
||||
void populateFactoryTable<DebuggerL0Hw<GfxFamily>>() {
|
||||
extern DebugerL0CreateFn debuggerL0Factory[IGFX_MAX_CORE];
|
||||
debuggerL0Factory[coreFamily] = DebuggerL0Hw<GfxFamily>::allocate;
|
||||
}
|
||||
template class DebuggerL0Hw<GfxFamily>;
|
||||
|
||||
} // namespace NEO
|
|
@ -1,6 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
const HardwareInfo XE_HP_SDV::hwInfo = XehpSdvHwConfig::hwInfo;
|
||||
const uint64_t XE_HP_SDV::defaultHardwareInfoConfig = 0;
|
||||
|
||||
void setupXEHPHardwareInfoImpl(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const CompilerProductHelper &compilerProductHelper) {
|
||||
XE_HP_SDV::setupHardwareInfoBase(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper);
|
||||
XehpSdvHwConfig::setupHardwareInfo(hwInfo, setupFeatureTableAndWorkaroundTable, compilerProductHelper);
|
||||
}
|
||||
|
||||
void (*XE_HP_SDV::setupHardwareInfo)(HardwareInfo *, bool, uint64_t, const CompilerProductHelper &) = setupXEHPHardwareInfoImpl;
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/aub_command_stream_receiver_hw.h"
|
||||
#include "shared/source/command_stream/command_stream_receiver_hw.h"
|
||||
#include "shared/source/command_stream/tbx_command_stream_receiver_hw.h"
|
||||
#include "shared/source/debugger/debugger_l0.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
extern GfxCoreHelper *gfxCoreHelperFactory[IGFX_MAX_CORE];
|
||||
|
||||
using Family = XeHpFamily;
|
||||
static auto gfxFamily = IGFX_XE_HP_CORE;
|
||||
|
||||
struct EnableCoreXeHpCore {
|
||||
EnableCoreXeHpCore() {
|
||||
gfxCoreHelperFactory[gfxFamily] = &GfxCoreHelperHw<Family>::get();
|
||||
populateFactoryTable<AUBCommandStreamReceiverHw<Family>>();
|
||||
populateFactoryTable<CommandStreamReceiverHw<Family>>();
|
||||
populateFactoryTable<TbxCommandStreamReceiverHw<Family>>();
|
||||
populateFactoryTable<DebuggerL0Hw<Family>>();
|
||||
}
|
||||
};
|
||||
|
||||
static EnableCoreXeHpCore enable;
|
||||
} // namespace NEO
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/experimental_command_buffer.inl"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
namespace NEO {
|
||||
typedef XeHpFamily GfxFamily;
|
||||
|
||||
template void ExperimentalCommandBuffer::injectBufferStart<GfxFamily>(LinearStream &parentStream, size_t cmdBufferOffset);
|
||||
template size_t ExperimentalCommandBuffer::getRequiredInjectionSize<GfxFamily>() noexcept;
|
||||
|
||||
template size_t ExperimentalCommandBuffer::programExperimentalCommandBuffer<GfxFamily>();
|
||||
template size_t ExperimentalCommandBuffer::getTotalExperimentalSize<GfxFamily>() noexcept;
|
||||
|
||||
template void ExperimentalCommandBuffer::addTimeStampPipeControl<GfxFamily>();
|
||||
template size_t ExperimentalCommandBuffer::getTimeStampPipeControlSize<GfxFamily>() noexcept;
|
||||
|
||||
template void ExperimentalCommandBuffer::addExperimentalCommands<GfxFamily>();
|
||||
template size_t ExperimentalCommandBuffer::getExperimentalCommandsSize<GfxFamily>() noexcept;
|
||||
} // namespace NEO
|
|
@ -1,156 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/aub_mapper.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
using Family = NEO::XeHpFamily;
|
||||
|
||||
#include "shared/source/helpers/api_specific_config.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/extra_allocation_data_xehp_and_later.inl"
|
||||
#include "shared/source/helpers/flat_batch_buffer_helper_hw.inl"
|
||||
#include "shared/source/helpers/gfx_core_helper_base.inl"
|
||||
#include "shared/source/helpers/gfx_core_helper_bdw_to_dg2.inl"
|
||||
#include "shared/source/helpers/gfx_core_helper_tgllp_and_later.inl"
|
||||
#include "shared/source/helpers/gfx_core_helper_xehp_and_later.inl"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
|
||||
namespace NEO {
|
||||
template <>
|
||||
const AuxTranslationMode GfxCoreHelperHw<Family>::defaultAuxTranslationMode = AuxTranslationMode::Blit;
|
||||
|
||||
template <>
|
||||
uint32_t GfxCoreHelperHw<Family>::getMetricsLibraryGenId() const {
|
||||
return static_cast<uint32_t>(MetricsLibraryApi::ClientGen::XeHP);
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t GfxCoreHelperHw<Family>::getComputeUnitsUsedForScratch(const RootDeviceEnvironment &rootDeviceEnvironment) const {
|
||||
if (DebugManager.flags.OverrideNumComputeUnitsForScratch.get() != -1) {
|
||||
return static_cast<uint32_t>(DebugManager.flags.OverrideNumComputeUnitsForScratch.get());
|
||||
}
|
||||
|
||||
// XeHP products return physical threads
|
||||
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
||||
return std::max(hwInfo->gtSystemInfo.MaxSubSlicesSupported, static_cast<uint32_t>(32)) * hwInfo->gtSystemInfo.MaxEuPerSubSlice * (hwInfo->gtSystemInfo.ThreadCount / hwInfo->gtSystemInfo.EUCount);
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t GfxCoreHelperHw<Family>::computeSlmValues(const HardwareInfo &hwInfo, uint32_t slmSize) {
|
||||
using SHARED_LOCAL_MEMORY_SIZE = typename Family::INTERFACE_DESCRIPTOR_DATA::SHARED_LOCAL_MEMORY_SIZE;
|
||||
|
||||
auto slmValue = std::max(slmSize, 1024u);
|
||||
slmValue = Math::nextPowerOfTwo(slmValue);
|
||||
slmValue = Math::getMinLsbSet(slmValue);
|
||||
slmValue = slmValue - 9;
|
||||
DEBUG_BREAK_IF(slmValue > 7);
|
||||
slmValue *= !!slmSize;
|
||||
|
||||
return slmValue;
|
||||
}
|
||||
|
||||
template <>
|
||||
void GfxCoreHelperHw<Family>::setL1CachePolicy(bool useL1Cache, typename Family::RENDER_SURFACE_STATE *surfaceState, const HardwareInfo *hwInfo) const {
|
||||
}
|
||||
|
||||
template <>
|
||||
bool GfxCoreHelperHw<Family>::isBankOverrideRequired(const HardwareInfo &hwInfo, const ProductHelper &productHelper) const {
|
||||
|
||||
bool forceOverrideMemoryBankIndex = (GfxCoreHelper::getSubDevicesCount(&hwInfo) == 4 &&
|
||||
GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, productHelper));
|
||||
|
||||
if (DebugManager.flags.ForceMemoryBankIndexOverride.get() != -1) {
|
||||
forceOverrideMemoryBankIndex = static_cast<bool>(DebugManager.flags.ForceMemoryBankIndexOverride.get());
|
||||
}
|
||||
return forceOverrideMemoryBankIndex;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool GfxCoreHelperHw<Family>::isSipWANeeded(const HardwareInfo &hwInfo) const {
|
||||
return hwInfo.platform.usRevId <= ProductHelper::get(hwInfo.platform.eProductFamily)->getHwRevIdFromStepping(REVISION_B, hwInfo);
|
||||
}
|
||||
|
||||
template <>
|
||||
bool GfxCoreHelperHw<Family>::isBufferSizeSuitableForCompression(const size_t size, const HardwareInfo &hwInfo) const {
|
||||
if (DebugManager.flags.OverrideBufferSuitableForRenderCompression.get() != -1) {
|
||||
return !!DebugManager.flags.OverrideBufferSuitableForRenderCompression.get();
|
||||
}
|
||||
if (ProductHelper::get(hwInfo.platform.eProductFamily)->allowStatelessCompression(hwInfo)) {
|
||||
return true;
|
||||
} else {
|
||||
return size > KB;
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
const StackVec<uint32_t, 6> GfxCoreHelperHw<Family>::getThreadsPerEUConfigs() const {
|
||||
return {4, 8};
|
||||
}
|
||||
|
||||
template <>
|
||||
void MemorySynchronizationCommands<Family>::setBarrierWaFlags(void *barrierCmd) {
|
||||
auto &pipeControl = *reinterpret_cast<typename Family::PIPE_CONTROL *>(barrierCmd);
|
||||
|
||||
pipeControl.setCommandStreamerStallEnable(true);
|
||||
pipeControl.setHdcPipelineFlush(true);
|
||||
}
|
||||
|
||||
template <>
|
||||
void MemorySynchronizationCommands<Family>::setBarrierExtraProperties(void *barrierCmd, PipeControlArgs &args) {
|
||||
auto &pipeControl = *reinterpret_cast<typename Family::PIPE_CONTROL *>(barrierCmd);
|
||||
|
||||
pipeControl.setHdcPipelineFlush(args.hdcPipelineFlush);
|
||||
pipeControl.setCompressionControlSurfaceCcsFlush(args.compressionControlSurfaceCcsFlush);
|
||||
pipeControl.setWorkloadPartitionIdOffsetEnable(args.workloadPartitionOffset);
|
||||
pipeControl.setAmfsFlushEnable(args.amfsFlushEnable);
|
||||
|
||||
if (DebugManager.flags.FlushAllCaches.get()) {
|
||||
pipeControl.setHdcPipelineFlush(true);
|
||||
pipeControl.setCompressionControlSurfaceCcsFlush(true);
|
||||
}
|
||||
if (DebugManager.flags.DoNotFlushCaches.get()) {
|
||||
pipeControl.setHdcPipelineFlush(false);
|
||||
pipeControl.setCompressionControlSurfaceCcsFlush(false);
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void MemorySynchronizationCommands<Family>::setPostSyncExtraProperties(PipeControlArgs &args, const HardwareInfo &hwInfo) {
|
||||
if (hwInfo.featureTable.flags.ftrLocalMemory) {
|
||||
args.hdcPipelineFlush = true;
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
void MemorySynchronizationCommands<Family>::setCacheFlushExtraProperties(PipeControlArgs &args) {
|
||||
args.hdcPipelineFlush = true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool GfxCoreHelperHw<Family>::unTypedDataPortCacheFlushRequired() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool GfxCoreHelperHw<Family>::disableL3CacheForDebug(const HardwareInfo &) const {
|
||||
return true;
|
||||
}
|
||||
template <>
|
||||
uint32_t GfxCoreHelperHw<Family>::calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) const {
|
||||
if (grfCount > GrfConfig::DefaultGrfNumber) {
|
||||
return hwInfo.gtSystemInfo.ThreadCount / 2u;
|
||||
}
|
||||
return hwInfo.gtSystemInfo.ThreadCount;
|
||||
}
|
||||
|
||||
template class GfxCoreHelperHw<Family>;
|
||||
template class FlatBatchBufferHelperHw<Family>;
|
||||
template struct MemorySynchronizationCommands<Family>;
|
||||
template struct LriHelper<Family>;
|
||||
|
||||
} // namespace NEO
|
|
@ -1,11 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifdef SUPPORT_XE_HP_SDV
|
||||
#include "hw_cmds_xe_hp_sdv.h"
|
||||
#endif
|
|
@ -1,152 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/commands/bxml_generator_glue.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/xe_hp_core/hw_info.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <type_traits>
|
||||
|
||||
template <class T>
|
||||
struct CmdParse;
|
||||
|
||||
namespace NEO {
|
||||
struct XeHpCore {
|
||||
#include "shared/source/generated/xe_hp_core/hw_cmds_generated_xe_hp_core.inl"
|
||||
|
||||
static constexpr uint32_t stateComputeModeForceNonCoherentMask = (0b11u << 3);
|
||||
static constexpr uint32_t stateComputeModeLargeGrfModeMask = (1u << 15);
|
||||
static constexpr uint32_t stateComputeModeForceDisableSupportMultiGpuPartialWrites = (1u << 2);
|
||||
static constexpr uint32_t stateComputeModeForceDisableSupportMultiGpuAtomics = (1u << 1);
|
||||
static constexpr uint32_t bcsEngineCount = 1u;
|
||||
static constexpr uint32_t timestampPacketCount = 16u;
|
||||
|
||||
static constexpr bool isUsingL3Control = true;
|
||||
static constexpr bool isUsingMediaSamplerDopClockGate = true;
|
||||
static constexpr bool supportsSampler = true;
|
||||
static constexpr bool isUsingGenericMediaStateClear = true;
|
||||
static constexpr bool isUsingMiMemFence = false;
|
||||
static constexpr bool isUsingMiSetPredicate = true;
|
||||
static constexpr bool isUsingMiMathMocs = false;
|
||||
|
||||
struct FrontEndStateSupport {
|
||||
static constexpr bool scratchSize = true;
|
||||
static constexpr bool privateScratchSize = true;
|
||||
static constexpr bool computeDispatchAllWalker = false;
|
||||
static constexpr bool disableEuFusion = false;
|
||||
static constexpr bool disableOverdispatch = true;
|
||||
static constexpr bool singleSliceDispatchCcsMode = true;
|
||||
};
|
||||
|
||||
struct StateComputeModeStateSupport {
|
||||
static constexpr bool threadArbitrationPolicy = false;
|
||||
static constexpr bool coherencyRequired = true;
|
||||
static constexpr bool largeGrfMode = true;
|
||||
static constexpr bool zPassAsyncComputeThreadLimit = false;
|
||||
static constexpr bool pixelAsyncComputeThreadLimit = false;
|
||||
static constexpr bool devicePreemptionMode = false;
|
||||
};
|
||||
|
||||
struct StateBaseAddressStateSupport {
|
||||
static constexpr bool globalAtomics = true;
|
||||
static constexpr bool bindingTablePoolBaseAddress = true;
|
||||
};
|
||||
|
||||
struct PipelineSelectStateSupport {
|
||||
static constexpr bool mediaSamplerDopClockGate = true;
|
||||
static constexpr bool systolicMode = true;
|
||||
};
|
||||
|
||||
struct PreemptionDebugSupport {
|
||||
static constexpr bool preemptionMode = true;
|
||||
static constexpr bool stateSip = true;
|
||||
static constexpr bool csrSurface = false;
|
||||
};
|
||||
|
||||
struct DataPortBindlessSurfaceExtendedMessageDescriptor {
|
||||
union {
|
||||
struct {
|
||||
uint32_t bindlessSurfaceOffset : 25;
|
||||
uint32_t reserved : 6;
|
||||
};
|
||||
uint32_t packed;
|
||||
};
|
||||
|
||||
DataPortBindlessSurfaceExtendedMessageDescriptor() {
|
||||
packed = 0;
|
||||
}
|
||||
|
||||
void setBindlessSurfaceOffset(uint32_t offsetInBindlessSurfaceHeapInBytes) {
|
||||
bindlessSurfaceOffset = offsetInBindlessSurfaceHeapInBytes >> 6;
|
||||
}
|
||||
|
||||
uint32_t getBindlessSurfaceOffsetToPatch() {
|
||||
return bindlessSurfaceOffset << 6;
|
||||
}
|
||||
};
|
||||
|
||||
static_assert(sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor) == sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor::packed), "");
|
||||
};
|
||||
|
||||
struct XeHpFamily : public XeHpCore {
|
||||
using PARSE = CmdParse<XeHpFamily>;
|
||||
using GfxFamily = XeHpFamily;
|
||||
using WALKER_TYPE = COMPUTE_WALKER;
|
||||
using VFE_STATE_TYPE = CFE_STATE;
|
||||
using XY_BLOCK_COPY_BLT = typename GfxFamily::XY_BLOCK_COPY_BLT;
|
||||
using XY_COPY_BLT = typename GfxFamily::XY_BLOCK_COPY_BLT;
|
||||
using XY_COLOR_BLT = typename GfxFamily::XY_FAST_COLOR_BLT;
|
||||
using MI_STORE_REGISTER_MEM_CMD = typename GfxFamily::MI_STORE_REGISTER_MEM;
|
||||
using TimestampPacketType = uint32_t;
|
||||
static const COMPUTE_WALKER cmdInitGpgpuWalker;
|
||||
static const CFE_STATE cmdInitCfeState;
|
||||
static const INTERFACE_DESCRIPTOR_DATA cmdInitInterfaceDescriptorData;
|
||||
static const MI_BATCH_BUFFER_END cmdInitBatchBufferEnd;
|
||||
static const MI_BATCH_BUFFER_START cmdInitBatchBufferStart;
|
||||
static const PIPE_CONTROL cmdInitPipeControl;
|
||||
static const STATE_COMPUTE_MODE cmdInitStateComputeMode;
|
||||
static const _3DSTATE_BINDING_TABLE_POOL_ALLOC cmdInitStateBindingTablePoolAlloc;
|
||||
static const MI_SEMAPHORE_WAIT cmdInitMiSemaphoreWait;
|
||||
static const RENDER_SURFACE_STATE cmdInitRenderSurfaceState;
|
||||
static const POSTSYNC_DATA cmdInitPostSyncData;
|
||||
static const MI_SET_PREDICATE cmdInitSetPredicate;
|
||||
static const MI_LOAD_REGISTER_IMM cmdInitLoadRegisterImm;
|
||||
static const MI_LOAD_REGISTER_REG cmdInitLoadRegisterReg;
|
||||
static const MI_LOAD_REGISTER_MEM cmdInitLoadRegisterMem;
|
||||
static const MI_STORE_DATA_IMM cmdInitStoreDataImm;
|
||||
static const MI_STORE_REGISTER_MEM cmdInitStoreRegisterMem;
|
||||
static const MI_NOOP cmdInitNoop;
|
||||
static const MI_REPORT_PERF_COUNT cmdInitReportPerfCount;
|
||||
static const MI_ATOMIC cmdInitAtomic;
|
||||
static const PIPELINE_SELECT cmdInitPipelineSelect;
|
||||
static const MI_ARB_CHECK cmdInitArbCheck;
|
||||
static const STATE_BASE_ADDRESS cmdInitStateBaseAddress;
|
||||
static const MEDIA_SURFACE_STATE cmdInitMediaSurfaceState;
|
||||
static const SAMPLER_STATE cmdInitSamplerState;
|
||||
static const BINDING_TABLE_STATE cmdInitBindingTableState;
|
||||
static const MI_USER_INTERRUPT cmdInitUserInterrupt;
|
||||
static const MI_CONDITIONAL_BATCH_BUFFER_END cmdInitConditionalBatchBufferEnd;
|
||||
static const L3_CONTROL cmdInitL3Control;
|
||||
static const L3_FLUSH_ADDRESS_RANGE cmdInitL3FlushAddressRange;
|
||||
static const MI_FLUSH_DW cmdInitMiFlushDw;
|
||||
static const XY_BLOCK_COPY_BLT cmdInitXyBlockCopyBlt;
|
||||
static const XY_BLOCK_COPY_BLT cmdInitXyCopyBlt;
|
||||
static const XY_FAST_COLOR_BLT cmdInitXyColorBlt;
|
||||
static const _3DSTATE_BTD cmd3dStateBtd;
|
||||
static const _3DSTATE_BTD_BODY cmd3dStateBtdBody;
|
||||
static const STATE_SIP cmdInitStateSip;
|
||||
static constexpr bool isQwordInOrderCounter = false;
|
||||
static constexpr bool walkerPostSyncSupport = true;
|
||||
|
||||
static constexpr bool supportsCmdSet(GFXCORE_FAMILY cmdSetBaseFamily) {
|
||||
return cmdSetBaseFamily == IGFX_XE_HP_CORE;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace NEO
|
|
@ -1,11 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifdef SUPPORT_XE_HP_SDV
|
||||
#include "hw_info_xehp.h"
|
||||
#endif
|
|
@ -1,12 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_info_xe_hp_core.h"
|
||||
|
||||
namespace NEO {
|
||||
const char *GfxFamilyMapper<IGFX_XE_HP_CORE>::name = "XE_HP_CORE";
|
||||
} // namespace NEO
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/hw_mapper.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
struct XeHpFamily;
|
||||
|
||||
template <>
|
||||
struct GfxFamilyMapper<IGFX_XE_HP_CORE> {
|
||||
typedef XeHpFamily GfxFamily;
|
||||
static const char *name;
|
||||
};
|
||||
} // namespace NEO
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/image/image_surface_state.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using Family = XeHpFamily;
|
||||
|
||||
// clang-format off
|
||||
#include "shared/source/image/image_bdw_and_later.inl"
|
||||
#include "shared/source/image/image_skl_and_later.inl"
|
||||
// clang-format on
|
||||
} // namespace NEO
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/implicit_scaling.h"
|
||||
#include "shared/source/command_container/implicit_scaling_xehp_and_later.inl"
|
||||
#include "shared/source/helpers/api_specific_config.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using Family = XeHpFamily;
|
||||
|
||||
template <>
|
||||
bool ImplicitScalingDispatch<Family>::pipeControlStallRequired = true;
|
||||
|
||||
template <>
|
||||
bool ImplicitScalingDispatch<Family>::platformSupportsImplicitScaling(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
||||
if (ApiSpecificConfig::getApiType() == ApiSpecificConfig::ApiType::OCL) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
template struct ImplicitScalingDispatch<Family>;
|
||||
} // namespace NEO
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/command_stream_receiver_with_aub_dump.inl"
|
||||
#include "shared/source/os_interface/linux/device_command_stream.inl"
|
||||
#include "shared/source/os_interface/linux/drm_command_stream.inl"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template class DeviceCommandStreamReceiver<XeHpFamily>;
|
||||
template class DrmCommandStreamReceiver<XeHpFamily>;
|
||||
template class CommandStreamReceiverWithAUBDump<DrmCommandStreamReceiver<XeHpFamily>>;
|
||||
} // namespace NEO
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/direct_submission/direct_submission_hw.inl"
|
||||
#include "shared/source/direct_submission/direct_submission_prefetch_mitigation_xe_hp_core_and_later.inl"
|
||||
#include "shared/source/direct_submission/direct_submission_prefetcher_xe_hp_core_and_later.inl"
|
||||
#include "shared/source/direct_submission/direct_submission_xe_hp_core_and_later.inl"
|
||||
#include "shared/source/direct_submission/dispatchers/blitter_dispatcher.inl"
|
||||
#include "shared/source/direct_submission/dispatchers/dispatcher.inl"
|
||||
#include "shared/source/direct_submission/dispatchers/render_dispatcher.inl"
|
||||
#include "shared/source/direct_submission/linux/drm_direct_submission.inl"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
namespace NEO {
|
||||
using GfxFamily = XeHpFamily;
|
||||
|
||||
template class Dispatcher<GfxFamily>;
|
||||
template class BlitterDispatcher<GfxFamily>;
|
||||
template class RenderDispatcher<GfxFamily>;
|
||||
|
||||
template class DirectSubmissionHw<GfxFamily, BlitterDispatcher<GfxFamily>>;
|
||||
template class DirectSubmissionHw<GfxFamily, RenderDispatcher<GfxFamily>>;
|
||||
|
||||
template class DrmDirectSubmission<GfxFamily, BlitterDispatcher<GfxFamily>>;
|
||||
template class DrmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>;
|
||||
} // namespace NEO
|
|
@ -1,149 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "aubstream/product_family.h"
|
||||
|
||||
namespace NEO {
|
||||
template <>
|
||||
uint32_t ProductHelperHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
|
||||
switch (stepping) {
|
||||
case REVISION_A0:
|
||||
return 0x0;
|
||||
case REVISION_A1:
|
||||
return 0x1;
|
||||
case REVISION_B:
|
||||
return 0x4;
|
||||
}
|
||||
return CommonConstants::invalidStepping;
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t ProductHelperHw<gfxProduct>::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const {
|
||||
return AOT::XEHP_SDV;
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t ProductHelperHw<gfxProduct>::getSteppingFromHwRevId(const HardwareInfo &hwInfo) const {
|
||||
switch (hwInfo.platform.usRevId) {
|
||||
case 0x0:
|
||||
return REVISION_A0;
|
||||
case 0x1:
|
||||
return REVISION_A1;
|
||||
case 0x4:
|
||||
return REVISION_B;
|
||||
}
|
||||
return CommonConstants::invalidStepping;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const {
|
||||
uint32_t stepping = getSteppingFromHwRevId(hwInfo);
|
||||
return REVISION_B > stepping;
|
||||
}
|
||||
|
||||
template <>
|
||||
void ProductHelperHw<gfxProduct>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) const {
|
||||
using SAMPLER_STATE = typename XeHpFamily::SAMPLER_STATE;
|
||||
|
||||
auto samplerState = reinterpret_cast<SAMPLER_STATE *>(sampler);
|
||||
if (DebugManager.flags.ForceSamplerLowFilteringPrecision.get()) {
|
||||
samplerState->setLowQualityFilter(SAMPLER_STATE::LOW_QUALITY_FILTER_ENABLE);
|
||||
}
|
||||
}
|
||||
|
||||
template <>
|
||||
std::string ProductHelperHw<gfxProduct>::getDeviceMemoryName() const {
|
||||
return "HBM";
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isDirectSubmissionSupported(const HardwareInfo &hwInfo) const {
|
||||
if (hwInfo.platform.usRevId < ProductHelper::get(hwInfo.platform.eProductFamily)->getHwRevIdFromStepping(REVISION_B, hwInfo)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const {
|
||||
return getSteppingFromHwRevId(hwInfo) >= REVISION_B;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::allowCompression(const HardwareInfo &hwInfo) const {
|
||||
if (hwInfo.gtSystemInfo.EUCount == 256u) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::allowStatelessCompression(const HardwareInfo &hwInfo) const {
|
||||
if (!NEO::ApiSpecificConfig::isStatelessCompressionSupported()) {
|
||||
return false;
|
||||
}
|
||||
if (DebugManager.flags.EnableStatelessCompression.get() != -1) {
|
||||
return static_cast<bool>(DebugManager.flags.EnableStatelessCompression.get());
|
||||
}
|
||||
if (!hwInfo.capabilityTable.ftrRenderCompressedBuffers) {
|
||||
return false;
|
||||
}
|
||||
if (GfxCoreHelper::getSubDevicesCount(&hwInfo) > 1) {
|
||||
return DebugManager.flags.EnableMultiTileCompression.get() > 0 ? true : false;
|
||||
}
|
||||
if (hwInfo.platform.usRevId < getHwRevIdFromStepping(REVISION_B, hwInfo)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
LocalMemoryAccessMode ProductHelperHw<gfxProduct>::getDefaultLocalMemoryAccessMode(const HardwareInfo &hwInfo) const {
|
||||
if (GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this)) {
|
||||
return LocalMemoryAccessMode::CpuAccessDisallowed;
|
||||
}
|
||||
return LocalMemoryAccessMode::Default;
|
||||
}
|
||||
|
||||
template <>
|
||||
std::pair<bool, bool> ProductHelperHw<gfxProduct>::isPipeControlPriorToNonPipelinedStateCommandsWARequired(const HardwareInfo &hwInfo, bool isRcs) const {
|
||||
auto isBasicWARequired = true;
|
||||
auto isExtendedWARequired = hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled > 1;
|
||||
|
||||
if (DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.get() != -1) {
|
||||
isExtendedWARequired = DebugManager.flags.ProgramExtendedPipeControlPriorToNonPipelinedStateCommand.get();
|
||||
}
|
||||
|
||||
return {isBasicWARequired, isExtendedWARequired};
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::heapInLocalMem(const HardwareInfo &hwInfo) const {
|
||||
return !GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this);
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::extraParametersInvalid(const HardwareInfo &hwInfo) const {
|
||||
return GfxCoreHelper::isWorkaroundRequired(REVISION_A0, REVISION_B, hwInfo, *this);
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isBlitterForImagesSupported() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool ProductHelperHw<gfxProduct>::isImplicitScalingSupported(const HardwareInfo &hwInfo) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <>
|
||||
std::optional<aub_stream::ProductFamily> ProductHelperHw<gfxProduct>::getAubStreamProductFamily() const {
|
||||
return aub_stream::ProductFamily::XeHpSdv;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
namespace NEO {
|
||||
struct XeHpFamily;
|
||||
using Family = XeHpFamily;
|
||||
} // namespace NEO
|
||||
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/helpers/preamble_xehp_and_later.inl"
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
void PreambleHelper<Family>::appendProgramVFEState(const RootDeviceEnvironment &rootDeviceEnvironment, const StreamProperties &streamProperties, void *cmd) {
|
||||
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
|
||||
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
|
||||
auto command = static_cast<typename Family::CFE_STATE *>(cmd);
|
||||
|
||||
command->setComputeOverdispatchDisable(streamProperties.frontEndState.disableOverdispatch.value == 1);
|
||||
command->setSingleSliceDispatchCcsMode(streamProperties.frontEndState.singleSliceDispatchCcsMode.value == 1);
|
||||
|
||||
if (DebugManager.flags.CFEComputeOverdispatchDisable.get() != -1) {
|
||||
command->setComputeOverdispatchDisable(DebugManager.flags.CFEComputeOverdispatchDisable.get());
|
||||
}
|
||||
|
||||
if (DebugManager.flags.CFEWeightedDispatchModeDisable.get() != -1) {
|
||||
command->setWeightedDispatchModeDisable(DebugManager.flags.CFEWeightedDispatchModeDisable.get());
|
||||
}
|
||||
|
||||
if (DebugManager.flags.CFESingleSliceDispatchCCSMode.get() != -1) {
|
||||
command->setSingleSliceDispatchCcsMode(DebugManager.flags.CFESingleSliceDispatchCCSMode.get());
|
||||
}
|
||||
|
||||
if (!gfxCoreHelper.isFusedEuDispatchEnabled(hwInfo, false)) {
|
||||
command->setFusedEuDispatch(true);
|
||||
}
|
||||
|
||||
command->setNumberOfWalkers(1);
|
||||
if (DebugManager.flags.CFENumberOfWalkers.get() != -1) {
|
||||
command->setNumberOfWalkers(DebugManager.flags.CFENumberOfWalkers.get());
|
||||
}
|
||||
}
|
||||
|
||||
template struct PreambleHelper<Family>;
|
||||
|
||||
} // namespace NEO
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/command_stream/preemption.inl"
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
using GfxFamily = XeHpFamily;
|
||||
|
||||
#include "shared/source/command_stream/preemption_xehp_and_later.inl"
|
||||
|
||||
template void PreemptionHelper::programCmdStream<GfxFamily>(LinearStream &cmdStream, PreemptionMode newPreemptionMode,
|
||||
PreemptionMode oldPreemptionMode, GraphicsAllocation *preemptionCsr);
|
||||
template size_t PreemptionHelper::getRequiredCmdStreamSize<GfxFamily>(PreemptionMode newPreemptionMode, PreemptionMode oldPreemptionMode);
|
||||
template size_t PreemptionHelper::getPreemptionWaCsSize<GfxFamily>(const Device &device);
|
||||
template void PreemptionHelper::applyPreemptionWaCmdsBegin<GfxFamily>(LinearStream *pCommandStream, const Device &device);
|
||||
template void PreemptionHelper::applyPreemptionWaCmdsEnd<GfxFamily>(LinearStream *pCommandStream, const Device &device);
|
||||
template void PreemptionHelper::programInterfaceDescriptorDataPreemption<GfxFamily>(INTERFACE_DESCRIPTOR_DATA<GfxFamily> *idd, PreemptionMode preemptionMode);
|
||||
} // namespace NEO
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/state_base_address_xehp_and_later.inl"
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template <>
|
||||
void StateBaseAddressHelper<XeHpFamily>::appendExtraCacheSettings(StateBaseAddressHelperArgs<XeHpFamily> &args) {
|
||||
}
|
||||
|
||||
template struct StateBaseAddressHelper<XeHpFamily>;
|
||||
} // namespace NEO
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/command_stream_receiver_with_aub_dump.inl"
|
||||
#include "shared/source/command_stream/tbx_command_stream_receiver_hw.h"
|
||||
#include "shared/source/command_stream/tbx_command_stream_receiver_hw.inl"
|
||||
#include "shared/source/helpers/array_count.h"
|
||||
#include "shared/source/helpers/populate_factory.h"
|
||||
#include "shared/source/memory_manager/memory_banks.h"
|
||||
#include "shared/source/memory_manager/memory_pool.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
|
||||
namespace NEO {
|
||||
typedef XeHpFamily Family;
|
||||
static auto gfxCore = IGFX_XE_HP_CORE;
|
||||
|
||||
template <>
|
||||
void populateFactoryTable<TbxCommandStreamReceiverHw<Family>>() {
|
||||
extern TbxCommandStreamReceiverCreateFunc tbxCommandStreamReceiverFactory[IGFX_MAX_CORE];
|
||||
UNRECOVERABLE_IF(!isInRange(gfxCore, tbxCommandStreamReceiverFactory));
|
||||
tbxCommandStreamReceiverFactory[gfxCore] = TbxCommandStreamReceiverHw<Family>::create;
|
||||
}
|
||||
|
||||
#include "shared/source/command_stream/tbx_command_stream_receiver_xehp_and_later.inl"
|
||||
|
||||
template class TbxCommandStreamReceiverHw<Family>;
|
||||
template class CommandStreamReceiverWithAUBDump<TbxCommandStreamReceiverHw<Family>>;
|
||||
} // namespace NEO
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/command_stream_receiver_with_aub_dump.inl"
|
||||
#include "shared/source/os_interface/windows/device_command_stream.inl"
|
||||
#include "shared/source/os_interface/windows/wddm_device_command_stream.inl"
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template class DeviceCommandStreamReceiver<XeHpFamily>;
|
||||
template class WddmCommandStreamReceiver<XeHpFamily>;
|
||||
template class CommandStreamReceiverWithAUBDump<WddmCommandStreamReceiver<XeHpFamily>>;
|
||||
} // namespace NEO
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/direct_submission/direct_submission_hw.inl"
|
||||
#include "shared/source/direct_submission/direct_submission_prefetch_mitigation_xe_hp_core_and_later.inl"
|
||||
#include "shared/source/direct_submission/direct_submission_prefetcher_xe_hp_core_and_later.inl"
|
||||
#include "shared/source/direct_submission/direct_submission_xe_hp_core_and_later.inl"
|
||||
#include "shared/source/direct_submission/dispatchers/blitter_dispatcher.inl"
|
||||
#include "shared/source/direct_submission/dispatchers/dispatcher.inl"
|
||||
#include "shared/source/direct_submission/dispatchers/render_dispatcher.inl"
|
||||
#include "shared/source/direct_submission/windows/wddm_direct_submission.inl"
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
namespace NEO {
|
||||
using GfxFamily = XeHpFamily;
|
||||
|
||||
template class Dispatcher<GfxFamily>;
|
||||
template class BlitterDispatcher<GfxFamily>;
|
||||
template class RenderDispatcher<GfxFamily>;
|
||||
|
||||
template class DirectSubmissionHw<GfxFamily, BlitterDispatcher<GfxFamily>>;
|
||||
template class DirectSubmissionHw<GfxFamily, RenderDispatcher<GfxFamily>>;
|
||||
|
||||
template class WddmDirectSubmission<GfxFamily, BlitterDispatcher<GfxFamily>>;
|
||||
template class WddmDirectSubmission<GfxFamily, RenderDispatcher<GfxFamily>>;
|
||||
} // namespace NEO
|
|
@ -1,14 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/windows/gmm_callbacks_tgllp_and_later.inl"
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
|
||||
namespace NEO {
|
||||
template struct DeviceCallbacks<XeHpFamily>;
|
||||
template struct TTCallbacks<XeHpFamily>;
|
||||
} // namespace NEO
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -10,6 +10,5 @@
|
|||
#include "shared/test/common/gen12lp/test_traits_gen12lp.h"
|
||||
#include "shared/test/common/gen8/test_traits_gen8.h"
|
||||
#include "shared/test/common/gen9/test_traits_gen9.h"
|
||||
#include "shared/test/common/xe_hp_core/test_traits_xe_hp_core.h"
|
||||
#include "shared/test/common/xe_hpc_core/test_traits_xe_hpc_core.h"
|
||||
#include "shared/test/common/xe_hpg_core/test_traits_xe_hpg_core.h"
|
||||
#include "shared/test/common/xe_hpg_core/test_traits_xe_hpg_core.h"
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2021-2023 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
#include "shared/test/common/test_configuration/aub_tests/aub_tests_configuration.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
template <>
|
||||
AubTestsConfig getAubTestsConfig<XeHpFamily>() {
|
||||
AubTestsConfig aubTestsConfig;
|
||||
aubTestsConfig.testCanonicalAddress = true;
|
||||
return aubTestsConfig;
|
||||
}
|
|
@ -12,7 +12,6 @@ using IsGen9 = IsGfxCore<IGFX_GEN9_CORE>;
|
|||
using IsGen11HP = IsGfxCore<IGFX_GEN11_CORE>;
|
||||
using IsGen11LP = IsGfxCore<IGFX_GEN11LP_CORE>;
|
||||
using IsGen12LP = IsGfxCore<IGFX_GEN12LP_CORE>;
|
||||
using IsXeHpCore = IsGfxCore<IGFX_XE_HP_CORE>;
|
||||
using IsXeHpgCore = IsGfxCore<IGFX_XE_HPG_CORE>;
|
||||
using IsXeHpcCore = IsGfxCore<IGFX_XE_HPC_CORE>;
|
||||
using IsNotXeHpcCore = IsNotGfxCore<IGFX_XE_HPC_CORE>;
|
||||
|
@ -67,9 +66,6 @@ using IsADLS = IsProduct<IGFX_ALDERLAKE_S>;
|
|||
using IsADLP = IsProduct<IGFX_ALDERLAKE_P>;
|
||||
using IsRKL = IsProduct<IGFX_ROCKETLAKE>;
|
||||
|
||||
using IsXEHP = IsProduct<IGFX_XE_HP_SDV>;
|
||||
using IsNotXEHP = IsNotWithinProducts<IGFX_XE_HP_SDV, IGFX_XE_HP_SDV>;
|
||||
|
||||
using IsMTL = IsProduct<IGFX_METEORLAKE>;
|
||||
using IsDG2 = IsProduct<IGFX_DG2>;
|
||||
|
||||
|
|
|
@ -23,10 +23,6 @@
|
|||
#define GEN11TEST_F(test_fixture, test_name) GENTEST_F(IGFX_GEN11_CORE, test_fixture, test_name)
|
||||
#define GEN11TEST_P(test_fixture, test_name) GENTEST_P(IGFX_GEN11_CORE, test_fixture, test_name)
|
||||
#endif
|
||||
#ifdef TESTS_XE_HP_CORE
|
||||
#define XE_HP_CORE_TEST_F(test_fixture, test_name) GENTEST_F(IGFX_XE_HP_CORE, test_fixture, test_name)
|
||||
#define XE_HP_CORE_TEST_P(test_fixture, test_name) GENTEST_P(IGFX_XE_HP_CORE, test_fixture, test_name)
|
||||
#endif
|
||||
#ifdef TESTS_XE_HPG_CORE
|
||||
#define XE_HPG_CORETEST_F(test_fixture, test_name) GENTEST_F(IGFX_XE_HPG_CORE, test_fixture, test_name)
|
||||
#define XE_HPG_CORETEST_P(test_fixture, test_name) GENTEST_P(IGFX_XE_HPG_CORE, test_fixture, test_name)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -23,9 +23,6 @@
|
|||
case IGFX_GEN12LP_CORE: \
|
||||
TGLLP_TYPED_TEST(methodName) \
|
||||
break; \
|
||||
case IGFX_XE_HP_CORE: \
|
||||
XEHP_TYPED_TEST(methodName) \
|
||||
break; \
|
||||
case IGFX_XE_HPG_CORE: \
|
||||
XEHPG_TYPED_TEST(methodName) \
|
||||
break; \
|
||||
|
@ -53,9 +50,6 @@
|
|||
case IGFX_GEN12LP_CORE: \
|
||||
supported = TGLLP_SUPPORTED_TEST(cmdSetBase); \
|
||||
break; \
|
||||
case IGFX_XE_HP_CORE: \
|
||||
supported = XEHP_SUPPORTED_TEST(cmdSetBase); \
|
||||
break; \
|
||||
case IGFX_XE_HPG_CORE: \
|
||||
supported = XEHPG_SUPPORTED_TEST(cmdSetBase); \
|
||||
break; \
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
|
@ -35,13 +35,6 @@
|
|||
#define TGLLP_TYPED_TEST(method)
|
||||
#define TGLLP_SUPPORTED_TEST(cmdSetBase) false
|
||||
#endif
|
||||
#ifdef TESTS_XE_HP_CORE
|
||||
#define XEHP_TYPED_TEST(method) method<typename NEO::GfxFamilyMapper<IGFX_XE_HP_CORE>::GfxFamily>();
|
||||
#define XEHP_SUPPORTED_TEST(cmdSetBase) NEO::GfxFamilyMapper<IGFX_XE_HP_CORE>::GfxFamily::supportsCmdSet(cmdSetBase)
|
||||
#else
|
||||
#define XEHP_TYPED_TEST(method)
|
||||
#define XEHP_SUPPORTED_TEST(cmdSetBase) false
|
||||
#endif
|
||||
#ifdef TESTS_XE_HPG_CORE
|
||||
#define XEHPG_TYPED_TEST(method) method<typename NEO::GfxFamilyMapper<IGFX_XE_HPG_CORE>::GfxFamily>();
|
||||
#define XEHPG_SUPPORTED_TEST(cmdSetBase) NEO::GfxFamilyMapper<IGFX_XE_HPG_CORE>::GfxFamily::supportsCmdSet(cmdSetBase)
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2021-2023 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
|
@ -1,13 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
using GenStruct = NEO::XeHpCore;
|
||||
using GenGfxFamily = NEO::XeHpFamily;
|
||||
#include "shared/test/common/cmd_parse/cmd_parse_xehp_and_later.inl"
|
||||
|
||||
template const typename GenGfxFamily::RENDER_SURFACE_STATE *NEO::HardwareParse::getSurfaceState<GenGfxFamily>(IndirectHeap *ssh, uint32_t index);
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/test/common/helpers/test_traits.h"
|
||||
|
||||
template <>
|
||||
struct TestTraits<IGFX_XE_HP_CORE> {
|
||||
static constexpr bool surfaceStateCompressionParamsSupported = true;
|
||||
static constexpr bool clearColorAddressMatcher = true;
|
||||
static constexpr bool auxBuiltinsSupported = true;
|
||||
static constexpr bool localMemCompressionAubsSupported = true;
|
||||
static constexpr bool systemMemCompressionAubsSupported = false;
|
||||
static constexpr bool l3ControlSupported = true;
|
||||
static constexpr bool forceNonCoherentSupported = true;
|
||||
static constexpr bool threadPreemptionDisableBitMatcher = true;
|
||||
static constexpr bool programOnlyChangedFieldsInComputeStateMode = false;
|
||||
static constexpr bool iohInSbaSupported = false;
|
||||
static constexpr bool auxTranslationSupported = true;
|
||||
static constexpr bool isUsingNonDefaultIoctls = true;
|
||||
static constexpr bool deviceEnqueueSupport = false;
|
||||
static constexpr bool fusedEuDispatchSupported = true;
|
||||
static constexpr bool numberOfWalkersInCfeStateSupported = true;
|
||||
static constexpr bool forceGpuNonCoherent = false;
|
||||
static constexpr bool isUnTypedDataPortCacheFlushSupported = false;
|
||||
static constexpr bool imagesSupported = true;
|
||||
static constexpr bool isPipeControlExtendedPriorToNonPipelinedStateCommandSupported = true;
|
||||
};
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/xe_hp_core/hw_cmds_base.h"
|
||||
#include "shared/source/xe_hp_core/hw_info.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.h"
|
||||
#include "shared/test/common/helpers/unit_test_helper.inl"
|
||||
#include "shared/test/common/helpers/unit_test_helper_xehp_and_later.inl"
|
||||
|
||||
using Family = NEO::XeHpFamily;
|
||||
|
||||
namespace NEO {
|
||||
template <>
|
||||
const AuxTranslationMode UnitTestHelper<Family>::requiredAuxTranslationMode = AuxTranslationMode::Blit;
|
||||
|
||||
template <>
|
||||
const bool UnitTestHelper<Family>::additionalMiFlushDwRequired = true;
|
||||
|
||||
template <>
|
||||
uint32_t UnitTestHelper<Family>::getDebugModeRegisterOffset() {
|
||||
return 0x20d8;
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t UnitTestHelper<Family>::getDebugModeRegisterValue() {
|
||||
return (1u << 5) | (1u << 21);
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t UnitTestHelper<Family>::getTdCtlRegisterOffset() {
|
||||
return 0xe400;
|
||||
}
|
||||
|
||||
template <>
|
||||
uint32_t UnitTestHelper<Family>::getTdCtlRegisterValue() {
|
||||
return (1u << 7) | (1u << 4) | (1u << 2) | (1u << 0);
|
||||
}
|
||||
|
||||
template struct UnitTestHelper<Family>;
|
||||
} // namespace NEO
|
|
@ -8,7 +8,6 @@
|
|||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/direct_submission/dispatchers/blitter_dispatcher.h"
|
||||
#include "shared/source/helpers/definitions/command_encoder_args.h"
|
||||
#include "shared/source/xe_hp_core/hw_cmds.h"
|
||||
#include "shared/test/common/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/mocks/mock_direct_submission_hw.h"
|
||||
|
|
|
@ -103,37 +103,6 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterHardwareCommandsTest, givenPartitionArg
|
|||
EXPECT_TRUE(storeDataImm->getWorkloadPartitionIdOffsetEnable());
|
||||
}
|
||||
|
||||
HWTEST2_F(XeHPAndLaterCommandEncoderTest,
|
||||
GivenImplicitAndAtomicsFlagsTrueWhenProgrammingSurfaceStateThenExpectMultiTileCorrectlySet, IsXeHpCore) {
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
|
||||
auto memoryManager = pDevice->getExecutionEnvironment()->memoryManager.get();
|
||||
size_t allocationSize = MemoryConstants::pageSize;
|
||||
AllocationProperties properties(pDevice->getRootDeviceIndex(), allocationSize, AllocationType::BUFFER, pDevice->getDeviceBitfield());
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties);
|
||||
|
||||
auto outSurfaceState = FamilyType::cmdInitRenderSurfaceState;
|
||||
|
||||
NEO::EncodeSurfaceStateArgs args;
|
||||
args.outMemory = &outSurfaceState;
|
||||
args.graphicsAddress = allocation->getGpuAddress();
|
||||
args.size = allocation->getUnderlyingBufferSize();
|
||||
args.mocs = pDevice->getGmmHelper()->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER);
|
||||
args.numAvailableDevices = pDevice->getNumGenericSubDevices();
|
||||
args.allocation = allocation;
|
||||
args.gmmHelper = pDevice->getGmmHelper();
|
||||
args.areMultipleSubDevicesInContext = true;
|
||||
args.implicitScaling = true;
|
||||
args.useGlobalAtomics = true;
|
||||
|
||||
EncodeSurfaceState<FamilyType>::encodeBuffer(args);
|
||||
|
||||
EXPECT_FALSE(outSurfaceState.getDisableSupportForMultiGpuAtomics());
|
||||
EXPECT_FALSE(outSurfaceState.getDisableSupportForMultiGpuPartialWrites());
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterHardwareCommandsTest, givenWorkloadPartitionArgumentTrueWhenAddingStoreRegisterMemThenExpectCommandFlagTrue) {
|
||||
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
||||
|
||||
|
|
|
@ -52,71 +52,6 @@ HWTEST2_F(CommandEncodeStatesTest, givenCommandContainerWhenAdjustPipelineSelect
|
|||
EXPECT_EQ(cmd->getPipelineSelection(), PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenLargeGrfModeProgrammedThenExpectedCommandSizeAdded, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE;
|
||||
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
|
||||
|
||||
auto usedSpaceBefore = cmdContainer->getCommandStream()->getUsed();
|
||||
|
||||
NEO::EncodeComputeMode<GfxFamily>::adjustPipelineSelect(*cmdContainer, descriptor);
|
||||
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
|
||||
StreamProperties streamProperties{};
|
||||
streamProperties.initSupport(rootDeviceEnvironment);
|
||||
streamProperties.stateComputeMode.setPropertiesAll(false, 256u, 0u, PreemptionMode::Disabled);
|
||||
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, rootDeviceEnvironment);
|
||||
|
||||
auto usedSpaceAfter = cmdContainer->getCommandStream()->getUsed();
|
||||
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
auto expectedCmdSize = sizeof(STATE_COMPUTE_MODE) + sizeof(PIPELINE_SELECT);
|
||||
auto cmdAddedSize = usedSpaceAfter - usedSpaceBefore;
|
||||
EXPECT_EQ(expectedCmdSize, cmdAddedSize);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenLargeGrfModeDisabledThenExpectedCommandsAreAdded, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE;
|
||||
using FORCE_NON_COHERENT = typename STATE_COMPUTE_MODE::FORCE_NON_COHERENT;
|
||||
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
|
||||
|
||||
auto usedSpaceBefore = cmdContainer->getCommandStream()->getUsed();
|
||||
|
||||
NEO::EncodeComputeMode<GfxFamily>::adjustPipelineSelect(*cmdContainer, descriptor);
|
||||
StreamProperties streamProperties{};
|
||||
streamProperties.stateComputeMode.largeGrfMode.set(0);
|
||||
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
|
||||
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, rootDeviceEnvironment);
|
||||
|
||||
auto usedSpaceAfter = cmdContainer->getCommandStream()->getUsed();
|
||||
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
auto expectedCmdSize = sizeof(STATE_COMPUTE_MODE) + sizeof(PIPELINE_SELECT);
|
||||
auto cmdAddedSize = usedSpaceAfter - usedSpaceBefore;
|
||||
EXPECT_EQ(expectedCmdSize, cmdAddedSize);
|
||||
|
||||
constexpr uint32_t expectedMask = NEO::pipelineSelectSystolicModeEnableMaskBits | NEO::pipelineSelectMediaSamplerDopClockGateMaskBits | NEO::pipelineSelectEnablePipelineSelectMaskBits;
|
||||
|
||||
auto expectedPsCmd = FamilyType::cmdInitPipelineSelect;
|
||||
expectedPsCmd.setSystolicModeEnable(false);
|
||||
expectedPsCmd.setMaskBits(expectedMask);
|
||||
expectedPsCmd.setMediaSamplerDopClockGateEnable(true);
|
||||
expectedPsCmd.setPipelineSelection(PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU);
|
||||
|
||||
auto psCmd = genCmdCast<PIPELINE_SELECT *>(ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), usedSpaceBefore));
|
||||
ASSERT_NE(nullptr, psCmd);
|
||||
EXPECT_TRUE(memcmp(&expectedPsCmd, psCmd, sizeof(PIPELINE_SELECT)) == 0);
|
||||
|
||||
auto expectedScmCmd = FamilyType::cmdInitStateComputeMode;
|
||||
expectedScmCmd.setLargeGrfMode(false);
|
||||
expectedScmCmd.setForceNonCoherent(FORCE_NON_COHERENT::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT);
|
||||
expectedScmCmd.setMaskBits(FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask);
|
||||
|
||||
auto scmCmd = genCmdCast<STATE_COMPUTE_MODE *>(ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), (usedSpaceBefore + sizeof(PIPELINE_SELECT))));
|
||||
ASSERT_NE(nullptr, scmCmd);
|
||||
EXPECT_TRUE(memcmp(&expectedScmCmd, scmCmd, sizeof(STATE_COMPUTE_MODE)) == 0);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenCommandContainerWithKernelDpasThenSystolicModeEnabled, IsWithinXeGfxFamily) {
|
||||
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
|
||||
descriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = true;
|
||||
|
@ -178,123 +113,3 @@ HWTEST2_F(CommandEncodeStatesTest, givenDebugModeToOverrideSystolicModeToFalseWh
|
|||
auto cmd = genCmdCast<PIPELINE_SELECT *>(*itorCmd);
|
||||
EXPECT_FALSE(cmd->getSystolicModeEnable());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenLargeGrfModeEnabledThenExpectedCommandsAreAdded, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE;
|
||||
using FORCE_NON_COHERENT = typename STATE_COMPUTE_MODE::FORCE_NON_COHERENT;
|
||||
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
|
||||
|
||||
auto usedSpaceBefore = cmdContainer->getCommandStream()->getUsed();
|
||||
|
||||
descriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = true;
|
||||
NEO::EncodeComputeMode<GfxFamily>::adjustPipelineSelect(*cmdContainer, descriptor);
|
||||
StreamProperties streamProperties{};
|
||||
streamProperties.stateComputeMode.largeGrfMode.set(1);
|
||||
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
|
||||
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, rootDeviceEnvironment);
|
||||
|
||||
auto usedSpaceAfter = cmdContainer->getCommandStream()->getUsed();
|
||||
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
auto expectedCmdSize = sizeof(STATE_COMPUTE_MODE) + sizeof(PIPELINE_SELECT);
|
||||
auto cmdAddedSize = usedSpaceAfter - usedSpaceBefore;
|
||||
EXPECT_EQ(expectedCmdSize, cmdAddedSize);
|
||||
|
||||
constexpr uint32_t expectedMask = NEO::pipelineSelectSystolicModeEnableMaskBits | NEO::pipelineSelectMediaSamplerDopClockGateMaskBits | NEO::pipelineSelectEnablePipelineSelectMaskBits;
|
||||
|
||||
auto expectedPsCmd = FamilyType::cmdInitPipelineSelect;
|
||||
expectedPsCmd.setSystolicModeEnable(true);
|
||||
expectedPsCmd.setMaskBits(expectedMask);
|
||||
expectedPsCmd.setMediaSamplerDopClockGateEnable(true);
|
||||
expectedPsCmd.setPipelineSelection(PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU);
|
||||
|
||||
auto psCmd = genCmdCast<PIPELINE_SELECT *>(ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), usedSpaceBefore));
|
||||
ASSERT_NE(nullptr, psCmd);
|
||||
EXPECT_TRUE(memcmp(&expectedPsCmd, psCmd, sizeof(PIPELINE_SELECT)) == 0);
|
||||
|
||||
auto expectedScmCmd = FamilyType::cmdInitStateComputeMode;
|
||||
expectedScmCmd.setLargeGrfMode(true);
|
||||
expectedScmCmd.setForceNonCoherent(FORCE_NON_COHERENT::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT);
|
||||
expectedScmCmd.setMaskBits(FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask);
|
||||
|
||||
auto scmCmd = genCmdCast<STATE_COMPUTE_MODE *>(ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), (usedSpaceBefore + sizeof(PIPELINE_SELECT))));
|
||||
ASSERT_NE(nullptr, scmCmd);
|
||||
EXPECT_TRUE(memcmp(&expectedScmCmd, scmCmd, sizeof(STATE_COMPUTE_MODE)) == 0);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenLargeGrfModeEnabledAndDisabledThenExpectedCommandsAreAdded, IsXeHpCore) {
|
||||
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
|
||||
using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE;
|
||||
using FORCE_NON_COHERENT = typename STATE_COMPUTE_MODE::FORCE_NON_COHERENT;
|
||||
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
|
||||
|
||||
auto usedSpaceBefore = cmdContainer->getCommandStream()->getUsed();
|
||||
|
||||
descriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode = true;
|
||||
NEO::EncodeComputeMode<GfxFamily>::adjustPipelineSelect(*cmdContainer, descriptor);
|
||||
StreamProperties streamProperties{};
|
||||
streamProperties.stateComputeMode.largeGrfMode.set(1);
|
||||
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
|
||||
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, rootDeviceEnvironment);
|
||||
|
||||
auto usedSpaceAfter = cmdContainer->getCommandStream()->getUsed();
|
||||
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
auto expectedCmdSize = sizeof(STATE_COMPUTE_MODE) + sizeof(PIPELINE_SELECT);
|
||||
auto cmdAddedSize = usedSpaceAfter - usedSpaceBefore;
|
||||
EXPECT_EQ(expectedCmdSize, cmdAddedSize);
|
||||
|
||||
constexpr uint32_t expectedMask = NEO::pipelineSelectSystolicModeEnableMaskBits | NEO::pipelineSelectMediaSamplerDopClockGateMaskBits | NEO::pipelineSelectEnablePipelineSelectMaskBits;
|
||||
|
||||
auto expectedPsCmd = FamilyType::cmdInitPipelineSelect;
|
||||
expectedPsCmd.setSystolicModeEnable(true);
|
||||
expectedPsCmd.setMaskBits(expectedMask);
|
||||
expectedPsCmd.setMediaSamplerDopClockGateEnable(true);
|
||||
expectedPsCmd.setPipelineSelection(PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU);
|
||||
|
||||
auto psCmd = genCmdCast<PIPELINE_SELECT *>(ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), usedSpaceBefore));
|
||||
ASSERT_NE(nullptr, psCmd);
|
||||
EXPECT_TRUE(memcmp(&expectedPsCmd, psCmd, sizeof(PIPELINE_SELECT)) == 0);
|
||||
|
||||
auto expectedScmCmd = FamilyType::cmdInitStateComputeMode;
|
||||
expectedScmCmd.setLargeGrfMode(true);
|
||||
expectedScmCmd.setForceNonCoherent(FORCE_NON_COHERENT::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT);
|
||||
expectedScmCmd.setMaskBits(FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask);
|
||||
|
||||
auto scmCmd = genCmdCast<STATE_COMPUTE_MODE *>(ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), (usedSpaceBefore + sizeof(PIPELINE_SELECT))));
|
||||
ASSERT_NE(nullptr, scmCmd);
|
||||
EXPECT_TRUE(memcmp(&expectedScmCmd, scmCmd, sizeof(STATE_COMPUTE_MODE)) == 0);
|
||||
|
||||
// Disable Large GRF Mode
|
||||
usedSpaceBefore = cmdContainer->getCommandStream()->getUsed();
|
||||
NEO::EncodeComputeMode<GfxFamily>::adjustPipelineSelect(*cmdContainer, descriptor);
|
||||
streamProperties.stateComputeMode.largeGrfMode.set(0);
|
||||
NEO::EncodeComputeMode<GfxFamily>::programComputeModeCommand(*cmdContainer->getCommandStream(), streamProperties.stateComputeMode, rootDeviceEnvironment);
|
||||
|
||||
usedSpaceAfter = cmdContainer->getCommandStream()->getUsed();
|
||||
ASSERT_GT(usedSpaceAfter, usedSpaceBefore);
|
||||
|
||||
expectedCmdSize = sizeof(STATE_COMPUTE_MODE) + sizeof(PIPELINE_SELECT);
|
||||
cmdAddedSize = usedSpaceAfter - usedSpaceBefore;
|
||||
EXPECT_EQ(expectedCmdSize, cmdAddedSize);
|
||||
|
||||
expectedPsCmd = FamilyType::cmdInitPipelineSelect;
|
||||
expectedPsCmd.setSystolicModeEnable(true);
|
||||
expectedPsCmd.setMaskBits(expectedMask);
|
||||
expectedPsCmd.setMediaSamplerDopClockGateEnable(true);
|
||||
expectedPsCmd.setPipelineSelection(PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU);
|
||||
|
||||
psCmd = genCmdCast<PIPELINE_SELECT *>(ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), usedSpaceBefore));
|
||||
ASSERT_NE(nullptr, psCmd);
|
||||
EXPECT_TRUE(memcmp(&expectedPsCmd, psCmd, sizeof(PIPELINE_SELECT)) == 0);
|
||||
|
||||
expectedScmCmd = FamilyType::cmdInitStateComputeMode;
|
||||
expectedScmCmd.setLargeGrfMode(false);
|
||||
expectedScmCmd.setForceNonCoherent(FORCE_NON_COHERENT::FORCE_NON_COHERENT_FORCE_GPU_NON_COHERENT);
|
||||
expectedScmCmd.setMaskBits(FamilyType::stateComputeModeForceNonCoherentMask | FamilyType::stateComputeModeLargeGrfModeMask);
|
||||
|
||||
scmCmd = genCmdCast<STATE_COMPUTE_MODE *>(ptrOffset(cmdContainer->getCommandStream()->getCpuBase(), (usedSpaceBefore + sizeof(PIPELINE_SELECT))));
|
||||
ASSERT_NE(nullptr, scmCmd);
|
||||
EXPECT_TRUE(memcmp(&expectedScmCmd, scmCmd, sizeof(STATE_COMPUTE_MODE)) == 0);
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/unit_test/fixtures/implicit_scaling_fixture.h"
|
||||
|
||||
HWTEST2_F(ImplicitScalingTests, GivenXeHpCoreWhenCheckingPipeControlStallRequiredThenExpectTrue, IsXeHpCore) {
|
||||
EXPECT_TRUE(ImplicitScalingDispatch<FamilyType>::getPipeControlStallRequired());
|
||||
}
|
|
@ -118,108 +118,6 @@ HWTEST2_F(BlitTests, givenGmmWithEnabledCompresionAndDebugFlagSetWhenAppendBlitC
|
|||
EXPECT_EQ(newCompressionFormat, blitCmd.getDestinationCompressionFormat());
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenA0StepWhenAppendBlitCommandsForFillBufferWithLocalAccessModeCpuAllowedThenSystemMemoryIsUsed, IsXEHP) {
|
||||
using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT;
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::CpuAccessAllowed));
|
||||
|
||||
auto blitCmd = FamilyType::cmdInitXyColorBlt;
|
||||
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
|
||||
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
|
||||
const auto &productHelper = pDevice->getProductHelper();
|
||||
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, *hwInfo);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationTargetMemory(), XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_SYSTEM_MEM);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenA0StepWhenAppendBlitCommandsForFillBufferWithLocalAccessModeCpuDisallowedThenLocalMemoryIsUsed, IsXEHP) {
|
||||
using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT;
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::CpuAccessDisallowed));
|
||||
|
||||
auto blitCmd = FamilyType::cmdInitXyColorBlt;
|
||||
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
|
||||
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
|
||||
const auto &productHelper = pDevice->getProductHelper();
|
||||
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A0, *hwInfo);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationTargetMemory(), XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenBStepWhenAppendBlitCommandsForFillBufferWithLocalAccessModeCpuAllowedThenLocalIsUsed, IsXEHP) {
|
||||
using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT;
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::CpuAccessAllowed));
|
||||
|
||||
auto blitCmd = FamilyType::cmdInitXyColorBlt;
|
||||
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
|
||||
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
|
||||
const auto &productHelper = pDevice->getProductHelper();
|
||||
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationTargetMemory(), XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenBStepWhenAppendBlitCommandsForFillBufferWithLocalAccessModeCpuDisallowedThenLocalIsUsed, IsXEHP) {
|
||||
using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT;
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::CpuAccessDisallowed));
|
||||
|
||||
auto blitCmd = FamilyType::cmdInitXyColorBlt;
|
||||
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::LocalMemory, MemoryManager::maxOsContextCount);
|
||||
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
|
||||
const auto &productHelper = pDevice->getProductHelper();
|
||||
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationTargetMemory(), XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenAllocationInSystemMemWhenAppendBlitCommandsForFillBufferWithLocalAccessModeCpuAllowedThenSystemMemIsUsed, IsXEHP) {
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::CpuAccessAllowed));
|
||||
|
||||
using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT;
|
||||
auto blitCmd = FamilyType::cmdInitXyColorBlt;
|
||||
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
|
||||
const auto &productHelper = pDevice->getProductHelper();
|
||||
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A1, *hwInfo);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationTargetMemory(), XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_SYSTEM_MEM);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenAllocationInSystemMemWhenAppendBlitCommandsForFillBufferWithLocalAccessModeCpuDisallowedThenSystemMemIsUsed, IsXEHP) {
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::CpuAccessDisallowed));
|
||||
|
||||
using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT;
|
||||
auto blitCmd = FamilyType::cmdInitXyColorBlt;
|
||||
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
HardwareInfo *hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->getMutableHardwareInfo();
|
||||
const auto &productHelper = pDevice->getProductHelper();
|
||||
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_A1, *hwInfo);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForFillBuffer(&mockAllocation, blitCmd, *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
|
||||
|
||||
EXPECT_EQ(blitCmd.getDestinationTargetMemory(), XY_COLOR_BLT::DESTINATION_TARGET_MEMORY::DESTINATION_TARGET_MEMORY_LOCAL_MEM);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenOverridedMocksValueWhenAppendBlitCommandsForFillBufferThenDebugMocksValueIsSet, BlitPlatforms) {
|
||||
using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT;
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
|
@ -334,264 +232,6 @@ typename FamilyType::XY_COLOR_BLT::COLOR_DEPTH getColorDepth(size_t patternSize)
|
|||
return depth;
|
||||
}
|
||||
|
||||
HWTEST2_P(BlitTestsTestXeHP, givenCommandStreamWhenCallToDispatchMemoryFillThenColorDepthAreProgrammedCorrectly, IsXeHpCore) {
|
||||
auto patternSize = GetParam();
|
||||
auto expecttedDepth = getColorDepth<FamilyType>(patternSize);
|
||||
GivenLinearStreamWhenCallDispatchBlitMemoryColorFillThenCorrectDepthIsProgrammedXEHP<FamilyType> test(pDevice);
|
||||
test.testBodyImpl(patternSize, expecttedDepth);
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(size_t,
|
||||
BlitTestsTestXeHP,
|
||||
testing::Values(1,
|
||||
2,
|
||||
4,
|
||||
8,
|
||||
16));
|
||||
|
||||
HWTEST2_F(BlitTests, givenOneBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) {
|
||||
using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT;
|
||||
auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.bytesPerPixel = 1;
|
||||
BlitCommandsHelper<FamilyType>::appendColorDepth(properties, bltCmd);
|
||||
EXPECT_EQ(bltCmd.getColorDepth(), XY_BLOCK_COPY_BLT::COLOR_DEPTH::COLOR_DEPTH_8_BIT_COLOR);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenTwoBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) {
|
||||
using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT;
|
||||
auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.bytesPerPixel = 2;
|
||||
BlitCommandsHelper<FamilyType>::appendColorDepth(properties, bltCmd);
|
||||
EXPECT_EQ(bltCmd.getColorDepth(), XY_BLOCK_COPY_BLT::COLOR_DEPTH::COLOR_DEPTH_16_BIT_COLOR);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenFourBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) {
|
||||
using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT;
|
||||
auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.bytesPerPixel = 4;
|
||||
BlitCommandsHelper<FamilyType>::appendColorDepth(properties, bltCmd);
|
||||
EXPECT_EQ(bltCmd.getColorDepth(), XY_BLOCK_COPY_BLT::COLOR_DEPTH::COLOR_DEPTH_32_BIT_COLOR);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenEightBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) {
|
||||
using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT;
|
||||
auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.bytesPerPixel = 8;
|
||||
BlitCommandsHelper<FamilyType>::appendColorDepth(properties, bltCmd);
|
||||
EXPECT_EQ(bltCmd.getColorDepth(), XY_BLOCK_COPY_BLT::COLOR_DEPTH::COLOR_DEPTH_64_BIT_COLOR);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenSixteenBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) {
|
||||
using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT;
|
||||
auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.bytesPerPixel = 16;
|
||||
BlitCommandsHelper<FamilyType>::appendColorDepth(properties, bltCmd);
|
||||
EXPECT_EQ(bltCmd.getColorDepth(), XY_BLOCK_COPY_BLT::COLOR_DEPTH::COLOR_DEPTH_128_BIT_COLOR);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenIncorrectBytePerPixelWhenAppendColorDepthThenCorrectDepthIsSet, IsXeHpCore) {
|
||||
using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT;
|
||||
auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.bytesPerPixel = 48;
|
||||
EXPECT_THROW(BlitCommandsHelper<FamilyType>::appendColorDepth(properties, bltCmd), std::exception);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenNotTiledSrcAndDestinationWhenAppendTilingTypeThenCorrectTilingIsSet, IsXeHpCore) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
BlitCommandsHelper<FamilyType>::appendTilingType(GMM_NOT_TILED, GMM_NOT_TILED, bltCmd);
|
||||
EXPECT_EQ(bltCmd.getSourceTiling(), XY_COPY_BLT::TILING::TILING_LINEAR);
|
||||
EXPECT_EQ(bltCmd.getDestinationTiling(), XY_COPY_BLT::TILING::TILING_LINEAR);
|
||||
}
|
||||
HWTEST2_F(BlitTests, givenTiled4SrcAndDestinationAppendTilingTypeThenCorrectTilingIsSet, IsXeHpCore) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
BlitCommandsHelper<FamilyType>::appendTilingType(GMM_TILED_4, GMM_TILED_4, bltCmd);
|
||||
EXPECT_EQ(bltCmd.getSourceTiling(), XY_COPY_BLT::TILING::TILING_TILE4);
|
||||
EXPECT_EQ(bltCmd.getDestinationTiling(), XY_COPY_BLT::TILING::TILING_TILE4);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenTiled64SrcAndDestinationAppendTilingTypeThenCorrectTilingIsSet, IsXeHpCore) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
BlitCommandsHelper<FamilyType>::appendTilingType(GMM_TILED_64, GMM_TILED_64, bltCmd);
|
||||
EXPECT_EQ(bltCmd.getSourceTiling(), XY_COPY_BLT::TILING::TILING_TILE64);
|
||||
EXPECT_EQ(bltCmd.getDestinationTiling(), XY_COPY_BLT::TILING::TILING_TILE64);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenTiled4SrcAndDestinationAppendImageCommandsThenCorrectTiledIsSet, IsXeHpCore) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmHelper());
|
||||
auto flags = gmm->gmmResourceInfo->getResourceFlags();
|
||||
flags->Info.Tile4 = true;
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
|
||||
mockAllocationSrc.setGmm(gmm.get(), 0);
|
||||
mockAllocationDst.setGmm(gmm.get(), 0);
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.srcSize = {1, 1, 1};
|
||||
properties.dstSize = {1, 1, 1};
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
properties.clearColorAllocation = &mockClearColor;
|
||||
auto srcSlicePitch = static_cast<uint32_t>(properties.srcSlicePitch);
|
||||
auto dstSlicePitch = static_cast<uint32_t>(properties.dstSlicePitch);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, bltCmd, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
EXPECT_EQ(bltCmd.getSourceTiling(), XY_COPY_BLT::TILING::TILING_TILE4);
|
||||
EXPECT_EQ(bltCmd.getDestinationTiling(), XY_COPY_BLT::TILING::TILING_TILE4);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenNotTiled64SrcAndDestinationAppendImageCommandsThenCorrectTiledIsSet, IsXeHpCore) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmHelper());
|
||||
auto flags = gmm->gmmResourceInfo->getResourceFlags();
|
||||
flags->Info.Tile64 = true;
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
|
||||
mockAllocationSrc.setGmm(gmm.get(), 0);
|
||||
mockAllocationDst.setGmm(gmm.get(), 0);
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.srcSize = {1, 1, 1};
|
||||
properties.dstSize = {1, 1, 1};
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
properties.clearColorAllocation = &mockClearColor;
|
||||
auto srcSlicePitch = static_cast<uint32_t>(properties.srcSlicePitch);
|
||||
auto dstSlicePitch = static_cast<uint32_t>(properties.dstSlicePitch);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, bltCmd, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
EXPECT_EQ(bltCmd.getSourceTiling(), XY_COPY_BLT::TILING::TILING_TILE64);
|
||||
EXPECT_EQ(bltCmd.getDestinationTiling(), XY_COPY_BLT::TILING::TILING_TILE64);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenNotTiledSrcAndDestinationAppendImageCommandsThenCorrectTiledIsSet, IsXeHpCore) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmHelper());
|
||||
auto flags = gmm->gmmResourceInfo->getResourceFlags();
|
||||
flags->Info.Tile64 = false;
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
|
||||
mockAllocationSrc.setGmm(gmm.get(), 0);
|
||||
mockAllocationDst.setGmm(gmm.get(), 0);
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.srcSize = {1, 1, 1};
|
||||
properties.dstSize = {1, 1, 1};
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
properties.clearColorAllocation = &mockClearColor;
|
||||
auto srcSlicePitch = static_cast<uint32_t>(properties.srcSlicePitch);
|
||||
auto dstSlicePitch = static_cast<uint32_t>(properties.dstSlicePitch);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, bltCmd, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
EXPECT_EQ(bltCmd.getSourceTiling(), XY_COPY_BLT::TILING::TILING_LINEAR);
|
||||
EXPECT_EQ(bltCmd.getDestinationTiling(), XY_COPY_BLT::TILING::TILING_LINEAR);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenGmmParamsWhenAppendSurfaceTypeThenCorrectSurfaceTypeIsSet, IsXeHpCore) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
|
||||
std::tuple<GMM_RESOURCE_TYPE_ENUM, typename XY_COPY_BLT::SURFACE_TYPE, uint32_t> testParams[]{
|
||||
{GMM_RESOURCE_TYPE::RESOURCE_1D, XY_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_1D, 1u},
|
||||
{GMM_RESOURCE_TYPE::RESOURCE_2D, XY_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_2D, 1u},
|
||||
{GMM_RESOURCE_TYPE::RESOURCE_3D, XY_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_3D, 1u},
|
||||
{GMM_RESOURCE_TYPE::RESOURCE_1D, XY_COPY_BLT::SURFACE_TYPE::SURFACE_TYPE_SURFTYPE_2D, 10u}};
|
||||
|
||||
for (const auto &[resourceType, expectedSurfaceType, arraySize] : testParams) {
|
||||
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmHelper());
|
||||
auto resourceInfo = static_cast<MockGmmResourceInfo *>(gmm->gmmResourceInfo.get());
|
||||
resourceInfo->mockResourceCreateParams.Type = resourceType;
|
||||
resourceInfo->mockResourceCreateParams.ArraySize = arraySize;
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
mockAllocationSrc.setGmm(gmm.get(), 0);
|
||||
mockAllocationDst.setGmm(gmm.get(), 0);
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
BlitCommandsHelper<FamilyType>::appendSurfaceType(properties, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd.getDestinationSurfaceType(), expectedSurfaceType);
|
||||
EXPECT_EQ(bltCmd.getSourceSurfaceType(), expectedSurfaceType);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenInvalidResourceWhenAppendSurfaceTypeThenSurfaceTypeDoesNotChange, IsXeHpCore) {
|
||||
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmHelper());
|
||||
auto resourceInfo = static_cast<MockGmmResourceInfo *>(gmm->gmmResourceInfo.get());
|
||||
resourceInfo->mockResourceCreateParams.Type = GMM_RESOURCE_TYPE::RESOURCE_INVALID;
|
||||
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
mockAllocationSrc.setGmm(gmm.get(), 0);
|
||||
mockAllocationDst.setGmm(gmm.get(), 0);
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
|
||||
auto srcSurfaceType = bltCmd.getSourceSurfaceType();
|
||||
auto dstSurfaceType = bltCmd.getDestinationSurfaceType();
|
||||
|
||||
BlitCommandsHelper<FamilyType>::appendSurfaceType(properties, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd.getSourceSurfaceType(), srcSurfaceType);
|
||||
EXPECT_EQ(bltCmd.getDestinationSurfaceType(), dstSurfaceType);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenResourcesWithoutGmmsWhenAppendSurfaceTypeThenSurfaceTypeDoesNotChange, IsXeHpCore) {
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
|
||||
auto srcSurfaceType = bltCmd.getSourceSurfaceType();
|
||||
auto dstSurfaceType = bltCmd.getDestinationSurfaceType();
|
||||
BlitCommandsHelper<FamilyType>::appendSurfaceType(properties, bltCmd);
|
||||
|
||||
EXPECT_EQ(bltCmd.getSourceSurfaceType(), srcSurfaceType);
|
||||
EXPECT_EQ(bltCmd.getDestinationSurfaceType(), dstSurfaceType);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenPlaneWhenGetBlitAllocationPropertiesIsCalledThenCompressionFormatIsProperlyAdjusted, CompressionParamsSupportedMatcher) {
|
||||
struct {
|
||||
uint8_t returnedCompressionFormat;
|
||||
|
@ -644,29 +284,6 @@ HWTEST2_F(BlitTests, givenPlaneWhenGetBlitAllocationPropertiesIsCalledThenCompre
|
|||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenA0orA1SteppingAndCpuLocalMemoryAccessWhenCallingAppendExtraMemoryPropertiesThenTargetMemoryIsSet, IsXeHpCore) {
|
||||
using XY_BLOCK_COPY_BLT = typename FamilyType::XY_BLOCK_COPY_BLT;
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
DebugManager.flags.ForceLocalMemoryAccessMode.set(1);
|
||||
|
||||
const auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
|
||||
auto &productHelper = pDevice->getProductHelper();
|
||||
std::array<std::pair<uint32_t, typename XY_BLOCK_COPY_BLT::TARGET_MEMORY>, 3> testParams = {
|
||||
{{REVISION_A0, XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM},
|
||||
{REVISION_A1, XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_SYSTEM_MEM},
|
||||
{REVISION_B, XY_BLOCK_COPY_BLT::TARGET_MEMORY::TARGET_MEMORY_LOCAL_MEM}}};
|
||||
|
||||
for (const auto &[revision, expectedTargetMemory] : testParams) {
|
||||
auto bltCmd = FamilyType::cmdInitXyBlockCopyBlt;
|
||||
auto hwInfo = rootDeviceEnvironment.getMutableHardwareInfo();
|
||||
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(revision, *hwInfo);
|
||||
|
||||
BlitCommandsHelper<FamilyType>::appendExtraMemoryProperties(bltCmd, rootDeviceEnvironment);
|
||||
EXPECT_EQ(bltCmd.getSourceTargetMemory(), expectedTargetMemory);
|
||||
EXPECT_EQ(bltCmd.getDestinationTargetMemory(), expectedTargetMemory);
|
||||
}
|
||||
}
|
||||
|
||||
struct MyMockResourecInfo : public GmmResourceInfo {
|
||||
using GmmResourceInfo::resourceInfo;
|
||||
|
||||
|
@ -687,200 +304,6 @@ struct MyMockResourecInfo : public GmmResourceInfo {
|
|||
size_t pitch = 0;
|
||||
GMM_RESOURCE_FLAG flags = {};
|
||||
};
|
||||
HWTEST2_F(BlitTests, givenResourceWithoutGmmWhenAppendImageCommandsThenPitchEqualPropertiesValue, IsXeHpCore) {
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
|
||||
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.srcSize = {1, 1, 1};
|
||||
properties.dstSize = {1, 1, 1};
|
||||
properties.dstRowPitch = 0x100;
|
||||
properties.srcRowPitch = 0x100;
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
properties.clearColorAllocation = &mockClearColor;
|
||||
auto srcSlicePitch = static_cast<uint32_t>(properties.srcSlicePitch);
|
||||
auto dstSlicePitch = static_cast<uint32_t>(properties.dstSlicePitch);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, bltCmd, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
|
||||
EXPECT_EQ(bltCmd.getDestinationPitch(), properties.dstRowPitch);
|
||||
EXPECT_EQ(bltCmd.getSourcePitch(), properties.srcRowPitch);
|
||||
}
|
||||
HWTEST2_F(BlitTests, givenInputAndDefaultSlicePitchWhenAppendBlitCommandsForImagesIsCalledThenSlicePitchIsCorrect, IsXeHpCore) {
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockClearColor;
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.dstRowPitch = 0x100;
|
||||
properties.srcRowPitch = 0x200;
|
||||
properties.copySize = {10, 20, 1};
|
||||
properties.srcSize = {20, 18, 1};
|
||||
properties.dstSize = {18, 20, 1};
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
properties.clearColorAllocation = &mockClearColor;
|
||||
{
|
||||
uint32_t inputSlicePitch = 0x4000;
|
||||
uint32_t srcSlicePitch = inputSlicePitch;
|
||||
uint32_t dstSlicePitch = inputSlicePitch;
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, bltCmd, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
EXPECT_EQ(inputSlicePitch, srcSlicePitch);
|
||||
EXPECT_EQ(inputSlicePitch, dstSlicePitch);
|
||||
}
|
||||
{
|
||||
uint32_t expectedSrcSlicePitch = static_cast<uint32_t>(properties.srcSize.y * properties.srcRowPitch);
|
||||
uint32_t expectedDstSlicePitch = static_cast<uint32_t>(properties.dstSize.y * properties.dstRowPitch);
|
||||
uint32_t srcSlicePitch = 0;
|
||||
uint32_t dstSlicePitch = 0;
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, bltCmd, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
EXPECT_EQ(expectedSrcSlicePitch, srcSlicePitch);
|
||||
EXPECT_EQ(expectedDstSlicePitch, dstSlicePitch);
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenResourceInfoWithZeroPitchWhenAppendImageCommandsThenPitchEqualPropertiesValue, IsXeHpCore) {
|
||||
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmHelper());
|
||||
GMM_RESCREATE_PARAMS gmmParams = {};
|
||||
gmm->gmmResourceInfo.reset(new MyMockResourecInfo(pDevice->getRootDeviceEnvironment().getGmmClientContext(), &gmmParams));
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
|
||||
mockAllocationSrc.setGmm(gmm.get(), 0);
|
||||
mockAllocationDst.setGmm(gmm.get(), 0);
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.srcSize = {1, 1, 1};
|
||||
properties.dstSize = {1, 1, 1};
|
||||
properties.dstRowPitch = 0x100;
|
||||
properties.srcRowPitch = 0x100;
|
||||
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
properties.clearColorAllocation = &mockClearColor;
|
||||
auto srcSlicePitch = static_cast<uint32_t>(properties.srcSlicePitch);
|
||||
auto dstSlicePitch = static_cast<uint32_t>(properties.dstSlicePitch);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, bltCmd, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
EXPECT_EQ(bltCmd.getDestinationPitch(), properties.dstRowPitch);
|
||||
EXPECT_EQ(bltCmd.getSourcePitch(), properties.srcRowPitch);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenTiledAllocationWhenAppendBlitCommandsForImagesThenBlitCmdIsCorrect, IsXeHpCore) {
|
||||
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmHelper());
|
||||
GMM_RESCREATE_PARAMS gmmParams = {};
|
||||
auto myResourecInfo = std::make_unique<MyMockResourecInfo>(pDevice->getRootDeviceEnvironment().getGmmClientContext(), &gmmParams);
|
||||
myResourecInfo->pitch = 0x100;
|
||||
gmm->gmmResourceInfo.reset(myResourecInfo.release());
|
||||
auto flags = gmm->gmmResourceInfo->getResourceFlags();
|
||||
flags->Info.Tile64 = true;
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
|
||||
mockAllocationSrc.setGmm(gmm.get(), 0);
|
||||
mockAllocationDst.setGmm(gmm.get(), 0);
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.srcSize = {1, 1, 1};
|
||||
properties.dstSize = {1, 1, 1};
|
||||
properties.dstRowPitch = 0x1000;
|
||||
properties.srcRowPitch = 0x1000;
|
||||
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.clearColorAllocation = &mockClearColor;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
auto srcSlicePitch = static_cast<uint32_t>(properties.srcSlicePitch);
|
||||
auto dstSlicePitch = static_cast<uint32_t>(properties.dstSlicePitch);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, bltCmd, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
EXPECT_EQ(bltCmd.getDestinationPitch(), gmm->gmmResourceInfo->getRenderPitch() / sizeof(uint32_t));
|
||||
EXPECT_EQ(bltCmd.getSourcePitch(), gmm->gmmResourceInfo->getRenderPitch() / sizeof(uint32_t));
|
||||
EXPECT_NE(bltCmd.getDestinationPitch(), static_cast<uint32_t>(properties.dstRowPitch));
|
||||
EXPECT_NE(bltCmd.getSourcePitch(), static_cast<uint32_t>(properties.srcRowPitch));
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenAlocationsWhenAppendBlitCommandsForImagesThenSurfaceSizesAreProgrammedCorrectly, IsXeHpCore) {
|
||||
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmHelper());
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockClearColor;
|
||||
mockAllocationSrc.setGmm(gmm.get(), 0);
|
||||
mockAllocationDst.setGmm(gmm.get(), 0);
|
||||
auto blitCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.dstRowPitch = 0x100;
|
||||
properties.srcRowPitch = 0x100;
|
||||
properties.srcSize = {8, 10, 12};
|
||||
properties.dstSize = {12, 8, 10};
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
properties.clearColorAllocation = &mockClearColor;
|
||||
auto srcSlicePitch = static_cast<uint32_t>(properties.srcSlicePitch);
|
||||
auto dstSlicePitch = static_cast<uint32_t>(properties.dstSlicePitch);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, blitCmd, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
|
||||
EXPECT_EQ(blitCmd.getSourceSurfaceWidth(), properties.srcSize.x);
|
||||
EXPECT_EQ(blitCmd.getSourceSurfaceHeight(), properties.srcSize.y);
|
||||
EXPECT_EQ(blitCmd.getSourceSurfaceDepth(), properties.srcSize.z);
|
||||
EXPECT_EQ(blitCmd.getDestinationSurfaceWidth(), properties.dstSize.x);
|
||||
EXPECT_EQ(blitCmd.getDestinationSurfaceHeight(), properties.dstSize.y);
|
||||
EXPECT_EQ(blitCmd.getDestinationSurfaceDepth(), properties.dstSize.z);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenLinearResourceInfoWithNotZeroPitchWhenAppendImageCommandsThenPitchEqualValueFromProperties, IsXeHpCore) {
|
||||
auto gmm = std::make_unique<MockGmm>(pDevice->getGmmHelper());
|
||||
GMM_RESCREATE_PARAMS gmmParams = {};
|
||||
auto myResourecInfo = std::make_unique<MyMockResourecInfo>(pDevice->getRootDeviceEnvironment().getGmmClientContext(), &gmmParams);
|
||||
myResourecInfo->pitch = 0x100;
|
||||
myResourecInfo->flags.Info.Linear = 1;
|
||||
gmm->gmmResourceInfo.reset(myResourecInfo.release());
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
|
||||
mockAllocationSrc.setGmm(gmm.get(), 0);
|
||||
mockAllocationDst.setGmm(gmm.get(), 0);
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
properties.srcSize = {1, 1, 1};
|
||||
properties.dstSize = {1, 1, 1};
|
||||
properties.dstRowPitch = 0x1000;
|
||||
properties.srcRowPitch = 0x1000;
|
||||
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
properties.clearColorAllocation = &mockClearColor;
|
||||
auto srcSlicePitch = static_cast<uint32_t>(properties.srcSlicePitch);
|
||||
auto dstSlicePitch = static_cast<uint32_t>(properties.dstSlicePitch);
|
||||
BlitCommandsHelper<FamilyType>::appendBlitCommandsForImages(properties, bltCmd, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
EXPECT_EQ(bltCmd.getDestinationPitch(), properties.dstRowPitch);
|
||||
EXPECT_EQ(bltCmd.getSourcePitch(), properties.dstRowPitch);
|
||||
EXPECT_NE(bltCmd.getDestinationPitch(), gmm->gmmResourceInfo->getRenderPitch());
|
||||
EXPECT_NE(bltCmd.getSourcePitch(), gmm->gmmResourceInfo->getRenderPitch());
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenCompressionInfoWhenAppendImageCommandsThenCorrectPropertiesAreSet, IsXeHpgCore) {
|
||||
using COMPRESSION_ENABLE = typename FamilyType::XY_BLOCK_COPY_BLT::COMPRESSION_ENABLE;
|
||||
|
@ -960,77 +383,6 @@ HWTEST2_F(BlitTests, givenCompressionInfoWhenAppendImageCommandsThenCorrectPrope
|
|||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenLinearResorcesWhenAppendSliceOffsetsThenAddressAreOffsetted, IsXeHpCore) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockClearColor(reinterpret_cast<void *>(0x1234), sizeof(uint32_t));
|
||||
properties.copySize = {0x10, 0x10, 0x1};
|
||||
properties.srcAllocation = &mockAllocationSrc;
|
||||
properties.dstAllocation = &mockAllocationDst;
|
||||
properties.srcSlicePitch = 0x4000;
|
||||
properties.dstSlicePitch = 0x8000;
|
||||
properties.srcGpuAddress = mockAllocationSrc.getGpuAddress();
|
||||
properties.dstGpuAddress = mockAllocationDst.getGpuAddress();
|
||||
properties.clearColorAllocation = &mockClearColor;
|
||||
properties.bytesPerPixel = 1;
|
||||
bltCmd.setSourceTiling(XY_COPY_BLT::TILING::TILING_LINEAR);
|
||||
bltCmd.setDestinationTiling(XY_COPY_BLT::TILING::TILING_LINEAR);
|
||||
uint32_t index = 1;
|
||||
auto srcSlicePitch = static_cast<uint32_t>(properties.srcSlicePitch);
|
||||
auto dstSlicePitch = static_cast<uint32_t>(properties.dstSlicePitch);
|
||||
BlitCommandsHelper<FamilyType>::appendSliceOffsets(properties, bltCmd, index, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
EXPECT_EQ(bltCmd.getDestinationBaseAddress(), ptrOffset(mockAllocationDst.getGpuAddress(), dstSlicePitch));
|
||||
EXPECT_EQ(bltCmd.getSourceBaseAddress(), ptrOffset(mockAllocationSrc.getGpuAddress(), srcSlicePitch));
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenTiledResorcesWhenAppendSliceOffsetsThenIndexsAreSet, IsXeHpCore) {
|
||||
using XY_COPY_BLT = typename FamilyType::XY_COPY_BLT;
|
||||
auto bltCmd = FamilyType::cmdInitXyCopyBlt;
|
||||
BlitProperties properties = {};
|
||||
MockGraphicsAllocation mockAllocationSrc(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
MockGraphicsAllocation mockAllocationDst(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, sizeof(uint32_t),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
bltCmd.setSourceTiling(XY_COPY_BLT::TILING::TILING_TILE64);
|
||||
bltCmd.setDestinationTiling(XY_COPY_BLT::TILING::TILING_TILE64);
|
||||
uint32_t index = 1;
|
||||
auto srcSlicePitch = static_cast<uint32_t>(properties.srcSlicePitch);
|
||||
auto dstSlicePitch = static_cast<uint32_t>(properties.dstSlicePitch);
|
||||
BlitCommandsHelper<FamilyType>::appendSliceOffsets(properties, bltCmd, index, pDevice->getRootDeviceEnvironment(), srcSlicePitch, dstSlicePitch);
|
||||
EXPECT_EQ(bltCmd.getDestinationArrayIndex(), index + 1);
|
||||
EXPECT_EQ(bltCmd.getSourceArrayIndex(), index + 1);
|
||||
}
|
||||
|
||||
HWTEST2_F(BlitTests, givenMemorySizeTwiceBiggerThanMaxWidthWhenFillPatternWithBlitThenHeightIsTwo, IsXeHpCore) {
|
||||
using XY_COLOR_BLT = typename FamilyType::XY_COLOR_BLT;
|
||||
using COLOR_DEPTH = typename XY_COLOR_BLT::COLOR_DEPTH;
|
||||
uint32_t pattern[4] = {1, 0, 0, 0};
|
||||
uint32_t streamBuffer[100] = {};
|
||||
LinearStream stream(streamBuffer, sizeof(streamBuffer));
|
||||
MockGraphicsAllocation mockAllocation(0, AllocationType::INTERNAL_HOST_MEMORY,
|
||||
reinterpret_cast<void *>(0x1234), 0x1000, 0, (2 * BlitterConstants::maxBlitWidth * sizeof(uint32_t)),
|
||||
MemoryPool::System4KBPages, MemoryManager::maxOsContextCount);
|
||||
BlitCommandsHelper<FamilyType>::dispatchBlitMemoryColorFill(&mockAllocation, 0, pattern, sizeof(uint32_t), stream, mockAllocation.getUnderlyingBufferSize(), *pDevice->getExecutionEnvironment()->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]);
|
||||
GenCmdList cmdList;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList, ptrOffset(stream.getCpuBase(), 0), stream.getUsed()));
|
||||
auto itor = find<XY_COLOR_BLT *>(cmdList.begin(), cmdList.end());
|
||||
EXPECT_NE(cmdList.end(), itor);
|
||||
{
|
||||
auto cmd = genCmdCast<XY_COLOR_BLT *>(*itor);
|
||||
EXPECT_EQ(cmd->getDestinationSurfaceType(), XY_COLOR_BLT::DESTINATION_SURFACE_TYPE::DESTINATION_SURFACE_TYPE_2D);
|
||||
}
|
||||
}
|
||||
|
||||
using IsXeHPOrAbove = IsAtLeastProduct<IGFX_XE_HP_SDV>;
|
||||
|
||||
HWTEST2_F(BlitTests, givenEnabledGlobalCacheInvalidationWhenProgrammingGlobalSequencerFlushThenCommandsAreProgrammed, IsXeHPOrAbove) {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue