Create printf handler if kernel has implicit args in OCL

Related-To: NEO-5081
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2021-09-17 10:33:25 +00:00
committed by Compute-Runtime-Automation
parent 5be770ab49
commit 64b2fd5b19
7 changed files with 93 additions and 38 deletions

View File

@@ -414,13 +414,24 @@ class MockKernelWithInternals {
class MockParentKernel : public Kernel {
public:
struct CreateParams {
bool addChildSimdSize = false;
bool addChildGlobalMemory = false;
bool addChildConstantMemory = false;
bool addPrintfForParent = false;
bool addPrintfForBlock = false;
};
using Kernel::auxTranslationRequired;
using Kernel::kernelInfo;
using Kernel::patchBlocksCurbeWithConstantValues;
using Kernel::pImplicitArgs;
using Kernel::pSshLocal;
using Kernel::sshLocalSize;
static MockParentKernel *create(Context &context, bool addChildSimdSize = false, bool addChildGlobalMemory = false, bool addChildConstantMemory = false, bool addPrintfForParent = true, bool addPrintfForBlock = true) {
static MockParentKernel *create(Context &context) {
CreateParams createParams{};
return create(context, createParams);
}
static MockParentKernel *create(Context &context, const CreateParams &createParams) {
auto clDevice = context.getDevice(0);
auto info = new MockKernelInfo();
@@ -441,7 +452,7 @@ class MockParentKernel : public Kernel {
info->setDeviceSideEnqueueEventPoolSurface(8, crossThreadOffset);
crossThreadOffset += 8;
if (addPrintfForParent) {
if (createParams.addPrintfForParent) {
info->setPrintfSurface(8, crossThreadOffset);
crossThreadOffset += 8;
}
@@ -450,7 +461,7 @@ class MockParentKernel : public Kernel {
deviceVector.push_back(clDevice);
MockProgram *mockProgram = new MockProgram(&context, false, deviceVector);
if (addChildSimdSize) {
if (createParams.addChildSimdSize) {
info->childrenKernelsIdOffset.push_back({0, crossThreadOffset});
}
@@ -473,17 +484,17 @@ class MockParentKernel : public Kernel {
infoBlock->setDeviceSideEnqueueEventPoolSurface(8, crossThreadOffset);
crossThreadOffsetBlock += 8;
if (addPrintfForBlock) {
if (createParams.addPrintfForBlock) {
infoBlock->setPrintfSurface(8, crossThreadOffsetBlock);
crossThreadOffsetBlock += 8;
}
if (addChildGlobalMemory) {
if (createParams.addChildGlobalMemory) {
infoBlock->setGlobalVariablesSurface(8, crossThreadOffsetBlock);
crossThreadOffsetBlock += 8;
}
if (addChildConstantMemory) {
if (createParams.addChildConstantMemory) {
infoBlock->setGlobalConstantsSurface(8, crossThreadOffsetBlock);
crossThreadOffsetBlock += 8;
}