mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 21:42:53 +08:00
performance: optimize checking if ga is imported 2/2
Related-To: NEO-13163 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c5d28bf99b
commit
e1084dfdd8
@@ -220,11 +220,12 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
}
|
||||
}
|
||||
|
||||
constexpr bool checkIfImported = checkIfAllocationImportedRequired();
|
||||
bool isKernelUsingSystemAllocation = false;
|
||||
bool isKernelUsingExternalAllocation = false;
|
||||
|
||||
if (!launchParams.isBuiltInKernel) {
|
||||
auto verifyKernelUsingSystemAllocations = [&](const NEO::ResidencyContainer &kernelResidencyContainer) {
|
||||
auto verifyKernelUsingSystemAllocations = [&]<bool checkImported>(const NEO::ResidencyContainer &kernelResidencyContainer) {
|
||||
for (const auto &allocation : kernelResidencyContainer) {
|
||||
if (allocation == nullptr) {
|
||||
continue;
|
||||
@@ -235,18 +236,20 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
|
||||
isKernelUsingSystemAllocation = true;
|
||||
}
|
||||
|
||||
if constexpr (checkIfAllocationImportedRequired()) {
|
||||
if constexpr (checkImported) {
|
||||
isKernelUsingExternalAllocation = allocation->getIsImported();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
verifyKernelUsingSystemAllocations(kernel->getArgumentsResidencyContainer());
|
||||
verifyKernelUsingSystemAllocations(kernel->getInternalResidencyContainer());
|
||||
verifyKernelUsingSystemAllocations.template operator()<checkIfImported>(kernel->getArgumentsResidencyContainer());
|
||||
verifyKernelUsingSystemAllocations.template operator()<false>(kernel->getInternalResidencyContainer());
|
||||
|
||||
} else {
|
||||
isKernelUsingSystemAllocation = launchParams.isDestinationAllocationInSystemMemory;
|
||||
isKernelUsingExternalAllocation = launchParams.isDestinationAllocationImported;
|
||||
if constexpr (checkIfImported) {
|
||||
isKernelUsingExternalAllocation = launchParams.isDestinationAllocationImported;
|
||||
}
|
||||
}
|
||||
|
||||
if (kernel->hasIndirectAllocationsAllowed()) {
|
||||
|
||||
Reference in New Issue
Block a user