Fix for problems with uninitialized SPatchExecutionEnvironment

Change-Id: I46b1c5badc6505b8443e7c1eaca1fc56a03f0768
This commit is contained in:
Wilma, Pawel
2018-10-05 11:28:50 +02:00
committed by sys_ocldev
parent 51ecef7ec2
commit 7d93fedbab
9 changed files with 44 additions and 37 deletions

View File

@ -39,6 +39,7 @@ class DispatchInfoBuilderFixture : public ContextFixture, public DeviceFixture {
pExecutionEnvironment = new SPatchExecutionEnvironment();
pExecutionEnvironment->CompiledSIMD32 = 1;
pExecutionEnvironment->LargestCompiledSIMDSize = 32;
pExecutionEnvironment->NumGRFRequired = GrfConfig::DefaultGrfNumber;
pPrintfSurface = new SPatchAllocateStatelessPrintfSurface();

View File

@ -635,7 +635,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, KernelCommandsTest, usedBindingTableStatePointersFor
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;

View File

@ -646,7 +646,7 @@ TEST(KernelReflectionSurfaceTestSingle, ObtainKernelReflectionSurfaceWithoutKern
cl_queue_properties properties[1] = {0};
DeviceQueue devQueue(&context, device.get(), properties[0]);
SPatchExecutionEnvironment environment;
SPatchExecutionEnvironment environment = {};
environment.HasDeviceEnqueue = 1;
info.patchInfo.executionEnvironment = &environment;
@ -701,7 +701,7 @@ TEST(KernelReflectionSurfaceTestSingle, ObtainKernelReflectionSurfaceWithDeviceQ
uint32_t devQueueCurbeOffset = 16;
uint32_t devQueueCurbeSize = 4;
SPatchExecutionEnvironment environment;
SPatchExecutionEnvironment environment = {};
environment.HasDeviceEnqueue = 1;
info.patchInfo.executionEnvironment = &environment;
@ -1251,6 +1251,7 @@ class ReflectionSurfaceHelperSetKernelDataTest : public testing::TestWithParam<s
info.patchInfo.dataParameterStream = &dataParameterStream;
executionEnvironment = {};
executionEnvironment.LargestCompiledSIMDSize = 16;
executionEnvironment.HasBarriers = 1;

View File

@ -472,7 +472,7 @@ TEST_F(KernelPrivateSurfaceTest, testPrivateSurface) {
tokenDPS.DataParameterStreamSize = 64;
pKernelInfo->patchInfo.dataParameterStream = &tokenDPS;
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -513,7 +513,7 @@ TEST_F(KernelPrivateSurfaceTest, givenKernelWithPrivateSurfaceThatIsInUseByGpuWh
tokenDPS.DataParameterStreamSize = 64;
pKernelInfo->patchInfo.dataParameterStream = &tokenDPS;
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD32 = true;
pKernelInfo->patchInfo.executionEnvironment = &tokenEE;
@ -554,7 +554,7 @@ TEST_F(KernelPrivateSurfaceTest, testPrivateSurfaceAllocationFailure) {
tokenDPS.DataParameterStreamSize = 64;
pKernelInfo->patchInfo.dataParameterStream = &tokenDPS;
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -599,7 +599,7 @@ TEST_F(KernelPrivateSurfaceTest, given32BitDeviceWhenKernelIsCreatedThenPrivateS
tokenDPS.DataParameterStreamSize = 64;
pKernelInfo->patchInfo.dataParameterStream = &tokenDPS;
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -623,7 +623,7 @@ HWTEST_F(KernelPrivateSurfaceTest, givenStatefulKernelWhenKernelIsCreatedThenPri
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -678,7 +678,7 @@ TEST_F(KernelPrivateSurfaceTest, givenStatelessKernelWhenKernelIsCreatedThenPriv
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -727,6 +727,7 @@ TEST_F(KernelPrivateSurfaceTest, GivenKernelWhenPrivateSurfaceTooBigAndGpuPointe
auto pAllocateStatelessPrivateSurface = std::unique_ptr<SPatchAllocateStatelessPrivateSurface>(new SPatchAllocateStatelessPrivateSurface());
pAllocateStatelessPrivateSurface->PerThreadPrivateMemorySize = std::numeric_limits<uint32_t>::max();
auto executionEnvironment = std::unique_ptr<SPatchExecutionEnvironment>(new SPatchExecutionEnvironment());
*executionEnvironment = {};
executionEnvironment->CompiledSIMD32 = 32;
auto pKernelInfo = std::make_unique<KernelInfo>();
pKernelInfo->patchInfo.pAllocateStatelessPrivateSurface = pAllocateStatelessPrivateSurface.get();
@ -745,6 +746,7 @@ TEST_F(KernelPrivateSurfaceTest, GivenKernelWhenPrivateSurfaceTooBigAndGpuPointe
auto pAllocateStatelessPrivateSurface = std::unique_ptr<SPatchAllocateStatelessPrivateSurface>(new SPatchAllocateStatelessPrivateSurface());
pAllocateStatelessPrivateSurface->PerThreadPrivateMemorySize = std::numeric_limits<uint32_t>::max();
auto executionEnvironment = std::unique_ptr<SPatchExecutionEnvironment>(new SPatchExecutionEnvironment());
*executionEnvironment = {};
executionEnvironment->CompiledSIMD32 = 32;
auto pKernelInfo = std::make_unique<KernelInfo>();
pKernelInfo->patchInfo.pAllocateStatelessPrivateSurface = pAllocateStatelessPrivateSurface.get();
@ -763,6 +765,7 @@ TEST_F(KernelPrivateSurfaceTest, GivenKernelWhenPrivateSurfaceTooBigAndGpuPointe
auto pAllocateStatelessPrivateSurface = std::unique_ptr<SPatchAllocateStatelessPrivateSurface>(new SPatchAllocateStatelessPrivateSurface());
pAllocateStatelessPrivateSurface->PerThreadPrivateMemorySize = std::numeric_limits<uint32_t>::max();
auto executionEnvironment = std::unique_ptr<SPatchExecutionEnvironment>(new SPatchExecutionEnvironment());
*executionEnvironment = {};
executionEnvironment->CompiledSIMD32 = 32;
auto pKernelInfo = std::make_unique<KernelInfo>();
pKernelInfo->patchInfo.pAllocateStatelessPrivateSurface = pAllocateStatelessPrivateSurface.get();
@ -793,7 +796,7 @@ TEST_F(KernelGlobalSurfaceTest, givenBuiltInKernelWhenKernelIsCreatedThenGlobalS
tempSPatchDataParameterStream.DataParameterStreamSize = 16;
pKernelInfo->patchInfo.dataParameterStream = &tempSPatchDataParameterStream;
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -836,7 +839,7 @@ TEST_F(KernelGlobalSurfaceTest, givenNDRangeKernelWhenKernelIsCreatedThenGlobalS
tempSPatchDataParameterStream.DataParameterStreamSize = 16;
pKernelInfo->patchInfo.dataParameterStream = &tempSPatchDataParameterStream;
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -866,7 +869,7 @@ HWTEST_F(KernelGlobalSurfaceTest, givenStatefulKernelWhenKernelIsCreatedThenGlob
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -924,7 +927,7 @@ TEST_F(KernelGlobalSurfaceTest, givenStatelessKernelWhenKernelIsCreatedThenGloba
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -968,7 +971,7 @@ TEST_F(KernelConstantSurfaceTest, givenBuiltInKernelWhenKernelIsCreatedThenConst
tempSPatchDataParameterStream.DataParameterStreamSize = 16;
pKernelInfo->patchInfo.dataParameterStream = &tempSPatchDataParameterStream;
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1010,7 +1013,7 @@ TEST_F(KernelConstantSurfaceTest, givenNDRangeKernelWhenKernelIsCreatedThenConst
tempSPatchDataParameterStream.DataParameterStreamSize = 16;
pKernelInfo->patchInfo.dataParameterStream = &tempSPatchDataParameterStream;
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1040,7 +1043,7 @@ HWTEST_F(KernelConstantSurfaceTest, givenStatefulKernelWhenKernelIsCreatedThenCo
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1098,7 +1101,7 @@ TEST_F(KernelConstantSurfaceTest, givenStatelessKernelWhenKernelIsCreatedThenCon
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1131,7 +1134,7 @@ HWTEST_F(KernelEventPoolSurfaceTest, givenStatefulKernelWhenKernelIsCreatedThenE
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1183,7 +1186,7 @@ HWTEST_F(KernelEventPoolSurfaceTest, givenStatefulKernelWhenEventPoolIsPatchedTh
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1235,7 +1238,7 @@ HWTEST_F(KernelEventPoolSurfaceTest, givenKernelWithNullEventPoolInKernelInfoWhe
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1267,7 +1270,7 @@ TEST_F(KernelEventPoolSurfaceTest, givenStatelessKernelWhenKernelIsCreatedThenEv
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1303,7 +1306,7 @@ TEST_F(KernelEventPoolSurfaceTest, givenStatelessKernelWhenEventPoolIsPatchedThe
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1341,7 +1344,7 @@ HWTEST_F(KernelDefaultDeviceQueueSurfaceTest, givenStatefulKernelWhenKernelIsCre
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1393,7 +1396,7 @@ HWTEST_F(KernelDefaultDeviceQueueSurfaceTest, givenStatefulKernelWhenDefaultDevi
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1447,7 +1450,7 @@ TEST_F(KernelDefaultDeviceQueueSurfaceTest, givenStatelessKernelWhenKernelIsCrea
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1481,7 +1484,7 @@ TEST_F(KernelDefaultDeviceQueueSurfaceTest, givenKernelWithNullDeviceQueueKernel
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1513,7 +1516,7 @@ TEST_F(KernelDefaultDeviceQueueSurfaceTest, givenStatelessKernelWhenDefaultDevic
// define kernel info
auto pKernelInfo = std::make_unique<KernelInfo>();
SPatchExecutionEnvironment tokenEE;
SPatchExecutionEnvironment tokenEE = {};
tokenEE.CompiledSIMD8 = false;
tokenEE.CompiledSIMD16 = false;
tokenEE.CompiledSIMD32 = true;
@ -1706,7 +1709,7 @@ struct KernelExecutionEnvironmentTest : public Test<DeviceFixture> {
MockKernel *pKernel;
std::unique_ptr<MockProgram> program;
std::unique_ptr<KernelInfo> pKernelInfo;
SPatchExecutionEnvironment executionEnvironment;
SPatchExecutionEnvironment executionEnvironment = {};
};
TEST_F(KernelExecutionEnvironmentTest, getMaxSimdReturnsMaxOfAll32) {
@ -1832,7 +1835,7 @@ struct KernelCrossThreadTests : Test<DeviceFixture> {
std::unique_ptr<MockProgram> program;
std::unique_ptr<KernelInfo> pKernelInfo;
SPatchDataParameterStream patchDataParameterStream;
SPatchExecutionEnvironment executionEnvironment;
SPatchExecutionEnvironment executionEnvironment = {};
};
TEST_F(KernelCrossThreadTests, globalWorkOffset) {

View File

@ -39,7 +39,7 @@ TEST(ParentKernelTest, GetObjectCounts) {
MockDevice *device = new MockDevice(*platformDevices[0]);
MockProgram program(*device->getExecutionEnvironment());
SPatchExecutionEnvironment environment;
SPatchExecutionEnvironment environment = {};
environment.HasDeviceEnqueue = 1;
info.patchInfo.executionEnvironment = &environment;
@ -164,6 +164,7 @@ TEST(ParentKernelTest, initializeOnParentKernelAllocatesPrivateMemoryForBlocks)
infoBlock->patchInfo.threadPayload = threadPayloadBlock;
SPatchExecutionEnvironment *executionEnvironmentBlock = new SPatchExecutionEnvironment;
*executionEnvironmentBlock = {};
executionEnvironmentBlock->HasDeviceEnqueue = 1;
infoBlock->patchInfo.executionEnvironment = executionEnvironmentBlock;

View File

@ -288,8 +288,8 @@ class MockKernelWithInternals {
SKernelBinaryHeaderCommon kernelHeader;
SPatchThreadPayload threadPayload;
SPatchDataParameterStream dataParameterStream;
SPatchExecutionEnvironment executionEnvironment;
SPatchExecutionEnvironment executionEnvironmentBlock;
SPatchExecutionEnvironment executionEnvironment = {};
SPatchExecutionEnvironment executionEnvironmentBlock = {};
uint32_t kernelIsa[32];
char crossThreadData[256];
char sshLocal[128];
@ -456,6 +456,7 @@ class MockParentKernel : public Kernel {
SPatchExecutionEnvironment *executionEnvironmentBlock = new SPatchExecutionEnvironment;
executionEnvironmentBlock->HasDeviceEnqueue = 1;
executionEnvironmentBlock->NumGRFRequired = GrfConfig::DefaultGrfNumber;
infoBlock->patchInfo.executionEnvironment = executionEnvironmentBlock;
SPatchDataParameterStream *streamBlock = new SPatchDataParameterStream;

View File

@ -65,7 +65,7 @@ struct ProfilingTests : public CommandEnqueueFixture,
SKernelBinaryHeaderCommon kernelHeader;
SPatchDataParameterStream dataParameterStream;
SPatchExecutionEnvironment executionEnvironment;
SPatchExecutionEnvironment executionEnvironment = {};
SPatchThreadPayload threadPayload;
KernelInfo kernelInfo;

View File

@ -250,7 +250,7 @@ TEST_F(KernelDataTest, ThreadPayload) {
}
TEST_F(KernelDataTest, ExecutionEnvironmentNoReqdWorkGroupSize) {
iOpenCL::SPatchExecutionEnvironment executionEnvironment;
iOpenCL::SPatchExecutionEnvironment executionEnvironment = {};
executionEnvironment.Token = PATCH_TOKEN_EXECUTION_ENVIRONMENT;
executionEnvironment.Size = sizeof(SPatchExecutionEnvironment);
executionEnvironment.RequiredWorkGroupSizeX = 0;
@ -285,7 +285,7 @@ TEST_F(KernelDataTest, ExecutionEnvironmentNoReqdWorkGroupSize) {
}
TEST_F(KernelDataTest, ExecutionEnvironment) {
iOpenCL::SPatchExecutionEnvironment executionEnvironment;
iOpenCL::SPatchExecutionEnvironment executionEnvironment = {};
executionEnvironment.Token = PATCH_TOKEN_EXECUTION_ENVIRONMENT;
executionEnvironment.Size = sizeof(SPatchExecutionEnvironment);
executionEnvironment.RequiredWorkGroupSizeX = 32;
@ -321,7 +321,7 @@ TEST_F(KernelDataTest, ExecutionEnvironment) {
}
TEST_F(KernelDataTest, ExecutionEnvironmentCompiledForGreaterThan4GBBuffers) {
iOpenCL::SPatchExecutionEnvironment executionEnvironment;
iOpenCL::SPatchExecutionEnvironment executionEnvironment = {};
executionEnvironment.Token = PATCH_TOKEN_EXECUTION_ENVIRONMENT;
executionEnvironment.Size = sizeof(SPatchExecutionEnvironment);
executionEnvironment.RequiredWorkGroupSizeX = 32;

View File

@ -32,7 +32,7 @@ class MockSchedulerKernel : public SchedulerKernel {
dataParametrStream.DataParameterStreamSize = 8;
dataParametrStream.Size = 8;
SPatchExecutionEnvironment executionEnvironment;
SPatchExecutionEnvironment executionEnvironment = {};
executionEnvironment.CompiledSIMD8 = 1;
executionEnvironment.HasDeviceEnqueue = 0;