From 8ca1537157f6381fabb9eebb4ad5acfcb57200db Mon Sep 17 00:00:00 2001 From: julienhascoet Date: Tue, 13 Oct 2020 10:27:27 +0200 Subject: [PATCH] Fix api/test_api_min_max for Embedded profile with cles_khr_int64 support (#994) In embedded profile with cles_khr_int64 support, the test did not consider the size of long. Thus the number of argument computation was not coherent with the returned CL_DEVICE_MAX_PARAMETER_SIZE leaded to test failure. We fix this by taking the size of long when cles_khr_int64 is available in the device extension. --- test_conformance/api/test_api_min_max.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test_conformance/api/test_api_min_max.cpp b/test_conformance/api/test_api_min_max.cpp index 5f171438..cf3d26e2 100644 --- a/test_conformance/api/test_api_min_max.cpp +++ b/test_conformance/api/test_api_min_max.cpp @@ -994,6 +994,7 @@ int test_min_max_parameter_size(cl_device_id deviceID, cl_context context, cl_co size_t decrement; cl_event event; cl_int event_status; + bool embeddedNoLong = gIsEmbedded && !gHasLong; /* Get the max param size */ @@ -1007,8 +1008,9 @@ int test_min_max_parameter_size(cl_device_id deviceID, cl_context context, cl_co return -1; } - /* The embedded profile does not require longs, so use ints */ - if(gIsEmbedded) + /* The embedded profile without cles_khr_int64 extension does not require + * longs, so use ints */ + if (embeddedNoLong) numberOfIntParametersToTry = numberExpected = (maxSize-sizeof(cl_mem))/sizeof(cl_int); else numberOfIntParametersToTry = numberExpected = (maxSize-sizeof(cl_mem))/sizeof(cl_long); @@ -1024,7 +1026,7 @@ int test_min_max_parameter_size(cl_device_id deviceID, cl_context context, cl_co clMemWrapper mem; clKernelWrapper kernel; - if(gIsEmbedded) + if (embeddedNoLong) { log_info("Trying a kernel with %ld int arguments (%ld bytes) and one cl_mem (%ld bytes) for %ld bytes total.\n", numberOfIntParametersToTry, sizeof(cl_int)*numberOfIntParametersToTry, sizeof(cl_mem),