mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
refactor: change ApiSpecificConfig functions names
- better description of the meaning of functions Related-To: NEO-7063 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
177d5ab602
commit
1c196b9f3d
@@ -95,7 +95,7 @@ StackVec<std::string, 3> getBuiltinResourceNames(EBuiltInOps::Type builtin, Buil
|
||||
const bool builtInUsesStatelessAddressing = EBuiltInOps::isStateless(builtin);
|
||||
if (builtInUsesStatelessAddressing || requiresStatelessAddressing) {
|
||||
return "stateless_";
|
||||
} else if (ApiSpecificConfig::getBindlessConfiguration()) {
|
||||
} else if (ApiSpecificConfig::getBindlessMode()) {
|
||||
return "bindless_";
|
||||
} else {
|
||||
return "bindful_";
|
||||
|
||||
@@ -359,7 +359,7 @@ void CommandContainer::endAlignedPrimaryBuffer() {
|
||||
}
|
||||
|
||||
void CommandContainer::prepareBindfulSsh() {
|
||||
if (ApiSpecificConfig::getBindlessConfiguration()) {
|
||||
if (ApiSpecificConfig::getBindlessMode()) {
|
||||
if (allocationIndirectHeaps[IndirectHeap::Type::SURFACE_STATE] == nullptr) {
|
||||
constexpr size_t heapSize = MemoryConstants::pageSize64k;
|
||||
allocationIndirectHeaps[IndirectHeap::Type::SURFACE_STATE] = heapHelper->getHeapAllocation(IndirectHeap::Type::SURFACE_STATE,
|
||||
@@ -557,7 +557,7 @@ bool CommandContainer::skipHeapAllocationCreation(HeapType heapType) {
|
||||
}
|
||||
const auto &hardwareInfo = this->device->getHardwareInfo();
|
||||
|
||||
bool skipCreation = NEO::ApiSpecificConfig::getBindlessConfiguration() ||
|
||||
bool skipCreation = NEO::ApiSpecificConfig::getBindlessMode() ||
|
||||
this->immediateCmdListSharedHeap(heapType) ||
|
||||
(!hardwareInfo.capabilityTable.supportsImages && IndirectHeap::Type::DYNAMIC_STATE == heapType) ||
|
||||
(this->heapAddressModel != HeapAddressModel::PrivateHeaps);
|
||||
|
||||
@@ -54,7 +54,7 @@ uint32_t EncodeStates<Family>::copySamplerState(IndirectHeap *dsh,
|
||||
|
||||
dsh->align(EncodeStates<Family>::alignIndirectStatePointer);
|
||||
uint32_t borderColorOffsetInDsh = 0;
|
||||
if (!ApiSpecificConfig::getBindlessConfiguration()) {
|
||||
if (!ApiSpecificConfig::getBindlessMode()) {
|
||||
borderColorOffsetInDsh = static_cast<uint32_t>(dsh->getUsed());
|
||||
auto borderColor = dsh->getSpace(borderColorSize);
|
||||
|
||||
@@ -544,7 +544,7 @@ template <typename Family>
|
||||
void *EncodeDispatchKernel<Family>::getInterfaceDescriptor(CommandContainer &container, IndirectHeap *childDsh, uint32_t &iddOffset) {
|
||||
|
||||
if (container.nextIddInBlockRef() == container.getNumIddPerBlock()) {
|
||||
if (ApiSpecificConfig::getBindlessConfiguration()) {
|
||||
if (ApiSpecificConfig::getBindlessMode()) {
|
||||
container.getDevice()->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH)->align(EncodeStates<Family>::alignInterfaceDescriptorData);
|
||||
container.setIddBlock(container.getDevice()->getBindlessHeapsHelper()->getSpaceInHeap(sizeof(INTERFACE_DESCRIPTOR_DATA) * container.getNumIddPerBlock(), BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH));
|
||||
} else {
|
||||
|
||||
@@ -120,7 +120,7 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
|
||||
if (kernelDescriptor.payloadMappings.samplerTable.numSamplers > 0) {
|
||||
auto dsHeap = args.dynamicStateHeap;
|
||||
if (dsHeap == nullptr) {
|
||||
if (!ApiSpecificConfig::getBindlessConfiguration()) {
|
||||
if (!ApiSpecificConfig::getBindlessMode()) {
|
||||
dsHeap = container.getIndirectHeap(HeapType::DYNAMIC_STATE);
|
||||
auto dshSizeRequired = NEO::EncodeDispatchKernel<Family>::getSizeRequiredDsh(kernelDescriptor, container.getNumIddPerBlock());
|
||||
if (dsHeap->getAvailableSpace() <= dshSizeRequired) {
|
||||
@@ -255,7 +255,7 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
|
||||
|
||||
cmd.setPredicateEnable(args.isPredicate);
|
||||
|
||||
if (ApiSpecificConfig::getBindlessConfiguration()) {
|
||||
if (ApiSpecificConfig::getBindlessMode()) {
|
||||
container.getResidencyContainer().push_back(args.device->getBindlessHeapsHelper()->getHeap(NEO::BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH)->getGraphicsAllocation());
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ void EncodeMediaInterfaceDescriptorLoad<Family>::encode(CommandContainer &contai
|
||||
if (childDsh != nullptr) {
|
||||
heapBase = childDsh->getCpuBase();
|
||||
} else {
|
||||
if (ApiSpecificConfig::getBindlessConfiguration()) {
|
||||
if (ApiSpecificConfig::getBindlessMode()) {
|
||||
heapBase = container.getDevice()->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH)->getGraphicsAllocation()->getUnderlyingBuffer();
|
||||
} else {
|
||||
heapBase = container.getIndirectHeap(HeapType::DYNAMIC_STATE)->getCpuBase();
|
||||
@@ -312,9 +312,9 @@ void EncodeMediaInterfaceDescriptorLoad<Family>::encode(CommandContainer &contai
|
||||
|
||||
auto iddOffset = static_cast<uint32_t>(ptrDiff(container.getIddBlock(), heapBase));
|
||||
|
||||
iddOffset += ApiSpecificConfig::getBindlessConfiguration() ? static_cast<uint32_t>(container.getDevice()->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH)->getGraphicsAllocation()->getGpuAddress() -
|
||||
container.getDevice()->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH)->getGraphicsAllocation()->getGpuBaseAddress())
|
||||
: 0;
|
||||
iddOffset += ApiSpecificConfig::getBindlessMode() ? static_cast<uint32_t>(container.getDevice()->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH)->getGraphicsAllocation()->getGpuAddress() -
|
||||
container.getDevice()->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH)->getGraphicsAllocation()->getGpuBaseAddress())
|
||||
: 0;
|
||||
|
||||
MEDIA_INTERFACE_DESCRIPTOR_LOAD cmd = Family::cmdInitMediaInterfaceDescriptorLoad;
|
||||
cmd.setInterfaceDescriptorDataStartAddress(iddOffset);
|
||||
|
||||
@@ -141,7 +141,7 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
|
||||
if (kernelDescriptor.payloadMappings.samplerTable.numSamplers > 0) {
|
||||
auto dsHeap = args.dynamicStateHeap;
|
||||
if (dsHeap == nullptr) {
|
||||
dsHeap = ApiSpecificConfig::getBindlessConfiguration() ? args.device->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH) : container.getIndirectHeap(HeapType::DYNAMIC_STATE);
|
||||
dsHeap = ApiSpecificConfig::getBindlessMode() ? args.device->getBindlessHeapsHelper()->getHeap(BindlessHeapsHelper::GLOBAL_DSH) : container.getIndirectHeap(HeapType::DYNAMIC_STATE);
|
||||
}
|
||||
UNRECOVERABLE_IF(!dsHeap);
|
||||
|
||||
@@ -151,7 +151,7 @@ void EncodeDispatchKernel<Family>::encode(CommandContainer &container, EncodeDis
|
||||
kernelDescriptor.payloadMappings.samplerTable.numSamplers, kernelDescriptor.payloadMappings.samplerTable.borderColor,
|
||||
args.dispatchInterface->getDynamicStateHeapData(),
|
||||
args.device->getBindlessHeapsHelper(), rootDeviceEnvironment);
|
||||
if (ApiSpecificConfig::getBindlessConfiguration()) {
|
||||
if (ApiSpecificConfig::getBindlessMode()) {
|
||||
container.getResidencyContainer().push_back(args.device->getBindlessHeapsHelper()->getHeap(NEO::BindlessHeapsHelper::BindlesHeapType::GLOBAL_DSH)->getGraphicsAllocation());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ uint64_t ScratchSpaceControllerXeHPAndLater::calculateNewGSH() {
|
||||
uint64_t ScratchSpaceControllerXeHPAndLater::getScratchPatchAddress() {
|
||||
uint64_t scratchAddress = 0u;
|
||||
if (scratchAllocation || privateScratchAllocation) {
|
||||
if (ApiSpecificConfig::getBindlessConfiguration()) {
|
||||
if (ApiSpecificConfig::getBindlessMode()) {
|
||||
scratchAddress = bindlessSS.surfaceStateOffset;
|
||||
} else {
|
||||
scratchAddress = static_cast<uint64_t>(getOffsetToSurfaceState(slotId + sshOffset));
|
||||
|
||||
@@ -37,7 +37,8 @@ Device *RootDevice::getRootDevice() const {
|
||||
}
|
||||
|
||||
void RootDevice::createBindlessHeapsHelper() {
|
||||
if (ApiSpecificConfig::getBindlessConfiguration()) {
|
||||
|
||||
if (ApiSpecificConfig::getBindlessMode()) {
|
||||
this->executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]->createBindlessHeapsHelper(getMemoryManager(), getNumGenericSubDevices() > 1, rootDeviceIndex, getDeviceBitfield());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -15,8 +15,8 @@ struct ApiSpecificConfig {
|
||||
L0 };
|
||||
static bool isStatelessCompressionSupported();
|
||||
static bool isBcsSplitWaSupported();
|
||||
static bool getHeapConfiguration();
|
||||
static bool getBindlessConfiguration();
|
||||
static bool getGlobalBindlessHeapConfiguration();
|
||||
static bool getBindlessMode();
|
||||
static bool isDeviceAllocationCacheEnabled();
|
||||
static ApiType getApiType();
|
||||
static std::string getName();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -15,7 +15,7 @@
|
||||
namespace NEO {
|
||||
|
||||
HeapAssigner::HeapAssigner() {
|
||||
apiAllowExternalHeapForSshAndDsh = ApiSpecificConfig::getHeapConfiguration();
|
||||
apiAllowExternalHeapForSshAndDsh = ApiSpecificConfig::getGlobalBindlessHeapConfiguration();
|
||||
}
|
||||
bool HeapAssigner::useInternal32BitHeap(AllocationType allocType) {
|
||||
return GraphicsAllocation::isIsaAllocationType(allocType) ||
|
||||
|
||||
@@ -244,7 +244,7 @@ void MemoryManager::freeGraphicsMemory(GraphicsAllocation *gfxAllocation, bool i
|
||||
if (!gfxAllocation) {
|
||||
return;
|
||||
}
|
||||
if (ApiSpecificConfig::getBindlessConfiguration() && executionEnvironment.rootDeviceEnvironments[gfxAllocation->getRootDeviceIndex()]->getBindlessHeapsHelper() != nullptr) {
|
||||
if (ApiSpecificConfig::getBindlessMode() && executionEnvironment.rootDeviceEnvironments[gfxAllocation->getRootDeviceIndex()]->getBindlessHeapsHelper() != nullptr) {
|
||||
executionEnvironment.rootDeviceEnvironments[gfxAllocation->getRootDeviceIndex()]->getBindlessHeapsHelper()->placeSSAllocationInReuseVectorOnFreeMemory(gfxAllocation);
|
||||
}
|
||||
const bool hasFragments = gfxAllocation->fragmentsStorage.fragmentCount != 0;
|
||||
|
||||
@@ -233,7 +233,7 @@ struct ValidEmptyKernel {
|
||||
auto execEnvTokInl = initToken<iOpenCL::SPatchExecutionEnvironment>(iOpenCL::PATCH_TOKEN_EXECUTION_ENVIRONMENT);
|
||||
execEnvTokInl.LargestCompiledSIMDSize = 32U;
|
||||
execEnvTokInl.CompiledSIMD32 = 1U;
|
||||
execEnvTokInl.UseBindlessMode = NEO::ApiSpecificConfig::getBindlessConfiguration();
|
||||
execEnvTokInl.UseBindlessMode = NEO::ApiSpecificConfig::getBindlessMode();
|
||||
headerTokInl.PatchListSize = sizeof(execEnvTokInl);
|
||||
ret.decodeStatus = NEO::DecodeError::Success;
|
||||
ret.name = "test_kernel";
|
||||
|
||||
@@ -40,10 +40,10 @@ bool ApiSpecificConfig::isStatelessCompressionSupported() {
|
||||
bool ApiSpecificConfig::isBcsSplitWaSupported() {
|
||||
return false;
|
||||
}
|
||||
bool ApiSpecificConfig::getHeapConfiguration() {
|
||||
bool ApiSpecificConfig::getGlobalBindlessHeapConfiguration() {
|
||||
return DebugManager.flags.UseExternalAllocatorForSshAndDsh.get();
|
||||
}
|
||||
bool ApiSpecificConfig::getBindlessConfiguration() {
|
||||
bool ApiSpecificConfig::getBindlessMode() {
|
||||
if (DebugManager.flags.UseBindlessMode.get() != -1) {
|
||||
return DebugManager.flags.UseBindlessMode.get();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user