From 30500fba06973115cab6333d96d2b75d53476daa Mon Sep 17 00:00:00 2001 From: Sreelakshmi Haridas Maruthur Date: Tue, 27 Sep 2022 10:28:57 -0600 Subject: [PATCH] SVM: Fix memory allocation size. (#1514) * SVM: Fix memory allocation size. 9ad48998 generally made memory allocation and mapping consistent with a size of size_t. Apply that fix to the final two allocations. * check-format fixes Co-authored-by: spauls --- test_conformance/SVM/test_cross_buffer_pointers.cpp | 3 ++- test_conformance/SVM/test_shared_sub_buffers.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test_conformance/SVM/test_cross_buffer_pointers.cpp b/test_conformance/SVM/test_cross_buffer_pointers.cpp index c1caebb9..2baa7ad7 100644 --- a/test_conformance/SVM/test_cross_buffer_pointers.cpp +++ b/test_conformance/SVM/test_cross_buffer_pointers.cpp @@ -162,7 +162,8 @@ int test_svm_cross_buffer_pointers_coarse_grain(cl_device_id deviceID, cl_contex test_error(error, "clCreateBuffer failed."); // this buffer holds the index into the nodes buffer that is used for node allocation - clMemWrapper allocator = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(cl_int), NULL, &error); + clMemWrapper allocator = clCreateBuffer(context, CL_MEM_READ_WRITE, + sizeof(size_t), NULL, &error); test_error(error, "clCreateBuffer failed."); // this buffer holds the count of correct nodes which is computed by the verify kernel. diff --git a/test_conformance/SVM/test_shared_sub_buffers.cpp b/test_conformance/SVM/test_shared_sub_buffers.cpp index a79484c9..2532886e 100644 --- a/test_conformance/SVM/test_shared_sub_buffers.cpp +++ b/test_conformance/SVM/test_shared_sub_buffers.cpp @@ -182,7 +182,8 @@ int test_svm_shared_sub_buffers(cl_device_id deviceID, cl_context context2, cl_c // this buffer holds the index into the nodes buffer that is used for node allocation - clMemWrapper allocator = clCreateBuffer(context, CL_MEM_READ_WRITE, sizeof(cl_int), NULL, &error); + clMemWrapper allocator = clCreateBuffer(context, CL_MEM_READ_WRITE, + sizeof(size_t), NULL, &error); test_error(error, "clCreateBuffer failed."); // this buffer holds the count of correct nodes which is computed by the verify kernel.