Reorder tests for Float16 vector functions
http://b/27547875
Add test for native_distance in RsTest. Also add missing tests and
re-order tests for other Float16 vector functions.
Change-Id: I0527dd5cf447aa9b31e1c73bcb555c03adc66042
diff --git a/java/tests/RsTest/src/com/android/rs/test/math_fp16.rs b/java/tests/RsTest/src/com/android/rs/test/math_fp16.rs
index 331a871..eef3a8a 100644
--- a/java/tests/RsTest/src/com/android/rs/test/math_fp16.rs
+++ b/java/tests/RsTest/src/com/android/rs/test/math_fp16.rs
@@ -88,6 +88,12 @@
h1 = fn(h3); \
h1 = fn(h4);
+#define TEST_H_FUNC_HN_HN(fn) \
+ h1 = fn(h1, h1); \
+ h1 = fn(h2, h2); \
+ h1 = fn(h3, h3); \
+ h1 = fn(h4, h4);
+
static bool testAPI() {
TEST_HN_FUNC_HN(acos);
TEST_HN_FUNC_HN(acosh);
@@ -138,7 +144,6 @@
TEST_IN_FUNC_HN(ilogb);
TEST_HN_FUNC_HN_IN(ldexp);
TEST_HN_FUNC_HN_I(ldexp);
- TEST_H_FUNC_HN(length);
TEST_HN_FUNC_HN(lgamma);
TEST_HN_FUNC_HN_PIN(lgamma);
@@ -191,7 +196,6 @@
TEST_HN_FUNC_HN(native_log1p);
TEST_HN_FUNC_HN(native_log2);
- TEST_HN_FUNC_HN(native_normalize);
TEST_HN_FUNC_HN_HN(native_powr);
TEST_HN_FUNC_HN(native_recip);
TEST_HN_FUNC_HN_IN(native_rootn);
@@ -207,7 +211,6 @@
TEST_HN_FUNC_HN(native_tanpi);
TEST_HN_FUNC_HN_HN(nextafter);
- TEST_HN_FUNC_HN(normalize);
TEST_HN_FUNC_HN_HN(pow);
TEST_HN_FUNC_HN_IN(pown);
TEST_HN_FUNC_HN_HN(powr);
@@ -241,6 +244,14 @@
// Vector math functions
h3 = cross(h3, h3);
h4 = cross(h4, h4);
+
+ TEST_H_FUNC_HN_HN(distance);
+ TEST_H_FUNC_HN_HN(dot);
+ TEST_H_FUNC_HN(length);
+ TEST_H_FUNC_HN_HN(native_distance);
+ TEST_H_FUNC_HN(native_length);
+ TEST_HN_FUNC_HN(native_normalize);
+ TEST_HN_FUNC_HN(normalize);
return true;
}