2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2020-02-22 16:28:27 +08:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/helpers/dispatch_info.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/kernel/kernel.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
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();
|
|
|
|
}
|
2018-08-16 21:47:25 +08:00
|
|
|
|
2019-06-28 15:37:04 +08:00
|
|
|
uint32_t DispatchInfo::getRequiredPrivateScratchSize() const {
|
|
|
|
return (kernel == nullptr) ? 0 : kernel->getPrivateScratchSize();
|
|
|
|
}
|
|
|
|
|
2018-08-16 21:47:25 +08:00
|
|
|
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;
|
|
|
|
}
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|