Files
compute-runtime/runtime/helpers/dispatch_info.cpp
Mateusz Jablonski 27f3f8ea8f Pass private scratch size to scratch space controller
Related-To: NEO-3190

Change-Id: I6f1e71481679492516d898226de6a1e721896e81
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2019-06-28 14:32:06 +02:00

40 lines
1.1 KiB
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/helpers/dispatch_info.h"
#include "runtime/kernel/kernel.h"
namespace NEO {
bool DispatchInfo::usesSlm() const {
return (kernel == nullptr) ? false : kernel->slmTotalSize > 0;
}
bool DispatchInfo::usesStatelessPrintfSurface() const {
return (kernel == nullptr) ? false : (kernel->getKernelInfo().patchInfo.pAllocateStatelessPrintfSurface != nullptr);
}
uint32_t DispatchInfo::getRequiredScratchSize() const {
return (kernel == nullptr) ? 0 : kernel->getScratchSize();
}
uint32_t DispatchInfo::getRequiredPrivateScratchSize() const {
return (kernel == nullptr) ? 0 : kernel->getPrivateScratchSize();
}
Kernel *MultiDispatchInfo::peekMainKernel() const {
if (dispatchInfos.size() == 0) {
return nullptr;
}
return mainKernel ? mainKernel : dispatchInfos.begin()->getKernel();
}
Kernel *MultiDispatchInfo::peekParentKernel() const {
return (mainKernel && mainKernel->isParentKernel) ? mainKernel : nullptr;
}
} // namespace NEO