mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Observed about 50MB reduction in overall binaries size (directory build)) when building all targets with MSVC (Visual Studio 2022 17.3.0 preview 6) using Debug 64 configuration. Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
32 lines
1.1 KiB
C++
32 lines
1.1 KiB
C++
/*
|
|
* Copyright (C) 2022 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "shared/source/gmm_helper/gmm_lib.h"
|
|
|
|
namespace CacheSettings {
|
|
inline constexpr uint32_t unknownMocs = GMM_RESOURCE_USAGE_UNKNOWN;
|
|
} // namespace CacheSettings
|
|
|
|
namespace NEO {
|
|
enum class AllocationType;
|
|
struct HardwareInfo;
|
|
|
|
struct CacheSettingsHelper {
|
|
static GMM_RESOURCE_USAGE_TYPE_ENUM getGmmUsageType(AllocationType allocationType, bool forceUncached, const HardwareInfo &hwInfo);
|
|
|
|
static constexpr bool isUncachedType(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType) {
|
|
return ((gmmResourceUsageType == GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC) ||
|
|
(gmmResourceUsageType == GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED) ||
|
|
(gmmResourceUsageType == GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED));
|
|
}
|
|
|
|
protected:
|
|
static GMM_RESOURCE_USAGE_TYPE_ENUM getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const HardwareInfo &hwInfo);
|
|
static GMM_RESOURCE_USAGE_TYPE_ENUM getDefaultUsageTypeWithCachingDisabled(AllocationType allocationType);
|
|
};
|
|
} // namespace NEO
|