mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 17:33:00 +08:00
Move Scratch Space functionality to dedicated class
Change-Id: Ic7655c4b971513961aba6823478a139ffc943466
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
24
unit_tests/aub_tests/fixtures/aub_fixture.cpp
Normal file
24
unit_tests/aub_tests/fixtures/aub_fixture.cpp
Normal 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
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user