Disable generation of kernel with kernel-debug-enable flag

- generation temporarily disabled for gen8 platforms only
- unit tests using the pregenerated kernel modified accordingly

Change-Id: I304a796836c823d222e60c44a78fc7f4b03b8a73
This commit is contained in:
Hoppe, Mateusz
2018-03-20 14:54:13 +01:00
committed by sys_ocldev
parent 37443c19a2
commit 1e81426599
2 changed files with 39 additions and 25 deletions

View File

@ -77,40 +77,46 @@ class ProgramWithKernelDebuggingTest : public ProgramSimpleFixture,
};
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsCompiledThenInternalOptionsIncludeDebugFlag) {
std::string receivedInternalOptions;
if (pDevice->getHardwareInfo().pPlatform->eRenderCoreFamily >= IGFX_GEN9_CORE) {
std::string receivedInternalOptions;
auto debugVars = OCLRT::getFclDebugVars();
debugVars.receivedInternalOptionsOutput = &receivedInternalOptions;
gEnvironment->fclPushDebugVars(debugVars);
auto debugVars = OCLRT::getFclDebugVars();
debugVars.receivedInternalOptionsOutput = &receivedInternalOptions;
gEnvironment->fclPushDebugVars(debugVars);
cl_int retVal = pProgram->compile(1, &device, nullptr,
0, nullptr, nullptr,
nullptr,
nullptr);
EXPECT_EQ(CL_SUCCESS, retVal);
cl_int retVal = pProgram->compile(1, &device, nullptr,
0, nullptr, nullptr,
nullptr,
nullptr);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_THAT(receivedInternalOptions, ::testing::HasSubstr(CompilerOptions::debugKernelEnable));
gEnvironment->fclPopDebugVars();
EXPECT_THAT(receivedInternalOptions, ::testing::HasSubstr(CompilerOptions::debugKernelEnable));
gEnvironment->fclPopDebugVars();
}
}
TEST_F(ProgramWithKernelDebuggingTest, givenEnabledKernelDebugWhenProgramIsBuiltThenInternalOptionsIncludeDebugFlag) {
std::string receivedInternalOptions;
if (pDevice->getHardwareInfo().pPlatform->eRenderCoreFamily >= IGFX_GEN9_CORE) {
std::string receivedInternalOptions;
auto debugVars = OCLRT::getFclDebugVars();
debugVars.receivedInternalOptionsOutput = &receivedInternalOptions;
gEnvironment->fclPushDebugVars(debugVars);
auto debugVars = OCLRT::getFclDebugVars();
debugVars.receivedInternalOptionsOutput = &receivedInternalOptions;
gEnvironment->fclPushDebugVars(debugVars);
cl_int retVal = pProgram->build(1, &device, nullptr, nullptr, nullptr, false);
EXPECT_EQ(CL_SUCCESS, retVal);
cl_int retVal = pProgram->build(1, &device, nullptr, nullptr, nullptr, false);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_THAT(receivedInternalOptions, ::testing::HasSubstr(CompilerOptions::debugKernelEnable));
gEnvironment->fclPopDebugVars();
EXPECT_THAT(receivedInternalOptions, ::testing::HasSubstr(CompilerOptions::debugKernelEnable));
gEnvironment->fclPopDebugVars();
}
}
TEST_F(ProgramWithKernelDebuggingTest, givenProgramWithKernelDebugEnabledWhenBuiltThenPatchTokenAllocateSipSurfaceHasSizeGreaterThanZero) {
retVal = pProgram->build(1, &device, CompilerOptions::debugKernelEnable, nullptr, nullptr, false);
EXPECT_EQ(CL_SUCCESS, retVal);
if (pDevice->getHardwareInfo().pPlatform->eRenderCoreFamily >= IGFX_GEN9_CORE) {
retVal = pProgram->build(1, &device, CompilerOptions::debugKernelEnable, nullptr, nullptr, false);
EXPECT_EQ(CL_SUCCESS, retVal);
auto kernelInfo = pProgram->getKernelInfo("CopyBuffer");
EXPECT_NE(0u, kernelInfo->patchInfo.pAllocateSystemThreadSurface->PerThreadSystemThreadSurfaceSize);
auto kernelInfo = pProgram->getKernelInfo("CopyBuffer");
EXPECT_NE(0u, kernelInfo->patchInfo.pAllocateSystemThreadSurface->PerThreadSystemThreadSurfaceSize);
}
}