mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
[26/n] Internal 4GB allocator.
- change the way we handle blocked commands. - instead of allocating CPU pointer and populating it with commands, create real IndirectHeap that may be later submitted to the GPU - that removes a lot of copy operations that were happening on submit time - for device enqueue, this requires dsh & shh to be passed directly to the underlying commands, in that scenario device queue buffers are not used Change-Id: I1124a8edbb46777ea7f7d3a5946f302e7fdf9665
This commit is contained in:
committed by
sys_ocldev
parent
100f559daa
commit
ffa9b097f5
@@ -616,6 +616,33 @@ TEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWhenGetIndirectHeapIsCalle
|
||||
EXPECT_EQ(GraphicsAllocation::ALLOCATION_TYPE_LINEAR_STREAM, indirectHeapAllocation->getAllocationType());
|
||||
}
|
||||
|
||||
TEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWhenGetHeapMemoryIsCalledThenHeapIsCreated) {
|
||||
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
|
||||
CommandQueue cmdQ(&context, pDevice, props);
|
||||
|
||||
IndirectHeap *indirectHeap = nullptr;
|
||||
cmdQ.allocateHeapMemory(this->GetParam(), 100, indirectHeap);
|
||||
EXPECT_NE(nullptr, indirectHeap);
|
||||
EXPECT_NE(nullptr, indirectHeap->getGraphicsAllocation());
|
||||
|
||||
pDevice->getMemoryManager()->freeGraphicsMemory(indirectHeap->getGraphicsAllocation());
|
||||
delete indirectHeap;
|
||||
}
|
||||
|
||||
TEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWhenGetHeapMemoryIsCalledWithAlreadyAllocatedHeapThenGraphicsAllocationIsCreated) {
|
||||
const cl_queue_properties props[3] = {CL_QUEUE_PROPERTIES, 0, 0};
|
||||
CommandQueue cmdQ(&context, pDevice, props);
|
||||
|
||||
IndirectHeap heap(nullptr, 100);
|
||||
|
||||
IndirectHeap *indirectHeap = &heap;
|
||||
cmdQ.allocateHeapMemory(this->GetParam(), 100, indirectHeap);
|
||||
EXPECT_EQ(&heap, indirectHeap);
|
||||
EXPECT_NE(nullptr, indirectHeap->getGraphicsAllocation());
|
||||
|
||||
pDevice->getMemoryManager()->freeGraphicsMemory(indirectHeap->getGraphicsAllocation());
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(
|
||||
Device,
|
||||
CommandQueueIndirectHeapTest,
|
||||
|
||||
Reference in New Issue
Block a user