@@ -491,9 +491,10 @@ TEST_F(ProgramDataTest, GivenProgramWith32bitPointerOptWhenProgramScopeConstantB
491491 constantSurfaceStorage[1 ] = sentinel;
492492
493493 programInfo.globalConstants .initData = constantSurface.mockGfxAllocation .getUnderlyingBuffer ();
494+ programInfo.globalConstants .size = constantSurface.mockGfxAllocation .getUnderlyingBufferSize ();
494495
495496 pProgram->setLinkerInput (pClDevice->getRootDeviceIndex (), std::move (programInfo.linkerInput ));
496- pProgram->linkBinary (&pClDevice->getDevice (), programInfo.globalConstants .initData , programInfo.globalVariables .initData , {}, prog->externalFunctions );
497+ pProgram->linkBinary (&pClDevice->getDevice (), programInfo.globalConstants .initData , programInfo.globalConstants . size , programInfo. globalVariables .initData , programInfo. globalVariables . size , {}, prog->externalFunctions );
497498 uint32_t expectedAddr = static_cast <uint32_t >(constantSurface.getGraphicsAllocation (pClDevice->getRootDeviceIndex ())->getGpuAddressToPatch ());
498499 EXPECT_EQ (expectedAddr, constantSurfaceStorage[0 ]);
499500 EXPECT_EQ (sentinel, constantSurfaceStorage[1 ]);
@@ -537,9 +538,10 @@ TEST_F(ProgramDataTest, GivenProgramWith32bitPointerOptWhenProgramScopeGlobalPoi
537538 globalSurfaceStorage[1 ] = sentinel;
538539
539540 programInfo.globalVariables .initData = globalSurface.mockGfxAllocation .getUnderlyingBuffer ();
541+ programInfo.globalVariables .size = globalSurface.mockGfxAllocation .getUnderlyingBufferSize ();
540542
541543 pProgram->setLinkerInput (pClDevice->getRootDeviceIndex (), std::move (programInfo.linkerInput ));
542- pProgram->linkBinary (&pClDevice->getDevice (), programInfo.globalConstants .initData , programInfo.globalVariables .initData , {}, prog->externalFunctions );
544+ pProgram->linkBinary (&pClDevice->getDevice (), programInfo.globalConstants .initData , programInfo.globalConstants . size , programInfo. globalVariables .initData , programInfo. globalVariables . size , {}, prog->externalFunctions );
543545 uint32_t expectedAddr = static_cast <uint32_t >(globalSurface.getGraphicsAllocation (pClDevice->getRootDeviceIndex ())->getGpuAddressToPatch ());
544546 EXPECT_EQ (expectedAddr, globalSurfaceStorage[0 ]);
545547 EXPECT_EQ (sentinel, globalSurfaceStorage[1 ]);
@@ -566,7 +568,7 @@ TEST(ProgramLinkBinaryTest, whenLinkerInputEmptyThenLinkSuccessful) {
566568 auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get ()));
567569 MockProgram program{nullptr , false , toClDeviceVector (*device)};
568570 program.setLinkerInput (device->getRootDeviceIndex (), std::move (linkerInput));
569- auto ret = program.linkBinary (&device->getDevice (), nullptr , nullptr , {}, program.externalFunctions );
571+ auto ret = program.linkBinary (&device->getDevice (), nullptr , 0 , nullptr , 0 , {}, program.externalFunctions );
570572 EXPECT_EQ (CL_SUCCESS, ret);
571573}
572574
@@ -592,7 +594,7 @@ TEST(ProgramLinkBinaryTest, whenLinkerUnresolvedExternalThenLinkFailedAndBuildLo
592594
593595 std::string buildLog = program.getBuildLog (device->getRootDeviceIndex ());
594596 EXPECT_TRUE (buildLog.empty ());
595- auto ret = program.linkBinary (&device->getDevice (), nullptr , nullptr , {}, program.externalFunctions );
597+ auto ret = program.linkBinary (&device->getDevice (), nullptr , 0 , nullptr , 0 , {}, program.externalFunctions );
596598 EXPECT_NE (CL_SUCCESS, ret);
597599 program.getKernelInfoArray (rootDeviceIndex).clear ();
598600 buildLog = program.getBuildLog (rootDeviceIndex);
@@ -640,7 +642,7 @@ TEST_F(ProgramDataTest, whenLinkerInputValidThenIsaIsProperlyPatched) {
640642 buildInfo.globalSurface = new MockGraphicsAllocation (globalVariablesBuffer.data (), globalVariablesBuffer.size ());
641643 buildInfo.constantSurface = new MockGraphicsAllocation (globalConstantsBuffer.data (), globalConstantsBuffer.size ());
642644
643- auto ret = program.linkBinary (&pClDevice->getDevice (), globalConstantsInitData.data (), globalVariablesInitData.data (), {}, program.externalFunctions );
645+ auto ret = program.linkBinary (&pClDevice->getDevice (), globalConstantsInitData.data (), globalConstantsInitData. size (), globalVariablesInitData.data (), globalVariablesInitData. size (), {}, program.externalFunctions );
644646 EXPECT_EQ (CL_SUCCESS, ret);
645647
646648 linkerInput.reset (static_cast <WhiteBox<LinkerInput> *>(buildInfo.linkerInput .release ()));
@@ -688,7 +690,7 @@ TEST_F(ProgramDataTest, whenRelocationsAreNotNeededThenIsaIsPreserved) {
688690 buildInfo.globalSurface = new MockGraphicsAllocation (globalVariablesBuffer.data (), globalVariablesBuffer.size ());
689691 buildInfo.constantSurface = new MockGraphicsAllocation (globalConstantsBuffer.data (), globalConstantsBuffer.size ());
690692
691- auto ret = program.linkBinary (&pClDevice->getDevice (), globalConstantsInitData.data (), globalVariablesInitData.data (), {}, program.externalFunctions );
693+ auto ret = program.linkBinary (&pClDevice->getDevice (), globalConstantsInitData.data (), globalConstantsInitData. size (), globalVariablesInitData.data (), globalVariablesInitData. size (), {}, program.externalFunctions );
692694 EXPECT_EQ (CL_SUCCESS, ret);
693695 EXPECT_EQ (kernelHeapData, kernelHeap);
694696
@@ -729,7 +731,7 @@ TEST(ProgramStringSectionTest, WhenConstStringBufferIsPresentThenUseItForLinking
729731 const char constStringData[] = " Hello World!\n " ;
730732 auto stringsAddr = reinterpret_cast <uintptr_t >(constStringData);
731733
732- auto ret = program.linkBinary (&device->getDevice (), nullptr , nullptr , {constStringData, sizeof (constStringData)}, program.externalFunctions );
734+ auto ret = program.linkBinary (&device->getDevice (), nullptr , 0 , nullptr , 0 , {constStringData, sizeof (constStringData)}, program.externalFunctions );
733735 EXPECT_EQ (CL_SUCCESS, ret);
734736 EXPECT_EQ (static_cast <size_t >(stringsAddr), *reinterpret_cast <size_t *>(patchAddr));
735737
@@ -754,7 +756,7 @@ TEST(ProgramImplicitArgsTest, givenImplicitRelocationAndStackCallsThenKernelRequ
754756 linkerInput->textRelocations .push_back ({{implicitArgsRelocationSymbolName, 0x8 , LinkerInput::RelocationInfo::Type::AddressLow, SegmentType::Instructions}});
755757 linkerInput->traits .requiresPatchingOfInstructionSegments = true ;
756758 program.setLinkerInput (rootDeviceIndex, std::move (linkerInput));
757- auto ret = program.linkBinary (&device->getDevice (), nullptr , nullptr , {}, program.externalFunctions );
759+ auto ret = program.linkBinary (&device->getDevice (), nullptr , 0 , nullptr , 0 , {}, program.externalFunctions );
758760 EXPECT_EQ (CL_SUCCESS, ret);
759761
760762 EXPECT_TRUE (kernelInfo.kernelDescriptor .kernelAttributes .flags .requiresImplicitArgs );
@@ -786,7 +788,7 @@ TEST(ProgramImplicitArgsTest, givenImplicitRelocationAndEnabledDebuggerThenKerne
786788 linkerInput->textRelocations .push_back ({{implicitArgsRelocationSymbolName, 0x8 , LinkerInput::RelocationInfo::Type::AddressLow, SegmentType::Instructions}});
787789 linkerInput->traits .requiresPatchingOfInstructionSegments = true ;
788790 program.setLinkerInput (rootDeviceIndex, std::move (linkerInput));
789- auto ret = program.linkBinary (&device->getDevice (), nullptr , nullptr , {}, program.externalFunctions );
791+ auto ret = program.linkBinary (&device->getDevice (), nullptr , 0 , nullptr , 0 , {}, program.externalFunctions );
790792 EXPECT_EQ (CL_SUCCESS, ret);
791793
792794 EXPECT_TRUE (kernelInfo.kernelDescriptor .kernelAttributes .flags .requiresImplicitArgs );
@@ -812,7 +814,7 @@ TEST(ProgramImplicitArgsTest, givenImplicitRelocationAndNoStackCallsAndDisabledD
812814 linkerInput->textRelocations .push_back ({{implicitArgsRelocationSymbolName, 0x8 , LinkerInput::RelocationInfo::Type::AddressLow, SegmentType::Instructions}});
813815 linkerInput->traits .requiresPatchingOfInstructionSegments = true ;
814816 program.setLinkerInput (rootDeviceIndex, std::move (linkerInput));
815- auto ret = program.linkBinary (&device->getDevice (), nullptr , nullptr , {}, program.externalFunctions );
817+ auto ret = program.linkBinary (&device->getDevice (), nullptr , 0 , nullptr , 0 , {}, program.externalFunctions );
816818 EXPECT_EQ (CL_SUCCESS, ret);
817819
818820 EXPECT_FALSE (kernelInfo.kernelDescriptor .kernelAttributes .flags .requiresImplicitArgs );
0 commit comments