2020-10-01 19:31:19 +08:00
|
|
|
/*
|
2024-01-31 21:07:07 +08:00
|
|
|
* Copyright (C) 2020-2024 Intel Corporation
|
2020-10-01 19:31:19 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
|
|
|
#include "shared/source/helpers/api_specific_config.h"
|
|
|
|
|
2021-09-23 06:03:07 +08:00
|
|
|
#include "opencl/source/os_interface/ocl_reg_path.h"
|
|
|
|
|
2023-08-20 12:31:48 +08:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
2020-10-01 19:31:19 +08:00
|
|
|
namespace NEO {
|
2023-09-21 22:02:00 +08:00
|
|
|
StackVec<const char *, 4> validClPrefixes;
|
|
|
|
StackVec<NEO::DebugVarPrefix, 4> validClPrefixTypes;
|
2021-08-03 16:24:06 +08:00
|
|
|
bool ApiSpecificConfig::isStatelessCompressionSupported() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2024-03-21 00:58:17 +08:00
|
|
|
bool ApiSpecificConfig::getGlobalBindlessHeapConfiguration(const ReleaseHelper *releaseHelper) {
|
2020-10-01 19:31:19 +08:00
|
|
|
return false;
|
|
|
|
}
|
2021-08-03 16:24:06 +08:00
|
|
|
|
2024-09-18 20:38:06 +08:00
|
|
|
bool ApiSpecificConfig::getBindlessMode(const Device &device) {
|
2023-11-30 16:32:25 +08:00
|
|
|
if (debugManager.flags.UseBindlessMode.get() != -1) {
|
|
|
|
return debugManager.flags.UseBindlessMode.get();
|
2020-10-01 19:31:19 +08:00
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2021-08-03 16:24:06 +08:00
|
|
|
|
2022-09-05 21:17:18 +08:00
|
|
|
bool ApiSpecificConfig::isDeviceAllocationCacheEnabled() {
|
2024-05-17 19:54:37 +08:00
|
|
|
return true;
|
2022-09-05 21:17:18 +08:00
|
|
|
}
|
|
|
|
|
2024-01-31 21:07:07 +08:00
|
|
|
bool ApiSpecificConfig::isHostAllocationCacheEnabled() {
|
2024-07-18 02:24:51 +08:00
|
|
|
return true;
|
2024-01-31 21:07:07 +08:00
|
|
|
}
|
|
|
|
|
2024-05-15 21:30:37 +08:00
|
|
|
bool ApiSpecificConfig::isDeviceUsmPoolingEnabled() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ApiSpecificConfig::isHostUsmPoolingEnabled() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-05-14 01:46:01 +08:00
|
|
|
ApiSpecificConfig::ApiType ApiSpecificConfig::getApiType() {
|
|
|
|
return ApiSpecificConfig::OCL;
|
|
|
|
}
|
2021-07-05 20:10:31 +08:00
|
|
|
|
2021-09-16 20:31:00 +08:00
|
|
|
std::string ApiSpecificConfig::getName() {
|
|
|
|
return "ocl";
|
2021-07-05 20:10:31 +08:00
|
|
|
}
|
2021-08-11 02:52:02 +08:00
|
|
|
|
|
|
|
uint64_t ApiSpecificConfig::getReducedMaxAllocSize(uint64_t maxAllocSize) {
|
|
|
|
return maxAllocSize / 2;
|
|
|
|
}
|
|
|
|
|
2021-09-23 06:03:07 +08:00
|
|
|
const char *ApiSpecificConfig::getRegistryPath() {
|
|
|
|
return oclRegPath;
|
|
|
|
}
|
2023-08-20 12:31:48 +08:00
|
|
|
|
|
|
|
void ApiSpecificConfig::initPrefixes() {
|
|
|
|
validClPrefixes = {"NEO_OCL_", "NEO_", ""};
|
2023-12-05 20:06:54 +08:00
|
|
|
validClPrefixTypes = {DebugVarPrefix::neoOcl, DebugVarPrefix::neo, DebugVarPrefix::none};
|
2023-08-20 12:31:48 +08:00
|
|
|
}
|
|
|
|
|
2023-09-21 22:02:00 +08:00
|
|
|
const StackVec<const char *, 4> &ApiSpecificConfig::getPrefixStrings() {
|
2023-08-20 12:31:48 +08:00
|
|
|
return validClPrefixes;
|
|
|
|
}
|
|
|
|
|
2023-09-21 22:02:00 +08:00
|
|
|
const StackVec<DebugVarPrefix, 4> &ApiSpecificConfig::getPrefixTypes() {
|
2023-08-20 12:31:48 +08:00
|
|
|
return validClPrefixTypes;
|
|
|
|
}
|
2024-02-29 23:03:53 +08:00
|
|
|
|
|
|
|
std::string ApiSpecificConfig::compilerCacheFileExtension() {
|
|
|
|
return ".cl_cache";
|
|
|
|
}
|
|
|
|
|
|
|
|
int64_t ApiSpecificConfig::compilerCacheDefaultEnabled() {
|
|
|
|
return 1l;
|
|
|
|
}
|
2024-09-05 23:43:24 +08:00
|
|
|
|
|
|
|
bool ApiSpecificConfig::isGlobalStatelessEnabled(const RootDeviceEnvironment &rootDeviceEnvironment) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-08-11 02:52:02 +08:00
|
|
|
} // namespace NEO
|