refactor: Make semaphore dependant resources UC

Change for tagBuffer type on Windows. Timestamp types are already UC on all DC
flush platforms regardless of OS.

Resolves: NEO-13847

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2025-01-28 12:37:29 +00:00
committed by Compute-Runtime-Automation
parent ad99c8d818
commit 7eac78d253
5 changed files with 18 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2024 Intel Corporation
* Copyright (C) 2022-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -12,6 +12,7 @@
#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"
@@ -87,11 +88,15 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCaching
case AllocationType::fillPattern:
case AllocationType::svmCpu:
case AllocationType::svmZeroCopy:
case AllocationType::tagBuffer:
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) {
return getDefaultUsageTypeWithCachingDisabled(allocationType, productHelper);
}
return GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER;
case AllocationType::gpuTimestampDeviceBuffer:
case AllocationType::timestampPacketTagBuffer:
if (debugManager.flags.ForceNonCoherentModeForTimestamps.get()) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2024 Intel Corporation
* Copyright (C) 2020-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -22,6 +22,7 @@ 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) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -123,6 +123,7 @@ 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);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -14,6 +14,7 @@ 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) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -9,6 +9,7 @@
#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"
@@ -718,9 +719,11 @@ TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) {
case AllocationType::fillPattern:
case AllocationType::svmCpu:
case AllocationType::svmZeroCopy:
case AllocationType::tagBuffer:
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;
break;
default:
expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_BUFFER;
break;