mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
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:

committed by
Compute-Runtime-Automation

parent
2cca41aeb2
commit
1673738dc7
@ -1,10 +1,11 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/context/context.h"
|
||||
#include "opencl/source/mem_obj/mem_obj_helper_common.inl"
|
||||
|
||||
#include "memory_properties_flags.h"
|
||||
@ -12,6 +13,9 @@
|
||||
namespace NEO {
|
||||
|
||||
bool MemObjHelper::isSuitableForRenderCompression(bool renderCompressed, const MemoryProperties &properties, Context &context, bool preferCompression) {
|
||||
if (context.getRootDeviceIndices().size() > 1u) {
|
||||
return false;
|
||||
}
|
||||
return renderCompressed && preferCompression;
|
||||
}
|
||||
|
||||
|
@ -155,3 +155,10 @@ TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertie
|
||||
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));
|
||||
}
|
Reference in New Issue
Block a user