Move kernel globals from SVM to USM device

With this change, module's data sections will be allocated in USM device
pool instead of SVM or USM shared.

Signed-off-by: Luzynski, Sebastian Jozef <sebastian.jozef.luzynski@intel.com>
This commit is contained in:
Luzynski, Sebastian Jozef
2022-09-23 13:05:43 +00:00
committed by Compute-Runtime-Automation
parent f5575a1370
commit bac85ddb25
7 changed files with 54 additions and 50 deletions

View File

@@ -2178,7 +2178,7 @@ kernels:
EXPECT_NE(nullptr, moduleTuValid.programInfo.linkerInput.get());
}
TEST_F(ModuleTranslationUnitTest, WhenCreatingFromZeBinaryAndGlobalsAreExportedThenTheirAllocationTypeIsSVM) {
TEST_F(ModuleTranslationUnitTest, WhenCreatingFromZeBinaryAndGlobalsAreExportedThenTheirAllocationTypeIsUSMDevice) {
std::string zeInfo = std::string("version :\'") + versionToString(zeInfoDecoderVersion) + R"===('
kernels:
- name : kernel
@@ -2217,8 +2217,14 @@ kernels:
zebin.data(), zebin.size());
auto retVal = moduleTu.processUnpackedBinary();
EXPECT_TRUE(retVal);
EXPECT_EQ(AllocationType::SVM_ZERO_COPY, moduleTu.globalConstBuffer->getAllocationType());
EXPECT_EQ(AllocationType::SVM_ZERO_COPY, moduleTu.globalVarBuffer->getAllocationType());
EXPECT_EQ(AllocationType::BUFFER, moduleTu.globalConstBuffer->getAllocationType());
EXPECT_EQ(AllocationType::BUFFER, moduleTu.globalVarBuffer->getAllocationType());
auto svmAllocsManager = device->getDriverHandle()->getSvmAllocsManager();
auto globalConstBufferAllocType = svmAllocsManager->getSVMAlloc(reinterpret_cast<void *>(moduleTu.globalConstBuffer->getGpuAddress()))->memoryType;
auto globalVarBufferAllocType = svmAllocsManager->getSVMAlloc(reinterpret_cast<void *>(moduleTu.globalVarBuffer->getGpuAddress()))->memoryType;
EXPECT_EQ(DEVICE_UNIFIED_MEMORY, globalConstBufferAllocType);
EXPECT_EQ(DEVICE_UNIFIED_MEMORY, globalVarBufferAllocType);
}
HWTEST_F(ModuleTranslationUnitTest, WhenBuildOptionsAreNullThenReuseExistingOptions) {