From d536a019d17fe434815e0ba57adfe2eb1c376323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Petit?= Date: Fri, 3 May 2019 01:16:31 +0800 Subject: [PATCH] Bugfix for Khronos Bug 16242. (#261) Use convert_int_rte for the result of the sqrt instead of casting to int. Fixes possible rounding issues. --- 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 51a7b718..12577801 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, (int)sqrt((float)i*i) / i);" + NL, " atomic_add(res+tid, convert_int_rte(sqrt((float)i*i) / i));" NL, " }" NL, "}" NL, ""