mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Update memory flags validation for Images
Change-Id: Ifc8b50301cd82bd7e9c83da626a02dbc1643e0b0 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
*/
|
||||
|
||||
#include "runtime/mem_obj/mem_obj_helper.h"
|
||||
#include "unit_tests/fixtures/image_fixture.h"
|
||||
#include "unit_tests/utilities/base_object_utils.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
@@ -110,3 +112,18 @@ TEST(MemObjHelper, givenInvalidPropertiesWhenValidatingMemoryPropertiesThenFalse
|
||||
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForBuffer(properties));
|
||||
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(properties, nullptr));
|
||||
}
|
||||
|
||||
TEST(MemObjHelper, givenParentMemObjAndHostPtrFlagsWhenValidatingMemoryPropertiesForImageThenFalseIsReturned) {
|
||||
MemoryProperties properties;
|
||||
MockContext context;
|
||||
auto image = clUniquePtr(Image1dHelper<>::create(&context));
|
||||
|
||||
properties.flags = CL_MEM_USE_HOST_PTR;
|
||||
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(properties, image.get()));
|
||||
|
||||
properties.flags = CL_MEM_ALLOC_HOST_PTR;
|
||||
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(properties, image.get()));
|
||||
|
||||
properties.flags = CL_MEM_COPY_HOST_PTR;
|
||||
EXPECT_FALSE(MemObjHelper::validateMemoryPropertiesForImage(properties, image.get()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user