mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Clean not used methods from linear stream.
Change-Id: Ib6775e346eb1a971c9ad5bc511c4226f1c53ecaf
This commit is contained in:
@ -112,47 +112,4 @@ TEST_F(LinearStreamTest, givenNewGraphicsAllocationWhenReplaceIsCalledThenLinear
|
||||
EXPECT_NE(&newGraphicsAllocation, graphicsAllocation);
|
||||
linearStream.replaceGraphicsAllocation(&newGraphicsAllocation);
|
||||
EXPECT_EQ(&newGraphicsAllocation, linearStream.getGraphicsAllocation());
|
||||
}
|
||||
|
||||
TEST_F(LinearStreamTest, givenGraphicsAllocationWithGpuBaseAddressWhenItIsUsedInLinearStreamThenGetGpuBaseReturnsGraphicsAllocationBase) {
|
||||
auto graphicsAllocation = linearStream.getGraphicsAllocation();
|
||||
EXPECT_NE(nullptr, graphicsAllocation);
|
||||
auto address = (void *)0x100000;
|
||||
uint64_t gpuAddress = 0x1000001;
|
||||
uint64_t gpuHeapBase = 0x1000000;
|
||||
|
||||
GraphicsAllocation newGraphicsAllocation(address, gpuAddress, gpuHeapBase, 4096);
|
||||
linearStream.replaceGraphicsAllocation(&newGraphicsAllocation);
|
||||
|
||||
EXPECT_EQ(gpuHeapBase, linearStream.getGpuBase());
|
||||
}
|
||||
|
||||
TEST_F(LinearStreamTest, givenGraphicsAllocationWithGpuBaseAddressWhenItIsQueriedForOffsetFromBaseThenProperOffsetIsReturned) {
|
||||
auto graphicsAllocation = linearStream.getGraphicsAllocation();
|
||||
EXPECT_NE(nullptr, graphicsAllocation);
|
||||
auto address = (void *)0x100000;
|
||||
uint64_t gpuAddress = 0x1000001;
|
||||
uint64_t gpuHeapBase = 0x1000000;
|
||||
|
||||
GraphicsAllocation newGraphicsAllocation(address, gpuAddress, gpuHeapBase, 4096);
|
||||
linearStream.replaceGraphicsAllocation(&newGraphicsAllocation);
|
||||
|
||||
EXPECT_EQ(gpuHeapBase, linearStream.getGpuBase());
|
||||
}
|
||||
|
||||
TEST_F(LinearStreamTest, given32BitHeapWhenItIsAskedForGpuoffsetThenOffsetFromBaseIsReturned) {
|
||||
auto allocationSize = 4096;
|
||||
std::unique_ptr<char> memoryPtr(new char[allocationSize]);
|
||||
uint64_t gpuHeapBase = 0x1000000;
|
||||
uint64_t gpuAddress = 0x1000017;
|
||||
|
||||
auto currentOffset = gpuAddress - gpuHeapBase;
|
||||
|
||||
GraphicsAllocation newGraphicsAllocation(memoryPtr.get(), gpuAddress, gpuHeapBase, allocationSize);
|
||||
linearStream.replaceGraphicsAllocation(&newGraphicsAllocation);
|
||||
|
||||
EXPECT_EQ(linearStream.getCurrentGpuOffsetFromHeapBase(), currentOffset);
|
||||
linearStream.getSpace(10);
|
||||
currentOffset += 10;
|
||||
EXPECT_EQ(linearStream.getCurrentGpuOffsetFromHeapBase(), currentOffset);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user