mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
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:
committed by
Compute-Runtime-Automation
parent
f5575a1370
commit
bac85ddb25
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user