From 0066daf495effa0f5fc785ac3ed8e0b86c1325ec Mon Sep 17 00:00:00 2001 From: "Mrozek, Michal" Date: Fri, 19 Jan 2018 10:55:36 +0100 Subject: [PATCH] Add support for deletion of allocations that may be in use by GPU. - fix deletion of constant program surface - fix deletion of global program surface - move program_data tests to shared code - make program_data tests SKU agnostic Change-Id: Icf3e9fd035416072699336c4f86e49703ef48cc5 --- runtime/kernel/kernel.cpp | 6 +- runtime/memory_manager/memory_manager.cpp | 9 ++ runtime/memory_manager/memory_manager.h | 2 + runtime/program/program.cpp | 6 +- .../fixtures/memory_manager_fixture.cpp | 2 +- unit_tests/fixtures/memory_manager_fixture.h | 1 + unit_tests/gen9/CMakeLists.txt | 1 - .../memory_manager/memory_manager_tests.cpp | 36 ++++- unit_tests/mocks/mock_device.cpp | 2 +- unit_tests/program/CMakeLists.txt | 1 + .../program_data_tests.cpp} | 127 +++++++++++------- 11 files changed, 130 insertions(+), 63 deletions(-) rename unit_tests/{gen9/program_data_tests_gen9.cpp => program/program_data_tests.cpp} (86%) diff --git a/runtime/kernel/kernel.cpp b/runtime/kernel/kernel.cpp index 9491e0aa15..21786293aa 100644 --- a/runtime/kernel/kernel.cpp +++ b/runtime/kernel/kernel.cpp @@ -114,11 +114,7 @@ Kernel::~Kernel() { crossThreadDataSize = 0; if (privateSurface) { - if (privateSurface->taskCount == ObjectNotUsed || privateSurface->taskCount <= *device.getTagAddress()) { - device.getMemoryManager()->freeGraphicsMemory(privateSurface); - } else { - device.getMemoryManager()->storeAllocation(std::unique_ptr(privateSurface), TEMPORARY_ALLOCATION); - } + device.getMemoryManager()->checkGpuUsageAndDestroyGraphicsAllocations(privateSurface); privateSurface = nullptr; } diff --git a/runtime/memory_manager/memory_manager.cpp b/runtime/memory_manager/memory_manager.cpp index b90ba5903c..992f186c0e 100644 --- a/runtime/memory_manager/memory_manager.cpp +++ b/runtime/memory_manager/memory_manager.cpp @@ -253,6 +253,15 @@ void MemoryManager::clearEvictionAllocations() { void MemoryManager::freeGraphicsMemory(GraphicsAllocation *gfxAllocation) { freeGraphicsMemoryImpl(gfxAllocation); } +//if not in use destroy in place +//if in use pass to temporary allocation list that is cleaned on blocking calls +void MemoryManager::checkGpuUsageAndDestroyGraphicsAllocations(GraphicsAllocation *gfxAllocation) { + if (gfxAllocation->taskCount == ObjectNotUsed || gfxAllocation->taskCount <= *csr->getTagAddress()) { + freeGraphicsMemory(gfxAllocation); + } else { + storeAllocation(std::unique_ptr(gfxAllocation), TEMPORARY_ALLOCATION); + } +} void MemoryManager::waitForDeletions() { if (deferredDeleter) { diff --git a/runtime/memory_manager/memory_manager.h b/runtime/memory_manager/memory_manager.h index 66690176e8..1a9c6fbe55 100644 --- a/runtime/memory_manager/memory_manager.h +++ b/runtime/memory_manager/memory_manager.h @@ -123,6 +123,8 @@ class MemoryManager { void freeGraphicsMemory(GraphicsAllocation *gfxAllocation); + void checkGpuUsageAndDestroyGraphicsAllocations(GraphicsAllocation *gfxAllocation); + void freeGmm(GraphicsAllocation *gfxAllocation); virtual uint64_t getSystemSharedMemory() = 0; diff --git a/runtime/program/program.cpp b/runtime/program/program.cpp index 72d2f5b7e6..a898890a61 100644 --- a/runtime/program/program.cpp +++ b/runtime/program/program.cpp @@ -120,14 +120,12 @@ Program::~Program() { delete blockKernelManager; if (constantSurface) { - auto memoryManager = pDevice->getMemoryManager(); - memoryManager->freeGraphicsMemory(constantSurface); + pDevice->getMemoryManager()->checkGpuUsageAndDestroyGraphicsAllocations(constantSurface); constantSurface = nullptr; } if (globalSurface) { - auto memoryManager = pDevice->getMemoryManager(); - memoryManager->freeGraphicsMemory(globalSurface); + pDevice->getMemoryManager()->checkGpuUsageAndDestroyGraphicsAllocations(globalSurface); globalSurface = nullptr; } } diff --git a/unit_tests/fixtures/memory_manager_fixture.cpp b/unit_tests/fixtures/memory_manager_fixture.cpp index d47027caa7..955d4a51a5 100644 --- a/unit_tests/fixtures/memory_manager_fixture.cpp +++ b/unit_tests/fixtures/memory_manager_fixture.cpp @@ -33,7 +33,7 @@ void MemoryManagerWithCsrFixture::SetUp() { ON_CALL(*gmockMemoryManager, cleanAllocationList(::testing::_, ::testing::_)).WillByDefault(::testing::Invoke(gmockMemoryManager, &GMockMemoryManager::MemoryManagerCleanAllocationList)); - csr.tagAddress = &taskCount; + csr.tagAddress = ¤tGpuTag; memoryManager->csr = &csr; } diff --git a/unit_tests/fixtures/memory_manager_fixture.h b/unit_tests/fixtures/memory_manager_fixture.h index af095705b8..9c4d525ccf 100644 --- a/unit_tests/fixtures/memory_manager_fixture.h +++ b/unit_tests/fixtures/memory_manager_fixture.h @@ -36,6 +36,7 @@ class MemoryManagerWithCsrFixture { GMockMemoryManager *gmockMemoryManager; MockCommandStreamReceiver csr; uint32_t taskCount = 0; + uint32_t currentGpuTag = initialHardwareTag; MemoryManagerWithCsrFixture() { } diff --git a/unit_tests/gen9/CMakeLists.txt b/unit_tests/gen9/CMakeLists.txt index e86772f970..1625fc0f0b 100644 --- a/unit_tests/gen9/CMakeLists.txt +++ b/unit_tests/gen9/CMakeLists.txt @@ -26,7 +26,6 @@ set(IGDRCL_SRCS_tests_gen9 ${CMAKE_CURRENT_SOURCE_DIR}/enqueue_media_kernel.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gen_cmd_parse.h ${CMAKE_CURRENT_SOURCE_DIR}/hw_helper_tests.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/program_data_tests_gen9.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_device_caps.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_device_queue_hw.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_platform_caps.cpp diff --git a/unit_tests/memory_manager/memory_manager_tests.cpp b/unit_tests/memory_manager/memory_manager_tests.cpp index 9d2a279574..608cc213ab 100644 --- a/unit_tests/memory_manager/memory_manager_tests.cpp +++ b/unit_tests/memory_manager/memory_manager_tests.cpp @@ -1295,7 +1295,7 @@ TEST_F(MemoryManagerWithCsrTest, checkAllocationsForOverlappingWithBiggerOverlap memoryManager->storeAllocation(std::unique_ptr(graphicsAllocation1), TEMPORARY_ALLOCATION, taskCountReady); // All fragments ready for release - taskCount = 1; + currentGpuTag = 1; csr.latestSentTaskCount = taskCountReady - 1; AllocationRequirements requirements; @@ -1351,7 +1351,7 @@ TEST_F(MemoryManagerWithCsrTest, checkAllocationsForOverlappingWithBiggerOverlap memoryManager->storeAllocation(std::unique_ptr(graphicsAllocation1), TEMPORARY_ALLOCATION, taskCountReady); // All fragments ready for release - taskCount = taskCountReady - 1; + currentGpuTag = taskCountReady - 1; csr.latestSentTaskCount = taskCountReady - 1; AllocationRequirements requirements; @@ -1384,3 +1384,35 @@ TEST_F(MemoryManagerWithCsrTest, checkAllocationsForOverlappingWithBiggerOverlap EXPECT_EQ(nullptr, checkedFragments.fragments[i]); } } +TEST_F(MemoryManagerWithCsrTest, givenAllocationThatWasNotUsedWhencheckGpuUsageAndDestroyGraphicsAllocationsIsCalledThenItIsDestroyedInPlace) { + auto notUsedAllocation = memoryManager->allocateGraphicsMemory(4096); + memoryManager->checkGpuUsageAndDestroyGraphicsAllocations(notUsedAllocation); + EXPECT_TRUE(memoryManager->graphicsAllocations.peekIsEmpty()); +} + +TEST_F(MemoryManagerWithCsrTest, givenAllocationThatWasUsedAndIsCompletedWhencheckGpuUsageAndDestroyGraphicsAllocationsIsCalledThenItIsDestroyedInPlace) { + auto usedAllocationButGpuCompleted = memoryManager->allocateGraphicsMemory(4096); + + auto tagAddress = memoryManager->csr->getTagAddress(); + ASSERT_NE(0u, *tagAddress); + + usedAllocationButGpuCompleted->taskCount = *tagAddress - 1; + + memoryManager->checkGpuUsageAndDestroyGraphicsAllocations(usedAllocationButGpuCompleted); + EXPECT_TRUE(memoryManager->graphicsAllocations.peekIsEmpty()); +} + +TEST_F(MemoryManagerWithCsrTest, givenAllocationThatWasUsedAndIsNotCompletedWhencheckGpuUsageAndDestroyGraphicsAllocationsIsCalledThenItIsAddedToTemporaryAllocationList) { + auto usedAllocationAndNotGpuCompleted = memoryManager->allocateGraphicsMemory(4096); + + auto tagAddress = memoryManager->csr->getTagAddress(); + + usedAllocationAndNotGpuCompleted->taskCount = *tagAddress + 1; + + memoryManager->checkGpuUsageAndDestroyGraphicsAllocations(usedAllocationAndNotGpuCompleted); + EXPECT_FALSE(memoryManager->graphicsAllocations.peekIsEmpty()); + EXPECT_EQ(memoryManager->graphicsAllocations.peekHead(), usedAllocationAndNotGpuCompleted); + + //change task count so cleanup will not clear alloc in use + usedAllocationAndNotGpuCompleted->taskCount = ObjectNotUsed; +} diff --git a/unit_tests/mocks/mock_device.cpp b/unit_tests/mocks/mock_device.cpp index 19a43937cc..1c1d069880 100644 --- a/unit_tests/mocks/mock_device.cpp +++ b/unit_tests/mocks/mock_device.cpp @@ -61,7 +61,7 @@ void MockDevice::injectMemoryManager(MockMemoryManager *memoryManager) { this->memoryManager->freeGraphicsMemory(tagAllocation); tagAllocation = memoryManager->allocateGraphicsMemory(sizeof(uint32_t), sizeof(uint32_t)); auto pTagMemory = reinterpret_cast(tagAllocation->getUnderlyingBuffer()); - *pTagMemory = -1; + *pTagMemory = initialHardwareTag; tagAddress = pTagMemory; commandStreamReceiver->setMemoryManager(memoryManager); commandStreamReceiver->setTagAllocation(tagAllocation); diff --git a/unit_tests/program/CMakeLists.txt b/unit_tests/program/CMakeLists.txt index b49e33c7c5..8e7310bbeb 100644 --- a/unit_tests/program/CMakeLists.txt +++ b/unit_tests/program/CMakeLists.txt @@ -29,6 +29,7 @@ set(IGDRCL_SRCS_tests_program ${CMAKE_CURRENT_SOURCE_DIR}/printf_handler_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/process_elf_binary_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/process_spir_binary_tests.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/program_data_tests.cpp ${CMAKE_CURRENT_SOURCE_DIR}/program_from_binary.h ${CMAKE_CURRENT_SOURCE_DIR}/program_with_source.h ${CMAKE_CURRENT_SOURCE_DIR}/program_with_block_kernels_tests.cpp diff --git a/unit_tests/gen9/program_data_tests_gen9.cpp b/unit_tests/program/program_data_tests.cpp similarity index 86% rename from unit_tests/gen9/program_data_tests_gen9.cpp rename to unit_tests/program/program_data_tests.cpp index f4260c93e4..5d2286bd6e 100644 --- a/unit_tests/gen9/program_data_tests_gen9.cpp +++ b/unit_tests/program/program_data_tests.cpp @@ -35,6 +35,7 @@ using namespace OCLRT; using namespace iOpenCL; static const char constValue[] = "11223344"; +static const char globalValue[] = "55667788"; class ProgramDataTest : public testing::Test, public ContextFixture, @@ -88,24 +89,47 @@ class ProgramDataTest : public testing::Test, allocateConstMemorySurface.ConstantBufferIndex = 0; allocateConstMemorySurface.InlineDataSize = static_cast(constSize); - pAllocateConstMemorySurface = new cl_char[allocateConstMemorySurface.Size]; + pAllocateConstMemorySurface.reset(new cl_char[allocateConstMemorySurface.Size]); - memcpy_s(pAllocateConstMemorySurface, + memcpy_s(pAllocateConstMemorySurface.get(), sizeof(SPatchAllocateConstantMemorySurfaceProgramBinaryInfo), &allocateConstMemorySurface, sizeof(SPatchAllocateConstantMemorySurfaceProgramBinaryInfo)); - memcpy_s((cl_char *)pAllocateConstMemorySurface + sizeof(allocateConstMemorySurface), constSize, constValue, constSize); + memcpy_s((cl_char *)pAllocateConstMemorySurface.get() + sizeof(allocateConstMemorySurface), constSize, constValue, constSize); - pProgramPatchList = (void *)pAllocateConstMemorySurface; + pProgramPatchList = (void *)pAllocateConstMemorySurface.get(); programPatchListSize = allocateConstMemorySurface.Size; return constSize; } - void cleanConstAllocation() { - delete[] pAllocateConstMemorySurface; - } - cl_char *pAllocateConstMemorySurface; + size_t setupGlobalAllocation() { + size_t globalSize = strlen(globalValue) + 1; + + EXPECT_EQ(nullptr, pProgram->getGlobalSurface()); + + SPatchAllocateGlobalMemorySurfaceProgramBinaryInfo allocateGlobalMemorySurface; + allocateGlobalMemorySurface.Token = PATCH_TOKEN_ALLOCATE_GLOBAL_MEMORY_SURFACE_PROGRAM_BINARY_INFO; + allocateGlobalMemorySurface.Size = static_cast(sizeof(SPatchAllocateGlobalMemorySurfaceProgramBinaryInfo) + globalSize); + + allocateGlobalMemorySurface.GlobalBufferIndex = 0; + allocateGlobalMemorySurface.InlineDataSize = static_cast(globalSize); + + pAllocateGlobalMemorySurface.reset(new cl_char[allocateGlobalMemorySurface.Size]); + + memcpy_s(pAllocateGlobalMemorySurface.get(), + sizeof(SPatchAllocateGlobalMemorySurfaceProgramBinaryInfo), + &allocateGlobalMemorySurface, + sizeof(SPatchAllocateGlobalMemorySurfaceProgramBinaryInfo)); + + memcpy_s((cl_char *)pAllocateGlobalMemorySurface.get() + sizeof(allocateGlobalMemorySurface), globalSize, globalValue, globalSize); + + pProgramPatchList = pAllocateGlobalMemorySurface.get(); + programPatchListSize = allocateGlobalMemorySurface.Size; + return globalSize; + } + std::unique_ptr pAllocateConstMemorySurface; + std::unique_ptr pAllocateGlobalMemorySurface; char *pCurPtr; SProgramBinaryHeader programBinaryHeader; void *pProgramPatchList; @@ -118,7 +142,7 @@ void ProgramDataTest::buildAndDecodeProgramPatchList() { cl_int error = CL_SUCCESS; programBinaryHeader.Magic = 0x494E5443; programBinaryHeader.Version = CURRENT_ICBE_VERSION; - programBinaryHeader.Device = IGFX_GEN9_CORE; + programBinaryHeader.Device = platformDevices[0]->pPlatform->eRenderCoreFamily; programBinaryHeader.GPUPointerSizeInBytes = 8; programBinaryHeader.NumberOfKernels = 0; programBinaryHeader.PatchListSize = programPatchListSize; @@ -146,11 +170,11 @@ void ProgramDataTest::buildAndDecodeProgramPatchList() { delete[] pProgramData; } -GEN9TEST_F(ProgramDataTest, EmptyProgramBinaryHeader) { +TEST_F(ProgramDataTest, EmptyProgramBinaryHeader) { buildAndDecodeProgramPatchList(); } -GEN9TEST_F(ProgramDataTest, AllocateConstantMemorySurfaceProgramBinaryInfo) { +TEST_F(ProgramDataTest, AllocateConstantMemorySurfaceProgramBinaryInfo) { auto constSize = setupConstantAllocation(); @@ -158,11 +182,44 @@ GEN9TEST_F(ProgramDataTest, AllocateConstantMemorySurfaceProgramBinaryInfo) { EXPECT_NE(nullptr, pProgram->getConstantSurface()); EXPECT_EQ(0, memcmp(constValue, reinterpret_cast(pProgram->getConstantSurface()->getUnderlyingBuffer()), constSize)); - - cleanConstAllocation(); } -GEN9TEST_F(ProgramDataTest, GivenDeviceForcing32BitMessagesWhenConstAllocationIsPresentInProgramBinariesThen32BitStorageIsAllocated) { +TEST_F(ProgramDataTest, givenConstantAllocationThatIsInUseByGpuWhenProgramIsBeingDestroyedThenItIsAddedToTemporaryAllocationList) { + + setupConstantAllocation(); + + buildAndDecodeProgramPatchList(); + + auto tagAddress = pProgram->getDevice(0).getTagAddress(); + auto constantSurface = pProgram->getConstantSurface(); + constantSurface->taskCount = *tagAddress + 1; + + auto memoryManager = pProgram->getDevice(0).getMemoryManager(); + EXPECT_TRUE(memoryManager->graphicsAllocations.peekIsEmpty()); + delete pProgram; + pProgram = nullptr; + EXPECT_FALSE(memoryManager->graphicsAllocations.peekIsEmpty()); + EXPECT_EQ(constantSurface, memoryManager->graphicsAllocations.peekHead()); +} + +TEST_F(ProgramDataTest, givenGlobalAllocationThatIsInUseByGpuWhenProgramIsBeingDestroyedThenItIsAddedToTemporaryAllocationList) { + setupGlobalAllocation(); + + buildAndDecodeProgramPatchList(); + + auto tagAddress = pProgram->getDevice(0).getTagAddress(); + auto globalSurface = pProgram->getGlobalSurface(); + globalSurface->taskCount = *tagAddress + 1; + + auto memoryManager = pProgram->getDevice(0).getMemoryManager(); + EXPECT_TRUE(memoryManager->graphicsAllocations.peekIsEmpty()); + delete pProgram; + pProgram = nullptr; + EXPECT_FALSE(memoryManager->graphicsAllocations.peekIsEmpty()); + EXPECT_EQ(globalSurface, memoryManager->graphicsAllocations.peekHead()); +} + +TEST_F(ProgramDataTest, GivenDeviceForcing32BitMessagesWhenConstAllocationIsPresentInProgramBinariesThen32BitStorageIsAllocated) { auto constSize = setupConstantAllocation(); this->pContext->getDevice(0)->getMemoryManager()->setForce32BitAllocations(true); @@ -173,44 +230,16 @@ GEN9TEST_F(ProgramDataTest, GivenDeviceForcing32BitMessagesWhenConstAllocationIs if (is64bit) EXPECT_TRUE(pProgram->getConstantSurface()->is32BitAllocation); - - cleanConstAllocation(); } -GEN9TEST_F(ProgramDataTest, AllocateGlobalMemorySurfaceProgramBinaryInfo) { - char globalValue[] = "55667788"; - size_t globalSize = strlen(globalValue) + 1; - - EXPECT_EQ(nullptr, pProgram->getGlobalSurface()); - - SPatchAllocateGlobalMemorySurfaceProgramBinaryInfo allocateGlobalMemorySurface; - allocateGlobalMemorySurface.Token = PATCH_TOKEN_ALLOCATE_GLOBAL_MEMORY_SURFACE_PROGRAM_BINARY_INFO; - allocateGlobalMemorySurface.Size = static_cast(sizeof(SPatchAllocateGlobalMemorySurfaceProgramBinaryInfo) + globalSize); - - allocateGlobalMemorySurface.GlobalBufferIndex = 0; - allocateGlobalMemorySurface.InlineDataSize = static_cast(globalSize); - - cl_char *pAllocateGlobalMemorySurface = new cl_char[allocateGlobalMemorySurface.Size]; - - memcpy_s(pAllocateGlobalMemorySurface, - sizeof(SPatchAllocateGlobalMemorySurfaceProgramBinaryInfo), - &allocateGlobalMemorySurface, - sizeof(SPatchAllocateGlobalMemorySurfaceProgramBinaryInfo)); - - memcpy_s((cl_char *)pAllocateGlobalMemorySurface + sizeof(allocateGlobalMemorySurface), globalSize, globalValue, globalSize); - - pProgramPatchList = (void *)pAllocateGlobalMemorySurface; - programPatchListSize = allocateGlobalMemorySurface.Size; - +TEST_F(ProgramDataTest, AllocateGlobalMemorySurfaceProgramBinaryInfo) { + auto globalSize = setupGlobalAllocation(); buildAndDecodeProgramPatchList(); - EXPECT_NE(nullptr, pProgram->getGlobalSurface()); EXPECT_EQ(0, memcmp(globalValue, reinterpret_cast(pProgram->getGlobalSurface()->getUnderlyingBuffer()), globalSize)); - - delete[] pAllocateGlobalMemorySurface; } -GEN9TEST_F(ProgramDataTest, GlobalPointerProgramBinaryInfo) { +TEST_F(ProgramDataTest, GlobalPointerProgramBinaryInfo) { char globalValue; char *pGlobalPointerValue = &globalValue; size_t globalPointerSize = sizeof(pGlobalPointerValue); @@ -363,7 +392,7 @@ GEN9TEST_F(ProgramDataTest, GlobalPointerProgramBinaryInfo) { delete[] pGlobalPointer; } -GEN9TEST_F(ProgramDataTest, Given32BitDeviceWhenGlobalMemorySurfaceIsPresentThenItHas32BitStorage) { +TEST_F(ProgramDataTest, Given32BitDeviceWhenGlobalMemorySurfaceIsPresentThenItHas32BitStorage) { char globalValue[] = "55667788"; size_t globalSize = strlen(globalValue) + 1; this->pContext->getDevice(0)->getMemoryManager()->setForce32BitAllocations(true); @@ -398,7 +427,7 @@ GEN9TEST_F(ProgramDataTest, Given32BitDeviceWhenGlobalMemorySurfaceIsPresentThen delete[] pAllocateGlobalMemorySurface; } -GEN9TEST_F(ProgramDataTest, ConstantPointerProgramBinaryInfo) { +TEST_F(ProgramDataTest, ConstantPointerProgramBinaryInfo) { const char *pConstantData = "01234567"; size_t constantDataLen = strlen(pConstantData); @@ -570,7 +599,7 @@ GEN9TEST_F(ProgramDataTest, ConstantPointerProgramBinaryInfo) { delete[] pConstantPointer; } -GEN9TEST_F(ProgramDataTest, GivenProgramWith32bitPointerOptWhenProgramScopeConstantBufferPatchTokensAreReadThenConstantPointerOffsetIsPatchedWith32bitPointer) { +TEST_F(ProgramDataTest, GivenProgramWith32bitPointerOptWhenProgramScopeConstantBufferPatchTokensAreReadThenConstantPointerOffsetIsPatchedWith32bitPointer) { cl_device_id device = pPlatform->getDevice(0); CreateProgramWithSource(pContext, &device, "CopyBuffer_simd8.cl"); ASSERT_NE(nullptr, pProgram); @@ -612,7 +641,7 @@ GEN9TEST_F(ProgramDataTest, GivenProgramWith32bitPointerOptWhenProgramScopeConst prog->setConstantSurface(nullptr); } -GEN9TEST_F(ProgramDataTest, GivenProgramWith32bitPointerOptWhenProgramScopeGlobalPointerPatchTokensAreReadThenGlobalPointerOffsetIsPatchedWith32bitPointer) { +TEST_F(ProgramDataTest, GivenProgramWith32bitPointerOptWhenProgramScopeGlobalPointerPatchTokensAreReadThenGlobalPointerOffsetIsPatchedWith32bitPointer) { cl_device_id device = pPlatform->getDevice(0); CreateProgramWithSource(pContext, &device, "CopyBuffer_simd8.cl"); ASSERT_NE(nullptr, pProgram);