From b763c6b07ecba4bfe09d1e5cec31968d8315fd78 Mon Sep 17 00:00:00 2001 From: Pavan K Lanka <32373903+lpavank@users.noreply.github.com> Date: Mon, 23 Sep 2019 13:01:21 -0700 Subject: [PATCH] Fix for Khronos https://github.com/KhronosGroup/OpenCL-CTS/issues/249 (#444) * Fix for Khronos https://github.com/KhronosGroup/OpenCL-CTS/issues/249 where incoming errors are overwritten by exit block * Fix for build failure that was observed in cl12_trunk with prior #249 change --- test_conformance/math_brute_force/macro_unary.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test_conformance/math_brute_force/macro_unary.c b/test_conformance/math_brute_force/macro_unary.c index 95af882a..1ebc78d2 100644 --- a/test_conformance/math_brute_force/macro_unary.c +++ b/test_conformance/math_brute_force/macro_unary.c @@ -396,6 +396,7 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) int ftz = job->ftz; cl_uint j, k; cl_int error = CL_SUCCESS; + cl_int ret = CL_SUCCESS; const char *name = job->f->name; int signbit_test = 0; @@ -564,6 +565,7 @@ static cl_int TestFloat( cl_uint job_id, cl_uint thread_id, void *data ) } exit: + ret = error; for( j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++ ) { if( (error = clEnqueueUnmapMemObject( tinfo->tQueue, tinfo->outBuf[j], out[j], 0, NULL, NULL)) ) @@ -574,7 +576,10 @@ exit: } if( (error = clFlush(tinfo->tQueue) )) + { vlog( "clFlush 3 failed\n" ); + return error; + } if( 0 == ( base & 0x0fffffff) ) @@ -589,7 +594,7 @@ exit: fflush(stdout); } - return error; + return ret; } static cl_int TestDouble( cl_uint job_id, cl_uint thread_id, void *data );