Move Scratch Space functionality to dedicated class

Change-Id: Ic7655c4b971513961aba6823478a139ffc943466
This commit is contained in:
Zdanowicz, Zbigniew
2018-11-22 15:16:20 +01:00
parent a9d3575919
commit 7dbd0ea4f3
41 changed files with 934 additions and 91 deletions

View File

@@ -380,12 +380,7 @@ struct AUBSimpleArgNonUniformFixture : public KernelAUBFixture<SimpleArgNonUnifo
kernel->setArgSvm(1, sizeUserMemory, destMemory);
outBuffer = csr->getMemoryManager()->allocateGraphicsMemory(sizeUserMemory, destMemory);
csr->makeResidentHostPtrAllocation(outBuffer);
csr->getInternalAllocationStorage()->storeAllocation(std::unique_ptr<GraphicsAllocation>(outBuffer), TEMPORARY_ALLOCATION);
ASSERT_NE(nullptr, outBuffer);
outBuffer->setAllocationType(GraphicsAllocation::AllocationType::BUFFER);
outBuffer->setMemObjectsAllocationWithWritableFlags(true);
outBuffer = createHostPtrAllocationFromSvmPtr(destMemory, sizeUserMemory);
}
void initializeExpectedMemory(size_t globalX, size_t globalY, size_t globalZ) {

View File

@@ -22,7 +22,8 @@ using OCLRT::folderAUB;
std::string getAubFileName(const OCLRT::Device *pDevice, const std::string baseName) {
const auto pGtSystemInfo = pDevice->getHardwareInfo().pSysInfo;
std::stringstream strfilename;
strfilename << pDevice->getProductAbbrev() << "_" << pGtSystemInfo->SliceCount << "x" << pGtSystemInfo->SubSliceCount << "x" << pGtSystemInfo->MaxEuPerSubSlice << "_" << baseName;
uint32_t subSlicesPerSlice = pGtSystemInfo->SubSliceCount / pGtSystemInfo->SliceCount;
strfilename << pDevice->getProductAbbrev() << "_" << pGtSystemInfo->SliceCount << "x" << subSlicesPerSlice << "x" << pGtSystemInfo->MaxEuPerSubSlice << "_" << baseName;
return strfilename.str();
}

View File

@@ -6,6 +6,7 @@
target_sources(igdrcl_aub_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/aub_fixture.cpp
${CMAKE_CURRENT_SOURCE_DIR}/aub_fixture.h
${CMAKE_CURRENT_SOURCE_DIR}/aub_parent_kernel_fixture.h
${CMAKE_CURRENT_SOURCE_DIR}/fixture_tests.cpp

View File

@@ -0,0 +1,24 @@
/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/memory_manager/graphics_allocation.h"
#include "runtime/memory_manager/internal_allocation_storage.h"
#include "runtime/memory_manager/memory_manager.h"
#include "unit_tests/aub_tests/fixtures/aub_fixture.h"
namespace OCLRT {
GraphicsAllocation *AUBFixture::createHostPtrAllocationFromSvmPtr(void *svmPtr, size_t size) {
GraphicsAllocation *allocation = csr->getMemoryManager()->allocateGraphicsMemory(size, svmPtr);
csr->makeResidentHostPtrAllocation(allocation);
csr->getInternalAllocationStorage()->storeAllocation(std::unique_ptr<GraphicsAllocation>(allocation), TEMPORARY_ALLOCATION);
allocation->setAllocationType(GraphicsAllocation::AllocationType::BUFFER);
allocation->setMemObjectsAllocationWithWritableFlags(true);
return allocation;
}
} // namespace OCLRT

View File

@@ -53,6 +53,8 @@ class AUBFixture : public CommandQueueHwFixture {
CommandQueueHwFixture::TearDown();
}
GraphicsAllocation *createHostPtrAllocationFromSvmPtr(void *svmPtr, size_t size);
template <typename FamilyType>
AUBCommandStreamReceiverHw<FamilyType> *getAubCsr() {
AUBCommandStreamReceiverHw<FamilyType> *aubCsr = nullptr;