diff --git a/test_conformance/math_brute_force/binary_double.cpp b/test_conformance/math_brute_force/binary_double.cpp index e51327df..cc46ebd3 100644 --- a/test_conformance/math_brute_force/binary_double.cpp +++ b/test_conformance/math_brute_force/binary_double.cpp @@ -636,12 +636,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) for (j = 0; j < buffer_elements; j++) r[j] = (cl_double)func.f_ff(s[j], s2[j]); - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_ulong *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -651,16 +652,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) } } - // Wait for the last buffer - out[j] = (cl_ulong *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, - buffer_size, 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - goto exit; - } - // Verify data t = (cl_ulong *)r; for (j = 0; j < buffer_elements; j++) diff --git a/test_conformance/math_brute_force/binary_float.cpp b/test_conformance/math_brute_force/binary_float.cpp index 5a37a407..6bea0c9a 100644 --- a/test_conformance/math_brute_force/binary_float.cpp +++ b/test_conformance/math_brute_force/binary_float.cpp @@ -684,12 +684,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) if (isFDim && ftz) RestoreFPState(&oldMode); - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_uint *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -699,16 +700,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) } } - // Wait for the last buffer - out[j] = (cl_uint *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, buffer_size, - 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - goto exit; - } - if (!skipVerification) { // Verify data diff --git a/test_conformance/math_brute_force/binary_i_double.cpp b/test_conformance/math_brute_force/binary_i_double.cpp index c3c3eb13..7e19b243 100644 --- a/test_conformance/math_brute_force/binary_i_double.cpp +++ b/test_conformance/math_brute_force/binary_i_double.cpp @@ -635,12 +635,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) for (j = 0; j < buffer_elements; j++) r[j] = (cl_double)func.f_fi(s[j], s2[j]); - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_ulong *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -650,16 +651,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) } } - // Wait for the last buffer - out[j] = (cl_ulong *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, - buffer_size, 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - goto exit; - } - // Verify data t = (cl_ulong *)r; for (j = 0; j < buffer_elements; j++) diff --git a/test_conformance/math_brute_force/binary_i_float.cpp b/test_conformance/math_brute_force/binary_i_float.cpp index 93cb910b..08790c9d 100644 --- a/test_conformance/math_brute_force/binary_i_float.cpp +++ b/test_conformance/math_brute_force/binary_i_float.cpp @@ -627,12 +627,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) s2 = (cl_int *)gIn2 + thread_id * buffer_elements; for (j = 0; j < buffer_elements; j++) r[j] = (float)func.f_fi(s[j], s2[j]); - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_uint *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -642,16 +643,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) } } - // Wait for the last buffer - out[j] = (cl_uint *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, buffer_size, - 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - goto exit; - } - // Verify data t = (cl_uint *)r; for (j = 0; j < buffer_elements; j++) diff --git a/test_conformance/math_brute_force/binary_operator_double.cpp b/test_conformance/math_brute_force/binary_operator_double.cpp index 09540b03..dc1edf96 100644 --- a/test_conformance/math_brute_force/binary_operator_double.cpp +++ b/test_conformance/math_brute_force/binary_operator_double.cpp @@ -629,12 +629,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) for (j = 0; j < buffer_elements; j++) r[j] = (cl_double)func.f_ff(s[j], s2[j]); - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_ulong *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -644,16 +645,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) } } - // Wait for the last buffer - out[j] = (cl_ulong *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, - buffer_size, 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - goto exit; - } - // Verify data t = (cl_ulong *)r; for (j = 0; j < buffer_elements; j++) diff --git a/test_conformance/math_brute_force/binary_operator_float.cpp b/test_conformance/math_brute_force/binary_operator_float.cpp index a59be163..bc037654 100644 --- a/test_conformance/math_brute_force/binary_operator_float.cpp +++ b/test_conformance/math_brute_force/binary_operator_float.cpp @@ -674,12 +674,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) if (ftz) RestoreFPState(&oldMode); - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_uint *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -689,16 +690,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) } } - // Wait for the last buffer - out[j] = (cl_uint *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, buffer_size, - 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - goto exit; - } - // Verify data t = (cl_uint *)r; for (j = 0; j < buffer_elements; j++) diff --git a/test_conformance/math_brute_force/macro_binary_double.cpp b/test_conformance/math_brute_force/macro_binary_double.cpp index 7c40a18b..4085bbd5 100644 --- a/test_conformance/math_brute_force/macro_binary_double.cpp +++ b/test_conformance/math_brute_force/macro_binary_double.cpp @@ -596,13 +596,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) s2 = (cl_double *)gIn2 + thread_id * buffer_elements; for (j = 0; j < buffer_elements; j++) r[j] = dfunc.i_ff(s[j], s2[j]); - - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_long *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -612,16 +612,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) } } - // Wait for the last buffer - out[j] = (cl_long *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, buffer_size, - 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - goto exit; - } - // Verify data t = (cl_long *)r; for (j = 0; j < buffer_elements; j++) diff --git a/test_conformance/math_brute_force/macro_binary_float.cpp b/test_conformance/math_brute_force/macro_binary_float.cpp index 12c14dc5..7c51895a 100644 --- a/test_conformance/math_brute_force/macro_binary_float.cpp +++ b/test_conformance/math_brute_force/macro_binary_float.cpp @@ -589,13 +589,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) s2 = (float *)gIn2 + thread_id * buffer_elements; for (j = 0; j < buffer_elements; j++) r[j] = func.i_ff(s[j], s2[j]); - - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_int *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -605,16 +605,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) } } - // Wait for the last buffer - out[j] = (cl_int *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, buffer_size, - 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - goto exit; - } - // Verify data t = (cl_int *)r; for (j = 0; j < buffer_elements; j++) diff --git a/test_conformance/math_brute_force/macro_unary_double.cpp b/test_conformance/math_brute_force/macro_unary_double.cpp index 4fadbfc3..d2501e22 100644 --- a/test_conformance/math_brute_force/macro_unary_double.cpp +++ b/test_conformance/math_brute_force/macro_unary_double.cpp @@ -413,12 +413,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) cl_double *s = (cl_double *)p; for (j = 0; j < buffer_elements; j++) r[j] = dfunc.i_f(s[j]); - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_long *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -428,16 +429,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) } } - // Wait for the last buffer - out[j] = (cl_long *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, buffer_size, - 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - return error; - } - // Verify data cl_long *t = (cl_long *)r; for (j = 0; j < buffer_elements; j++) diff --git a/test_conformance/math_brute_force/macro_unary_float.cpp b/test_conformance/math_brute_force/macro_unary_float.cpp index 4e72748a..94a315d0 100644 --- a/test_conformance/math_brute_force/macro_unary_float.cpp +++ b/test_conformance/math_brute_force/macro_unary_float.cpp @@ -416,12 +416,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) float *s = (float *)p; for (j = 0; j < buffer_elements; j++) r[j] = ref_func(s[j]); - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_int *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -431,16 +432,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) } } - // Wait for the last buffer - out[j] = (cl_int *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, buffer_size, - 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - return error; - } - // Verify data cl_int *t = (cl_int *)r; for (j = 0; j < buffer_elements; j++) diff --git a/test_conformance/math_brute_force/unary_double.cpp b/test_conformance/math_brute_force/unary_double.cpp index 3dc1548c..3b2fe473 100644 --- a/test_conformance/math_brute_force/unary_double.cpp +++ b/test_conformance/math_brute_force/unary_double.cpp @@ -436,12 +436,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) cl_double *s = (cl_double *)p; for (j = 0; j < buffer_elements; j++) r[j] = (cl_double)func.f_f(s[j]); - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_ulong *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -450,16 +451,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) return error; } } - // Wait for the last buffer - out[j] = (cl_ulong *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, - buffer_size, 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - return error; - } - // Verify data cl_ulong *t = (cl_ulong *)r; diff --git a/test_conformance/math_brute_force/unary_float.cpp b/test_conformance/math_brute_force/unary_float.cpp index 73365d19..83d5e807 100644 --- a/test_conformance/math_brute_force/unary_float.cpp +++ b/test_conformance/math_brute_force/unary_float.cpp @@ -491,12 +491,13 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) float *s = (float *)p; for (j = 0; j < buffer_elements; j++) r[j] = (float)func.f_f(s[j]); - // Read the data back -- no need to wait for the first N-1 buffers. This is - // an in order queue. - for (j = gMinVectorSizeIndex; j + 1 < gMaxVectorSizeIndex; j++) + // Read the data back -- no need to wait for the first N-1 buffers but wait + // for the last buffer. This is an in order queue. + for (j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++) { + cl_bool blocking = (j + 1 < gMaxVectorSizeIndex) ? CL_FALSE : CL_TRUE; out[j] = (cl_uint *)clEnqueueMapBuffer( - tinfo->tQueue, tinfo->outBuf[j], CL_FALSE, CL_MAP_READ, 0, + tinfo->tQueue, tinfo->outBuf[j], blocking, CL_MAP_READ, 0, buffer_size, 0, NULL, NULL, &error); if (error || NULL == out[j]) { @@ -506,16 +507,6 @@ static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data) } } - // Wait for the last buffer - out[j] = (uint32_t *)clEnqueueMapBuffer(tinfo->tQueue, tinfo->outBuf[j], - CL_TRUE, CL_MAP_READ, 0, - buffer_size, 0, NULL, NULL, &error); - if (error || NULL == out[j]) - { - vlog_error("Error: clEnqueueMapBuffer %d failed! err: %d\n", j, error); - return error; - } - // Verify data uint32_t *t = (uint32_t *)r; for (j = 0; j < buffer_elements; j++)