Disable compression for multi root device mem objects
Related-To: NEO-3691 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
parent
2cca41aeb2
commit
1673738dc7
|
@ -1,10 +1,11 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2018-2020 Intel Corporation
|
* Copyright (C) 2018-2021 Intel Corporation
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: MIT
|
* SPDX-License-Identifier: MIT
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "opencl/source/context/context.h"
|
||||||
#include "opencl/source/mem_obj/mem_obj_helper_common.inl"
|
#include "opencl/source/mem_obj/mem_obj_helper_common.inl"
|
||||||
|
|
||||||
#include "memory_properties_flags.h"
|
#include "memory_properties_flags.h"
|
||||||
|
@ -12,6 +13,9 @@
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|
||||||
bool MemObjHelper::isSuitableForRenderCompression(bool renderCompressed, const MemoryProperties &properties, Context &context, bool preferCompression) {
|
bool MemObjHelper::isSuitableForRenderCompression(bool renderCompressed, const MemoryProperties &properties, Context &context, bool preferCompression) {
|
||||||
|
if (context.getRootDeviceIndices().size() > 1u) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return renderCompressed && preferCompression;
|
return renderCompressed && preferCompression;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,3 +155,10 @@ TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertie
|
||||||
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, imageWithAccessFlagsUnrestricted.get(), context));
|
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(memoryProperties, flags, 0, imageWithAccessFlagsUnrestricted.get(), context));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(MemObjHelper, givenContextWithMultipleRootDevicesWhenIsSuitableForRenderCompressionIsCalledThenFalseIsReturned) {
|
||||||
|
MockDefaultContext context;
|
||||||
|
|
||||||
|
MemoryProperties memoryProperties = MemoryPropertiesHelper::createMemoryProperties(0, 0, 0, &context.pRootDevice0->getDevice());
|
||||||
|
EXPECT_FALSE(MemObjHelper::isSuitableForRenderCompression(true, memoryProperties, context, true));
|
||||||
|
}
|
Loading…
Reference in New Issue