Files
compute-runtime/shared/source/gmm_helper/cache_settings_helper.cpp
Bartosz Dunajski a95198521e Initial implementation of CacheSettingsHelper
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
2022-02-08 16:18:06 +01:00

28 lines
802 B
C++

/*
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/gmm_helper/cache_settings_helper.h"
#include "shared/source/memory_manager/allocation_type.h"
namespace NEO {
namespace CacheSettingsHelper {
GMM_RESOURCE_USAGE_TYPE_ENUM getGmmUsageType(AllocationType allocationType, bool forceUncached) {
if (forceUncached) {
return (allocationType == AllocationType::PREEMPTION) ? GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC
: GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED;
}
if (allocationType == AllocationType::IMAGE) {
return GMM_RESOURCE_USAGE_OCL_IMAGE;
}
return GMM_RESOURCE_USAGE_OCL_BUFFER;
}
} // namespace CacheSettingsHelper
} // namespace NEO