mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
refactor: Use timestamp types for events and in order nodes
Switching tagAllocation into UC causes regressions in non event scenarios. It is no longer used as dependant type for semaphores. Restoring previous GMM_USAGE settings for tag. Marking events and in order nodes using only timestamp types as they have proper GMM_USAGE settings already and can be both in smem and lmem. Resolves: NEO-13847 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
9305652446
commit
09e23804dc
@@ -100,8 +100,7 @@ ze_result_t EventPool::initialize(DriverHandle *driver, Context *context, uint32
|
||||
|
||||
initializeSizeParameters(numDevices, deviceHandles, *driverHandleImp, rootDeviceEnvironment);
|
||||
|
||||
NEO::AllocationType allocationType = isEventPoolTimestampFlagSet() ? NEO::AllocationType::timestampPacketTagBuffer
|
||||
: NEO::AllocationType::tagBuffer;
|
||||
NEO::AllocationType allocationType = NEO::AllocationType::timestampPacketTagBuffer;
|
||||
if (this->devices.size() > 1) {
|
||||
this->isDeviceEventPoolAllocation = false;
|
||||
}
|
||||
@@ -448,7 +447,7 @@ ze_result_t EventPool::openEventPoolIpcHandle(const ze_ipc_event_pool_handle_t &
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
NEO::AllocationType allocationType = NEO::AllocationType::tagBuffer;
|
||||
NEO::AllocationType allocationType = NEO::AllocationType::timestampPacketTagBuffer;
|
||||
if (eventPool->isDeviceEventPoolAllocation) {
|
||||
allocationType = NEO::AllocationType::gpuTimestampDeviceBuffer;
|
||||
}
|
||||
|
||||
@@ -2412,7 +2412,7 @@ HWTEST2_F(InOrderCmdListTests, givenDebugFlagSetWhenDispatchingThenEnsureHostAll
|
||||
EXPECT_NE(nullptr, immCmdList2->inOrderExecInfo->getHostCounterAllocation());
|
||||
EXPECT_NE(immCmdList2->inOrderExecInfo->getDeviceCounterAllocation(), immCmdList2->inOrderExecInfo->getHostCounterAllocation());
|
||||
|
||||
EXPECT_EQ(AllocationType::tagBuffer, immCmdList1->inOrderExecInfo->getHostCounterAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::timestampPacketTagBuffer, immCmdList1->inOrderExecInfo->getHostCounterAllocation()->getAllocationType());
|
||||
EXPECT_EQ(immCmdList1->inOrderExecInfo->getBaseHostAddress(), immCmdList1->inOrderExecInfo->getHostCounterAllocation()->getUnderlyingBuffer());
|
||||
EXPECT_FALSE(immCmdList1->inOrderExecInfo->getHostCounterAllocation()->isAllocatedInLocalMemoryPool());
|
||||
|
||||
@@ -2421,7 +2421,7 @@ HWTEST2_F(InOrderCmdListTests, givenDebugFlagSetWhenDispatchingThenEnsureHostAll
|
||||
auto hostAllocOffset = ptrDiff(immCmdList2->inOrderExecInfo->getBaseHostAddress(), immCmdList1->inOrderExecInfo->getBaseHostAddress());
|
||||
EXPECT_NE(0u, hostAllocOffset);
|
||||
|
||||
EXPECT_EQ(AllocationType::tagBuffer, immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::timestampPacketTagBuffer, immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getAllocationType());
|
||||
EXPECT_EQ(immCmdList2->inOrderExecInfo->getBaseHostAddress(), ptrOffset(immCmdList2->inOrderExecInfo->getHostCounterAllocation()->getUnderlyingBuffer(), hostAllocOffset));
|
||||
EXPECT_FALSE(immCmdList2->inOrderExecInfo->getHostCounterAllocation()->isAllocatedInLocalMemoryPool());
|
||||
|
||||
@@ -2454,7 +2454,7 @@ HWTEST2_F(InOrderCmdListTests, givenInOrderModeWhenDispatchingThenHandleDependen
|
||||
auto immCmdList = createImmCmdList<gfxCoreFamily>();
|
||||
|
||||
EXPECT_NE(nullptr, immCmdList->inOrderExecInfo.get());
|
||||
EXPECT_EQ(AllocationType::timestampPacketTagBuffer, immCmdList->inOrderExecInfo->getDeviceCounterAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::gpuTimestampDeviceBuffer, immCmdList->inOrderExecInfo->getDeviceCounterAllocation()->getAllocationType());
|
||||
|
||||
EXPECT_EQ(0u, immCmdList->inOrderExecInfo->getCounterValue());
|
||||
|
||||
|
||||
@@ -382,7 +382,7 @@ HWTEST2_F(CopyOffloadInOrderTests, givenProfilingEventWithRelaxedOrderingWhenApp
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(CopyOffloadInOrderTests, givenAtomicSignalingModeWhenUpdatingCounterThenUseCorrectHwCommands, IsAtLeastXeHpCore) {
|
||||
HWTEST2_F(CopyOffloadInOrderTests, givenAtomicSignalingModeWhenUpdatingCounterThenUseCorrectHwCommands, IsAtLeastXe2HpgCore) {
|
||||
using MI_ATOMIC = typename FamilyType::MI_ATOMIC;
|
||||
using ATOMIC_OPCODES = typename FamilyType::MI_ATOMIC::ATOMIC_OPCODES;
|
||||
using DATA_SIZE = typename FamilyType::MI_ATOMIC::DATA_SIZE;
|
||||
|
||||
@@ -369,7 +369,7 @@ TEST_F(EventPoolCreate, GivenDeviceThenEventPoolIsCreated) {
|
||||
if (l0GfxCoreHelper.alwaysAllocateEventInLocalMem()) {
|
||||
EXPECT_EQ(NEO::AllocationType::gpuTimestampDeviceBuffer, eventPool->getAllocation().getAllocationType());
|
||||
} else {
|
||||
EXPECT_EQ(NEO::AllocationType::tagBuffer, eventPool->getAllocation().getAllocationType());
|
||||
EXPECT_EQ(NEO::AllocationType::timestampPacketTagBuffer, eventPool->getAllocation().getAllocationType());
|
||||
}
|
||||
eventPool->destroy();
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/memory_manager/allocation_type.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/os_interface/product_helper.h"
|
||||
#include "shared/source/release_helper/release_helper.h"
|
||||
|
||||
@@ -88,12 +87,8 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCaching
|
||||
case AllocationType::fillPattern:
|
||||
case AllocationType::svmCpu:
|
||||
case AllocationType::svmZeroCopy:
|
||||
if (debugManager.flags.DisableCachingForStatefulBufferAccess.get()) {
|
||||
return getDefaultUsageTypeWithCachingDisabled(allocationType, productHelper);
|
||||
}
|
||||
return GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
case AllocationType::tagBuffer:
|
||||
if (productHelper.isDcFlushAllowed() && OSInterface::isSemaphoreDependantResourceUCRequired) {
|
||||
if (debugManager.flags.DisableCachingForStatefulBufferAccess.get()) {
|
||||
return getDefaultUsageTypeWithCachingDisabled(allocationType, productHelper);
|
||||
}
|
||||
return GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
|
||||
@@ -30,7 +30,7 @@ class DeviceAllocNodeType {
|
||||
|
||||
static constexpr size_t defaultAllocatorTagCount = 128;
|
||||
|
||||
static constexpr AllocationType getAllocationType() { return deviceAlloc ? NEO::AllocationType::timestampPacketTagBuffer : NEO::AllocationType::tagBuffer; }
|
||||
static constexpr AllocationType getAllocationType() { return deviceAlloc ? NEO::AllocationType::gpuTimestampDeviceBuffer : NEO::AllocationType::timestampPacketTagBuffer; }
|
||||
|
||||
static constexpr TagNodeType getTagNodeType() { return TagNodeType::counter64b; }
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ bool OSInterface::osEnabled64kbPages = false;
|
||||
bool OSInterface::newResourceImplicitFlush = true;
|
||||
bool OSInterface::gpuIdleImplicitFlush = true;
|
||||
bool OSInterface::requiresSupportForWddmTrimNotification = false;
|
||||
bool OSInterface::isSemaphoreDependantResourceUCRequired = false;
|
||||
|
||||
bool OSInterface::isDebugAttachAvailable() const {
|
||||
if (driverModel && driverModel->getDriverModelType() == DriverModelType::drm) {
|
||||
|
||||
@@ -123,7 +123,6 @@ class OSInterface : public NonCopyableClass {
|
||||
static bool newResourceImplicitFlush;
|
||||
static bool gpuIdleImplicitFlush;
|
||||
static bool requiresSupportForWddmTrimNotification;
|
||||
static bool isSemaphoreDependantResourceUCRequired;
|
||||
static std::vector<std::unique_ptr<HwDeviceId>> discoverDevices(ExecutionEnvironment &executionEnvironment);
|
||||
static std::vector<std::unique_ptr<HwDeviceId>> discoverDevice(ExecutionEnvironment &executionEnvironment, std::string &osPciPath);
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ bool OSInterface::osEnabled64kbPages = true;
|
||||
bool OSInterface::newResourceImplicitFlush = true;
|
||||
bool OSInterface::gpuIdleImplicitFlush = false;
|
||||
bool OSInterface::requiresSupportForWddmTrimNotification = true;
|
||||
bool OSInterface::isSemaphoreDependantResourceUCRequired = true;
|
||||
|
||||
bool OSInterface::isDebugAttachAvailable() const {
|
||||
if (driverModel) {
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/source/sku_info/operations/sku_info_transfer.h"
|
||||
#include "shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
@@ -719,10 +718,8 @@ TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) {
|
||||
case AllocationType::fillPattern:
|
||||
case AllocationType::svmCpu:
|
||||
case AllocationType::svmZeroCopy:
|
||||
expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
break;
|
||||
case AllocationType::tagBuffer:
|
||||
expectedUsage = (forceUncached || (productHelper.isDcFlushAllowed() && OSInterface::isSemaphoreDependantResourceUCRequired)) ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
|
||||
break;
|
||||
default:
|
||||
expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_BUFFER;
|
||||
|
||||
@@ -481,8 +481,8 @@ TEST_F(TagAllocatorTest, givenTagAllocatorWhenGraphicsAllocationIsCreatedThenSet
|
||||
EXPECT_EQ(AllocationType::timestampPacketTagBuffer, timestampPacketTag->getBaseGraphicsAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::profilingTagBuffer, hwTimeStampsTag->getBaseGraphicsAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::profilingTagBuffer, hwPerfCounterTag->getBaseGraphicsAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::timestampPacketTagBuffer, inOrderDeviceTag->getBaseGraphicsAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::tagBuffer, inOrderHostTag->getBaseGraphicsAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::gpuTimestampDeviceBuffer, inOrderDeviceTag->getBaseGraphicsAllocation()->getAllocationType());
|
||||
EXPECT_EQ(AllocationType::timestampPacketTagBuffer, inOrderHostTag->getBaseGraphicsAllocation()->getAllocationType());
|
||||
}
|
||||
|
||||
TEST_F(TagAllocatorTest, givenMultipleRootDevicesWhenPopulatingTagsThenCreateMultiGraphicsAllocation) {
|
||||
|
||||
Reference in New Issue
Block a user