mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Simplify getAllocationProperties
Change-Id: I006337ec700e50259c46be1fd73fde34562c8b83 Related-To: NEO-2535 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
068a8d7189
commit
ddcd3fbbed
@ -135,3 +135,27 @@ TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertie
|
||||
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(properties, imageWithAccessFlagsUnrestricted.get()));
|
||||
}
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenDifferentParametersWhenCallingFillCachePolicyInPropertiesThenFlushL3FlagsAreCorrectlySet) {
|
||||
AllocationProperties allocationProperties{0, GraphicsAllocation::AllocationType::BUFFER};
|
||||
|
||||
for (auto uncached : ::testing::Bool()) {
|
||||
for (auto readOnly : ::testing::Bool()) {
|
||||
for (auto deviceOnlyVisibilty : ::testing::Bool()) {
|
||||
if (uncached || readOnly || deviceOnlyVisibilty) {
|
||||
allocationProperties.flags.flushL3RequiredForRead = true;
|
||||
allocationProperties.flags.flushL3RequiredForWrite = true;
|
||||
MemObjHelper::fillCachePolicyInProperties(allocationProperties, uncached, readOnly, deviceOnlyVisibilty);
|
||||
EXPECT_FALSE(allocationProperties.flags.flushL3RequiredForRead);
|
||||
EXPECT_FALSE(allocationProperties.flags.flushL3RequiredForWrite);
|
||||
} else {
|
||||
allocationProperties.flags.flushL3RequiredForRead = false;
|
||||
allocationProperties.flags.flushL3RequiredForWrite = false;
|
||||
MemObjHelper::fillCachePolicyInProperties(allocationProperties, uncached, readOnly, deviceOnlyVisibilty);
|
||||
EXPECT_TRUE(allocationProperties.flags.flushL3RequiredForRead);
|
||||
EXPECT_TRUE(allocationProperties.flags.flushL3RequiredForWrite);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user