mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-23 20:11:42 +08:00
- fill AllocationData in one place - remove allocateGraphicsMemoryForSVM function - refactor SVM manager tests Change-Id: I6f4ecd70503da8031cced50ea98a54162fd8e5d3 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
25 lines
931 B
C++
25 lines
931 B
C++
/*
|
|
* 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(MockAllocationProperties{false, 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
|