mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Adjust hostPtr size in unit test to fit image requirements
Change-Id: I061ca8f65d8a05a92dafa361a1fae58bd5e6ec53 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
ccea3f497c
commit
b09a0af97d
@@ -418,12 +418,13 @@ INSTANTIATE_TEST_CASE_P(CreateImageWithFlags,
|
||||
|
||||
TEST_P(clCreateImageValidFlags, GivenValidFlagsWhenCreatingImageThenImageIsCreatedAndSuccessReturned) {
|
||||
cl_mem_flags flags = GetParam();
|
||||
char ptr[10];
|
||||
std::unique_ptr<char[]> ptr;
|
||||
char *hostPtr = nullptr;
|
||||
|
||||
if (flags & CL_MEM_USE_HOST_PTR ||
|
||||
flags & CL_MEM_COPY_HOST_PTR) {
|
||||
hostPtr = ptr;
|
||||
ptr = std::make_unique<char[]>(alignUp(imageDesc.image_width * imageDesc.image_height * 4, MemoryConstants::pageSize));
|
||||
hostPtr = ptr.get();
|
||||
}
|
||||
|
||||
auto image = clCreateImage(
|
||||
|
||||
Reference in New Issue
Block a user