From 2edcc561171b2adf59109794647ccbd4618c2506 Mon Sep 17 00:00:00 2001 From: Nikhil Joshi Date: Wed, 29 May 2019 15:39:28 +0530 Subject: [PATCH] Fix test_host_queue_order not to rely on bit accurate float ops (#277) Currently, test_host_queue_order relies on bit accurate float ops. It expects expects that sqrt((float)i * i) == i. This is not always true due to floating point precision limitations. The test does not really need the sqrt operation and it can be removed instead of trying to correct the floating point check. Replace problematic float operation with constant value of 1. --- test_conformance/device_execution/host_queue_order.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_conformance/device_execution/host_queue_order.cpp b/test_conformance/device_execution/host_queue_order.cpp index 12577801..9161c3a6 100644 --- a/test_conformance/device_execution/host_queue_order.cpp +++ b/test_conformance/device_execution/host_queue_order.cpp @@ -37,7 +37,7 @@ static const char* enqueue_block_first_kernel[] = NL, " for(int i = 1 ; i < tid ; i++)" NL, " {" NL, " for(int j = 0 ; j < num ; j++)" - NL, " atomic_add(res+tid, convert_int_rte(sqrt((float)i*i) / i));" + NL, " atomic_add(res+tid, 1);" NL, " }" NL, "}" NL, ""