fix: global stateless heap creation in heapless path

Related-To: NEO-10681
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2024-09-05 15:43:24 +00:00
committed by Compute-Runtime-Automation
parent b2004979ce
commit 95b035a071
4 changed files with 29 additions and 0 deletions

View File

@@ -6,10 +6,12 @@
*/
#include "shared/source/debug_settings/debug_settings_manager.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/api_specific_config.h"
#include "shared/source/release_helper/release_helper.h"
#include "level_zero/core/source/compiler_interface/l0_reg_path.h"
#include "level_zero/core/source/gfx_core_helpers/l0_gfx_core_helper.h"
#include <string>
#include <vector>
@@ -93,4 +95,11 @@ std::string ApiSpecificConfig::compilerCacheFileExtension() {
int64_t ApiSpecificConfig::compilerCacheDefaultEnabled() {
return 1l;
}
bool ApiSpecificConfig::isGlobalStatelessEnabled(const RootDeviceEnvironment &rootDeviceEnvironment) {
auto &l0GfxCoreHelper = rootDeviceEnvironment.getHelper<L0::L0GfxCoreHelper>();
return l0GfxCoreHelper.getHeapAddressModel(rootDeviceEnvironment) == HeapAddressModel::globalStateless;
}
} // namespace NEO

View File

@@ -84,4 +84,9 @@ std::string ApiSpecificConfig::compilerCacheFileExtension() {
int64_t ApiSpecificConfig::compilerCacheDefaultEnabled() {
return 1l;
}
bool ApiSpecificConfig::isGlobalStatelessEnabled(const RootDeviceEnvironment &rootDeviceEnvironment) {
return false;
}
} // namespace NEO

View File

@@ -15,6 +15,7 @@
namespace NEO {
class ReleaseHelper;
struct RootDeviceEnvironment;
struct ApiSpecificConfig {
enum ApiType { OCL,
@@ -26,6 +27,7 @@ struct ApiSpecificConfig {
static bool isHostAllocationCacheEnabled();
static bool isDeviceUsmPoolingEnabled();
static bool isHostUsmPoolingEnabled();
static bool isGlobalStatelessEnabled(const RootDeviceEnvironment &rootDeviceEnvironment);
static ApiType getApiType();
static std::string getName();
static uint64_t getReducedMaxAllocSize(uint64_t maxAllocSize);

View File

@@ -15,6 +15,9 @@ namespace NEO {
class ReleaseHelper;
ApiSpecificConfig::ApiType apiTypeForUlts = ApiSpecificConfig::OCL;
bool globalStatelessL0 = false;
bool globalStatelessOcl = false;
bool isStatelessCompressionSupportedForUlts = true;
StackVec<const char *, 4> validUltL0Prefixes = {"NEO_L0_", "NEO_", ""};
@@ -113,4 +116,14 @@ int64_t ApiSpecificConfig::compilerCacheDefaultEnabled() {
return 1l;
}
bool ApiSpecificConfig::isGlobalStatelessEnabled(const RootDeviceEnvironment &rootDeviceEnvironment) {
if (apiTypeForUlts == ApiSpecificConfig::L0) {
return globalStatelessL0;
} else {
return globalStatelessOcl;
}
}
} // namespace NEO