The test_closure::triangle_area and test_extrema::max_vector_length (and possibly others) expect too much precision of the OpenCL built-in length() function when calculating the lengths of vectors.
The precision of length() is defined in ULP as <= 3 + 0.5 * ((0.5 * n) + 0.5 * (n - 1)) where n is the number of vector elements. [source] For the float4s used in triangle_area, this works out to 4.75 ULP. Given the expected result is 1.0f, the actual answer should be approximately 1.0 +/- 5.7e-07 [1]. The precision expected by the test is 1.0e-6percent, or 1.0e-8.
That is, the triangle_area test can fail even on a conformant OpenCL implementation. The max_vector_length test has a similar problem.
[1] This doesn't take into account the division by 2 in the test, which introduces further error.
The
test_closure::triangle_area
andtest_extrema::max_vector_length
(and possibly others) expect too much precision of the OpenCL built-inlength()
function when calculating the lengths of vectors.The precision of
length()
is defined in ULP as<= 3 + 0.5 * ((0.5 * n) + 0.5 * (n - 1))
wheren
is the number of vector elements. [source] For thefloat4
s used intriangle_area
, this works out to 4.75 ULP. Given the expected result is1.0f
, the actual answer should be approximately1.0 +/- 5.7e-07
[1]. The precision expected by the test is1.0e-6
percent, or1.0e-8
.That is, the
triangle_area
test can fail even on a conformant OpenCL implementation. Themax_vector_length
test has a similar problem.[1] This doesn't take into account the division by 2 in the test, which introduces further error.