performance: use simple if operation instead of std max

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2024-09-03 16:30:48 +00:00
committed by Compute-Runtime-Automation
parent a4f68c57bb
commit 11405af267

View File

@@ -131,8 +131,13 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendLaunchKernelWithParams(K
bool kernelNeedsScratchSpace = false;
if (!launchParams.makeKernelCommandView) {
for (uint32_t slotId = 0u; slotId < 2; slotId++) {
auto currentPerThreadScratchSize = std::max<uint32_t>(launchParams.externalPerThreadScratchSize[slotId], kernelDescriptor.kernelAttributes.perThreadScratchSize[slotId]);
commandListPerThreadScratchSize[slotId] = std::max<uint32_t>(commandListPerThreadScratchSize[slotId], currentPerThreadScratchSize);
auto currentPerThreadScratchSize = kernelDescriptor.kernelAttributes.perThreadScratchSize[slotId];
if (launchParams.externalPerThreadScratchSize[slotId] > currentPerThreadScratchSize) {
currentPerThreadScratchSize = launchParams.externalPerThreadScratchSize[slotId];
}
if (currentPerThreadScratchSize > commandListPerThreadScratchSize[slotId]) {
commandListPerThreadScratchSize[slotId] = currentPerThreadScratchSize;
}
if (commandListPerThreadScratchSize[slotId] > 0) {
needScratchSpace = true;
}