From 282f4fb544d406386899f9bf52d125f636851caf Mon Sep 17 00:00:00 2001 From: PRZEMYSLAW_WISNIEWSKI Date: Mon, 19 Jun 2023 13:22:19 +0200 Subject: [PATCH] fix for warning in svm test file --- tests/test_openclhpp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_openclhpp.cpp b/tests/test_openclhpp.cpp index 5efbd43b..e770cee1 100644 --- a/tests/test_openclhpp.cpp +++ b/tests/test_openclhpp.cpp @@ -4194,14 +4194,14 @@ void testEnqueueReleaseExternalMemObjects(void) {} #endif // cl_khr_external_memory /**************************************************************************** - * Tests for allocate and deallocate API (clSVMAlloc, clSVMFree, clEnqueueSVMMap) + * Tests for allocate and deallocate API (stubs for clSVMAlloc, clSVMFree, clEnqueueSVMMap) ****************************************************************************/ int *testMemory; void *clSVMAllocARM_stubForMemoryAllocation(cl_context context,cl_svm_mem_flags flags, size_t size, cl_uint alignment, int cmock_num_calls) { TEST_ASSERT_EQUAL_HEX(size, 3 * sizeof(int)); - testMemory = new int[3]; + testMemory = new int[size / sizeof(int)]; return testMemory; } cl_int clEnqueueSVMMap_stubForMemoryAllocation(cl_command_queue command_queue, cl_bool blocking_map, cl_map_flags flags, void* svm_ptr, size_t size, cl_uint num_events_in_wait_list, const cl_event* event_wait_list, cl_event* event, int cmock_num_calls) @@ -4214,10 +4214,10 @@ void clSVMFree_stubForMemoryAllocation(cl_context context, void *svm_pointer, int cmock_num_calls) { TEST_ASSERT_EQUAL_PTR(svm_pointer, testMemory); - delete svm_pointer; + delete (int*) svm_pointer; } void testSVMMemoryAllocation() -{ +{// #if CL_HPP_TARGET_OPENCL_VERSION >= 200 cl::SVMAllocator> svmAllocator;