From e61da21cd6a2088f6961b029f2f3268e499b168e Mon Sep 17 00:00:00 2001 From: Michael Rizkalla Date: Tue, 17 Dec 2024 08:30:48 +0000 Subject: [PATCH] Fix using incorrect free function in arrayimagecopy and imagearraycopy basic tests' unique_ptr (#2177) This change addresses a free function mis-match issue where `delete` is used to free memory allocated via `malloc` within `create_random_data` and in the test function. The change involves the following tests: 1. arrayimagecopy 2. arrayimagecopy3d 3. imagearraycopy 4. imagearraycopy3d This should address #2173 Signed-off-by: Michael Rizkalla --- test_conformance/basic/test_arrayimagecopy.cpp | 3 ++- test_conformance/basic/test_imagearraycopy.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test_conformance/basic/test_arrayimagecopy.cpp b/test_conformance/basic/test_arrayimagecopy.cpp index b0322ed5..91e308a0 100644 --- a/test_conformance/basic/test_arrayimagecopy.cpp +++ b/test_conformance/basic/test_arrayimagecopy.cpp @@ -37,7 +37,8 @@ int test_arrayimagecopy_single_format(cl_device_id device, cl_context context, cl_mem_object_type image_type, const cl_image_format *format) { - std::unique_ptr bufptr, imgptr; + std::unique_ptr bufptr{ nullptr, free }, + imgptr{ nullptr, free }; clMemWrapper buffer, image; int img_width = 512; int img_height = 512; diff --git a/test_conformance/basic/test_imagearraycopy.cpp b/test_conformance/basic/test_imagearraycopy.cpp index abd33236..eb784a49 100644 --- a/test_conformance/basic/test_imagearraycopy.cpp +++ b/test_conformance/basic/test_imagearraycopy.cpp @@ -37,7 +37,8 @@ int test_imagearraycopy_single_format(cl_device_id device, cl_context context, cl_mem_object_type image_type, const cl_image_format *format) { - std::unique_ptr bufptr, imgptr; + std::unique_ptr bufptr{ nullptr, free }, + imgptr{ nullptr, free }; clMemWrapper buffer, image; const int img_width = 512; const int img_height = 512;