am 9661871f: am 8d38cdd2: Merge "Projection Widget Test: Remove two unnecessary buttons" into lollipop-mr1-cts-dev
* commit '9661871f852f8498434991f93f23c90fef680eaa':
Projection Widget Test: Remove two unnecessary buttons
diff --git a/CtsBuild.mk b/CtsBuild.mk
index dbe93c7..1b12293 100644
--- a/CtsBuild.mk
+++ b/CtsBuild.mk
@@ -14,28 +14,6 @@
LOCAL_PATH := $(call my-dir)
-# Test XMLs, native executables, and packages will be placed in this
-# directory before creating the final CTS distribution.
-CTS_TESTCASES_OUT := $(HOST_OUT)/cts-testcases
-
-# Scanners of source files for tests which are then inputed into
-# the XML generator to produce test XMLs.
-CTS_NATIVE_TEST_SCANNER := $(HOST_OUT_EXECUTABLES)/cts-native-scanner
-CTS_JAVA_TEST_SCANNER := $(HOST_OUT_EXECUTABLES)/cts-java-scanner
-CTS_JAVA_TEST_SCANNER_DOCLET := $(HOST_OUT_JAVA_LIBRARIES)/cts-java-scanner-doclet.jar
-
-# Generator of test XMLs from scanner output.
-CTS_XML_GENERATOR := $(HOST_OUT_EXECUTABLES)/cts-xml-generator
-
-# File indicating which tests should be blacklisted due to problems.
-CTS_EXPECTATIONS := cts/tests/expectations/knownfailures.txt
-
-# File indicating which tests should be blacklisted due to unsupported abi.
-CTS_UNSUPPORTED_ABIS := cts/tests/expectations/unsupportedabis.txt
-
-# Holds the target architecture to build for.
-CTS_TARGET_ARCH := $(TARGET_ARCH)
-
# Functions to get the paths of the build outputs.
define cts-get-lib-paths
diff --git a/apps/CtsVerifier/jni/cameraanalyzer/Android.mk b/apps/CtsVerifier/jni/cameraanalyzer/Android.mk
index ed66992..d595a20 100644
--- a/apps/CtsVerifier/jni/cameraanalyzer/Android.mk
+++ b/apps/CtsVerifier/jni/cameraanalyzer/Android.mk
@@ -16,7 +16,7 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-include external/stlport/libstlport.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := libcameraanalyzer
@@ -31,10 +31,12 @@
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../include/colorchecker $(JNI_H_INCLUDE)
+LOCAL_CXX_STL := libc++
LOCAL_STATIC_LIBRARIES := libcolorchecker
-LOCAL_SHARED_LIBRARIES := libjnigraphics \
- libstlport \
- libcutils \
- libutils liblog
+LOCAL_SHARED_LIBRARIES := \
+ libjnigraphics \
+ libcutils \
+ libutils \
+ liblog \
include $(BUILD_SHARED_LIBRARY)
diff --git a/apps/CtsVerifier/lib/colorchecker/Android.mk b/apps/CtsVerifier/lib/colorchecker/Android.mk
index 38f595f..48f1356 100644
--- a/apps/CtsVerifier/lib/colorchecker/Android.mk
+++ b/apps/CtsVerifier/lib/colorchecker/Android.mk
@@ -19,7 +19,7 @@
# Build image analysis library
include $(CLEAR_VARS)
-include external/stlport/libstlport.mk
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libcolorchecker
@@ -35,8 +35,9 @@
whitebalancetest.cpp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../include/colorchecker
-LOCAL_SHARED_LIBRARIES := libstlport \
- libcutils \
- libutils
+LOCAL_CXX_STL := libc++
+LOCAL_SHARED_LIBRARIES := \
+ libcutils \
+ libutils \
include $(BUILD_STATIC_LIBRARY)
diff --git a/apps/CtsVerifier/lib/colorchecker/colorcheckertest.cpp b/apps/CtsVerifier/lib/colorchecker/colorcheckertest.cpp
index 46b8cc8..ef7d2c6 100644
--- a/apps/CtsVerifier/lib/colorchecker/colorcheckertest.cpp
+++ b/apps/CtsVerifier/lib/colorchecker/colorcheckertest.cpp
@@ -549,10 +549,10 @@
(pointBottomRight.x() >= mImage->getHeight()) ||
(pointBottomRight.y() < 0) ||
(pointBottomRight.y() >= mImage->getWidth()) ||
- (abs(pointUpperLeft.x() - pointBottomRight.x()) <= 5) ||
- (abs(pointUpperLeft.y() - pointBottomRight.y()) <= 5) ||
- (abs(pointUpperLeft.x() - pointBottomRight.x()) >= 30) ||
- (abs(pointUpperLeft.y() - pointBottomRight.y()) >= 30)) {
+ (std::abs(pointUpperLeft.x() - pointBottomRight.x()) <= 5) ||
+ (std::abs(pointUpperLeft.y() - pointBottomRight.y()) <= 5) ||
+ (std::abs(pointUpperLeft.x() - pointBottomRight.x()) >= 30) ||
+ (std::abs(pointUpperLeft.y() - pointBottomRight.y()) >= 30)) {
// If any of the quadrilateral corners are out of the image or if
// the distance between them are too large or too big, the quadrilateral
diff --git a/apps/CtsVerifier/lib/colorchecker/imagetesthandler.cpp b/apps/CtsVerifier/lib/colorchecker/imagetesthandler.cpp
index 1c5bc17..cc3bca9 100644
--- a/apps/CtsVerifier/lib/colorchecker/imagetesthandler.cpp
+++ b/apps/CtsVerifier/lib/colorchecker/imagetesthandler.cpp
@@ -19,6 +19,7 @@
#include <utils/Log.h>
#include <utils/Timers.h>
#include <cmath>
+#include <cstring>
#include "vec2.h"
#include "vec3.h"
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleServerService.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleServerService.java
old mode 100644
new mode 100755
diff --git a/build/config.mk b/build/config.mk
index 931220b..a836f92 100644
--- a/build/config.mk
+++ b/build/config.mk
@@ -12,6 +12,29 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+# Test XMLs, native executables, and packages will be placed in this
+# directory before creating the final CTS distribution.
+CTS_TESTCASES_OUT := $(HOST_OUT)/cts-testcases
+
+# Scanners of source files for tests which are then inputed into
+# the XML generator to produce test XMLs.
+CTS_NATIVE_TEST_SCANNER := $(HOST_OUT_EXECUTABLES)/cts-native-scanner
+CTS_JAVA_TEST_SCANNER := $(HOST_OUT_EXECUTABLES)/cts-java-scanner
+CTS_JAVA_TEST_SCANNER_DOCLET := $(HOST_OUT_JAVA_LIBRARIES)/cts-java-scanner-doclet.jar
+
+# Generator of test XMLs from scanner output.
+CTS_XML_GENERATOR := $(HOST_OUT_EXECUTABLES)/cts-xml-generator
+
+# File indicating which tests should be blacklisted due to problems.
+CTS_EXPECTATIONS := cts/tests/expectations/knownfailures.txt
+
+# File indicating which tests should be blacklisted due to unsupported abi.
+CTS_UNSUPPORTED_ABIS := cts/tests/expectations/unsupportedabis.txt
+
+# Holds the target architecture to build for.
+CTS_TARGET_ARCH := $(TARGET_ARCH)
+
+# CTS build rules
BUILD_CTS_EXECUTABLE := cts/build/test_executable.mk
BUILD_CTS_PACKAGE := cts/build/test_package.mk
BUILD_CTS_GTEST_PACKAGE := cts/build/test_gtest_package.mk
diff --git a/build/test_executable.mk b/build/test_executable.mk
index 02b3e4c..3cabdf3 100644
--- a/build/test_executable.mk
+++ b/build/test_executable.mk
@@ -23,6 +23,7 @@
# as needed by CTS.
#
+LOCAL_CXX_STL := libc++
include $(BUILD_EXECUTABLE)
cts_executable_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).xml
diff --git a/hostsidetests/security/Android.mk b/hostsidetests/security/Android.mk
index 0c976a3..d9fbc65 100644
--- a/hostsidetests/security/Android.mk
+++ b/hostsidetests/security/Android.mk
@@ -29,7 +29,15 @@
LOCAL_CTS_TEST_PACKAGE := android.host.security
-LOCAL_JAVA_RESOURCE_FILES := $(HOST_OUT_EXECUTABLES)/sepolicy-analyze
+selinux_general_seapp_contexts := $(call intermediates-dir-for,ETC,general_seapp_contexts)/general_seapp_contexts
+
+selinux_general_file_contexts := $(call intermediates-dir-for,ETC,general_file_contexts)/general_file_contexts
+
+selinux_general_property_contexts := $(call intermediates-dir-for,ETC,general_property_contexts)/general_property_contexts
+
+selinux_general_service_contexts := $(call intermediates-dir-for,ETC,general_service_contexts)/general_service_contexts
+
+LOCAL_JAVA_RESOURCE_FILES := $(HOST_OUT_EXECUTABLES)/sepolicy-analyze $(HOST_OUT_EXECUTABLES)/checkseapp $(HOST_OUT_EXECUTABLES)/checkfc $(selinux_general_seapp_contexts) $(selinux_general_file_contexts) $(selinux_general_property_contexts) $(selinux_general_service_contexts)
selinux_general_policy := $(call intermediates-dir-for,ETC,general_sepolicy.conf)/general_sepolicy.conf
diff --git a/hostsidetests/security/src/android/cts/security/SELinuxHostTest.java b/hostsidetests/security/src/android/cts/security/SELinuxHostTest.java
index c93295a..1f89abc 100644
--- a/hostsidetests/security/src/android/cts/security/SELinuxHostTest.java
+++ b/hostsidetests/security/src/android/cts/security/SELinuxHostTest.java
@@ -20,19 +20,30 @@
import com.android.ddmlib.Log;
import com.android.ddmlib.Log.LogLevel;
import com.android.tradefed.build.IBuildInfo;
+import com.android.tradefed.device.CollectingOutputReceiver;
+import com.android.tradefed.device.DeviceNotAvailableException;
import com.android.tradefed.device.ITestDevice;
import com.android.tradefed.testtype.DeviceTestCase;
import com.android.tradefed.testtype.IBuildReceiver;
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileReader;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.String;
import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import java.util.Scanner;
+import java.util.Set;
/**
* Host-side SELinux tests.
@@ -44,7 +55,17 @@
public class SELinuxHostTest extends DeviceTestCase {
private File sepolicyAnalyze;
+ private File checkSeapp;
+ private File checkFc;
+ private File aospSeappFile;
+ private File aospFcFile;
+ private File aospPcFile;
+ private File aospSvcFile;
private File devicePolicyFile;
+ private File deviceSeappFile;
+ private File deviceFcFile;
+ private File devicePcFile;
+ private File deviceSvcFile;
/**
* A reference to the device under test.
@@ -74,10 +95,44 @@
sepolicyAnalyze = copyResourceToTempFile("/sepolicy-analyze");
sepolicyAnalyze.setExecutable(true);
+ /* retrieve the checkseapp executable from jar */
+ checkSeapp = copyResourceToTempFile("/checkseapp");
+ checkSeapp.setExecutable(true);
+
+ /* retrieve the checkfc executable from jar */
+ checkFc = copyResourceToTempFile("/checkfc");
+ checkFc.setExecutable(true);
+
/* obtain sepolicy file from running device */
devicePolicyFile = File.createTempFile("sepolicy", ".tmp");
devicePolicyFile.deleteOnExit();
mDevice.pullFile("/sys/fs/selinux/policy", devicePolicyFile);
+
+ /* obtain seapp_contexts file from running device */
+ deviceSeappFile = File.createTempFile("seapp_contexts", ".tmp");
+ deviceSeappFile.deleteOnExit();
+ mDevice.pullFile("/seapp_contexts", deviceSeappFile);
+
+ /* obtain file_contexts file from running device */
+ deviceFcFile = File.createTempFile("file_contexts", ".tmp");
+ deviceFcFile.deleteOnExit();
+ mDevice.pullFile("/file_contexts", deviceFcFile);
+
+ /* obtain property_contexts file from running device */
+ devicePcFile = File.createTempFile("property_contexts", ".tmp");
+ devicePcFile.deleteOnExit();
+ mDevice.pullFile("/property_contexts", devicePcFile);
+
+ /* obtain service_contexts file from running device */
+ deviceSvcFile = File.createTempFile("service_contexts", ".tmp");
+ deviceSvcFile.deleteOnExit();
+ mDevice.pullFile("/service_contexts", deviceSvcFile);
+
+ /* retrieve the AOSP *_contexts files from jar */
+ aospSeappFile = copyResourceToTempFile("/general_seapp_contexts");
+ aospFcFile = copyResourceToTempFile("/general_file_contexts");
+ aospPcFile = copyResourceToTempFile("/general_property_contexts");
+ aospSvcFile = copyResourceToTempFile("/general_service_contexts");
}
/**
@@ -104,4 +159,540 @@
assertTrue("The following SELinux domains were found to be in permissive mode:\n"
+ errorString, errorString.length() == 0);
}
+
+ /**
+ * Asserts that specified type is not associated with the specified
+ * attribute.
+ *
+ * @param attribute
+ * The attribute name.
+ * @param type
+ * The type name.
+ */
+ private void assertNotInAttribute(String attribute, String badtype) throws Exception {
+ /* run sepolicy-analyze attribute check on policy file */
+ ProcessBuilder pb = new ProcessBuilder(sepolicyAnalyze.getAbsolutePath(),
+ devicePolicyFile.getAbsolutePath(), "attribute", attribute);
+ pb.redirectOutput(ProcessBuilder.Redirect.PIPE);
+ pb.redirectErrorStream(true);
+ Process p = pb.start();
+ p.waitFor();
+ BufferedReader result = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String type;
+ while ((type = result.readLine()) != null) {
+ assertFalse("Attribute " + attribute + " includes " + type + "\n",
+ type.equals(badtype));
+ }
+ }
+
+ /**
+ * Tests that mlstrustedsubject does not include untrusted_app
+ * and that mlstrustedobject does not include app_data_file.
+ * This helps prevent circumventing the per-user isolation of
+ * normal apps via levelFrom=user.
+ *
+ * @throws Exception
+ */
+ public void testMLSAttributes() throws Exception {
+ assertNotInAttribute("mlstrustedsubject", "untrusted_app");
+ assertNotInAttribute("mlstrustedobject", "app_data_file");
+ }
+
+ /**
+ * Tests that the seapp_contexts file on the device is valid.
+ *
+ * @throws Exception
+ */
+ public void testValidSeappContexts() throws Exception {
+ File OutputFile = File.createTempFile("seapp_output", ".tmp");
+ OutputFile.deleteOnExit();
+
+ /* run checkseapp on seapp_contexts */
+ ProcessBuilder pb = new ProcessBuilder(checkSeapp.getAbsolutePath(),
+ "-p", devicePolicyFile.getAbsolutePath(),
+ deviceSeappFile.getAbsolutePath(),
+ "-o", OutputFile.getAbsolutePath());
+ pb.redirectOutput(ProcessBuilder.Redirect.PIPE);
+ pb.redirectErrorStream(true);
+ Process p = pb.start();
+ p.waitFor();
+ BufferedReader result = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line;
+ StringBuilder errorString = new StringBuilder();
+ while ((line = result.readLine()) != null) {
+ errorString.append(line);
+ errorString.append("\n");
+ }
+ assertTrue("The seapp_contexts file was invalid:\n"
+ + errorString, errorString.length() == 0);
+ }
+
+ /**
+ * Asserts that the actual file contents starts with the expected file
+ * contents.
+ *
+ * @param expectedFile
+ * The file with the expected contents.
+ * @param actualFile
+ * The actual file being checked.
+ */
+ private void assertFileStartsWith(File expectedFile, File actualFile) throws Exception {
+ BufferedReader expectedReader = new BufferedReader(new FileReader(expectedFile.getAbsolutePath()));
+ BufferedReader actualReader = new BufferedReader(new FileReader(actualFile.getAbsolutePath()));
+ String expectedLine, actualLine;
+ while ((expectedLine = expectedReader.readLine()) != null) {
+ actualLine = actualReader.readLine();
+ assertEquals("Lines do not match:", expectedLine, actualLine);
+ }
+ }
+
+ /**
+ * Tests that the seapp_contexts file on the device contains
+ * the standard AOSP entries.
+ *
+ * @throws Exception
+ */
+ public void testAospSeappContexts() throws Exception {
+ assertFileStartsWith(aospSeappFile, deviceSeappFile);
+ }
+
+ /**
+ * Tests that the file_contexts file on the device contains
+ * the standard AOSP entries.
+ *
+ * @throws Exception
+ */
+ public void testAospFileContexts() throws Exception {
+ assertFileStartsWith(aospFcFile, deviceFcFile);
+ }
+
+ /**
+ * Tests that the property_contexts file on the device contains
+ * the standard AOSP entries.
+ *
+ * @throws Exception
+ */
+ public void testAospPropertyContexts() throws Exception {
+ assertFileStartsWith(aospPcFile, devicePcFile);
+ }
+
+ /**
+ * Tests that the service_contexts file on the device contains
+ * the standard AOSP entries.
+ *
+ * @throws Exception
+ */
+ public void testAospServiceContexts() throws Exception {
+ assertFileStartsWith(aospSvcFile, deviceSvcFile);
+ }
+
+ /**
+ * Tests that the file_contexts file on the device is valid.
+ *
+ * @throws Exception
+ */
+ public void testValidFileContexts() throws Exception {
+
+ /* run checkfc on file_contexts */
+ ProcessBuilder pb = new ProcessBuilder(checkFc.getAbsolutePath(),
+ devicePolicyFile.getAbsolutePath(),
+ deviceFcFile.getAbsolutePath());
+ pb.redirectOutput(ProcessBuilder.Redirect.PIPE);
+ pb.redirectErrorStream(true);
+ Process p = pb.start();
+ p.waitFor();
+ BufferedReader result = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line;
+ StringBuilder errorString = new StringBuilder();
+ while ((line = result.readLine()) != null) {
+ errorString.append(line);
+ errorString.append("\n");
+ }
+ assertTrue("The file_contexts file was invalid:\n"
+ + errorString, errorString.length() == 0);
+ }
+
+ /**
+ * Tests that the property_contexts file on the device is valid.
+ *
+ * @throws Exception
+ */
+ public void testValidPropertyContexts() throws Exception {
+
+ /* run checkfc -p on property_contexts */
+ ProcessBuilder pb = new ProcessBuilder(checkFc.getAbsolutePath(),
+ "-p", devicePolicyFile.getAbsolutePath(),
+ devicePcFile.getAbsolutePath());
+ pb.redirectOutput(ProcessBuilder.Redirect.PIPE);
+ pb.redirectErrorStream(true);
+ Process p = pb.start();
+ p.waitFor();
+ BufferedReader result = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line;
+ StringBuilder errorString = new StringBuilder();
+ while ((line = result.readLine()) != null) {
+ errorString.append(line);
+ errorString.append("\n");
+ }
+ assertTrue("The property_contexts file was invalid:\n"
+ + errorString, errorString.length() == 0);
+ }
+
+ /**
+ * Tests that the service_contexts file on the device is valid.
+ *
+ * @throws Exception
+ */
+ public void testValidServiceContexts() throws Exception {
+
+ /* run checkfc -p on service_contexts */
+ ProcessBuilder pb = new ProcessBuilder(checkFc.getAbsolutePath(),
+ "-p", devicePolicyFile.getAbsolutePath(),
+ devicePcFile.getAbsolutePath());
+ pb.redirectOutput(ProcessBuilder.Redirect.PIPE);
+ pb.redirectErrorStream(true);
+ Process p = pb.start();
+ p.waitFor();
+ BufferedReader result = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line;
+ StringBuilder errorString = new StringBuilder();
+ while ((line = result.readLine()) != null) {
+ errorString.append(line);
+ errorString.append("\n");
+ }
+ assertTrue("The service_contexts file was invalid:\n"
+ + errorString, errorString.length() == 0);
+ }
+
+ /**
+ * Tests that the policy defines no booleans (runtime conditional policy).
+ *
+ * @throws Exception
+ */
+ public void testNoBooleans() throws Exception {
+
+ /* run sepolicy-analyze booleans check on policy file */
+ ProcessBuilder pb = new ProcessBuilder(sepolicyAnalyze.getAbsolutePath(),
+ devicePolicyFile.getAbsolutePath(), "booleans");
+ pb.redirectOutput(ProcessBuilder.Redirect.PIPE);
+ pb.redirectErrorStream(true);
+ Process p = pb.start();
+ p.waitFor();
+ BufferedReader result = new BufferedReader(new InputStreamReader(p.getInputStream()));
+ String line;
+ StringBuilder errorString = new StringBuilder();
+ while ((line = result.readLine()) != null) {
+ errorString.append(line);
+ errorString.append("\n");
+ }
+ assertTrue("The policy contained booleans:\n"
+ + errorString, errorString.length() == 0);
+ }
+
+ /**
+ * Tests that important domain labels are being appropriately applied.
+ */
+
+ /**
+ * Asserts that no processes are running in a domain.
+ *
+ * @param domain
+ * The domain or SELinux context to check.
+ */
+ private void assertDomainEmpty(String domain) throws DeviceNotAvailableException {
+ List<ProcessDetails> procs = ProcessDetails.getProcMap(mDevice).get(domain);
+ String msg = "Expected no processes in SELinux domain \"" + domain + "\""
+ + " Found: \"" + procs + "\"";
+ assertNull(msg, procs);
+ }
+
+ /**
+ * Asserts that a domain exists and that only one, well defined, process is
+ * running in that domain.
+ *
+ * @param domain
+ * The domain or SELinux context to check.
+ * @param executable
+ * The path of the executable or application package name.
+ */
+ private void assertDomainOne(String domain, String executable) throws DeviceNotAvailableException {
+ List<ProcessDetails> procs = ProcessDetails.getProcMap(mDevice).get(domain);
+ String msg = "Expected 1 process in SELinux domain \"" + domain + "\""
+ + " Found \"" + procs + "\"";
+ assertNotNull(msg, procs);
+ assertEquals(msg, 1, procs.size());
+
+ msg = "Expected executable \"" + executable + "\" in SELinux domain \"" + domain + "\""
+ + "Found: \"" + procs + "\"";
+ assertEquals(msg, executable, procs.get(0).procTitle);
+ }
+
+ /**
+ * Asserts that a domain may exist. If a domain exists, the cardinality of
+ * the domain is verified to be 1 and that the correct process is running in
+ * that domain.
+ *
+ * @param domain
+ * The domain or SELinux context to check.
+ * @param executable
+ * The path of the executable or application package name.
+ */
+ private void assertDomainZeroOrOne(String domain, String executable)
+ throws DeviceNotAvailableException {
+ List<ProcessDetails> procs = ProcessDetails.getProcMap(mDevice).get(domain);
+ if (procs == null) {
+ /* not on all devices */
+ return;
+ }
+
+ String msg = "Expected 1 process in SELinux domain \"" + domain + "\""
+ + " Found: \"" + procs + "\"";
+ assertEquals(msg, 1, procs.size());
+
+ msg = "Expected executable \"" + executable + "\" in SELinux domain \"" + domain + "\""
+ + "Found: \"" + procs.get(0) + "\"";
+ assertEquals(msg, executable, procs.get(0).procTitle);
+ }
+
+ /**
+ * Asserts that a domain must exist, and that the cardinality is greater
+ * than or equal to 1.
+ *
+ * @param domain
+ * The domain or SELinux context to check.
+ * @param executables
+ * The path of the allowed executables or application package names.
+ */
+ private void assertDomainN(String domain, String... executables)
+ throws DeviceNotAvailableException {
+ List<ProcessDetails> procs = ProcessDetails.getProcMap(mDevice).get(domain);
+ String msg = "Expected 1 or more processes in SELinux domain but found none.";
+ assertNotNull(msg, procs);
+
+ Set<String> execList = new HashSet<String>(Arrays.asList(executables));
+
+ for (ProcessDetails p : procs) {
+ msg = "Expected one of \"" + execList + "\" in SELinux domain \"" + domain + "\""
+ + " Found: \"" + p + "\"";
+ assertTrue(msg, execList.contains(p.procTitle));
+ }
+ }
+
+ /**
+ * Asserts that a domain, if it exists, is only running the listed executables.
+ *
+ * @param domain
+ * The domain or SELinux context to check.
+ * @param executables
+ * The path of the allowed executables or application package names.
+ */
+ private void assertDomainHasExecutable(String domain, String... executables)
+ throws DeviceNotAvailableException {
+ List<ProcessDetails> procs = ProcessDetails.getProcMap(mDevice).get(domain);
+ if (procs == null) {
+ return; // domain doesn't exist
+ }
+
+ Set<String> execList = new HashSet<String>(Arrays.asList(executables));
+
+ for (ProcessDetails p : procs) {
+ String msg = "Expected one of \"" + execList + "\" in SELinux domain \""
+ + domain + "\"" + " Found: \"" + p + "\"";
+ assertTrue(msg, execList.contains(p.procTitle));
+ }
+ }
+
+ /* Init is always there */
+ public void testInitDomain() throws DeviceNotAvailableException {
+ assertDomainOne("u:r:init:s0", "/init");
+ }
+
+ /* Ueventd is always there */
+ public void testUeventdDomain() throws DeviceNotAvailableException {
+ assertDomainOne("u:r:ueventd:s0", "/sbin/ueventd");
+ }
+
+ /* Devices always have healthd */
+ public void testHealthdDomain() throws DeviceNotAvailableException {
+ assertDomainOne("u:r:healthd:s0", "/sbin/healthd");
+ }
+
+ /* Servicemanager is always there */
+ public void testServicemanagerDomain() throws DeviceNotAvailableException {
+ assertDomainOne("u:r:servicemanager:s0", "/system/bin/servicemanager");
+ }
+
+ /* Vold is always there */
+ public void testVoldDomain() throws DeviceNotAvailableException {
+ assertDomainOne("u:r:vold:s0", "/system/bin/vold");
+ }
+
+ /* netd is always there */
+ public void testNetdDomain() throws DeviceNotAvailableException {
+ assertDomainOne("u:r:netd:s0", "/system/bin/netd");
+ }
+
+ /* Debuggerd is always there */
+ public void testDebuggerdDomain() throws DeviceNotAvailableException {
+ assertDomainN("u:r:debuggerd:s0", "/system/bin/debuggerd", "/system/bin/debuggerd64");
+ }
+
+ /* Surface flinger is always there */
+ public void testSurfaceflingerDomain() throws DeviceNotAvailableException {
+ assertDomainOne("u:r:surfaceflinger:s0", "/system/bin/surfaceflinger");
+ }
+
+ /* Zygote is always running */
+ public void testZygoteDomain() throws DeviceNotAvailableException {
+ assertDomainN("u:r:zygote:s0", "zygote", "zygote64");
+ }
+
+ /* drm server is always present */
+ public void testDrmServerDomain() throws DeviceNotAvailableException {
+ assertDomainOne("u:r:drmserver:s0", "/system/bin/drmserver");
+ }
+
+ /* Media server is always running */
+ public void testMediaserverDomain() throws DeviceNotAvailableException {
+ assertDomainN("u:r:mediaserver:s0", "media.log", "/system/bin/mediaserver");
+ }
+
+ /* Installd is always running */
+ public void testInstalldDomain() throws DeviceNotAvailableException {
+ assertDomainOne("u:r:installd:s0", "/system/bin/installd");
+ }
+
+ /* keystore is always running */
+ public void testKeystoreDomain() throws DeviceNotAvailableException {
+ assertDomainOne("u:r:keystore:s0", "/system/bin/keystore");
+ }
+
+ /* System server better be running :-P */
+ public void testSystemServerDomain() throws DeviceNotAvailableException {
+ assertDomainOne("u:r:system_server:s0", "system_server");
+ }
+
+ /*
+ * Some OEMs do not use sdcardd so transient. Other OEMs have multiple sdcards
+ * so they run the daemon multiple times.
+ */
+ public void testSdcarddDomain() throws DeviceNotAvailableException {
+ assertDomainHasExecutable("u:r:sdcardd:s0", "/system/bin/sdcard");
+ }
+
+ /* Watchdogd may or may not be there */
+ public void testWatchdogdDomain() throws DeviceNotAvailableException {
+ assertDomainZeroOrOne("u:r:watchdogd:s0", "/sbin/watchdogd");
+ }
+
+ /* Wifi may be off so cardinality of 0 or 1 is ok */
+ public void testWpaDomain() throws DeviceNotAvailableException {
+ assertDomainZeroOrOne("u:r:wpa:s0", "/system/bin/wpa_supplicant");
+ }
+
+ /*
+ * Nothing should be running in this domain, cardinality test is all thats
+ * needed
+ */
+ public void testInitShellDomain() throws DeviceNotAvailableException {
+ assertDomainEmpty("u:r:init_shell:s0");
+ }
+
+ /*
+ * Nothing should be running in this domain, cardinality test is all thats
+ * needed
+ */
+ public void testRecoveryDomain() throws DeviceNotAvailableException {
+ assertDomainEmpty("u:r:recovery:s0");
+ }
+
+ /*
+ * Nothing should be running in this domain, cardinality test is all thats
+ * needed
+ */
+ public void testSuDomain() throws DeviceNotAvailableException {
+ assertDomainEmpty("u:r:su:s0");
+ }
+
+ /*
+ * There will at least be some kernel thread running and all kthreads should
+ * be in kernel context.
+ */
+ public void testKernelDomain() throws DeviceNotAvailableException {
+ String domain = "u:r:kernel:s0";
+ List<ProcessDetails> procs = ProcessDetails.getProcMap(mDevice).get(domain);
+ assertNotNull(procs);
+ for (ProcessDetails p : procs) {
+ assertTrue("Non Kernel thread \"" + p + "\" found!", p.isKernel());
+ }
+ }
+
+ private static class ProcessDetails {
+ public String label;
+ public String user;
+ public int pid;
+ public int ppid;
+ public String procTitle;
+
+ private static HashMap<String, ArrayList<ProcessDetails>> procMap;
+ private static int kernelParentThreadpid = -1;
+
+ ProcessDetails(String label, String user, int pid, int ppid, String procTitle) {
+ this.label = label;
+ this.user = user;
+ this.pid = pid;
+ this.ppid = ppid;
+ this.procTitle = procTitle;
+ }
+
+ @Override
+ public String toString() {
+ return "label: " + label
+ + " user: " + user
+ + " pid: " + pid
+ + " ppid: " + ppid
+ + " cmd: " + procTitle;
+ }
+
+
+ private static void createProcMap(ITestDevice tDevice) throws DeviceNotAvailableException {
+
+ /* take the output of a ps -Z to do our analysis */
+ CollectingOutputReceiver psOut = new CollectingOutputReceiver();
+ tDevice.executeShellCommand("ps -Z", psOut);
+ String psOutString = psOut.getOutput();
+ Pattern p = Pattern.compile(
+ "^([\\w_:]+)\\s+([\\w_]+)\\s+(\\d+)\\s+(\\d+)\\s+(\\p{Graph}+)$",
+ Pattern.MULTILINE);
+ Matcher m = p.matcher(psOutString);
+ procMap = new HashMap<String, ArrayList<ProcessDetails>>();
+ while(m.find()) {
+ String domainLabel = m.group(1);
+ String user = m.group(2);
+ int pid = Integer.parseInt(m.group(3));
+ int ppid = Integer.parseInt(m.group(4));
+ String procTitle = m.group(5);
+ ProcessDetails proc = new ProcessDetails(domainLabel, user, pid, ppid, procTitle);
+ if (procMap.get(domainLabel) == null) {
+ procMap.put(domainLabel, new ArrayList<ProcessDetails>());
+ }
+ procMap.get(domainLabel).add(proc);
+ if (procTitle.equals("kthreadd") && ppid == 0) {
+ kernelParentThreadpid = pid;
+ }
+ }
+ }
+
+ public static HashMap<String, ArrayList<ProcessDetails>> getProcMap(ITestDevice tDevice)
+ throws DeviceNotAvailableException{
+ if (procMap == null) {
+ createProcMap(tDevice);
+ }
+ return procMap;
+ }
+
+ public boolean isKernel() {
+ return (pid == kernelParentThreadpid || ppid == kernelParentThreadpid);
+ }
+ }
}
diff --git a/libs/commonutil/src/com/android/cts/util/StatisticsUtils.java b/libs/commonutil/src/com/android/cts/util/StatisticsUtils.java
new file mode 100644
index 0000000..d6589af
--- /dev/null
+++ b/libs/commonutil/src/com/android/cts/util/StatisticsUtils.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.cts.util;
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Set of static helper methods for CTS tests.
+ */
+public class StatisticsUtils {
+
+
+ /**
+ * Private constructor for static class.
+ */
+ private StatisticsUtils() {}
+
+ /**
+ * Get the value of the 95th percentile using nearest rank algorithm.
+ *
+ * @throws IllegalArgumentException if the collection is null or empty
+ */
+ public static <TValue extends Comparable<? super TValue>> TValue get95PercentileValue(
+ Collection<TValue> collection) {
+ validateCollection(collection);
+
+ List<TValue> arrayCopy = new ArrayList<TValue>(collection);
+ Collections.sort(arrayCopy);
+
+ // zero-based array index
+ int arrayIndex = (int) Math.round(arrayCopy.size() * 0.95 + .5) - 1;
+
+ return arrayCopy.get(arrayIndex);
+ }
+
+ /**
+ * Calculate the mean of a collection.
+ *
+ * @throws IllegalArgumentException if the collection is null or empty
+ */
+ public static <TValue extends Number> double getMean(Collection<TValue> collection) {
+ validateCollection(collection);
+
+ double sum = 0.0;
+ for(TValue value : collection) {
+ sum += value.doubleValue();
+ }
+ return sum / collection.size();
+ }
+
+ /**
+ * Calculate the bias-corrected sample variance of a collection.
+ *
+ * @throws IllegalArgumentException if the collection is null or empty
+ */
+ public static <TValue extends Number> double getVariance(Collection<TValue> collection) {
+ validateCollection(collection);
+
+ double mean = getMean(collection);
+ ArrayList<Double> squaredDiffs = new ArrayList<Double>();
+ for(TValue value : collection) {
+ double difference = mean - value.doubleValue();
+ squaredDiffs.add(Math.pow(difference, 2));
+ }
+
+ double sum = 0.0;
+ for (Double value : squaredDiffs) {
+ sum += value;
+ }
+ return sum / (squaredDiffs.size() - 1);
+ }
+
+ /**
+ * Calculate the bias-corrected standard deviation of a collection.
+ *
+ * @throws IllegalArgumentException if the collection is null or empty
+ */
+ public static <TValue extends Number> double getStandardDeviation(
+ Collection<TValue> collection) {
+ return Math.sqrt(getVariance(collection));
+ }
+
+ /**
+ * Validate that a collection is not null or empty.
+ *
+ * @throws IllegalStateException if collection is null or empty.
+ */
+ private static <T> void validateCollection(Collection<T> collection) {
+ if(collection == null || collection.size() == 0) {
+ throw new IllegalStateException("Collection cannot be null or empty");
+ }
+ }
+
+}
diff --git a/libs/commonutil/src/com/android/cts/util/StatisticsUtilsTest.java b/libs/commonutil/src/com/android/cts/util/StatisticsUtilsTest.java
new file mode 100644
index 0000000..d78ba99
--- /dev/null
+++ b/libs/commonutil/src/com/android/cts/util/StatisticsUtilsTest.java
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.cts.util;
+
+import junit.framework.TestCase;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Unit tests for the {@link StatisticsUtils} class.
+ */
+public class StatisticsUtilsTest extends TestCase {
+
+ /**
+ * Test {@link StatisticsUtils#get95PercentileValue(Collection)}.
+ */
+ public void testGet95PercentileValue() {
+ Collection<Integer> values = new HashSet<Integer>();
+ for (int i = 0; i < 100; i++) {
+ values.add(i);
+ }
+ assertEquals(95, (int) StatisticsUtils.get95PercentileValue(values));
+
+ values = new HashSet<Integer>();
+ for (int i = 0; i < 1000; i++) {
+ values.add(i);
+ }
+ assertEquals(950, (int) StatisticsUtils.get95PercentileValue(values));
+
+ values = new HashSet<Integer>();
+ for (int i = 0; i < 100; i++) {
+ values.add(i * i);
+ }
+ assertEquals(95 * 95, (int) StatisticsUtils.get95PercentileValue(values));
+ }
+
+ /**
+ * Test {@link StatisticsUtils#getMean(Collection)}.
+ */
+ public void testGetMean() {
+ List<Integer> values = Arrays.asList(0, 1, 2, 3, 4);
+ double mean = StatisticsUtils.getMean(values);
+ assertEquals(2.0, mean, 0.00001);
+
+ values = Arrays.asList(1, 2, 3, 4, 5);
+ mean = StatisticsUtils.getMean(values);
+ assertEquals(3.0, mean, 0.00001);
+
+ values = Arrays.asList(0, 1, 4, 9, 16);
+ mean = StatisticsUtils.getMean(values);
+ assertEquals(6.0, mean, 0.00001);
+ }
+
+ /**
+ * Test {@link StatisticsUtils#getVariance(Collection)}.
+ */
+ public void testGetVariance() {
+ List<Integer> values = Arrays.asList(0, 1, 2, 3, 4);
+ double variance = StatisticsUtils.getVariance(values);
+ assertEquals(2.5, variance, 0.00001);
+
+ values = Arrays.asList(1, 2, 3, 4, 5);
+ variance = StatisticsUtils.getVariance(values);
+ assertEquals(2.5, variance, 0.00001);
+
+ values = Arrays.asList(0, 2, 4, 6, 8);
+ variance = StatisticsUtils.getVariance(values);
+ assertEquals(10.0, variance, 0.00001);
+ }
+
+ /**
+ * Test {@link StatisticsUtils#getStandardDeviation(Collection)}.
+ */
+ public void testGetStandardDeviation() {
+ List<Integer> values = Arrays.asList(0, 1, 2, 3, 4);
+ double stddev = StatisticsUtils.getStandardDeviation(values);
+ assertEquals(Math.sqrt(2.5), stddev, 0.00001);
+
+ values = Arrays.asList(1, 2, 3, 4, 5);
+ stddev = StatisticsUtils.getStandardDeviation(values);
+ assertEquals(Math.sqrt(2.5), stddev, 0.00001);
+
+ values = Arrays.asList(0, 2, 4, 6, 8);
+ stddev = StatisticsUtils.getStandardDeviation(values);
+ assertEquals(Math.sqrt(10.0), stddev, 0.00001);
+ }
+
+
+}
diff --git a/suite/audio_quality/test/Android.mk b/suite/audio_quality/test/Android.mk
index 4582fe7..bd0033f 100644
--- a/suite/audio_quality/test/Android.mk
+++ b/suite/audio_quality/test/Android.mk
@@ -34,7 +34,7 @@
# functions and linker error happens
LOCAL_WHOLE_STATIC_LIBRARIES := libcts_audio_quality
LOCAL_CFLAGS:= -g -fno-exceptions
-LOCAL_LDFLAGS:= -g -lrt -ldl -lstdc++ -lm -fno-exceptions -lpthread
+LOCAL_LDFLAGS:= -g -lrt -ldl -lm -fno-exceptions -lpthread
LOCAL_MODULE:= cts_audio_quality_test
include $(BUILD_HOST_EXECUTABLE)
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.h b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.h
index e50acd0..3e4367a 100644
--- a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.h
+++ b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/Boid.h
@@ -16,6 +16,7 @@
#define BOID_H
#include <graphics/Vector2D.h>
+#include <utils/Compat.h>
class Boid {
public:
@@ -24,14 +25,14 @@
void flock(const Boid* boids[], int numBoids, int index, float limitX, float limitY);
// The following floats are the parameters for the flocking algorithm, changing these
// modifies the boid's behaviour.
- static const float MAX_SPEED = 2.0f;// Upper limit of boid velocity.
- static const float MAX_FORCE = 0.05f;// Upper limit of the force used to push a boid.
- static const float NEIGHBOUR_RADIUS = 70.0f;// Radius used to find neighbours, was 50.
- static const float DESIRED_BOID_DIST = 35.0f;// Distance boids want to be from others, was 25.
+ static const CONSTEXPR float MAX_SPEED = 2.0f;// Upper limit of boid velocity.
+ static const CONSTEXPR float MAX_FORCE = 0.05f;// Upper limit of the force used to push a boid.
+ static const CONSTEXPR float NEIGHBOUR_RADIUS = 70.0f;// Radius used to find neighbours, was 50.
+ static const CONSTEXPR float DESIRED_BOID_DIST = 35.0f;// Distance boids want to be from others, was 25.
// The weightings of the components.
- static const float SEPARATION_WEIGHT = 2.0f;
- static const float ALIGNMENT_WEIGHT = 1.0f;
- static const float COHESION_WEIGHT = 1.0f;
+ static const CONSTEXPR float SEPARATION_WEIGHT = 2.0f;
+ static const CONSTEXPR float ALIGNMENT_WEIGHT = 1.0f;
+ static const CONSTEXPR float COHESION_WEIGHT = 1.0f;
Vector2D mPosition;
Vector2D mVelocity;
Vector2D mAcceleration;
diff --git a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.h b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.h
index 97bd4cc..7cdcffe 100644
--- a/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.h
+++ b/suite/cts/deviceTests/opengl/jni/reference/scene/flocking/FlockingScene.h
@@ -15,6 +15,7 @@
#define FLOCKINGSCENE_H
#include <graphics/Program.h>
+#include <utils/Compat.h>
#include "../Scene.h"
#include "Boid.h"
@@ -41,6 +42,6 @@
float mBoardHeight;
Program* mMainProgram;
Program* mWaterProgram;
- static const float BOID_SCALE = 1.0f / 50.0f;
+ static const CONSTEXPR float BOID_SCALE = 1.0f / 50.0f;
};
#endif
diff --git a/suite/cts/deviceTests/opengl/test/Android.mk b/suite/cts/deviceTests/opengl/test/Android.mk
index a4abe4f..5270bac 100644
--- a/suite/cts/deviceTests/opengl/test/Android.mk
+++ b/suite/cts/deviceTests/opengl/test/Android.mk
@@ -18,6 +18,7 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(patsubst ./%,%, $(shell cd $(LOCAL_PATH); \
@@ -26,8 +27,8 @@
#$(info $(LOCAL_SRC_FILES))
LOCAL_C_INCLUDES += external/gtest/include $(LOCAL_PATH)/../jni/graphics/
-LOCAL_STATIC_LIBRARIES := libutils libcutils libgtest_host libgtest_main_host liblog
-LOCAL_LDFLAGS:= -g -lrt -ldl -lstdc++ -lm -fno-exceptions -lpthread
+LOCAL_STATIC_LIBRARIES := libgtest_host libgtest_main_host liblog
+LOCAL_LDFLAGS:= -g -lpthread
LOCAL_MODULE:= cts_device_opengl_test
include $(BUILD_HOST_EXECUTABLE)
diff --git a/tests/tests/bionic/Android.mk b/tests/tests/bionic/Android.mk
index e1afd50..f441d7a 100644
--- a/tests/tests/bionic/Android.mk
+++ b/tests/tests/bionic/Android.mk
@@ -4,6 +4,7 @@
list_executable := $(test_executable)_list
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := $(test_executable)
LOCAL_MODULE_TAGS := optional
@@ -12,25 +13,24 @@
LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-LOCAL_ADDITION_DEPENDENCIES := \
- $(LOCAL_PATH)/Android.mk \
-
LOCAL_SHARED_LIBRARIES += \
- libstlport \
libdl \
LOCAL_WHOLE_STATIC_LIBRARIES += \
libBionicTests \
+ libBionicCtsGtestMain \
LOCAL_STATIC_LIBRARIES += \
+ libtinyxml2 \
+ liblog \
libgtest \
- libgtest_main \
LOCAL_CTS_TEST_PACKAGE := android.bionic
include $(BUILD_CTS_EXECUTABLE)
ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64))
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := $(list_executable)
@@ -39,18 +39,14 @@
LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)
LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-LOCAL_ADDITION_DEPENDENCIES := \
- $(LOCAL_PATH)/Android.mk \
-
-# A main without the extra output from the gtest main.
-LOCAL_SRC_FILES := \
- main.cpp \
-
LOCAL_LDLIBS += \
- -lrt \
+ -lrt -ldl -lutil \
LOCAL_WHOLE_STATIC_LIBRARIES += \
libBionicTests \
+ libBionicCtsGtestMain \
+
+LOCAL_CXX_STL := libc++
include $(BUILD_HOST_NATIVE_TEST)
endif # ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64))
diff --git a/tests/tests/bionic/main.cpp b/tests/tests/bionic/main.cpp
deleted file mode 100644
index b661af4..0000000
--- a/tests/tests/bionic/main.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <gtest/gtest.h>
-
-int main(int argc, char **argv) {
- // Do not use gtest_main to avoid the Running main() ... output.
- testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/tests/tests/drm/jni/android_drm_cts_NativeCodeTest.cpp b/tests/tests/drm/jni/android_drm_cts_NativeCodeTest.cpp
index 398a44e..e5c9f96 100644
--- a/tests/tests/drm/jni/android_drm_cts_NativeCodeTest.cpp
+++ b/tests/tests/drm/jni/android_drm_cts_NativeCodeTest.cpp
@@ -16,6 +16,7 @@
#include <jni.h>
#include <sys/types.h>
+#include <string.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <utils/Log.h>
diff --git a/tests/tests/hardware/Android.mk b/tests/tests/hardware/Android.mk
index e5203e5..153445d 100644
--- a/tests/tests/hardware/Android.mk
+++ b/tests/tests/hardware/Android.mk
@@ -19,8 +19,11 @@
include $(CLEAR_VARS)
LOCAL_MODULE := cts-sensors-tests
+
LOCAL_MODULE_TAGS := tests
+LOCAL_STATIC_JAVA_LIBRARIES := ctsdeviceutil
+
LOCAL_SDK_VERSION := current
# TODO: sensors need to be refactored out into their own namespace: android.hardware.sensors.cts
@@ -49,11 +52,8 @@
LOCAL_PACKAGE_NAME := CtsHardwareTestCases
-# uncomment when b/13281332 is fixed
-# please also uncomment the equivalent code in
-# cts/apps/CtsVerifiers/Android.mk
-#
-# LOCAL_SDK_VERSION := current
+LOCAL_SDK_VERSION := current
+
LOCAL_JAVA_LIBRARIES := android.test.runner
include $(BUILD_CTS_PACKAGE)
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/SensorCtsHelperTest.java b/tests/tests/hardware/src/android/hardware/cts/helpers/SensorCtsHelperTest.java
index 6f99692..daac8d1 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/SensorCtsHelperTest.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/SensorCtsHelperTest.java
@@ -30,80 +30,6 @@
public class SensorCtsHelperTest extends TestCase {
/**
- * Test {@link SensorCtsHelper#get95PercentileValue(Collection)}.
- */
- public void testGet95PercentileValue() {
- Collection<Integer> values = new HashSet<Integer>();
- for (int i = 0; i < 100; i++) {
- values.add(i);
- }
- assertEquals(95, (int) SensorCtsHelper.get95PercentileValue(values));
-
- values = new HashSet<Integer>();
- for (int i = 0; i < 1000; i++) {
- values.add(i);
- }
- assertEquals(950, (int) SensorCtsHelper.get95PercentileValue(values));
-
- values = new HashSet<Integer>();
- for (int i = 0; i < 100; i++) {
- values.add(i * i);
- }
- assertEquals(95 * 95, (int) SensorCtsHelper.get95PercentileValue(values));
- }
-
- /**
- * Test {@link SensorCtsHelper#getMean(Collection)}.
- */
- public void testGetMean() {
- List<Integer> values = Arrays.asList(0, 1, 2, 3, 4);
- double mean = SensorCtsHelper.getMean(values);
- assertEquals(2.0, mean, 0.00001);
-
- values = Arrays.asList(1, 2, 3, 4, 5);
- mean = SensorCtsHelper.getMean(values);
- assertEquals(3.0, mean, 0.00001);
-
- values = Arrays.asList(0, 1, 4, 9, 16);
- mean = SensorCtsHelper.getMean(values);
- assertEquals(6.0, mean, 0.00001);
- }
-
- /**
- * Test {@link SensorCtsHelper#getVariance(Collection)}.
- */
- public void testGetVariance() {
- List<Integer> values = Arrays.asList(0, 1, 2, 3, 4);
- double variance = SensorCtsHelper.getVariance(values);
- assertEquals(2.5, variance, 0.00001);
-
- values = Arrays.asList(1, 2, 3, 4, 5);
- variance = SensorCtsHelper.getVariance(values);
- assertEquals(2.5, variance, 0.00001);
-
- values = Arrays.asList(0, 2, 4, 6, 8);
- variance = SensorCtsHelper.getVariance(values);
- assertEquals(10.0, variance, 0.00001);
- }
-
- /**
- * Test {@link SensorCtsHelper#getStandardDeviation(Collection)}.
- */
- public void testGetStandardDeviation() {
- List<Integer> values = Arrays.asList(0, 1, 2, 3, 4);
- double stddev = SensorCtsHelper.getStandardDeviation(values);
- assertEquals(Math.sqrt(2.5), stddev, 0.00001);
-
- values = Arrays.asList(1, 2, 3, 4, 5);
- stddev = SensorCtsHelper.getStandardDeviation(values);
- assertEquals(Math.sqrt(2.5), stddev, 0.00001);
-
- values = Arrays.asList(0, 2, 4, 6, 8);
- stddev = SensorCtsHelper.getStandardDeviation(values);
- assertEquals(Math.sqrt(10.0), stddev, 0.00001);
- }
-
- /**
* Test {@link SensorCtsHelper#getFrequency(Number, TimeUnit)}.
*/
public void testGetFrequency() {
diff --git a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorverification/JitterVerification.java b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorverification/JitterVerification.java
index f95ea0b..6633903 100644
--- a/tests/tests/hardware/src/android/hardware/cts/helpers/sensorverification/JitterVerification.java
+++ b/tests/tests/hardware/src/android/hardware/cts/helpers/sensorverification/JitterVerification.java
@@ -25,6 +25,8 @@
import android.hardware.cts.helpers.TestSensorEvent;
import android.util.SparseIntArray;
+import com.android.cts.util.StatisticsUtils;
+
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@@ -131,7 +133,7 @@
for (int i = 1; i < mTimestamps.size(); i++) {
deltas.add(mTimestamps.get(i) - mTimestamps.get(i - 1));
}
- double deltaMean = SensorCtsHelper.getMean(deltas);
+ double deltaMean = StatisticsUtils.getMean(deltas);
List<Double> jitters = new ArrayList<Double>(deltas.size());
for (long delta : deltas) {
jitters.add(Math.abs(delta - deltaMean));
diff --git a/tests/tests/keystore/src/android/keystore/cts/AndroidKeyStoreTest.java b/tests/tests/keystore/src/android/keystore/cts/AndroidKeyStoreTest.java
index 2c926a8..4ee9a80 100644
--- a/tests/tests/keystore/src/android/keystore/cts/AndroidKeyStoreTest.java
+++ b/tests/tests/keystore/src/android/keystore/cts/AndroidKeyStoreTest.java
@@ -16,14 +16,17 @@
package android.keystore.cts;
+import android.security.KeyPairGeneratorSpec;
import android.security.KeyStoreParameter;
import android.test.AndroidTestCase;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
+import java.math.BigInteger;
import java.security.Key;
import java.security.KeyFactory;
+import java.security.KeyPairGenerator;
import java.security.KeyStore;
import java.security.KeyStore.Entry;
import java.security.KeyStore.PrivateKeyEntry;
@@ -41,6 +44,7 @@
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
@@ -48,9 +52,11 @@
import java.util.Iterator;
import java.util.Set;
+import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
+import javax.security.auth.x500.X500Principal;
public class AndroidKeyStoreTest extends AndroidTestCase {
private KeyStore mKeyStore;
@@ -2250,4 +2256,51 @@
assertEquals(Arrays.toString(expectedSecret.getEncoded()),
Arrays.toString(actualSecret.getEncoded()));
}
+
+ public void testKeyStore_Encrypting_RSA_NONE_NOPADDING() throws Exception {
+
+ String alias = "MyKey";
+ KeyStore ks = KeyStore.getInstance("AndroidKeyStore");
+ assertNotNull(ks);
+ ks.load(null);
+
+ Calendar cal = Calendar.getInstance();
+ cal.set(1944, 5, 6);
+ Date now = cal.getTime();
+ cal.clear();
+
+ cal.set(1945, 8, 2);
+ Date end = cal.getTime();
+
+ KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", "AndroidKeyStore");
+ assertNotNull(kpg);
+ kpg.initialize(new KeyPairGeneratorSpec.Builder(mContext)
+ .setAlias(alias)
+ .setStartDate(now)
+ .setEndDate(end)
+ .setSerialNumber(BigInteger.valueOf(1))
+ .setSubject(new X500Principal("CN=test1"))
+ .build());
+
+ kpg.generateKeyPair();
+
+ RSAPrivateKey key = (RSAPrivateKey) ks.getKey(alias, null);
+ assertNotNull(key);
+ String cipher = key.getAlgorithm() + "/NONE/NOPADDING";
+ Cipher encrypt = Cipher.getInstance(cipher);
+ assertNotNull(encrypt);
+ encrypt.init(Cipher.ENCRYPT_MODE, key);
+
+ byte[] plainText = new byte[encrypt.getBlockSize()];
+ Arrays.fill(plainText, (byte) 0xFF);
+
+ // We expect a BadPaddingException here as the message size (plaintext)
+ // is bigger than the modulus.
+ try {
+ encrypt.doFinal(plainText);
+ fail("Expected BadPaddingException");
+ } catch (BadPaddingException e) {
+ // pass on exception as it is expected
+ }
+ }
}
diff --git a/tests/tests/media/libmediandkjni/native-media-jni.cpp b/tests/tests/media/libmediandkjni/native-media-jni.cpp
index 9bca242..2624c25 100644
--- a/tests/tests/media/libmediandkjni/native-media-jni.cpp
+++ b/tests/tests/media/libmediandkjni/native-media-jni.cpp
@@ -234,7 +234,7 @@
AMediaFormat **format = new AMediaFormat*[numtracks];
bool *sawInputEOS = new bool[numtracks];
bool *sawOutputEOS = new bool[numtracks];
- simplevector<int> sizes[numtracks];
+ simplevector<int> *sizes = new simplevector<int>[numtracks];
ALOGV("input has %d tracks", numtracks);
for (int i = 0; i < numtracks; i++) {
@@ -354,6 +354,8 @@
}
env->ReleaseIntArrayElements(ret, org, 0);
+ delete[] sizes;
+ delete[] sawOutputEOS;
delete[] sawInputEOS;
for (int i = 0; i < numtracks; i++) {
AMediaFormat_delete(format[i]);
diff --git a/tests/tests/media/res/raw/monotestgsm.wav b/tests/tests/media/res/raw/monotestgsm.wav
new file mode 100644
index 0000000..6062f36
--- /dev/null
+++ b/tests/tests/media/res/raw/monotestgsm.wav
Binary files differ
diff --git a/tests/tests/media/src/android/media/cts/DecoderTest.java b/tests/tests/media/src/android/media/cts/DecoderTest.java
index 42f1b23..9014f8d 100644
--- a/tests/tests/media/src/android/media/cts/DecoderTest.java
+++ b/tests/tests/media/src/android/media/cts/DecoderTest.java
@@ -149,20 +149,25 @@
}
public void testDecodeMonoMp3() throws Exception {
- monoTest(R.raw.monotestmp3);
+ monoTest(R.raw.monotestmp3, 44100);
testTimeStampOrdering(R.raw.monotestmp3);
}
public void testDecodeMonoM4a() throws Exception {
- monoTest(R.raw.monotestm4a);
+ monoTest(R.raw.monotestm4a, 44100);
testTimeStampOrdering(R.raw.monotestm4a);
}
public void testDecodeMonoOgg() throws Exception {
- monoTest(R.raw.monotestogg);
+ monoTest(R.raw.monotestogg, 44100);
testTimeStampOrdering(R.raw.monotestogg);
}
+ public void testDecodeMonoGsm() throws Exception {
+ monoTest(R.raw.monotestgsm, 8000);
+ testTimeStampOrdering(R.raw.monotestgsm);
+ }
+
public void testDecodeAacTs() throws Exception {
testTimeStampOrdering(R.raw.sinesweeptsaac);
}
@@ -498,11 +503,11 @@
}
- private void monoTest(int res) throws Exception {
+ private void monoTest(int res, int expectedLength) throws Exception {
short [] mono = decodeToMemory(res, RESET_MODE_NONE, CONFIG_MODE_NONE, -1, null);
- if (mono.length == 44100) {
+ if (mono.length == expectedLength) {
// expected
- } else if (mono.length == 88200) {
+ } else if (mono.length == expectedLength * 2) {
// the decoder output 2 channels instead of 1, check that the left and right channel
// are identical
for (int i = 0; i < mono.length; i += 2) {
@@ -513,10 +518,18 @@
}
short [] mono2 = decodeToMemory(res, RESET_MODE_RECONFIGURE, CONFIG_MODE_NONE, -1, null);
- assertTrue(Arrays.equals(mono, mono2));
+
+ assertEquals("count different after reconfigure: ", mono.length, mono2.length);
+ for (int i = 0; i < mono.length; i++) {
+ assertEquals("samples at " + i + " don't match", mono[i], mono2[i]);
+ }
short [] mono3 = decodeToMemory(res, RESET_MODE_FLUSH, CONFIG_MODE_NONE, -1, null);
- assertTrue(Arrays.equals(mono, mono3));
+
+ assertEquals("count different after flush: ", mono.length, mono3.length);
+ for (int i = 0; i < mono.length; i++) {
+ assertEquals("samples at " + i + " don't match", mono[i], mono3[i]);
+ }
}
/**
diff --git a/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java b/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java
index 89d6efa..014c1a5 100644
--- a/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java
+++ b/tests/tests/media/src/android/media/cts/EncodeVirtualDisplayWithCompositionTest.java
@@ -657,6 +657,7 @@
} catch (InterruptedException e) {
// don't care
}
+ cleanupGl();
mCompositionThread = null;
mSurface = null;
mStartCompletionSemaphore = null;
@@ -966,6 +967,7 @@
public void cleanup() {
mNumTextureUpdated.set(0);
+ mVerticesData.clear();
if (mTextureId != 0) {
int[] textures = new int[] {
mTextureId
diff --git a/tests/tests/media/src/android/media/cts/ExtractDecodeEditEncodeMuxTest.java b/tests/tests/media/src/android/media/cts/ExtractDecodeEditEncodeMuxTest.java
index 029a632..9da229c 100644
--- a/tests/tests/media/src/android/media/cts/ExtractDecodeEditEncodeMuxTest.java
+++ b/tests/tests/media/src/android/media/cts/ExtractDecodeEditEncodeMuxTest.java
@@ -29,6 +29,10 @@
import android.util.Log;
import android.view.Surface;
+import android.media.MediaCodecInfo;
+import android.media.MediaCodecInfo.CodecCapabilities;
+import android.media.MediaCodecInfo.CodecProfileLevel;
+
import com.android.cts.media.R;
import java.io.File;
@@ -111,28 +115,28 @@
private String mOutputFile;
public void testExtractDecodeEditEncodeMuxQCIF() throws Throwable {
- setSize(176, 144);
+ if(!setSize(176, 144)) return;
setSource(R.raw.video_480x360_mp4_h264_500kbps_30fps_aac_stereo_128kbps_44100hz);
setCopyVideo();
TestWrapper.runTest(this);
}
public void testExtractDecodeEditEncodeMuxQVGA() throws Throwable {
- setSize(320, 240);
+ if(!setSize(320, 240)) return;
setSource(R.raw.video_480x360_mp4_h264_500kbps_30fps_aac_stereo_128kbps_44100hz);
setCopyVideo();
TestWrapper.runTest(this);
}
public void testExtractDecodeEditEncodeMux720p() throws Throwable {
- setSize(1280, 720);
+ if(!setSize(1280, 720)) return;
setSource(R.raw.video_480x360_mp4_h264_500kbps_30fps_aac_stereo_128kbps_44100hz);
setCopyVideo();
TestWrapper.runTest(this);
}
public void testExtractDecodeEditEncodeMuxAudio() throws Throwable {
- setSize(1280, 720);
+ if(!setSize(1280, 720)) return;
setSource(R.raw.video_480x360_mp4_h264_500kbps_30fps_aac_stereo_128kbps_44100hz);
setCopyAudio();
setVerifyAudioFormat();
@@ -140,7 +144,7 @@
}
public void testExtractDecodeEditEncodeMuxAudioVideo() throws Throwable {
- setSize(1280, 720);
+ if(!setSize(1280, 720)) return;
setSource(R.raw.video_480x360_mp4_h264_500kbps_30fps_aac_stereo_128kbps_44100hz);
setCopyAudio();
setCopyVideo();
@@ -203,14 +207,21 @@
}
/**
- * Sets the desired frame size.
+ * Sets the desired frame size and returns whether the given resolution is
+ * supported.
+ *
+ * <p>If decoding/encoding using AVC as the codec, checks that the resolution
+ * is supported. For other codecs, always return {@code true}.
*/
- private void setSize(int width, int height) {
+ private boolean setSize(int width, int height) {
if ((width % 16) != 0 || (height % 16) != 0) {
Log.w(TAG, "WARNING: width or height not multiple of 16");
}
mWidth = width;
mHeight = height;
+
+ // TODO: remove this logic in setSize as it is now handled when configuring codecs
+ return true;
}
/**
diff --git a/tests/tests/nativemedia/sl/Android.mk b/tests/tests/nativemedia/sl/Android.mk
index 48b816c..28dfeff 100644
--- a/tests/tests/nativemedia/sl/Android.mk
+++ b/tests/tests/nativemedia/sl/Android.mk
@@ -6,6 +6,7 @@
list_executable := $(test_executable)_list
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := $(test_executable)
LOCAL_MODULE_TAGS := optional
@@ -15,11 +16,8 @@
LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
LOCAL_C_INCLUDES := \
- bionic \
- bionic/libstdc++/include \
external/gtest/include \
$(call include-path-for, wilhelm) \
- external/stlport/stlport \
$(call include-path-for, wilhelm-ut)
LOCAL_SRC_FILES := \
@@ -29,7 +27,6 @@
libutils \
liblog \
libOpenSLES \
- libstlport
LOCAL_STATIC_LIBRARIES := \
libOpenSLESUT \
@@ -39,6 +36,7 @@
include $(BUILD_CTS_EXECUTABLE)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := $(list_executable)
LOCAL_MODULE_TAGS := optional
diff --git a/tests/tests/nativemedia/xa/Android.mk b/tests/tests/nativemedia/xa/Android.mk
index ace315a..52126c3 100644
--- a/tests/tests/nativemedia/xa/Android.mk
+++ b/tests/tests/nativemedia/xa/Android.mk
@@ -6,6 +6,7 @@
list_executable := $(test_executable)_list
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE:= $(test_executable)
LOCAL_MODULE_TAGS := optional
@@ -15,11 +16,8 @@
LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
LOCAL_C_INCLUDES := \
- bionic \
- bionic/libstdc++/include \
external/gtest/include \
$(call include-path-for, wilhelm) \
- external/stlport/stlport \
$(call include-path-for, wilhelm-ut)
LOCAL_SRC_FILES := \
@@ -29,15 +27,15 @@
libutils \
liblog \
libOpenMAXAL \
- libstlport
LOCAL_STATIC_LIBRARIES := \
- libgtest
+ libgtest \
LOCAL_CTS_TEST_PACKAGE := android.nativemedia.xa
include $(BUILD_CTS_EXECUTABLE)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := $(list_executable)
LOCAL_MODULE_TAGS := optional
diff --git a/tests/tests/nativeopengl/libnativeopengltests/Android.mk b/tests/tests/nativeopengl/libnativeopengltests/Android.mk
index 5d7dd6e..62e28ec 100644
--- a/tests/tests/nativeopengl/libnativeopengltests/Android.mk
+++ b/tests/tests/nativeopengl/libnativeopengltests/Android.mk
@@ -16,9 +16,11 @@
# This is the shared library included by the JNI test app.
#
-LOCAL_PATH:= $(call my-dir)/../standalone/jni/
+LOCAL_PATH := $(call my-dir)/../standalone/jni/
+REAL_LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(REAL_LOCAL_PATH)/Android.mk
LOCAL_MODULE := libnativeopengltests
@@ -26,10 +28,7 @@
LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES := $(JNI_H_INCLUDE) \
- bionic \
- bionic/libstdc++/include \
external/gtest/include \
- external/stlport/stlport
LOCAL_SRC_FILES := \
register.cpp \
@@ -38,11 +37,11 @@
tests/EGLCleanup_test.cpp \
tests/EGLCreateContext_test.cpp
+LOCAL_CXX_STL := libc++
LOCAL_SHARED_LIBRARIES := libEGL \
libGLESv2 \
- libstlport \
libandroid \
- liblog
+ liblog \
LOCAL_STATIC_LIBRARIES := libgtest
diff --git a/tests/tests/net/Android.mk b/tests/tests/net/Android.mk
index 46d4d81..f6e5c90 100644
--- a/tests/tests/net/Android.mk
+++ b/tests/tests/net/Android.mk
@@ -26,15 +26,15 @@
LOCAL_JAVA_LIBRARIES := voip-common conscrypt
-LOCAL_JNI_SHARED_LIBRARIES := libnativedns_jni
+LOCAL_JNI_SHARED_LIBRARIES := libcts_jni libnativedns_jni
# include CtsTestServer as a temporary hack to free net.cts from cts.stub.
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_PACKAGE_NAME := CtsNetTestCases
-LOCAL_STATIC_JAVA_LIBRARIES := ctstestserver ctsdeviceutil ctstestrunner \
- core-tests-support
+LOCAL_STATIC_JAVA_LIBRARIES := core-tests-support ctsdeviceutil \
+ ctstestrunner ctstestserver mockwebserver
# uncomment when b/13249961 is fixed
#LOCAL_SDK_VERSION := current
diff --git a/tests/tests/net/jni/NativeDnsJni.c b/tests/tests/net/jni/NativeDnsJni.c
index b975594..4eb3c7a 100644
--- a/tests/tests/net/jni/NativeDnsJni.c
+++ b/tests/tests/net/jni/NativeDnsJni.c
@@ -18,6 +18,7 @@
#include <jni.h>
#include <netdb.h>
#include <stdio.h>
+#include <string.h>
#include <utils/Log.h>
const char *GoogleDNSIpV4Address="8.8.8.8";
diff --git a/tests/tests/net/src/android/net/cts/LocalSocketTest.java b/tests/tests/net/src/android/net/cts/LocalSocketTest.java
index 0a4bc0d..865ec21 100644
--- a/tests/tests/net/src/android/net/cts/LocalSocketTest.java
+++ b/tests/tests/net/src/android/net/cts/LocalSocketTest.java
@@ -126,8 +126,8 @@
socket.setReceiveBufferSize(1999);
assertEquals(1999 << 1, socket.getReceiveBufferSize());
- socket.setSendBufferSize(1998);
- assertEquals(1998 << 1, socket.getSendBufferSize());
+ socket.setSendBufferSize(3998);
+ assertEquals(3998 << 1, socket.getSendBufferSize());
// Timeout is not support at present, so set is ignored
socket.setSoTimeout(1996);
diff --git a/tests/tests/net/src/android/net/cts/SSLCertificateSocketFactoryTest.java b/tests/tests/net/src/android/net/cts/SSLCertificateSocketFactoryTest.java
index 6175923..60ac226 100644
--- a/tests/tests/net/src/android/net/cts/SSLCertificateSocketFactoryTest.java
+++ b/tests/tests/net/src/android/net/cts/SSLCertificateSocketFactoryTest.java
@@ -26,7 +26,7 @@
import android.net.SSLCertificateSocketFactory;
import android.test.AndroidTestCase;
-import libcore.javax.net.ssl.SSLDefaultConfigurationAsserts;
+import libcore.javax.net.ssl.SSLConfigurationAsserts;
public class SSLCertificateSocketFactoryTest extends AndroidTestCase {
private SSLCertificateSocketFactory mFactory;
@@ -40,7 +40,7 @@
}
public void testDefaultConfiguration() throws Exception {
- SSLDefaultConfigurationAsserts.assertSSLSocketFactory(mFactory);
+ SSLConfigurationAsserts.assertSSLSocketFactoryDefaultConfiguration(mFactory);
}
public void testAccessProperties() throws Exception {
diff --git a/tests/tests/net/src/android/net/http/cts/HttpResponseCacheTest.java b/tests/tests/net/src/android/net/http/cts/HttpResponseCacheTest.java
new file mode 100644
index 0000000..545541d
--- /dev/null
+++ b/tests/tests/net/src/android/net/http/cts/HttpResponseCacheTest.java
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.http.cts;
+
+import com.google.mockwebserver.MockResponse;
+import com.google.mockwebserver.MockWebServer;
+
+import junit.framework.TestCase;
+
+import android.cts.util.FileUtils;
+import android.net.http.HttpResponseCache;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.CacheRequest;
+import java.net.CacheResponse;
+import java.net.ResponseCache;
+import java.net.URI;
+import java.net.URLConnection;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+public final class HttpResponseCacheTest extends TestCase {
+
+ private File cacheDir;
+ private MockWebServer server = new MockWebServer();
+
+ @Override public void setUp() throws Exception {
+ super.setUp();
+ String tmp = System.getProperty("java.io.tmpdir");
+ cacheDir = new File(tmp, "HttpCache-" + UUID.randomUUID());
+ cacheDir.mkdirs();
+ // Make the cache directory read / writable.
+ FileUtils.setPermissions(cacheDir.getPath(), 0777);
+ }
+
+ @Override protected void tearDown() throws Exception {
+ ResponseCache.setDefault(null);
+ server.shutdown();
+ super.tearDown();
+ }
+
+ public void testInstall() throws Exception {
+ HttpResponseCache installed = HttpResponseCache.install(cacheDir, 10 * 1024 * 1024);
+ assertNotNull(installed);
+ assertSame(installed, ResponseCache.getDefault());
+ assertSame(installed, HttpResponseCache.getDefault());
+ }
+
+ public void testSecondEquivalentInstallDoesNothing() throws Exception {
+ HttpResponseCache first = HttpResponseCache.install(cacheDir, 10 * 1024 * 1024);
+ HttpResponseCache another = HttpResponseCache.install(cacheDir, 10 * 1024 * 1024);
+ assertSame(first, another);
+ }
+
+ public void testInstallClosesPreviouslyInstalled() throws Exception {
+ HttpResponseCache first = HttpResponseCache.install(cacheDir, 10 * 1024 * 1024);
+ initializeCache(first);
+
+ HttpResponseCache another = HttpResponseCache.install(cacheDir, 8 * 1024 * 1024);
+ initializeCache(first);
+
+ assertNotSame(first, another);
+ try {
+ first.flush();
+ fail();
+ } catch (IllegalStateException expected) {
+ }
+ }
+
+ public void testGetInstalledWithWrongTypeInstalled() {
+ ResponseCache.setDefault(new ResponseCache() {
+ @Override public CacheResponse get(URI uri, String requestMethod,
+ Map<String, List<String>> requestHeaders) {
+ return null;
+ }
+ @Override public CacheRequest put(URI uri, URLConnection connection) {
+ return null;
+ }
+ });
+ assertNull(HttpResponseCache.getInstalled());
+ }
+
+ public void testCloseCloses() throws Exception {
+ HttpResponseCache cache = HttpResponseCache.install(cacheDir, 10 * 1024 * 1024);
+ initializeCache(cache);
+
+ cache.close();
+ try {
+ cache.flush();
+ fail();
+ } catch (IllegalStateException expected) {
+ }
+ }
+
+ public void testCloseUninstalls() throws Exception {
+ HttpResponseCache cache = HttpResponseCache.install(cacheDir, 10 * 1024 * 1024);
+ cache.close();
+ assertNull(ResponseCache.getDefault());
+ }
+
+ public void testDeleteUninstalls() throws Exception {
+ HttpResponseCache cache = HttpResponseCache.install(cacheDir, 10 * 1024 * 1024);
+ cache.delete();
+ assertNull(ResponseCache.getDefault());
+ }
+
+ /**
+ * Make sure that statistics tracking are wired all the way through the
+ * wrapper class. http://code.google.com/p/android/issues/detail?id=25418
+ */
+ public void testStatisticsTracking() throws Exception {
+ HttpResponseCache cache = HttpResponseCache.install(cacheDir, 10 * 1024 * 1024);
+
+ server.enqueue(new MockResponse()
+ .addHeader("Cache-Control: max-age=60")
+ .setBody("A"));
+ server.play();
+
+ URLConnection c1 = server.getUrl("/").openConnection();
+ InputStream inputStream1 = c1.getInputStream();
+ assertEquals('A', inputStream1.read());
+ inputStream1.close();
+
+ assertEquals(1, cache.getRequestCount());
+ assertEquals(1, cache.getNetworkCount());
+ assertEquals(0, cache.getHitCount());
+
+ URLConnection c2 = server.getUrl("/").openConnection();
+ assertEquals('A', c2.getInputStream().read());
+
+ URLConnection c3 = server.getUrl("/").openConnection();
+ assertEquals('A', c3.getInputStream().read());
+ assertEquals(3, cache.getRequestCount());
+ assertEquals(1, cache.getNetworkCount());
+ assertEquals(2, cache.getHitCount());
+ }
+
+ private void initializeCache(HttpResponseCache cache) {
+ // Ensure the cache is initialized, otherwise various methods are no-ops.
+ cache.size();
+ }
+}
diff --git a/tests/tests/net/src/android/net/wifi/cts/NsdManagerTest.java b/tests/tests/net/src/android/net/wifi/cts/NsdManagerTest.java
index d434728..e132cce 100644
--- a/tests/tests/net/src/android/net/wifi/cts/NsdManagerTest.java
+++ b/tests/tests/net/src/android/net/wifi/cts/NsdManagerTest.java
@@ -372,8 +372,6 @@
assertTrue(lastEvent != null);
assertTrue(lastEvent.mInfo.getServiceName().equals(registeredName));
- assertTrue(eventCacheSize() == 2);
-
// Register service again to see if we discover it
checkForAdditionalEvents();
clearEventCache();
@@ -405,7 +403,6 @@
lastEvent.mInfo.getServiceName());
assertTrue(lastEvent.mInfo.getServiceName().equals(registeredName));
- assertTrue(checkCacheSize(2));
checkForAdditionalEvents();
clearEventCache();
diff --git a/tests/tests/os/jni/Android.mk b/tests/tests/os/jni/Android.mk
index 32a5a9c..dd3bb51 100644
--- a/tests/tests/os/jni/Android.mk
+++ b/tests/tests/os/jni/Android.mk
@@ -25,12 +25,13 @@
CtsOsJniOnLoad.cpp \
android_os_cts_CpuInstructions.cpp.arm \
android_os_cts_TaggedPointer.cpp \
+ android_os_cts_HardwareName.cpp \
android_os_cts_OSFeatures.cpp \
android_os_cts_NoExecutePermissionTest.cpp
LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-LOCAL_SHARED_LIBRARIES := libnativehelper liblog libdl
+LOCAL_SHARED_LIBRARIES := libnativehelper liblog libdl libcutils
LOCAL_SRC_FILES += android_os_cts_CpuFeatures.cpp
LOCAL_C_INCLUDES += ndk/sources/cpufeatures
diff --git a/tests/tests/os/jni/CtsOsJniOnLoad.cpp b/tests/tests/os/jni/CtsOsJniOnLoad.cpp
index 3920915..e4a0dc0 100644
--- a/tests/tests/os/jni/CtsOsJniOnLoad.cpp
+++ b/tests/tests/os/jni/CtsOsJniOnLoad.cpp
@@ -23,6 +23,8 @@
extern int register_android_os_cts_TaggedPointer(JNIEnv*);
+extern int register_android_os_cts_HardwareName(JNIEnv*);
+
extern int register_android_os_cts_OSFeatures(JNIEnv*);
extern int register_android_os_cts_NoExecutePermissionTest(JNIEnv*);
@@ -46,6 +48,10 @@
return JNI_ERR;
}
+ if (register_android_os_cts_HardwareName(env)) {
+ return JNI_ERR;
+ }
+
if (register_android_os_cts_OSFeatures(env)) {
return JNI_ERR;
}
diff --git a/tests/tests/os/jni/android_os_cts_CpuInstructions.cpp b/tests/tests/os/jni/android_os_cts_CpuInstructions.cpp
index 3eea71b..15006f0 100644
--- a/tests/tests/os/jni/android_os_cts_CpuInstructions.cpp
+++ b/tests/tests/os/jni/android_os_cts_CpuInstructions.cpp
@@ -19,6 +19,7 @@
#if defined(__arm__) || defined(__aarch64__)
#include <setjmp.h>
#include <signal.h>
+#include <string.h>
static sigjmp_buf jmpenv;
diff --git a/tests/tests/os/jni/android_os_cts_HardwareName.cpp b/tests/tests/os/jni/android_os_cts_HardwareName.cpp
new file mode 100644
index 0000000..6752aa3
--- /dev/null
+++ b/tests/tests/os/jni/android_os_cts_HardwareName.cpp
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include <jni.h>
+
+#include <cutils/properties.h>
+
+jstring android_os_cts_HardwareName_getName(JNIEnv* env, jobject thiz)
+{
+ char name[PROPERTY_VALUE_MAX];
+ int ret;
+
+ ret = property_get("ro.boot.hardware", name, NULL);
+ if (ret <= 0) {
+ return NULL;
+ }
+
+ return env->NewStringUTF(name);
+}
+
+static JNINativeMethod gMethods[] = {
+ { "getName", "()Ljava/lang/String;",
+ (void *) android_os_cts_HardwareName_getName },
+};
+
+int register_android_os_cts_HardwareName(JNIEnv* env)
+{
+ jclass clazz = env->FindClass("android/os/cts/HardwareName");
+
+ return env->RegisterNatives(clazz, gMethods,
+ sizeof(gMethods) / sizeof(JNINativeMethod));
+}
diff --git a/tests/tests/os/jni/android_os_cts_NoExecutePermissionTest.cpp b/tests/tests/os/jni/android_os_cts_NoExecutePermissionTest.cpp
index e30599c..5425fde 100644
--- a/tests/tests/os/jni/android_os_cts_NoExecutePermissionTest.cpp
+++ b/tests/tests/os/jni/android_os_cts_NoExecutePermissionTest.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*
*/
+#include <errno.h>
#include <jni.h>
#include <string.h>
#include <stdio.h>
diff --git a/tests/tests/os/jni/android_os_cts_OSFeatures.cpp b/tests/tests/os/jni/android_os_cts_OSFeatures.cpp
index 5f3ee4e..2ee31b1 100644
--- a/tests/tests/os/jni/android_os_cts_OSFeatures.cpp
+++ b/tests/tests/os/jni/android_os_cts_OSFeatures.cpp
@@ -14,18 +14,21 @@
* limitations under the License.
*
*/
-#include <jni.h>
-#include <sys/prctl.h>
-#include <string.h>
+
+#include "jni.h"
+
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
#include <linux/filter.h>
#include <linux/seccomp.h>
-#include <sys/utsname.h>
+#include <sys/prctl.h>
#include <sys/types.h>
+#include <sys/utsname.h>
#include <sys/wait.h>
jint android_os_cts_OSFeatures_getNoNewPrivs(JNIEnv* env, jobject thiz)
diff --git a/tests/tests/os/jni/android_os_cts_TaggedPointer.cpp b/tests/tests/os/jni/android_os_cts_TaggedPointer.cpp
index e8f83a3..f656f50 100644
--- a/tests/tests/os/jni/android_os_cts_TaggedPointer.cpp
+++ b/tests/tests/os/jni/android_os_cts_TaggedPointer.cpp
@@ -20,6 +20,7 @@
#include <signal.h>
#include <stdbool.h>
#include <stdlib.h>
+#include <string.h>
//mask the top 8 bits
#define TAG_MASK ((0xFFULL) << 56)
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/os/src/android/os/cts/HardwareName.java
similarity index 72%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/os/src/android/os/cts/HardwareName.java
index 66f3fef..7ee80e6 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/os/src/android/os/cts/HardwareName.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 The Android Open Source Project
+ * Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,13 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+package android.os.cts;
+public class HardwareName {
+
+ static {
+ System.loadLibrary("ctsos_jni");
+ }
+
+ public static native String getName();
+}
diff --git a/tests/tests/os/src/android/os/cts/HardwareNameTest.java b/tests/tests/os/src/android/os/cts/HardwareNameTest.java
new file mode 100644
index 0000000..7a754d1
--- /dev/null
+++ b/tests/tests/os/src/android/os/cts/HardwareNameTest.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.os.cts;
+
+import android.test.AndroidTestCase;
+import android.os.cts.HardwareName;
+
+public class HardwareNameTest extends AndroidTestCase {
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ public void testHardwareNameIsSet() {
+ String name = HardwareName.getName();
+ assertNotNull("androidboot.hardware must be passed on the kernel command line", name);
+ }
+}
diff --git a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
old mode 100755
new mode 100644
index babc93f..f590f97
--- a/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java
@@ -164,6 +164,7 @@
assertFalse(f.canRead());
assertFalse(f.canWrite());
assertFalse(f.canExecute());
+ assertFalse(f.exists());
}
@MediumTest
@@ -172,6 +173,7 @@
assertFalse(f.canRead());
assertFalse(f.canWrite());
assertFalse(f.canExecute());
+ assertFalse(f.exists());
}
@MediumTest
@@ -717,21 +719,6 @@
assertTrue(mountPoint + " is not mounted read-only", pm.isMountReadOnly(mountPoint));
}
- /**
- * Test that the /system directory, as mounted by init, is mounted read-only.
- * Different processes can have different mount namespaces, so init
- * may be in a different mount namespace than Zygote spawned processes.
- *
- * This test assumes that init's filesystem layout is roughly identical
- * to Zygote's filesystem layout. If this assumption ever changes, we should
- * delete this test.
- */
- public void testSystemMountedRO_init() throws IOException {
- ParsedMounts pm = new ParsedMounts("/proc/1/mounts");
- String mountPoint = pm.findMountPointContaining(new File("/system"));
- assertTrue(mountPoint + " is not mounted read-only", pm.isMountReadOnly(mountPoint));
- }
-
public void testRootMountedRO() throws IOException {
ParsedMounts pm = new ParsedMounts("/proc/self/mounts");
String mountPoint = pm.findMountPointContaining(new File("/"));
@@ -739,22 +726,6 @@
pm.isMountReadOnly(mountPoint));
}
- /**
- * Test that the root directory, as mounted by init, is mounted read-only.
- * Different processes can have different mount namespaces, so init
- * may be in a different mount namespace than Zygote spawned processes.
- *
- * This test assumes that init's filesystem layout is roughly identical
- * to Zygote's filesystem layout. If this assumption ever changes, we should
- * delete this test.
- */
- public void testRootMountedRO_init() throws IOException {
- ParsedMounts pm = new ParsedMounts("/proc/1/mounts");
- String mountPoint = pm.findMountPointContaining(new File("/"));
- assertTrue("The root directory \"" + mountPoint + "\" is not mounted read-only",
- pm.isMountReadOnly(mountPoint));
- }
-
public void testAllBlockDevicesAreSecure() throws Exception {
Set<File> insecure = getAllInsecureDevicesInDirAndSubdir(new File("/dev"), FileUtils.S_IFBLK);
assertTrue("Found insecure block devices: " + insecure.toString(),
diff --git a/tests/tests/provider/src/android/provider/cts/BrowserTest.java b/tests/tests/provider/src/android/provider/cts/BrowserTest.java
index 2f0432a..9f96412 100644
--- a/tests/tests/provider/src/android/provider/cts/BrowserTest.java
+++ b/tests/tests/provider/src/android/provider/cts/BrowserTest.java
@@ -84,7 +84,9 @@
value.put(colNames[i], cursor.getFloat(i));
break;
case Cursor.FIELD_TYPE_INTEGER:
- value.put(colNames[i], cursor.getLong(i));
+ if (!"_ID".equalsIgnoreCase(colNames[i])) {
+ value.put(colNames[i], cursor.getLong(i));
+ }
break;
case Cursor.FIELD_TYPE_STRING:
value.put(colNames[i], cursor.getString(i));
diff --git a/tests/tests/renderscript/libcoremathtestcpp/Android.mk b/tests/tests/renderscript/libcoremathtestcpp/Android.mk
index 7ec8671..3b693e0 100644
--- a/tests/tests/renderscript/libcoremathtestcpp/Android.mk
+++ b/tests/tests/renderscript/libcoremathtestcpp/Android.mk
@@ -17,15 +17,17 @@
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := libcoremathtestcpp_jni
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := CoreMathTestJni.cpp
+LOCAL_CFLAGS := -std=c++11
+
LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
LOCAL_C_INCLUDES += frameworks/rs/cpp
LOCAL_C_INCLUDES += frameworks/rs
-LOCAL_C_INCLUDES += external/stlport/stlport bionic/ bionic/libstdc++/include
-LOCAL_SHARED_LIBRARIES := libdl liblog libRScpp libstlport
+LOCAL_SHARED_LIBRARIES := libdl liblog libRScpp
LOCAL_STATIC_LIBRARIES := libcutils
include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/CoreMathVerifier.java b/tests/tests/renderscript/src/android/renderscript/cts/CoreMathVerifier.java
index dfcf1f5..653329b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/CoreMathVerifier.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/CoreMathVerifier.java
@@ -290,14 +290,14 @@
}
static private Target.Floaty atan2(float y, float x, Target t) {
- Target.Floaty inY = t.new32(y);
- Target.Floaty inX = t.new32(x);
+ Target.Floaty numerator = t.new32(y);
+ Target.Floaty denominator = t.new32(x);
return t.new32(
- atan2(inY.mid32(), inX.mid32()),
- atan2(inY.min32(), inX.min32()),
- atan2(inY.min32(), inX.max32()),
- atan2(inY.max32(), inX.min32()),
- atan2(inY.max32(), inX.max32()));
+ atan2(numerator.mid32(), denominator.mid32()),
+ atan2(numerator.min32(), denominator.min32()),
+ atan2(numerator.min32(), denominator.max32()),
+ atan2(numerator.max32(), denominator.min32()),
+ atan2(numerator.max32(), denominator.max32()));
}
static private Target.Floaty atan2pi(float y, float x, Target t) {
@@ -462,14 +462,14 @@
}
static private Target.Floaty powr(float x, float y, Target t) {
- Target.Floaty inX = t.new32(x);
- Target.Floaty inY = t.new32(y);
+ Target.Floaty base = t.new32(x);
+ Target.Floaty exponent = t.new32(y);
return t.new32(
- pow(inX.mid32(), inY.mid32()),
- pow(inX.min32(), inY.min32()),
- pow(inX.min32(), inY.max32()),
- pow(inX.max32(), inY.min32()),
- pow(inX.max32(), inY.max32()));
+ pow(base.mid32(), exponent.mid32()),
+ pow(base.min32(), exponent.min32()),
+ pow(base.min32(), exponent.max32()),
+ pow(base.max32(), exponent.min32()),
+ pow(base.max32(), exponent.max32()));
}
static private Target.Floaty recip(float f, Target t) {
@@ -569,622 +569,622 @@
}
}
- static public void computeAbs(TestAbs.ArgumentsCharUchar args) {
- args.out = (byte)Math.abs(args.inValue);
+ static public void computeAbs(GeneratedTestAbs.ArgumentsCharUchar args) {
+ args.out = (byte)Math.abs(args.inV);
}
- static public void computeAbs(TestAbs.ArgumentsShortUshort args) {
- args.out = (short)Math.abs(args.inValue);
+ static public void computeAbs(GeneratedTestAbs.ArgumentsShortUshort args) {
+ args.out = (short)Math.abs(args.inV);
}
- static public void computeAbs(TestAbs.ArgumentsIntUint args) {
- args.out = Math.abs(args.inValue);
+ static public void computeAbs(GeneratedTestAbs.ArgumentsIntUint args) {
+ args.out = Math.abs(args.inV);
}
- static public void computeAcos(TestAcos.ArgumentsFloatFloat args, Target t) {
+ static public void computeAcos(GeneratedTestAcos.ArgumentsFloatFloat args, Target t) {
t.setPrecision(4, 128, false);
args.out = acos(args.inV, t);
}
- static public void computeAcosh(TestAcosh.ArgumentsFloatFloat args, Target t) {
+ static public void computeAcosh(GeneratedTestAcosh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(4, 128, false);
- args.out = acosh(args.in, t);
+ args.out = acosh(args.inV, t);
}
- static public void computeAcospi(TestAcospi.ArgumentsFloatFloat args, Target t) {
+ static public void computeAcospi(GeneratedTestAcospi.ArgumentsFloatFloat args, Target t) {
t.setPrecision(5, 128, false);
args.out = acospi(args.inV, t);
}
- static public void computeAsin(TestAsin.ArgumentsFloatFloat args, Target t) {
+ static public void computeAsin(GeneratedTestAsin.ArgumentsFloatFloat args, Target t) {
t.setPrecision(4, 128, false);
args.out = asin(args.inV, t);
}
- static public void computeAsinh(TestAsinh.ArgumentsFloatFloat args, Target t) {
+ static public void computeAsinh(GeneratedTestAsinh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(4, 128, false);
- args.out = asinh(args.in, t);
+ args.out = asinh(args.inV, t);
}
- static public void computeAsinpi(TestAsinpi.ArgumentsFloatFloat args, Target t) {
+ static public void computeAsinpi(GeneratedTestAsinpi.ArgumentsFloatFloat args, Target t) {
t.setPrecision(5, 128, false);
args.out = asinpi(args.inV, t);
}
- static public void computeAtan(TestAtan.ArgumentsFloatFloat args, Target t) {
+ static public void computeAtan(GeneratedTestAtan.ArgumentsFloatFloat args, Target t) {
t.setPrecision(5, 128, false);
args.out = atan(args.inV, t);
}
- static public void computeAtanh(TestAtanh.ArgumentsFloatFloat args, Target t) {
+ static public void computeAtanh(GeneratedTestAtanh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(5, 128, false);
args.out = atanh(args.inV, t);
}
- static public void computeAtanpi(TestAtanpi.ArgumentsFloatFloat args, Target t) {
+ static public void computeAtanpi(GeneratedTestAtanpi.ArgumentsFloatFloat args, Target t) {
t.setPrecision(5, 128, false);
args.out = atanpi(args.inV, t);
}
- static public void computeAtan2(TestAtan2.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeAtan2(GeneratedTestAtan2.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(6, 128, false);
- args.out = atan2(args.inY, args.inX, t);
+ args.out = atan2(args.inNumerator, args.inDenominator, t);
}
- static public void computeAtan2pi(TestAtan2pi.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeAtan2pi(GeneratedTestAtan2pi.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(6, 128, false);
- args.out = atan2pi(args.inY, args.inX, t);
+ args.out = atan2pi(args.inNumerator, args.inDenominator, t);
}
- static public void computeCbrt(TestCbrt.ArgumentsFloatFloat args, Target t) {
+ static public void computeCbrt(GeneratedTestCbrt.ArgumentsFloatFloat args, Target t) {
t.setPrecision(2, 128, false);
- args.out = cbrt(args.in, t);
+ args.out = cbrt(args.inV, t);
}
- static public void computeCeil(TestCeil.ArgumentsFloatFloat args, Target t) {
+ static public void computeCeil(GeneratedTestCeil.ArgumentsFloatFloat args, Target t) {
t.setPrecision(0, 1, false);
- Target.Floaty in = t.new32(args.in);
+ Target.Floaty in = t.new32(args.inV);
args.out = t.new32(
ceil(in.mid32()),
ceil(in.min32()),
ceil(in.max32()));
}
- static public void computeClamp(TestClamp.ArgumentsCharCharCharChar args) {
+ static public void computeClamp(GeneratedTestClamp.ArgumentsCharCharCharChar args) {
args.out = minI8(args.inMaxValue, maxI8(args.inValue, args.inMinValue));
}
- static public void computeClamp(TestClamp.ArgumentsUcharUcharUcharUchar args) {
+ static public void computeClamp(GeneratedTestClamp.ArgumentsUcharUcharUcharUchar args) {
args.out = minU8(args.inMaxValue, maxU8(args.inValue, args.inMinValue));
}
- static public void computeClamp(TestClamp.ArgumentsShortShortShortShort args) {
+ static public void computeClamp(GeneratedTestClamp.ArgumentsShortShortShortShort args) {
args.out = minI16(args.inMaxValue, maxI16(args.inValue, args.inMinValue));
}
- static public void computeClamp(TestClamp.ArgumentsUshortUshortUshortUshort args) {
+ static public void computeClamp(GeneratedTestClamp.ArgumentsUshortUshortUshortUshort args) {
args.out = minU16(args.inMaxValue, maxU16(args.inValue, args.inMinValue));
}
- static public void computeClamp(TestClamp.ArgumentsIntIntIntInt args) {
+ static public void computeClamp(GeneratedTestClamp.ArgumentsIntIntIntInt args) {
args.out = minI32(args.inMaxValue, maxI32(args.inValue, args.inMinValue));
}
- static public void computeClamp(TestClamp.ArgumentsUintUintUintUint args) {
+ static public void computeClamp(GeneratedTestClamp.ArgumentsUintUintUintUint args) {
args.out = minU32(args.inMaxValue, maxU32(args.inValue, args.inMinValue));
}
- static public void computeClamp(TestClamp.ArgumentsFloatFloatFloatFloat args, Target t) {
+ static public void computeClamp(GeneratedTestClamp.ArgumentsFloatFloatFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new32(Math.min(args.inMaxValue,
Math.max(args.inValue, args.inMinValue)));
}
- static public void computeClamp(TestClamp.ArgumentsLongLongLongLong args) {
+ static public void computeClamp(GeneratedTestClamp.ArgumentsLongLongLongLong args) {
args.out = minI64(args.inMaxValue, maxI64(args.inValue, args.inMinValue));
}
- static public void computeClamp(TestClamp.ArgumentsUlongUlongUlongUlong args) {
+ static public void computeClamp(GeneratedTestClamp.ArgumentsUlongUlongUlongUlong args) {
args.out = minU64(args.inMaxValue, maxU64(args.inValue, args.inMinValue));
}
- static public void computeClz(TestClz.ArgumentsCharChar args) {
+ static public void computeClz(GeneratedTestClz.ArgumentsCharChar args) {
int x = args.inValue;
args.out = (byte) (Integer.numberOfLeadingZeros(x & 0xff) - 24);
}
- static public void computeClz(TestClz.ArgumentsUcharUchar args) {
+ static public void computeClz(GeneratedTestClz.ArgumentsUcharUchar args) {
int x = args.inValue;
args.out = (byte) (Integer.numberOfLeadingZeros(x & 0xff) - 24);
}
- static public void computeClz(TestClz.ArgumentsShortShort args) {
+ static public void computeClz(GeneratedTestClz.ArgumentsShortShort args) {
args.out = (short) (Integer.numberOfLeadingZeros(args.inValue & 0xffff) - 16);
}
- static public void computeClz(TestClz.ArgumentsUshortUshort args) {
+ static public void computeClz(GeneratedTestClz.ArgumentsUshortUshort args) {
args.out = (short) (Integer.numberOfLeadingZeros(args.inValue & 0xffff) - 16);
}
- static public void computeClz(TestClz.ArgumentsIntInt args) {
+ static public void computeClz(GeneratedTestClz.ArgumentsIntInt args) {
args.out = (int) Integer.numberOfLeadingZeros(args.inValue);
}
- static public void computeClz(TestClz.ArgumentsUintUint args) {
+ static public void computeClz(GeneratedTestClz.ArgumentsUintUint args) {
args.out = (int) Integer.numberOfLeadingZeros(args.inValue);
}
- static public void computeConvert(TestConvert.ArgumentsCharChar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsCharChar args) {
args.out = convertCharToChar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsCharUchar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsCharUchar args) {
args.out = convertCharToUchar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsCharShort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsCharShort args) {
args.out = convertCharToShort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsCharUshort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsCharUshort args) {
args.out = convertCharToUshort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsCharInt args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsCharInt args) {
args.out = convertCharToInt(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsCharUint args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsCharUint args) {
args.out = convertCharToUint(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsCharLong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsCharLong args) {
args.out = convertCharToLong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsCharUlong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsCharUlong args) {
args.out = convertCharToUlong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsCharFloat args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsCharFloat args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new32(convertCharToFloat(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsCharDouble args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsCharDouble args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new64(convertCharToDouble(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsUcharChar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUcharChar args) {
args.out = convertUcharToChar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUcharUchar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUcharUchar args) {
args.out = convertUcharToUchar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUcharShort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUcharShort args) {
args.out = convertUcharToShort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUcharUshort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUcharUshort args) {
args.out = convertUcharToUshort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUcharInt args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUcharInt args) {
args.out = convertUcharToInt(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUcharUint args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUcharUint args) {
args.out = convertUcharToUint(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUcharLong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUcharLong args) {
args.out = convertUcharToLong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUcharUlong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUcharUlong args) {
args.out = convertUcharToUlong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUcharFloat args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUcharFloat args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new32(convertUcharToFloat(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsUcharDouble args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUcharDouble args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new64(convertUcharToDouble(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsShortChar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsShortChar args) {
args.out = convertShortToChar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsShortUchar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsShortUchar args) {
args.out = convertShortToUchar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsShortShort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsShortShort args) {
args.out = convertShortToShort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsShortUshort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsShortUshort args) {
args.out = convertShortToUshort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsShortInt args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsShortInt args) {
args.out = convertShortToInt(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsShortUint args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsShortUint args) {
args.out = convertShortToUint(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsShortLong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsShortLong args) {
args.out = convertShortToLong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsShortUlong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsShortUlong args) {
args.out = convertShortToUlong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsShortFloat args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsShortFloat args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new32(convertShortToFloat(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsShortDouble args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsShortDouble args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new64(convertShortToDouble(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsUshortChar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUshortChar args) {
args.out = convertUshortToChar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUshortUchar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUshortUchar args) {
args.out = convertUshortToUchar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUshortShort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUshortShort args) {
args.out = convertUshortToShort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUshortUshort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUshortUshort args) {
args.out = convertUshortToUshort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUshortInt args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUshortInt args) {
args.out = convertUshortToInt(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUshortUint args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUshortUint args) {
args.out = convertUshortToUint(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUshortLong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUshortLong args) {
args.out = convertUshortToLong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUshortUlong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUshortUlong args) {
args.out = convertUshortToUlong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUshortFloat args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUshortFloat args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new32(convertUshortToFloat(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsUshortDouble args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUshortDouble args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new64(convertUshortToDouble(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsIntChar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsIntChar args) {
args.out = convertIntToChar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsIntUchar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsIntUchar args) {
args.out = convertIntToUchar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsIntShort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsIntShort args) {
args.out = convertIntToShort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsIntUshort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsIntUshort args) {
args.out = convertIntToUshort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsIntInt args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsIntInt args) {
args.out = convertIntToInt(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsIntUint args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsIntUint args) {
args.out = convertIntToUint(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsIntLong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsIntLong args) {
args.out = convertIntToLong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsIntUlong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsIntUlong args) {
args.out = convertIntToUlong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsIntFloat args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsIntFloat args, Target t) {
t.setPrecision(1, 1, false);
args.out = t.new32(convertIntToFloat(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsIntDouble args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsIntDouble args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new64(convertIntToDouble(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsUintChar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUintChar args) {
args.out = convertUintToChar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUintUchar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUintUchar args) {
args.out = convertUintToUchar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUintShort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUintShort args) {
args.out = convertUintToShort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUintUshort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUintUshort args) {
args.out = convertUintToUshort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUintInt args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUintInt args) {
args.out = convertUintToInt(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUintUint args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUintUint args) {
args.out = convertUintToUint(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUintLong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUintLong args) {
args.out = convertUintToLong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUintUlong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUintUlong args) {
args.out = convertUintToUlong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUintFloat args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUintFloat args, Target t) {
t.setPrecision(1, 1, false);
args.out = t.new32(convertUintToFloat(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsUintDouble args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUintDouble args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new64(convertUintToDouble(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsLongChar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsLongChar args) {
args.out = convertLongToChar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsLongUchar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsLongUchar args) {
args.out = convertLongToUchar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsLongShort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsLongShort args) {
args.out = convertLongToShort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsLongUshort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsLongUshort args) {
args.out = convertLongToUshort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsLongInt args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsLongInt args) {
args.out = convertLongToInt(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsLongUint args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsLongUint args) {
args.out = convertLongToUint(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsLongLong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsLongLong args) {
args.out = convertLongToLong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsLongUlong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsLongUlong args) {
args.out = convertLongToUlong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsLongFloat args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsLongFloat args, Target t) {
t.setPrecision(1, 1, false);
args.out = t.new32(convertLongToFloat(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsLongDouble args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsLongDouble args, Target t) {
t.setPrecision(1, 1, false);
args.out = t.new64(convertLongToDouble(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsUlongChar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUlongChar args) {
args.out = convertUlongToChar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUlongUchar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUlongUchar args) {
args.out = convertUlongToUchar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUlongShort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUlongShort args) {
args.out = convertUlongToShort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUlongUshort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUlongUshort args) {
args.out = convertUlongToUshort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUlongInt args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUlongInt args) {
args.out = convertUlongToInt(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUlongUint args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUlongUint args) {
args.out = convertUlongToUint(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUlongLong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUlongLong args) {
args.out = convertUlongToLong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUlongUlong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUlongUlong args) {
args.out = convertUlongToUlong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsUlongFloat args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUlongFloat args, Target t) {
t.setPrecision(1, 1, false);
args.out = t.new32(convertUlongToFloat(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsUlongDouble args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsUlongDouble args, Target t) {
t.setPrecision(1, 1, false);
args.out = t.new64(convertUlongToDouble(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsFloatChar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsFloatChar args) {
args.out = convertFloatToChar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsFloatUchar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsFloatUchar args) {
args.out = convertFloatToUchar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsFloatShort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsFloatShort args) {
args.out = convertFloatToShort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsFloatUshort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsFloatUshort args) {
args.out = convertFloatToUshort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsFloatInt args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsFloatInt args) {
args.out = convertFloatToInt(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsFloatUint args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsFloatUint args) {
args.out = convertFloatToUint(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsFloatLong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsFloatLong args) {
args.out = convertFloatToLong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsFloatUlong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsFloatUlong args) {
args.out = convertFloatToUlong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsFloatFloat args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new32(convertFloatToFloat(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsFloatDouble args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsFloatDouble args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new64(convertFloatToDouble(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsDoubleChar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsDoubleChar args) {
args.out = convertDoubleToChar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsDoubleUchar args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsDoubleUchar args) {
args.out = convertDoubleToUchar(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsDoubleShort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsDoubleShort args) {
args.out = convertDoubleToShort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsDoubleUshort args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsDoubleUshort args) {
args.out = convertDoubleToUshort(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsDoubleInt args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsDoubleInt args) {
args.out = convertDoubleToInt(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsDoubleUint args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsDoubleUint args) {
args.out = convertDoubleToUint(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsDoubleLong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsDoubleLong args) {
args.out = convertDoubleToLong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsDoubleUlong args) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsDoubleUlong args) {
args.out = convertDoubleToUlong(args.inV);
}
- static public void computeConvert(TestConvert.ArgumentsDoubleFloat args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsDoubleFloat args, Target t) {
t.setPrecision(1, 1, false);
args.out = t.new32(convertDoubleToFloat(args.inV));
}
- static public void computeConvert(TestConvert.ArgumentsDoubleDouble args, Target t) {
+ static public void computeConvert(GeneratedTestConvert.ArgumentsDoubleDouble args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new64(convertDoubleToDouble(args.inV));
}
- static public void computeCopysign(TestCopysign.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeCopysign(GeneratedTestCopysign.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- args.out = t.new32(Math.copySign(args.inX, args.inY));
+ args.out = t.new32(Math.copySign(args.inMagnitudeValue, args.inSignValue));
}
- static public void computeCos(TestCos.ArgumentsFloatFloat args, Target t) {
+ static public void computeCos(GeneratedTestCos.ArgumentsFloatFloat args, Target t) {
t.setPrecision(4, 128, false);
- args.out = cos(args.in, t);
+ args.out = cos(args.inV, t);
}
- static public void computeCosh(TestCosh.ArgumentsFloatFloat args, Target t) {
+ static public void computeCosh(GeneratedTestCosh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(4, 128, false);
- args.out = cosh(args.in, t);
+ args.out = cosh(args.inV, t);
}
- static public void computeCospi(TestCospi.ArgumentsFloatFloat args, Target t) {
+ static public void computeCospi(GeneratedTestCospi.ArgumentsFloatFloat args, Target t) {
t.setPrecision(4, 128, false);
- args.out = cospi(args.in, t);
+ args.out = cospi(args.inV, t);
}
- static public void computeCross(TestCross.ArgumentsFloatNFloatNFloatN args, Target t) {
+ static public void computeCross(GeneratedTestCross.ArgumentsFloatNFloatNFloatN args, Target t) {
t.setPrecision(1, 4, false);
- cross(args.inLhs, args.inRhs, args.out, t);
+ cross(args.inLeftVector, args.inRightVector, args.out, t);
}
- static public void computeDegrees(TestDegrees.ArgumentsFloatFloat args, Target t) {
+ static public void computeDegrees(GeneratedTestDegrees.ArgumentsFloatFloat args, Target t) {
t.setPrecision(3, 3, false);
- Target.Floaty in = t.new32(args.inValue);
+ Target.Floaty in = t.new32(args.inV);
Target.Floaty k = t.new32((float)(180.0 / Math.PI));
args.out = t.multiply(in, k);
}
- static public void computeDistance(TestDistance.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeDistance(GeneratedTestDistance.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(1, 1, false);
- args.out = distance(new float[] {args.inLhs}, new float[] {args.inRhs}, t);
+ args.out = distance(new float[] {args.inLeftVector}, new float[] {args.inRightVector}, t);
}
- static public void computeDistance(TestDistance.ArgumentsFloatNFloatNFloat args, Target t) {
+ static public void computeDistance(GeneratedTestDistance.ArgumentsFloatNFloatNFloat args, Target t) {
t.setPrecision(1, 1, false);
- args.out = distance(args.inLhs, args.inRhs, t);
+ args.out = distance(args.inLeftVector, args.inRightVector, t);
}
- static public void computeDot(TestDot.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeDot(GeneratedTestDot.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(1, 4, false);
- Target.Floaty a = t.new32(args.inLhs);
- Target.Floaty b = t.new32(args.inRhs);
+ Target.Floaty a = t.new32(args.inLeftVector);
+ Target.Floaty b = t.new32(args.inRightVector);
args.out = t.multiply(a, b);
}
- static public void computeDot(TestDot.ArgumentsFloatNFloatNFloat args, Target t) {
+ static public void computeDot(GeneratedTestDot.ArgumentsFloatNFloatNFloat args, Target t) {
t.setPrecision(1, 4, false);
Target.Floaty sum = t.new32(0.f);
- for (int i = 0; i < args.inLhs.length; i++) {
- Target.Floaty a = t.new32(args.inLhs[i]);
- Target.Floaty b = t.new32(args.inRhs[i]);
+ for (int i = 0; i < args.inLeftVector.length; i++) {
+ Target.Floaty a = t.new32(args.inLeftVector[i]);
+ Target.Floaty b = t.new32(args.inRightVector[i]);
sum = t.add(sum, t.multiply(a, b));
}
args.out = sum;
}
- static public void computeErf(TestErf.ArgumentsFloatFloat args, Target t) {
+ static public void computeErf(GeneratedTestErf.ArgumentsFloatFloat args, Target t) {
t.setPrecision(16, 128, false);
- Target.Floaty in = t.new32(args.in);
+ Target.Floaty in = t.new32(args.inV);
args.out = t.new32(
- erf(args.in),
+ erf(args.inV),
erf(in.min32()),
erf(in.max32()));
}
- static public void computeErfc(TestErfc.ArgumentsFloatFloat args, Target t) {
+ static public void computeErfc(GeneratedTestErfc.ArgumentsFloatFloat args, Target t) {
t.setPrecision(16, 128, false);
- Target.Floaty in = t.new32(args.in);
+ Target.Floaty in = t.new32(args.inV);
args.out = t.new32(
- erfc(args.in),
+ erfc(args.inV),
erfc(in.min32()),
erfc(in.max32()));
}
- static public void computeExp(TestExp.ArgumentsFloatFloat args, Target t) {
+ static public void computeExp(GeneratedTestExp.ArgumentsFloatFloat args, Target t) {
t.setPrecision(3, 16, false);
- args.out = exp(args.in, t);
+ args.out = exp(args.inV, t);
}
- static public void computeExp10(TestExp10.ArgumentsFloatFloat args, Target t) {
+ static public void computeExp10(GeneratedTestExp10.ArgumentsFloatFloat args, Target t) {
t.setPrecision(3, 32, false);
- args.out = exp10(args.in, t);
+ args.out = exp10(args.inV, t);
}
- static public void computeExp2(TestExp2.ArgumentsFloatFloat args, Target t) {
+ static public void computeExp2(GeneratedTestExp2.ArgumentsFloatFloat args, Target t) {
t.setPrecision(3, 16, false);
- args.out = exp2(args.in, t);
+ args.out = exp2(args.inV, t);
}
- static public void computeExpm1(TestExpm1.ArgumentsFloatFloat args, Target t) {
+ static public void computeExpm1(GeneratedTestExpm1.ArgumentsFloatFloat args, Target t) {
t.setPrecision(3, 16, false);
- args.out = expm1(args.in, t);
+ args.out = expm1(args.inV, t);
}
- static public void computeFabs(TestFabs.ArgumentsFloatFloat args, Target t) {
+ static public void computeFabs(GeneratedTestFabs.ArgumentsFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- Target.Floaty in = t.new32(args.in);
+ Target.Floaty in = t.new32(args.inV);
args.out = t.new32(
- Math.abs(args.in),
+ Math.abs(args.inV),
Math.abs(in.min32()),
Math.abs(in.max32()));
}
- static public void computeFastDistance(TestFastDistance.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeFastDistance(GeneratedTestFastDistance.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(FAST_PRECISION, FAST_PRECISION, false);
- args.out = distance(new float[] {args.inLhs}, new float[] {args.inRhs}, t);
+ args.out = distance(new float[] {args.inLeftVector}, new float[] {args.inRightVector}, t);
}
- static public void computeFastDistance(TestFastDistance.ArgumentsFloatNFloatNFloat args, Target t) {
+ static public void computeFastDistance(GeneratedTestFastDistance.ArgumentsFloatNFloatNFloat args, Target t) {
t.setPrecision(FAST_PRECISION, FAST_PRECISION, false);
- args.out = distance(args.inLhs, args.inRhs, t);
+ args.out = distance(args.inLeftVector, args.inRightVector, t);
}
- static public void computeFastLength(TestFastLength.ArgumentsFloatFloat args, Target t) {
+ static public void computeFastLength(GeneratedTestFastLength.ArgumentsFloatFloat args, Target t) {
t.setPrecision(FAST_PRECISION, FAST_PRECISION, false);
args.out = length(new float[] {args.inV}, t);
}
- static public void computeFastLength(TestFastLength.ArgumentsFloatNFloat args, Target t) {
+ static public void computeFastLength(GeneratedTestFastLength.ArgumentsFloatNFloat args, Target t) {
t.setPrecision(FAST_PRECISION, FAST_PRECISION, false);
args.out = length(args.inV, t);
}
- static public void computeFastNormalize(TestFastNormalize.ArgumentsFloatFloat args, Target t) {
+ static public void computeFastNormalize(GeneratedTestFastNormalize.ArgumentsFloatFloat args, Target t) {
t.setPrecision(FAST_PRECISION, FAST_PRECISION, false);
Target.Floaty[] out = new Target.Floaty[1];
normalize(new float[] {args.inV}, out, t);
args.out = out[0];
}
- static public void computeFastNormalize(TestFastNormalize.ArgumentsFloatNFloatN args, Target t) {
+ static public void computeFastNormalize(GeneratedTestFastNormalize.ArgumentsFloatNFloatN args, Target t) {
t.setPrecision(FAST_PRECISION, FAST_PRECISION, false);
normalize(args.inV, args.out, t);
}
- static public void computeFdim(TestFdim.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeFdim(GeneratedTestFdim.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(1, 1, false);
Target.Floaty inA = t.new32(args.inA);
Target.Floaty inB = t.new32(args.inB);
@@ -1195,58 +1195,58 @@
Math.max(0.f, r.max32()));
}
- static public void computeFloor(TestFloor.ArgumentsFloatFloat args, Target t) {
+ static public void computeFloor(GeneratedTestFloor.ArgumentsFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- Target.Floaty in = t.new32(args.in);
+ Target.Floaty in = t.new32(args.inV);
args.out = t.new32(
- floor(args.in),
+ floor(args.inV),
floor(in.min32()),
floor(in.max32()));
}
- static public void computeFma(TestFma.ArgumentsFloatFloatFloatFloat args, Target t) {
+ static public void computeFma(GeneratedTestFma.ArgumentsFloatFloatFloatFloat args, Target t) {
t.setPrecision(1, 1, false);
- Target.Floaty ab = t.multiply(t.new32(args.inA), t.new32(args.inB));
- args.out = t.add(ab, t.new32(args.inC));
+ Target.Floaty ab = t.multiply(t.new32(args.inMultiplicand1), t.new32(args.inMultiplicand2));
+ args.out = t.add(ab, t.new32(args.inOffset));
}
- static public void computeFmax(TestFmax.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeFmax(GeneratedTestFmax.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- Target.Floaty inX = t.new32(args.inX);
- Target.Floaty inY = t.new32(args.inY);
+ Target.Floaty a = t.new32(args.inA);
+ Target.Floaty b = t.new32(args.inB);
args.out = t.new32(
- Math.max(args.inX, args.inY),
- Math.max(inX.min32(), inY.min32()),
- Math.max(inX.min32(), inY.max32()),
- Math.max(inX.max32(), inY.min32()),
- Math.max(inX.max32(), inY.max32()));
+ Math.max(args.inA, args.inB),
+ Math.max(a.min32(), b.min32()),
+ Math.max(a.min32(), b.max32()),
+ Math.max(a.max32(), b.min32()),
+ Math.max(a.max32(), b.max32()));
}
- static public void computeFmin(TestFmin.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeFmin(GeneratedTestFmin.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- Target.Floaty inX = t.new32(args.inX);
- Target.Floaty inY = t.new32(args.inY);
+ Target.Floaty a = t.new32(args.inA);
+ Target.Floaty b = t.new32(args.inB);
args.out = t.new32(
- Math.min(args.inX, args.inY),
- Math.min(inX.min32(), inY.min32()),
- Math.min(inX.min32(), inY.max32()),
- Math.min(inX.max32(), inY.min32()),
- Math.min(inX.max32(), inY.max32()));
+ Math.min(args.inA, args.inB),
+ Math.min(a.min32(), b.min32()),
+ Math.min(a.min32(), b.max32()),
+ Math.min(a.max32(), b.min32()),
+ Math.min(a.max32(), b.max32()));
}
- static public void computeFmod(TestFmod.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeFmod(GeneratedTestFmod.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(1, 1, false);
- Target.Floaty inX = t.new32(args.inX);
- Target.Floaty inY = t.new32(args.inY);
+ Target.Floaty numerator = t.new32(args.inNumerator);
+ Target.Floaty denominator = t.new32(args.inDenominator);
args.out = t.new32(
- args.inX % args.inY,
- inX.min32() % inY.min32(),
- inX.min32() % inY.max32(),
- inX.max32() % inY.min32(),
- inX.max32() % inY.max32());
+ args.inNumerator % args.inDenominator,
+ numerator.min32() % denominator.min32(),
+ numerator.min32() % denominator.max32(),
+ numerator.max32() % denominator.min32(),
+ numerator.max32() % denominator.max32());
}
- static public void computeFract(TestFract.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeFract(GeneratedTestFract.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(1, 1, false);
float floor = floor(args.inV);
args.outFloor = t.new32(floor);
@@ -1254,49 +1254,49 @@
args.out = t.new32(Math.min(args.inV - floor, 0x1.fffffep-1f));
}
- static public void computeFract(TestFract.ArgumentsFloatFloat args, Target t) {
+ static public void computeFract(GeneratedTestFract.ArgumentsFloatFloat args, Target t) {
t.setPrecision(1, 1, false);
float floor = floor(args.inV);
// 0x1.fffffep-1f is 0.999999...
args.out = t.new32(Math.min(args.inV - floor, 0x1.fffffep-1f));
}
- static public void computeFrexp(TestFrexp.ArgumentsFloatIntFloat args, Target t) {
+ static public void computeFrexp(GeneratedTestFrexp.ArgumentsFloatIntFloat args, Target t) {
t.setPrecision(0, 0, false);
FrexpResult result = frexp(args.inV);
args.out = t.new32(result.significand);
- args.outIptr = result.exponent;
+ args.outExponent = result.exponent;
}
- static public void computeHalfRecip(TestHalfRecip.ArgumentsFloatFloat args, Target t) {
+ static public void computeHalfRecip(GeneratedTestHalfRecip.ArgumentsFloatFloat args, Target t) {
t.setPrecision(HALF_PRECISION, HALF_PRECISION, false);
args.out = recip(args.inV, t);
}
- static public void computeHalfRsqrt(TestHalfRsqrt.ArgumentsFloatFloat args, Target t) {
+ static public void computeHalfRsqrt(GeneratedTestHalfRsqrt.ArgumentsFloatFloat args, Target t) {
t.setPrecision(HALF_PRECISION, HALF_PRECISION, false);
args.out = rsqrt(args.inV, t);
}
- static public void computeHalfSqrt(TestHalfSqrt.ArgumentsFloatFloat args, Target t) {
+ static public void computeHalfSqrt(GeneratedTestHalfSqrt.ArgumentsFloatFloat args, Target t) {
t.setPrecision(HALF_PRECISION, HALF_PRECISION, false);
args.out = sqrt(args.inV, t);
}
- static public void computeHypot(TestHypot.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeHypot(GeneratedTestHypot.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(4, 4, false);
- args.out = hypot(args.inX, args.inY, t);
+ args.out = hypot(args.inA, args.inB, t);
}
- static public String verifyIlogb(TestIlogb.ArgumentsFloatInt args) {
+ static public String verifyIlogb(GeneratedTestIlogb.ArgumentsFloatInt args) {
// Special case when the input is 0. We accept two different answers.
- if (args.in == 0.f) {
+ if (args.inV == 0.f) {
if (args.out != -Integer.MAX_VALUE && args.out != Integer.MIN_VALUE) {
return "Expected " + Integer.toString(-Integer.MAX_VALUE) + " or " +
Integer.toString(Integer.MIN_VALUE);
}
} else {
- int result = ilogb(args.in);
+ int result = ilogb(args.inV);
if (args.out != result) {
return "Expected " + Integer.toString(result);
}
@@ -1304,28 +1304,28 @@
return null;
}
- static public void computeLdexp(TestLdexp.ArgumentsFloatIntFloat args, Target t) {
+ static public void computeLdexp(GeneratedTestLdexp.ArgumentsFloatIntFloat args, Target t) {
t.setPrecision(1, 1, false);
- Target.Floaty inX = t.new32(args.inX);
+ Target.Floaty inMantissa = t.new32(args.inMantissa);
args.out = t.new32(
- ldexp(inX.mid32(), args.inY),
- ldexp(inX.min32(), args.inY),
- ldexp(inX.max32(), args.inY));
+ ldexp(inMantissa.mid32(), args.inExponent),
+ ldexp(inMantissa.min32(), args.inExponent),
+ ldexp(inMantissa.max32(), args.inExponent));
}
- static public void computeLength(TestLength.ArgumentsFloatFloat args, Target t) {
+ static public void computeLength(GeneratedTestLength.ArgumentsFloatFloat args, Target t) {
t.setPrecision(1, 1, false);
args.out = length(new float[]{args.inV}, t);
}
- static public void computeLength(TestLength.ArgumentsFloatNFloat args, Target t) {
+ static public void computeLength(GeneratedTestLength.ArgumentsFloatNFloat args, Target t) {
t.setPrecision(1, 1, false);
args.out = length(args.inV, t);
}
- static public void computeLgamma(TestLgamma.ArgumentsFloatFloat args, Target t) {
+ static public void computeLgamma(GeneratedTestLgamma.ArgumentsFloatFloat args, Target t) {
t.setPrecision(16, 128, false);
- Target.Floaty in = t.new32(args.in);
+ Target.Floaty in = t.new32(args.inV);
args.out = t.new32(
lgamma(in.mid32()),
lgamma(in.min32()),
@@ -1335,9 +1335,9 @@
/* TODO Until -0 handling is corrected in bionic & associated drivers, we temporarily
* disable the verification of -0. We do this with a custom verifier. Once bionic
* is fixed, we can restore computeLgamma and remove verifyLgamma.
- static public void computeLgamma(TestLgamma.ArgumentsFloatIntFloat args, Target t) {
+ static public void computeLgamma(GeneratedTestLgamma.ArgumentsFloatIntFloat args, Target t) {
t.setPrecision(16, 128, false);
- Target.Floaty in = t.new32(args.inX);
+ Target.Floaty in = t.new32(args.inV);
LgammaResult result = lgamma2(in.mid32());
LgammaResult resultMin = lgamma2(in.min32());
LgammaResult resultMax = lgamma2(in.max32());
@@ -1345,27 +1345,27 @@
args.outY = result.gammaSign;
}
*/
- static public String verifyLgamma(TestLgamma.ArgumentsFloatIntFloat args, Target t) {
+ static public String verifyLgamma(GeneratedTestLgamma.ArgumentsFloatIntFloat args, Target t) {
t.setPrecision(16, 128, false);
- Target.Floaty in = t.new32(args.inX);
+ Target.Floaty in = t.new32(args.inV);
LgammaResult result = lgamma2(in.mid32());
LgammaResult resultMin = lgamma2(in.min32());
LgammaResult resultMax = lgamma2(in.max32());
Target.Floaty expectedOut = t.new32(result.lgamma, resultMin.lgamma, resultMax.lgamma);
- boolean isNegativeZero = args.inX == 0.f && 1.f / args.inX < 0.f;
+ boolean isNegativeZero = args.inV == 0.f && 1.f / args.inV < 0.f;
/* TODO The current implementation of bionic does not handle the -0.f case correctly.
* It should set the sign to -1 but sets it to 1.
*/
if (!expectedOut.couldBe(args.out) ||
- (args.outY != result.gammaSign && !isNegativeZero)) {
+ (args.outSignOfGamma != result.gammaSign && !isNegativeZero)) {
StringBuilder message = new StringBuilder();
- message.append(String.format("Input in %14.8g {%8x}:\n", args.inX, Float.floatToRawIntBits(args.inX)));
+ message.append(String.format("Input in %14.8g {%8x}:\n", args.inV, Float.floatToRawIntBits(args.inV)));
message.append("Expected out: ");
message.append(expectedOut.toString());
message.append("\n");
message.append(String.format("Actual out: %14.8g {%8x}", args.out, Float.floatToRawIntBits(args.out)));
- message.append(String.format("Expected outY: %d\n", result.gammaSign));
- message.append(String.format("Actual outY: %d\n", args.outY));
+ message.append(String.format("Expected outSign: %d\n", result.gammaSign));
+ message.append(String.format("Actual outSign: %d\n", args.outSignOfGamma));
return message.toString();
}
@@ -1374,269 +1374,270 @@
// TODO The relaxed ulf for the various log are taken from the old tests.
// They are not consistent.
- static public void computeLog(TestLog.ArgumentsFloatFloat args, Target t) {
+ static public void computeLog(GeneratedTestLog.ArgumentsFloatFloat args, Target t) {
t.setPrecision(3, 16, false);
- args.out = log(args.in, t);
+ args.out = log(args.inV, t);
}
- static public void computeLog10(TestLog10.ArgumentsFloatFloat args, Target t) {
+ static public void computeLog10(GeneratedTestLog10.ArgumentsFloatFloat args, Target t) {
t.setPrecision(3, 16, false);
- args.out = log10(args.in, t);
+ args.out = log10(args.inV, t);
}
- static public void computeLog1p(TestLog1p.ArgumentsFloatFloat args, Target t) {
+ static public void computeLog1p(GeneratedTestLog1p.ArgumentsFloatFloat args, Target t) {
t.setPrecision(2, 16, false);
- args.out = log1p(args.in, t);
+ args.out = log1p(args.inV, t);
}
- static public void computeLog2(TestLog2.ArgumentsFloatFloat args, Target t) {
+ static public void computeLog2(GeneratedTestLog2.ArgumentsFloatFloat args, Target t) {
t.setPrecision(3, 128, false);
- args.out = log2(args.in, t);
+ args.out = log2(args.inV, t);
}
- static public void computeLogb(TestLogb.ArgumentsFloatFloat args, Target t) {
+ static public void computeLogb(GeneratedTestLogb.ArgumentsFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- Target.Floaty in = t.new32(args.in);
+ Target.Floaty in = t.new32(args.inV);
args.out = t.new32(
logb(in.mid32()),
logb(in.min32()),
logb(in.max32()));
}
- static public void computeMad(TestMad.ArgumentsFloatFloatFloatFloat args, Target t) {
+ static public void computeMad(GeneratedTestMad.ArgumentsFloatFloatFloatFloat args, Target t) {
t.setPrecision(1, 4, false);
- Target.Floaty ab = t.multiply(t.new32(args.inA), t.new32(args.inB));
- args.out = t.add(ab, t.new32(args.inC));
+ Target.Floaty ab = t.multiply(t.new32(args.inMultiplicand1), t.new32(args.inMultiplicand2));
+ args.out = t.add(ab, t.new32(args.inOffset));
}
- static public void computeMax(TestMax.ArgumentsCharCharChar args) {
- args.out = maxI8(args.inV1, args.inV2);
+ static public void computeMax(GeneratedTestMax.ArgumentsCharCharChar args) {
+ args.out = maxI8(args.inA, args.inB);
}
- static public void computeMax(TestMax.ArgumentsUcharUcharUchar args) {
- args.out = maxU8(args.inV1, args.inV2);
+ static public void computeMax(GeneratedTestMax.ArgumentsUcharUcharUchar args) {
+ args.out = maxU8(args.inA, args.inB);
}
- static public void computeMax(TestMax.ArgumentsShortShortShort args) {
- args.out = maxI16(args.inV1, args.inV2);
+ static public void computeMax(GeneratedTestMax.ArgumentsShortShortShort args) {
+ args.out = maxI16(args.inA, args.inB);
}
- static public void computeMax(TestMax.ArgumentsUshortUshortUshort args) {
- args.out = maxU16(args.inV1, args.inV2);
+ static public void computeMax(GeneratedTestMax.ArgumentsUshortUshortUshort args) {
+ args.out = maxU16(args.inA, args.inB);
}
- static public void computeMax(TestMax.ArgumentsIntIntInt args) {
- args.out = maxI32(args.inV1, args.inV2);
+ static public void computeMax(GeneratedTestMax.ArgumentsIntIntInt args) {
+ args.out = maxI32(args.inA, args.inB);
}
- static public void computeMax(TestMax.ArgumentsUintUintUint args) {
- args.out = maxU32(args.inV1, args.inV2);
+ static public void computeMax(GeneratedTestMax.ArgumentsUintUintUint args) {
+ args.out = maxU32(args.inA, args.inB);
}
- static public void computeMax(TestMax.ArgumentsLongLongLong args) {
- args.out = maxI64(args.inV1, args.inV2);
+ static public void computeMax(GeneratedTestMax.ArgumentsLongLongLong args) {
+ args.out = maxI64(args.inA, args.inB);
}
- static public void computeMax(TestMax.ArgumentsUlongUlongUlong args) {
- args.out = maxU64(args.inV1, args.inV2);
+ static public void computeMax(GeneratedTestMax.ArgumentsUlongUlongUlong args) {
+ args.out = maxU64(args.inA, args.inB);
}
- static public void computeMax(TestMax.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeMax(GeneratedTestMax.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- Target.Floaty in = t.new32(args.in);
- Target.Floaty in1 = t.new32(args.in1);
+ Target.Floaty a = t.new32(args.inA);
+ Target.Floaty b = t.new32(args.inB);
args.out = t.new32(
- Math.max(in.mid32(), in1.mid32()),
- Math.max(in.min32(), in1.min32()),
- Math.max(in.min32(), in1.max32()),
- Math.max(in.max32(), in1.min32()),
- Math.max(in.max32(), in1.max32()));
+ Math.max(a.mid32(), b.mid32()),
+ Math.max(a.min32(), b.min32()),
+ Math.max(a.min32(), b.max32()),
+ Math.max(a.max32(), b.min32()),
+ Math.max(a.max32(), b.max32()));
}
- static public void computeMin(TestMin.ArgumentsCharCharChar args) {
- args.out = minI8(args.inV1, args.inV2);
+ static public void computeMin(GeneratedTestMin.ArgumentsCharCharChar args) {
+ args.out = minI8(args.inA, args.inB);
}
- static public void computeMin(TestMin.ArgumentsUcharUcharUchar args) {
- args.out = minU8(args.inV1, args.inV2);
+ static public void computeMin(GeneratedTestMin.ArgumentsUcharUcharUchar args) {
+ args.out = minU8(args.inA, args.inB);
}
- static public void computeMin(TestMin.ArgumentsShortShortShort args) {
- args.out = minI16(args.inV1, args.inV2);
+ static public void computeMin(GeneratedTestMin.ArgumentsShortShortShort args) {
+ args.out = minI16(args.inA, args.inB);
}
- static public void computeMin(TestMin.ArgumentsUshortUshortUshort args) {
- args.out = minU16(args.inV1, args.inV2);
+ static public void computeMin(GeneratedTestMin.ArgumentsUshortUshortUshort args) {
+ args.out = minU16(args.inA, args.inB);
}
- static public void computeMin(TestMin.ArgumentsIntIntInt args) {
- args.out = minI32(args.inV1, args.inV2);
+ static public void computeMin(GeneratedTestMin.ArgumentsIntIntInt args) {
+ args.out = minI32(args.inA, args.inB);
}
- static public void computeMin(TestMin.ArgumentsUintUintUint args) {
- args.out = minU32(args.inV1, args.inV2);
+ static public void computeMin(GeneratedTestMin.ArgumentsUintUintUint args) {
+ args.out = minU32(args.inA, args.inB);
}
- static public void computeMin(TestMin.ArgumentsLongLongLong args) {
- args.out = minI64(args.inV1, args.inV2);
+ static public void computeMin(GeneratedTestMin.ArgumentsLongLongLong args) {
+ args.out = minI64(args.inA, args.inB);
}
- static public void computeMin(TestMin.ArgumentsUlongUlongUlong args) {
- args.out = minU64(args.inV1, args.inV2);
+ static public void computeMin(GeneratedTestMin.ArgumentsUlongUlongUlong args) {
+ args.out = minU64(args.inA, args.inB);
}
- static public void computeMin(TestMin.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeMin(GeneratedTestMin.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- args.out = t.new32(Math.min(args.in, args.in1));
+ args.out = t.new32(Math.min(args.inA, args.inB));
}
- static public void computeMix(TestMix.ArgumentsFloatFloatFloatFloat args, Target t) {
+ static public void computeMix(GeneratedTestMix.ArgumentsFloatFloatFloatFloat args, Target t) {
t.setPrecision(1, 4, false);
Target.Floaty start = t.new32(args.inStart);
Target.Floaty stop = t.new32(args.inStop);
Target.Floaty diff = t.subtract(stop, start);
- args.out = t.add(start, t.multiply(diff, t.new32(args.inAmount)));
+ args.out = t.add(start, t.multiply(diff, t.new32(args.inFraction)));
}
- static public void computeModf(TestModf.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeModf(GeneratedTestModf.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- float ret = (float)(int)args.inX;
- args.outIret = t.new32(ret);
- args.out = t.new32(args.inX - ret);
+ float ret = (float)(int)args.inV;
+ args.outIntegralPart = t.new32(ret);
+ args.out = t.new32(args.inV - ret);
}
- static public void computeNan(TestNan.ArgumentsUintFloat args, Target t) {
+ static public void computeNan(GeneratedTestNan.ArgumentsUintFloat args, Target t) {
t.setPrecision(0, 0, false);
+ // TODO(jeanluc) We're not using the input argument
args.out = t.new32(Float.NaN);
}
- static public void computeNativeAcos(TestNativeAcos.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeAcos(GeneratedTestNativeAcos.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
args.out = acos(args.inV, t);
}
- static public void computeNativeAcosh(TestNativeAcosh.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeAcosh(GeneratedTestNativeAcosh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = acosh(args.in, t);
+ args.out = acosh(args.inV, t);
}
- static public void computeNativeAcospi(TestNativeAcospi.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeAcospi(GeneratedTestNativeAcospi.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
args.out = acospi(args.inV, t);
}
- static public void computeNativeAsin(TestNativeAsin.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeAsin(GeneratedTestNativeAsin.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
args.out = asin(args.inV, t);
}
- static public void computeNativeAsinh(TestNativeAsinh.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeAsinh(GeneratedTestNativeAsinh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = asinh(args.in, t);
+ args.out = asinh(args.inV, t);
}
- static public void computeNativeAsinpi(TestNativeAsinpi.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeAsinpi(GeneratedTestNativeAsinpi.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
args.out = asinpi(args.inV, t);
}
- static public void computeNativeAtan(TestNativeAtan.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeAtan(GeneratedTestNativeAtan.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
args.out = atan(args.inV, t);
}
- static public void computeNativeAtanh(TestNativeAtanh.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeAtanh(GeneratedTestNativeAtanh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = atanh(args.inIn, t);
+ args.out = atanh(args.inV, t);
}
- static public void computeNativeAtanpi(TestNativeAtanpi.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeAtanpi(GeneratedTestNativeAtanpi.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
args.out = atanpi(args.inV, t);
}
- static public void computeNativeAtan2(TestNativeAtan2.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeNativeAtan2(GeneratedTestNativeAtan2.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = atan2(args.inY, args.inX, t);
+ args.out = atan2(args.inNumerator, args.inDenominator, t);
}
- static public void computeNativeAtan2pi(TestNativeAtan2pi.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeNativeAtan2pi(GeneratedTestNativeAtan2pi.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = atan2pi(args.inY, args.inX, t);
+ args.out = atan2pi(args.inNumerator, args.inDenominator, t);
}
- static public void computeNativeCbrt(TestNativeCbrt.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeCbrt(GeneratedTestNativeCbrt.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = cbrt(args.in, t);
+ args.out = cbrt(args.inV, t);
}
- static public void computeNativeCos(TestNativeCos.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeCos(GeneratedTestNativeCos.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = cos(args.in, t);
+ args.out = cos(args.inV, t);
}
- static public void computeNativeCosh(TestNativeCosh.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeCosh(GeneratedTestNativeCosh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = cosh(args.in, t);
+ args.out = cosh(args.inV, t);
}
- static public void computeNativeCospi(TestNativeCospi.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeCospi(GeneratedTestNativeCospi.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = cospi(args.in, t);
+ args.out = cospi(args.inV, t);
}
- static public void computeNativeDistance(TestNativeDistance.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeNativeDistance(GeneratedTestNativeDistance.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = distance(new float[]{args.inLhs}, new float[]{args.inRhs}, t);
+ args.out = distance(new float[]{args.inLeftVector}, new float[]{args.inRightVector}, t);
}
- static public void computeNativeDistance(TestNativeDistance.ArgumentsFloatNFloatNFloat args, Target t) {
+ static public void computeNativeDistance(GeneratedTestNativeDistance.ArgumentsFloatNFloatNFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = distance(args.inLhs, args.inRhs, t);
+ args.out = distance(args.inLeftVector, args.inRightVector, t);
}
- static public void computeNativeDivide(TestNativeDivide.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeNativeDivide(GeneratedTestNativeDivide.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = t.divide(t.new32(args.inLhs), t.new32(args.inRhs));
+ args.out = t.divide(t.new32(args.inLeftVector), t.new32(args.inRightVector));
}
- static public void computeNativeExp(TestNativeExp.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeExp(GeneratedTestNativeExp.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
args.out = exp(args.inV, t);
}
- static public void computeNativeExp10(TestNativeExp10.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeExp10(GeneratedTestNativeExp10.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
args.out = exp10(args.inV, t);
}
- static public void computeNativeExp2(TestNativeExp2.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeExp2(GeneratedTestNativeExp2.ArgumentsFloatFloat args, Target t) {
// TODO we would like to use NATIVE_PRECISION, NATIVE_PRECISION
t.setPrecision(13000, 13000, true);
args.out = exp2(args.inV, t);
}
- static public void computeNativeExpm1(TestNativeExpm1.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeExpm1(GeneratedTestNativeExpm1.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = expm1(args.in, t);
+ args.out = expm1(args.inV, t);
}
- static public void computeNativeHypot(TestNativeHypot.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeNativeHypot(GeneratedTestNativeHypot.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = hypot(args.inX, args.inY, t);
+ args.out = hypot(args.inA, args.inB, t);
}
- static public void computeNativeLength(TestNativeLength.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeLength(GeneratedTestNativeLength.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
args.out = length(new float[] {args.inV}, t);
}
- static public void computeNativeLength(TestNativeLength.ArgumentsFloatNFloat args, Target t) {
+ static public void computeNativeLength(GeneratedTestNativeLength.ArgumentsFloatNFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
args.out = length(args.inV, t);
}
- static public void computeNativeLog(TestNativeLog.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeLog(GeneratedTestNativeLog.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
// For very small values, allow anything.
if (Math.abs(args.inV) < 1.e-20) {
@@ -1646,7 +1647,7 @@
}
}
- static public void computeNativeLog10(TestNativeLog10.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeLog10(GeneratedTestNativeLog10.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
// For very small values, allow anything.
if (Math.abs(args.inV) < 1.e-20) {
@@ -1656,12 +1657,12 @@
}
}
- static public void computeNativeLog1p(TestNativeLog1p.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeLog1p(GeneratedTestNativeLog1p.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = log1p(args.in, t);
+ args.out = log1p(args.inV, t);
}
- static public void computeNativeLog2(TestNativeLog2.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeLog2(GeneratedTestNativeLog2.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
// For very small values, allow anything.
if (Math.abs(args.inV) < 1.e-20) {
@@ -1671,35 +1672,35 @@
}
}
- static public void computeNativeNormalize(TestNativeNormalize.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeNormalize(GeneratedTestNativeNormalize.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
Target.Floaty[] out = new Target.Floaty[1];
normalize(new float[] {args.inV}, out, t);
args.out = out[0];
}
- static public void computeNativeNormalize(TestNativeNormalize.ArgumentsFloatNFloatN args, Target t) {
+ static public void computeNativeNormalize(GeneratedTestNativeNormalize.ArgumentsFloatNFloatN args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
normalize(args.inV, args.out, t);
}
- static public void computeNativePowr(TestNativePowr.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeNativePowr(GeneratedTestNativePowr.ArgumentsFloatFloatFloat args, Target t) {
// TODO we would like to use NATIVE_PRECISION, NATIVE_PRECISION
t.setPrecision(32000, 32000, true);
// For very small values, allow anything.
- if (Math.abs(args.inV) < 1.e-20) {
+ if (Math.abs(args.inBase) < 1.e-20) {
args.out = any32(t);
} else {
- args.out = powr(args.inV, args.inY, t);
+ args.out = powr(args.inBase, args.inExponent, t);
}
}
- static public void computeNativeRecip(TestNativeRecip.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeRecip(GeneratedTestNativeRecip.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
args.out = recip(args.inV, t);
}
- static public void computeNativeRootn(TestNativeRootn.ArgumentsFloatIntFloat args, Target t) {
+ static public void computeNativeRootn(GeneratedTestNativeRootn.ArgumentsFloatIntFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
// Allow anything for zero.
if (args.inN == 0) {
@@ -1709,115 +1710,115 @@
}
}
- static public void computeNativeRsqrt(TestNativeRsqrt.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeRsqrt(GeneratedTestNativeRsqrt.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = rsqrt(args.in, t);
+ args.out = rsqrt(args.inV, t);
}
- static public void computeNativeSin(TestNativeSin.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeSin(GeneratedTestNativeSin.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = sin(args.in, t);
- }
-
- static public void computeNativeSincos(TestNativeSincos.ArgumentsFloatFloatFloat args, Target t) {
- t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.outCosptr = cos(args.inV, t);
args.out = sin(args.inV, t);
}
- static public void computeNativeSinh(TestNativeSinh.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeSincos(GeneratedTestNativeSincos.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = sinh(args.in, t);
+ args.outCos = cos(args.inV, t);
+ args.out = sin(args.inV, t);
}
- static public void computeNativeSinpi(TestNativeSinpi.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeSinh(GeneratedTestNativeSinh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = sinpi(args.in, t);
+ args.out = sinh(args.inV, t);
}
- static public void computeNativeSqrt(TestNativeSqrt.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeSinpi(GeneratedTestNativeSinpi.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = sqrt(args.in, t);
+ args.out = sinpi(args.inV, t);
}
- static public void computeNativeTan(TestNativeTan.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeSqrt(GeneratedTestNativeSqrt.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = tan(args.in, t);
+ args.out = sqrt(args.inV, t);
}
- static public void computeNativeTanh(TestNativeTanh.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeTan(GeneratedTestNativeTan.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = tanh(args.in, t);
+ args.out = tan(args.inV, t);
}
- static public void computeNativeTanpi(TestNativeTanpi.ArgumentsFloatFloat args, Target t) {
+ static public void computeNativeTanh(GeneratedTestNativeTanh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
- args.out = tanpi(args.in, t);
+ args.out = tanh(args.inV, t);
}
- static public void computeNextafter(TestNextafter.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeNativeTanpi(GeneratedTestNativeTanpi.ArgumentsFloatFloat args, Target t) {
+ t.setPrecision(NATIVE_PRECISION, NATIVE_PRECISION, true);
+ args.out = tanpi(args.inV, t);
+ }
+
+ static public void computeNextafter(GeneratedTestNextafter.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- args.out = t.new32(Math.nextAfter(args.inX, args.inY));
+ args.out = t.new32(Math.nextAfter(args.inV, args.inTarget));
}
- static public void computeNormalize(TestNormalize.ArgumentsFloatFloat args, Target t) {
+ static public void computeNormalize(GeneratedTestNormalize.ArgumentsFloatFloat args, Target t) {
t.setPrecision(1, 1, false);
Target.Floaty[] out = new Target.Floaty[1];
normalize(new float[] {args.inV}, out, t);
args.out = out[0];
}
- static public void computeNormalize(TestNormalize.ArgumentsFloatNFloatN args, Target t) {
+ static public void computeNormalize(GeneratedTestNormalize.ArgumentsFloatNFloatN args, Target t) {
t.setPrecision(1, 1, false);
normalize(args.inV, args.out, t);
}
- static public void computePow(TestPow.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computePow(GeneratedTestPow.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(16, 128, false);
- Target.Floaty inX = t.new32(args.inX);
- Target.Floaty inY = t.new32(args.inY);
+ Target.Floaty base = t.new32(args.inBase);
+ Target.Floaty exponent = t.new32(args.inExponent);
args.out = t.new32(
- pow(inX.mid32(), inY.mid32()),
- pow(inX.min32(), inY.min32()),
- pow(inX.min32(), inY.max32()),
- pow(inX.max32(), inY.min32()),
- pow(inX.max32(), inY.max32()));
+ pow(base.mid32(), exponent.mid32()),
+ pow(base.min32(), exponent.min32()),
+ pow(base.min32(), exponent.max32()),
+ pow(base.max32(), exponent.min32()),
+ pow(base.max32(), exponent.max32()));
}
- static public void computePown(TestPown.ArgumentsFloatIntFloat args, Target t) {
+ static public void computePown(GeneratedTestPown.ArgumentsFloatIntFloat args, Target t) {
t.setPrecision(16, 128, false);
- Target.Floaty in = t.new32(args.inX);
+ Target.Floaty in = t.new32(args.inBase);
// We use double for the calculations because floats does not have enough
// mantissa bits. Knowing if an int is odd or even will matter for negative
// numbers. Using a float loses the lowest bit.
- final double y = (double) args.inY;
+ final double y = (double) args.inExponent;
args.out = t.new32(
(float) Math.pow(in.mid32(), y),
(float) Math.pow(in.min32(), y),
(float) Math.pow(in.max32(), y));
}
- static public void computePowr(TestPowr.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computePowr(GeneratedTestPowr.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(16, 128, false);
- args.out = powr(args.inX, args.inY, t);
+ args.out = powr(args.inBase, args.inExponent, t);
}
- static public void computeRadians(TestRadians.ArgumentsFloatFloat args, Target t) {
+ static public void computeRadians(GeneratedTestRadians.ArgumentsFloatFloat args, Target t) {
t.setPrecision(3, 3, false);
- Target.Floaty in = t.new32(args.inValue);
+ Target.Floaty in = t.new32(args.inV);
Target.Floaty k = t.new32((float)(Math.PI / 180.0));
args.out = t.multiply(in, k);
}
- static public void computeRemainder(TestRemainder.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeRemainder(GeneratedTestRemainder.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- RemquoResult result = remquo(args.inX, args.inY);
+ RemquoResult result = remquo(args.inNumerator, args.inDenominator);
args.out = t.new32(result.remainder);
}
- static public String verifyRemquo(TestRemquo.ArgumentsFloatFloatIntFloat args, Target t) {
+ static public String verifyRemquo(GeneratedTestRemquo.ArgumentsFloatFloatIntFloat args, Target t) {
t.setPrecision(0, 0, false);
- RemquoResult expected = remquo(args.inB, args.inC);
+ RemquoResult expected = remquo(args.inNumerator, args.inDenominator);
// If the expected remainder is NaN, we don't validate the quotient. It's because of
// a division by zero.
if (expected.remainder != expected.remainder) {
@@ -1827,8 +1828,8 @@
}
} else {
// The quotient should have the same lowest three bits.
- if ((args.outD & 0x07) != (expected.quotient & 0x07)) {
- return "Quotient returned " + Integer.toString(args.outD) +
+ if ((args.outQuotient & 0x07) != (expected.quotient & 0x07)) {
+ return "Quotient returned " + Integer.toString(args.outQuotient) +
" does not have the same lower three bits as the expected " +
Integer.toString(expected.quotient);
}
@@ -1842,97 +1843,97 @@
return null;
}
- static public void computeRint(TestRint.ArgumentsFloatFloat args, Target t) {
+ static public void computeRint(GeneratedTestRint.ArgumentsFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- Target.Floaty in = t.new32(args.in);
+ Target.Floaty in = t.new32(args.inV);
args.out = t.new32(
rint(in.mid32()),
rint(in.min32()),
rint(in.max32()));
}
- static public void computeRootn(TestRootn.ArgumentsFloatIntFloat args, Target t) {
+ static public void computeRootn(GeneratedTestRootn.ArgumentsFloatIntFloat args, Target t) {
t.setPrecision(16, 16, false);
args.out = rootn(args.inV, args.inN, t);
}
- static public void computeRound(TestRound.ArgumentsFloatFloat args, Target t) {
+ static public void computeRound(GeneratedTestRound.ArgumentsFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- Target.Floaty in = t.new32(args.in);
+ Target.Floaty in = t.new32(args.inV);
args.out = t.new32(
round(in.mid32()),
round(in.min32()),
round(in.max32()));
}
- static public void computeRsqrt(TestRsqrt.ArgumentsFloatFloat args, Target t) {
+ static public void computeRsqrt(GeneratedTestRsqrt.ArgumentsFloatFloat args, Target t) {
t.setPrecision(2, 2, false);
- args.out = rsqrt(args.in, t);
+ args.out = rsqrt(args.inV, t);
}
- static public void computeSign(TestSign.ArgumentsFloatFloat args, Target t) {
+ static public void computeSign(GeneratedTestSign.ArgumentsFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new32(Math.signum(args.inV));
}
- static public void computeSin(TestSin.ArgumentsFloatFloat args, Target t) {
+ static public void computeSin(GeneratedTestSin.ArgumentsFloatFloat args, Target t) {
t.setPrecision(4, 128, false);
- args.out = sin(args.in, t);
- }
-
- static public void computeSincos(TestSincos.ArgumentsFloatFloatFloat args, Target t) {
- t.setPrecision(4, 128, false);
- args.outCosptr = cos(args.inV,t );
args.out = sin(args.inV, t);
}
- static public void computeSinh(TestSinh.ArgumentsFloatFloat args, Target t) {
+ static public void computeSincos(GeneratedTestSincos.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(4, 128, false);
- args.out = sinh(args.in, t);
+ args.outCos = cos(args.inV,t );
+ args.out = sin(args.inV, t);
}
- static public void computeSinpi(TestSinpi.ArgumentsFloatFloat args, Target t) {
+ static public void computeSinh(GeneratedTestSinh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(4, 128, false);
- args.out = sinpi(args.in, t);
+ args.out = sinh(args.inV, t);
}
- static public void computeSqrt(TestSqrt.ArgumentsFloatFloat args, Target t) {
+ static public void computeSinpi(GeneratedTestSinpi.ArgumentsFloatFloat args, Target t) {
+ t.setPrecision(4, 128, false);
+ args.out = sinpi(args.inV, t);
+ }
+
+ static public void computeSqrt(GeneratedTestSqrt.ArgumentsFloatFloat args, Target t) {
t.setPrecision(3, 3, false);
- args.out = sqrt(args.in, t);
+ args.out = sqrt(args.inV, t);
}
- static public void computeStep(TestStep.ArgumentsFloatFloatFloat args, Target t) {
+ static public void computeStep(GeneratedTestStep.ArgumentsFloatFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
args.out = t.new32(args.inV < args.inEdge ? 0.f : 1.f);
}
- static public void computeTan(TestTan.ArgumentsFloatFloat args, Target t) {
+ static public void computeTan(GeneratedTestTan.ArgumentsFloatFloat args, Target t) {
t.setPrecision(5, 128, false);
- args.out = tan(args.in, t);
+ args.out = tan(args.inV, t);
}
- static public void computeTanh(TestTanh.ArgumentsFloatFloat args, Target t) {
+ static public void computeTanh(GeneratedTestTanh.ArgumentsFloatFloat args, Target t) {
t.setPrecision(5, 128, false);
- args.out = tanh(args.in, t);
+ args.out = tanh(args.inV, t);
}
- static public void computeTanpi(TestTanpi.ArgumentsFloatFloat args, Target t) {
+ static public void computeTanpi(GeneratedTestTanpi.ArgumentsFloatFloat args, Target t) {
t.setPrecision(4, 128, false);
- args.out = tanpi(args.in, t);
+ args.out = tanpi(args.inV, t);
}
- static public void computeTgamma(TestTgamma.ArgumentsFloatFloat args, Target t) {
+ static public void computeTgamma(GeneratedTestTgamma.ArgumentsFloatFloat args, Target t) {
t.setPrecision(16, 128, false);
- Target.Floaty in = t.new32(args.in);
+ Target.Floaty in = t.new32(args.inV);
args.out = t.new32(
tgamma(in.mid32()),
tgamma(in.min32()),
tgamma(in.max32()));
}
- static public void computeTrunc(TestTrunc.ArgumentsFloatFloat args, Target t) {
+ static public void computeTrunc(GeneratedTestTrunc.ArgumentsFloatFloat args, Target t) {
t.setPrecision(0, 0, false);
- Target.Floaty in = t.new32(args.in);
+ Target.Floaty in = t.new32(args.inV);
args.out = t.new32(
trunc(in.mid32()),
trunc(in.min32()),
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/DebugContext.java b/tests/tests/renderscript/src/android/renderscript/cts/DebugContext.java
index cf0f76d..f82feb1 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/DebugContext.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/DebugContext.java
@@ -65,6 +65,11 @@
Soob.invoke_write_i(9, 0);
mRS.finish();
}
+
+ // Flush messages through the pipeline.
+ Soob.invoke_send_msg();
+ waitForMessage();
+
Soob.destroy();
assertTrue(mRanErrorHandler);
checkForErrors();
@@ -81,6 +86,11 @@
Soob.invoke_write_i(9, 0);
mRS.finish();
}
+
+ // Flush messages through the pipeline.
+ Soob.invoke_send_msg();
+ waitForMessage();
+
Soob.destroy();
assertTrue(mRanErrorHandler);
checkForErrors();
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/ElementTest.java b/tests/tests/renderscript/src/android/renderscript/cts/ElementTest.java
index ead4528..131b3fd 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/ElementTest.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/ElementTest.java
@@ -448,7 +448,7 @@
assertEquals(DataType.RS_PROGRAM_RASTER, DataType.valueOf("RS_PROGRAM_RASTER"));
assertEquals(DataType.RS_PROGRAM_STORE, DataType.valueOf("RS_PROGRAM_STORE"));
// Make sure no new enums are added
- assertEquals(29, DataType.values().length);
+ assertEquals(30, DataType.values().length);
for (DataType dt : DataType.values()) {
switch (dt) {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAbs.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAbs.java
similarity index 74%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAbs.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAbs.java
index 6b3914c..05acb35 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAbs.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAbs.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestAbs extends RSBaseCompute {
+public class GeneratedTestAbs extends RSBaseCompute {
- private ScriptC_TestAbs script;
- private ScriptC_TestAbsRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAbs script;
+ private ScriptC_GeneratedTestAbsRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestAbs(mRS);
- scriptRelaxed = new ScriptC_TestAbsRelaxed(mRS);
+ script = new ScriptC_GeneratedTestAbs(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAbsRelaxed(mRS);
}
public class ArgumentsCharUchar {
- public byte inValue;
+ public byte inV;
public byte out;
}
private void checkAbsCharUchar() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 1, 0x4c0d03eb0d0c5a91l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 1, 0x79257810f7393ea6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 1), INPUTSIZE);
- script.forEach_testAbsCharUchar(inValue, out);
- verifyResultsAbsCharUchar(inValue, out, false);
+ script.forEach_testAbsCharUchar(inV, out);
+ verifyResultsAbsCharUchar(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsCharUchar: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 1), INPUTSIZE);
- scriptRelaxed.forEach_testAbsCharUchar(inValue, out);
- verifyResultsAbsCharUchar(inValue, out, true);
+ scriptRelaxed.forEach_testAbsCharUchar(inV, out);
+ verifyResultsAbsCharUchar(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsCharUchar: " + e.toString());
}
}
- private void verifyResultsAbsCharUchar(Allocation inValue, Allocation out, boolean relaxed) {
- byte[] arrayInValue = new byte[INPUTSIZE * 1];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsCharUchar(Allocation inV, Allocation out, boolean relaxed) {
+ byte[] arrayInV = new byte[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
byte[] arrayOut = new byte[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsCharUchar args = new ArgumentsCharUchar();
- args.inValue = arrayInValue[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -76,8 +76,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -96,33 +96,33 @@
}
private void checkAbsChar2Uchar2() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 2, 0x901d551e7f67bb87l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 2, 0xff611dd40e5e407cl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 2), INPUTSIZE);
- script.forEach_testAbsChar2Uchar2(inValue, out);
- verifyResultsAbsChar2Uchar2(inValue, out, false);
+ script.forEach_testAbsChar2Uchar2(inV, out);
+ verifyResultsAbsChar2Uchar2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsChar2Uchar2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 2), INPUTSIZE);
- scriptRelaxed.forEach_testAbsChar2Uchar2(inValue, out);
- verifyResultsAbsChar2Uchar2(inValue, out, true);
+ scriptRelaxed.forEach_testAbsChar2Uchar2(inV, out);
+ verifyResultsAbsChar2Uchar2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsChar2Uchar2: " + e.toString());
}
}
- private void verifyResultsAbsChar2Uchar2(Allocation inValue, Allocation out, boolean relaxed) {
- byte[] arrayInValue = new byte[INPUTSIZE * 2];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsChar2Uchar2(Allocation inV, Allocation out, boolean relaxed) {
+ byte[] arrayInV = new byte[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
byte[] arrayOut = new byte[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsCharUchar args = new ArgumentsCharUchar();
- args.inValue = arrayInValue[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -132,8 +132,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -152,33 +152,33 @@
}
private void checkAbsChar3Uchar3() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 3, 0xb5d1caa5c8a5e105l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 3, 0xff62e6ef0479615al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 3), INPUTSIZE);
- script.forEach_testAbsChar3Uchar3(inValue, out);
- verifyResultsAbsChar3Uchar3(inValue, out, false);
+ script.forEach_testAbsChar3Uchar3(inV, out);
+ verifyResultsAbsChar3Uchar3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsChar3Uchar3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 3), INPUTSIZE);
- scriptRelaxed.forEach_testAbsChar3Uchar3(inValue, out);
- verifyResultsAbsChar3Uchar3(inValue, out, true);
+ scriptRelaxed.forEach_testAbsChar3Uchar3(inV, out);
+ verifyResultsAbsChar3Uchar3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsChar3Uchar3: " + e.toString());
}
}
- private void verifyResultsAbsChar3Uchar3(Allocation inValue, Allocation out, boolean relaxed) {
- byte[] arrayInValue = new byte[INPUTSIZE * 4];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsChar3Uchar3(Allocation inV, Allocation out, boolean relaxed) {
+ byte[] arrayInV = new byte[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
byte[] arrayOut = new byte[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsCharUchar args = new ArgumentsCharUchar();
- args.inValue = arrayInValue[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -188,8 +188,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -208,33 +208,33 @@
}
private void checkAbsChar4Uchar4() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 4, 0xdb86402d11e40683l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 4, 0xff64b009fa948238l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 4), INPUTSIZE);
- script.forEach_testAbsChar4Uchar4(inValue, out);
- verifyResultsAbsChar4Uchar4(inValue, out, false);
+ script.forEach_testAbsChar4Uchar4(inV, out);
+ verifyResultsAbsChar4Uchar4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsChar4Uchar4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 4), INPUTSIZE);
- scriptRelaxed.forEach_testAbsChar4Uchar4(inValue, out);
- verifyResultsAbsChar4Uchar4(inValue, out, true);
+ scriptRelaxed.forEach_testAbsChar4Uchar4(inV, out);
+ verifyResultsAbsChar4Uchar4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsChar4Uchar4: " + e.toString());
}
}
- private void verifyResultsAbsChar4Uchar4(Allocation inValue, Allocation out, boolean relaxed) {
- byte[] arrayInValue = new byte[INPUTSIZE * 4];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsChar4Uchar4(Allocation inV, Allocation out, boolean relaxed) {
+ byte[] arrayInV = new byte[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
byte[] arrayOut = new byte[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsCharUchar args = new ArgumentsCharUchar();
- args.inValue = arrayInValue[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -244,8 +244,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -264,38 +264,38 @@
}
public class ArgumentsShortUshort {
- public short inValue;
+ public short inV;
public short out;
}
private void checkAbsShortUshort() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 1, 0xaead1a96b6ea02a7l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 1, 0xfab837da064819cl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 1), INPUTSIZE);
- script.forEach_testAbsShortUshort(inValue, out);
- verifyResultsAbsShortUshort(inValue, out, false);
+ script.forEach_testAbsShortUshort(inV, out);
+ verifyResultsAbsShortUshort(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsShortUshort: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 1), INPUTSIZE);
- scriptRelaxed.forEach_testAbsShortUshort(inValue, out);
- verifyResultsAbsShortUshort(inValue, out, true);
+ scriptRelaxed.forEach_testAbsShortUshort(inV, out);
+ verifyResultsAbsShortUshort(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsShortUshort: " + e.toString());
}
}
- private void verifyResultsAbsShortUshort(Allocation inValue, Allocation out, boolean relaxed) {
- short[] arrayInValue = new short[INPUTSIZE * 1];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsShortUshort(Allocation inV, Allocation out, boolean relaxed) {
+ short[] arrayInV = new short[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
short[] arrayOut = new short[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsShortUshort args = new ArgumentsShortUshort();
- args.inValue = arrayInValue[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -305,8 +305,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -325,33 +325,33 @@
}
private void checkAbsShort2Ushort2() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 2, 0x41a1894ff6b0da9l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 2, 0x231450e16856b93el, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 2), INPUTSIZE);
- script.forEach_testAbsShort2Ushort2(inValue, out);
- verifyResultsAbsShort2Ushort2(inValue, out, false);
+ script.forEach_testAbsShort2Ushort2(inV, out);
+ verifyResultsAbsShort2Ushort2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsShort2Ushort2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 2), INPUTSIZE);
- scriptRelaxed.forEach_testAbsShort2Ushort2(inValue, out);
- verifyResultsAbsShort2Ushort2(inValue, out, true);
+ scriptRelaxed.forEach_testAbsShort2Ushort2(inV, out);
+ verifyResultsAbsShort2Ushort2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsShort2Ushort2: " + e.toString());
}
}
- private void verifyResultsAbsShort2Ushort2(Allocation inValue, Allocation out, boolean relaxed) {
- short[] arrayInValue = new short[INPUTSIZE * 2];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsShort2Ushort2(Allocation inV, Allocation out, boolean relaxed) {
+ short[] arrayInV = new short[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
short[] arrayOut = new short[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsShortUshort args = new ArgumentsShortUshort();
- args.inValue = arrayInValue[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -361,8 +361,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -381,33 +381,33 @@
}
private void checkAbsShort3Ushort3() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 3, 0x5969cbec377ba515l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 3, 0x23611868beb24a6al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 3), INPUTSIZE);
- script.forEach_testAbsShort3Ushort3(inValue, out);
- verifyResultsAbsShort3Ushort3(inValue, out, false);
+ script.forEach_testAbsShort3Ushort3(inV, out);
+ verifyResultsAbsShort3Ushort3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsShort3Ushort3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 3), INPUTSIZE);
- scriptRelaxed.forEach_testAbsShort3Ushort3(inValue, out);
- verifyResultsAbsShort3Ushort3(inValue, out, true);
+ scriptRelaxed.forEach_testAbsShort3Ushort3(inV, out);
+ verifyResultsAbsShort3Ushort3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsShort3Ushort3: " + e.toString());
}
}
- private void verifyResultsAbsShort3Ushort3(Allocation inValue, Allocation out, boolean relaxed) {
- short[] arrayInValue = new short[INPUTSIZE * 4];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsShort3Ushort3(Allocation inV, Allocation out, boolean relaxed) {
+ short[] arrayInV = new short[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
short[] arrayOut = new short[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsShortUshort args = new ArgumentsShortUshort();
- args.inValue = arrayInValue[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -417,8 +417,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -437,33 +437,33 @@
}
private void checkAbsShort4Ushort4() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 4, 0xaeb97f436f8c3c81l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 4, 0x23addff0150ddb96l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 4), INPUTSIZE);
- script.forEach_testAbsShort4Ushort4(inValue, out);
- verifyResultsAbsShort4Ushort4(inValue, out, false);
+ script.forEach_testAbsShort4Ushort4(inV, out);
+ verifyResultsAbsShort4Ushort4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsShort4Ushort4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 4), INPUTSIZE);
- scriptRelaxed.forEach_testAbsShort4Ushort4(inValue, out);
- verifyResultsAbsShort4Ushort4(inValue, out, true);
+ scriptRelaxed.forEach_testAbsShort4Ushort4(inV, out);
+ verifyResultsAbsShort4Ushort4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsShort4Ushort4: " + e.toString());
}
}
- private void verifyResultsAbsShort4Ushort4(Allocation inValue, Allocation out, boolean relaxed) {
- short[] arrayInValue = new short[INPUTSIZE * 4];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsShort4Ushort4(Allocation inV, Allocation out, boolean relaxed) {
+ short[] arrayInV = new short[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
short[] arrayOut = new short[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsShortUshort args = new ArgumentsShortUshort();
- args.inValue = arrayInValue[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -473,8 +473,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -493,38 +493,38 @@
}
public class ArgumentsIntUint {
- public int inValue;
+ public int inV;
public int out;
}
private void checkAbsIntUint() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0xcda40fd4fa1abbd1l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0x6adb1880ac5b83e6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 1), INPUTSIZE);
- script.forEach_testAbsIntUint(inValue, out);
- verifyResultsAbsIntUint(inValue, out, false);
+ script.forEach_testAbsIntUint(inV, out);
+ verifyResultsAbsIntUint(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsIntUint: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testAbsIntUint(inValue, out);
- verifyResultsAbsIntUint(inValue, out, true);
+ scriptRelaxed.forEach_testAbsIntUint(inV, out);
+ verifyResultsAbsIntUint(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsIntUint: " + e.toString());
}
}
- private void verifyResultsAbsIntUint(Allocation inValue, Allocation out, boolean relaxed) {
- int[] arrayInValue = new int[INPUTSIZE * 1];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsIntUint(Allocation inV, Allocation out, boolean relaxed) {
+ int[] arrayInV = new int[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
int[] arrayOut = new int[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsIntUint args = new ArgumentsIntUint();
- args.inValue = arrayInValue[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -534,8 +534,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -554,33 +554,33 @@
}
private void checkAbsInt2Uint2() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0x71326739aabbb4a5l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0xc8728053938616fal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 2), INPUTSIZE);
- script.forEach_testAbsInt2Uint2(inValue, out);
- verifyResultsAbsInt2Uint2(inValue, out, false);
+ script.forEach_testAbsInt2Uint2(inV, out);
+ verifyResultsAbsInt2Uint2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsInt2Uint2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testAbsInt2Uint2(inValue, out);
- verifyResultsAbsInt2Uint2(inValue, out, true);
+ scriptRelaxed.forEach_testAbsInt2Uint2(inV, out);
+ verifyResultsAbsInt2Uint2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsInt2Uint2: " + e.toString());
}
}
- private void verifyResultsAbsInt2Uint2(Allocation inValue, Allocation out, boolean relaxed) {
- int[] arrayInValue = new int[INPUTSIZE * 2];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsInt2Uint2(Allocation inV, Allocation out, boolean relaxed) {
+ int[] arrayInV = new int[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
int[] arrayOut = new int[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsIntUint args = new ArgumentsIntUint();
- args.inValue = arrayInValue[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -590,8 +590,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -610,33 +610,33 @@
}
private void checkAbsInt3Uint3() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0x9bbf87f7a6fae959l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0xc8728af4f28ddbeel, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 3), INPUTSIZE);
- script.forEach_testAbsInt3Uint3(inValue, out);
- verifyResultsAbsInt3Uint3(inValue, out, false);
+ script.forEach_testAbsInt3Uint3(inV, out);
+ verifyResultsAbsInt3Uint3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsInt3Uint3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testAbsInt3Uint3(inValue, out);
- verifyResultsAbsInt3Uint3(inValue, out, true);
+ scriptRelaxed.forEach_testAbsInt3Uint3(inV, out);
+ verifyResultsAbsInt3Uint3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsInt3Uint3: " + e.toString());
}
}
- private void verifyResultsAbsInt3Uint3(Allocation inValue, Allocation out, boolean relaxed) {
- int[] arrayInValue = new int[INPUTSIZE * 4];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsInt3Uint3(Allocation inV, Allocation out, boolean relaxed) {
+ int[] arrayInV = new int[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsIntUint args = new ArgumentsIntUint();
- args.inValue = arrayInValue[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -646,8 +646,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -666,33 +666,33 @@
}
private void checkAbsInt4Uint4() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0xc64ca8b5a33a1e0dl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0xc87295965195a0e2l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 4), INPUTSIZE);
- script.forEach_testAbsInt4Uint4(inValue, out);
- verifyResultsAbsInt4Uint4(inValue, out, false);
+ script.forEach_testAbsInt4Uint4(inV, out);
+ verifyResultsAbsInt4Uint4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsInt4Uint4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testAbsInt4Uint4(inValue, out);
- verifyResultsAbsInt4Uint4(inValue, out, true);
+ scriptRelaxed.forEach_testAbsInt4Uint4(inV, out);
+ verifyResultsAbsInt4Uint4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAbsInt4Uint4: " + e.toString());
}
}
- private void verifyResultsAbsInt4Uint4(Allocation inValue, Allocation out, boolean relaxed) {
- int[] arrayInValue = new int[INPUTSIZE * 4];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsAbsInt4Uint4(Allocation inV, Allocation out, boolean relaxed) {
+ int[] arrayInV = new int[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsIntUint args = new ArgumentsIntUint();
- args.inValue = arrayInValue[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeAbs(args);
// Validate the outputs.
@@ -702,8 +702,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
- message.append(String.format("%d", args.inValue));
+ message.append("Input inV: ");
+ message.append(String.format("%d", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAbs.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAbs.rs
new file mode 100644
index 0000000..1a7fb31
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAbs.rs
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+
+uchar __attribute__((kernel)) testAbsCharUchar(char inV) {
+ return abs(inV);
+}
+
+uchar2 __attribute__((kernel)) testAbsChar2Uchar2(char2 inV) {
+ return abs(inV);
+}
+
+uchar3 __attribute__((kernel)) testAbsChar3Uchar3(char3 inV) {
+ return abs(inV);
+}
+
+uchar4 __attribute__((kernel)) testAbsChar4Uchar4(char4 inV) {
+ return abs(inV);
+}
+
+ushort __attribute__((kernel)) testAbsShortUshort(short inV) {
+ return abs(inV);
+}
+
+ushort2 __attribute__((kernel)) testAbsShort2Ushort2(short2 inV) {
+ return abs(inV);
+}
+
+ushort3 __attribute__((kernel)) testAbsShort3Ushort3(short3 inV) {
+ return abs(inV);
+}
+
+ushort4 __attribute__((kernel)) testAbsShort4Ushort4(short4 inV) {
+ return abs(inV);
+}
+
+uint __attribute__((kernel)) testAbsIntUint(int inV) {
+ return abs(inV);
+}
+
+uint2 __attribute__((kernel)) testAbsInt2Uint2(int2 inV) {
+ return abs(inV);
+}
+
+uint3 __attribute__((kernel)) testAbsInt3Uint3(int3 inV) {
+ return abs(inV);
+}
+
+uint4 __attribute__((kernel)) testAbsInt4Uint4(int4 inV) {
+ return abs(inV);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAbsRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAbsRelaxed.rs
index 66f3fef..4016723 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAbsRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAbs.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAcos.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcos.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAcos.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcos.java
index 999fd1b..3b6a199 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAcos.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcos.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestAcos extends RSBaseCompute {
+public class GeneratedTestAcos extends RSBaseCompute {
- private ScriptC_TestAcos script;
- private ScriptC_TestAcosRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAcos script;
+ private ScriptC_GeneratedTestAcosRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestAcos(mRS);
- scriptRelaxed = new ScriptC_TestAcosRelaxed(mRS);
+ script = new ScriptC_GeneratedTestAcos(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAcosRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAcos.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcos.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAcos.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcos.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcosRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcosRelaxed.rs
index 66f3fef..9413bea 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcosRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAcos.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcosh.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcosh.java
index 77c467c..192d5c0 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcosh.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestAcosh extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAcosh script;
+ private ScriptC_GeneratedTestAcoshRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestAcosh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAcoshRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkAcoshFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x777ec00cf303663l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testAcoshFloatFloat(inV, out);
+ verifyResultsAcoshFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testAcoshFloatFloat(inV, out);
+ verifyResultsAcoshFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsAcoshFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeAcosh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkAcoshFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkAcoshFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xf102471f37b311efl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testAcoshFloat2Float2(inV, out);
+ verifyResultsAcoshFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testAcoshFloat2Float2(inV, out);
+ verifyResultsAcoshFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsAcoshFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeAcosh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkAcoshFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkAcoshFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xf104103a2dce32cdl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testAcoshFloat3Float3(inV, out);
+ verifyResultsAcoshFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testAcoshFloat3Float3(inV, out);
+ verifyResultsAcoshFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsAcoshFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeAcosh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkAcoshFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkAcoshFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf105d95523e953abl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testAcoshFloat4Float4(inV, out);
+ verifyResultsAcoshFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testAcoshFloat4Float4(inV, out);
+ verifyResultsAcoshFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsAcoshFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeAcosh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkAcoshFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testAcosh() {
+ checkAcoshFloatFloat();
+ checkAcoshFloat2Float2();
+ checkAcoshFloat3Float3();
+ checkAcoshFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcosh.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcosh.rs
index 7dae4cf..35c4c73 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcosh.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTgammaFloatFloat(float in) {
- return tgamma(in);
+float __attribute__((kernel)) testAcoshFloatFloat(float inV) {
+ return acosh(inV);
}
-float2 __attribute__((kernel)) testTgammaFloat2Float2(float2 in) {
- return tgamma(in);
+float2 __attribute__((kernel)) testAcoshFloat2Float2(float2 inV) {
+ return acosh(inV);
}
-float3 __attribute__((kernel)) testTgammaFloat3Float3(float3 in) {
- return tgamma(in);
+float3 __attribute__((kernel)) testAcoshFloat3Float3(float3 inV) {
+ return acosh(inV);
}
-float4 __attribute__((kernel)) testTgammaFloat4Float4(float4 in) {
- return tgamma(in);
+float4 __attribute__((kernel)) testAcoshFloat4Float4(float4 inV) {
+ return acosh(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcoshRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcoshRelaxed.rs
index 66f3fef..bf34014 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcoshRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAcosh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAcospi.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcospi.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAcospi.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcospi.java
index 7669fea..a06cce5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAcospi.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcospi.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestAcospi extends RSBaseCompute {
+public class GeneratedTestAcospi extends RSBaseCompute {
- private ScriptC_TestAcospi script;
- private ScriptC_TestAcospiRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAcospi script;
+ private ScriptC_GeneratedTestAcospiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestAcospi(mRS);
- scriptRelaxed = new ScriptC_TestAcospiRelaxed(mRS);
+ script = new ScriptC_GeneratedTestAcospi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAcospiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAcospi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcospi.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAcospi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcospi.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcospiRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcospiRelaxed.rs
index 66f3fef..f894336 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAcospiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAcospi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAsin.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsin.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAsin.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsin.java
index ce728e7..e69f912 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAsin.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsin.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestAsin extends RSBaseCompute {
+public class GeneratedTestAsin extends RSBaseCompute {
- private ScriptC_TestAsin script;
- private ScriptC_TestAsinRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAsin script;
+ private ScriptC_GeneratedTestAsinRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestAsin(mRS);
- scriptRelaxed = new ScriptC_TestAsinRelaxed(mRS);
+ script = new ScriptC_GeneratedTestAsin(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAsinRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAsin.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsin.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAsin.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsin.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinRelaxed.rs
index 66f3fef..99362a8 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAsin.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinh.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinh.java
index 77c467c..def06e3 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinh.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestAsinh extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAsinh script;
+ private ScriptC_GeneratedTestAsinhRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestAsinh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAsinhRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkAsinhFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2cdf6bfa7c4a48f4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testAsinhFloatFloat(inV, out);
+ verifyResultsAsinhFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testAsinhFloatFloat(inV, out);
+ verifyResultsAsinhFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsAsinhFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeAsinh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkAsinhFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkAsinhFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x198d997279032b38l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testAsinhFloat2Float2(inV, out);
+ verifyResultsAsinhFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testAsinhFloat2Float2(inV, out);
+ verifyResultsAsinhFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsAsinhFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeAsinh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkAsinhFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkAsinhFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x198f628d6f1e4c16l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testAsinhFloat3Float3(inV, out);
+ verifyResultsAsinhFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testAsinhFloat3Float3(inV, out);
+ verifyResultsAsinhFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsAsinhFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeAsinh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkAsinhFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkAsinhFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x19912ba865396cf4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testAsinhFloat4Float4(inV, out);
+ verifyResultsAsinhFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testAsinhFloat4Float4(inV, out);
+ verifyResultsAsinhFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsAsinhFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeAsinh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkAsinhFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testAsinh() {
+ checkAsinhFloatFloat();
+ checkAsinhFloat2Float2();
+ checkAsinhFloat3Float3();
+ checkAsinhFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinh.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinh.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAsinh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinh.rs
index a72a5f4..b7567db 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinh.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinh.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testAsinhFloatFloat(float in) {
- return asinh(in);
+float __attribute__((kernel)) testAsinhFloatFloat(float inV) {
+ return asinh(inV);
}
-float2 __attribute__((kernel)) testAsinhFloat2Float2(float2 in) {
- return asinh(in);
+float2 __attribute__((kernel)) testAsinhFloat2Float2(float2 inV) {
+ return asinh(inV);
}
-float3 __attribute__((kernel)) testAsinhFloat3Float3(float3 in) {
- return asinh(in);
+float3 __attribute__((kernel)) testAsinhFloat3Float3(float3 inV) {
+ return asinh(inV);
}
-float4 __attribute__((kernel)) testAsinhFloat4Float4(float4 in) {
- return asinh(in);
+float4 __attribute__((kernel)) testAsinhFloat4Float4(float4 inV) {
+ return asinh(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinhRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinhRelaxed.rs
index 66f3fef..487e710 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinhRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAsinh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinpi.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinpi.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAsinpi.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinpi.java
index 50bc387..23dc9b8 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinpi.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinpi.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestAsinpi extends RSBaseCompute {
+public class GeneratedTestAsinpi extends RSBaseCompute {
- private ScriptC_TestAsinpi script;
- private ScriptC_TestAsinpiRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAsinpi script;
+ private ScriptC_GeneratedTestAsinpiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestAsinpi(mRS);
- scriptRelaxed = new ScriptC_TestAsinpiRelaxed(mRS);
+ script = new ScriptC_GeneratedTestAsinpi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAsinpiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinpi.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAsinpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinpi.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinpiRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinpiRelaxed.rs
index 66f3fef..591d9cd 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAsinpiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAsinpi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAtan.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan.java
index 1d7055c..4721017 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestAtan extends RSBaseCompute {
+public class GeneratedTestAtan extends RSBaseCompute {
- private ScriptC_TestAtan script;
- private ScriptC_TestAtanRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAtan script;
+ private ScriptC_GeneratedTestAtanRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestAtan(mRS);
- scriptRelaxed = new ScriptC_TestAtanRelaxed(mRS);
+ script = new ScriptC_GeneratedTestAtan(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAtanRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAtan.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2.java
similarity index 65%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAtan2.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2.java
index 10b862d..37843e9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestAtan2 extends RSBaseCompute {
+public class GeneratedTestAtan2 extends RSBaseCompute {
- private ScriptC_TestAtan2 script;
- private ScriptC_TestAtan2Relaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAtan2 script;
+ private ScriptC_GeneratedTestAtan2Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestAtan2(mRS);
- scriptRelaxed = new ScriptC_TestAtan2Relaxed(mRS);
+ script = new ScriptC_GeneratedTestAtan2(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAtan2Relaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inY;
- public float inX;
+ public float inNumerator;
+ public float inDenominator;
public Target.Floaty out;
}
private void checkAtan2FloatFloatFloat() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x8f58f1f953c03c32l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x8f58f1f953c03c31l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x717c0d8e261d332l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x37738e957bd90d5bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testAtan2FloatFloatFloat(inY, out);
- verifyResultsAtan2FloatFloatFloat(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testAtan2FloatFloatFloat(inNumerator, out);
+ verifyResultsAtan2FloatFloatFloat(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2FloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testAtan2FloatFloatFloat(inY, out);
- verifyResultsAtan2FloatFloatFloat(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testAtan2FloatFloatFloat(inNumerator, out);
+ verifyResultsAtan2FloatFloatFloat(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2FloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsAtan2FloatFloatFloat(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
+ private void verifyResultsAtan2FloatFloatFloat(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 1];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 1];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i];
- args.inX = arrayInX[i];
+ args.inNumerator = arrayInNumerator[i];
+ args.inDenominator = arrayInDenominator[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeAtan2(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkAtan2Float2Float2Float2() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xbe78dcdcd414b6c0l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xbe78dcdcd414b6bfl, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x8658ecfeefb30700l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x552b6d6bab583839l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testAtan2Float2Float2Float2(inY, out);
- verifyResultsAtan2Float2Float2Float2(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testAtan2Float2Float2Float2(inNumerator, out);
+ verifyResultsAtan2Float2Float2Float2(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2Float2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testAtan2Float2Float2Float2(inY, out);
- verifyResultsAtan2Float2Float2Float2(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testAtan2Float2Float2Float2(inNumerator, out);
+ verifyResultsAtan2Float2Float2Float2(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2Float2Float2Float2: " + e.toString());
}
}
- private void verifyResultsAtan2Float2Float2Float2(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
+ private void verifyResultsAtan2Float2Float2Float2(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 2];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 2];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 2 + j];
- args.inX = arrayInX[i * 2 + j];
+ args.inNumerator = arrayInNumerator[i * 2 + j];
+ args.inDenominator = arrayInDenominator[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeAtan2(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkAtan2Float3Float3Float3() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x12ddbafcd5f2b861l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x12ddbafcd5f2b860l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x61e79638927ef301l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1e8faeb47e33cb72l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testAtan2Float3Float3Float3(inY, out);
- verifyResultsAtan2Float3Float3Float3(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testAtan2Float3Float3Float3(inNumerator, out);
+ verifyResultsAtan2Float3Float3Float3(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2Float3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testAtan2Float3Float3Float3(inY, out);
- verifyResultsAtan2Float3Float3Float3(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testAtan2Float3Float3Float3(inNumerator, out);
+ verifyResultsAtan2Float3Float3Float3(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2Float3Float3Float3: " + e.toString());
}
}
- private void verifyResultsAtan2Float3Float3Float3(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
+ private void verifyResultsAtan2Float3Float3Float3(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 4 + j];
- args.inX = arrayInX[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeAtan2(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkAtan2Float4Float4Float4() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6742991cd7d0ba02l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6742991cd7d0ba01l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3d763f72354adf02l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xe7f3effd510f5eabl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testAtan2Float4Float4Float4(inY, out);
- verifyResultsAtan2Float4Float4Float4(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testAtan2Float4Float4Float4(inNumerator, out);
+ verifyResultsAtan2Float4Float4Float4(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2Float4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testAtan2Float4Float4Float4(inY, out);
- verifyResultsAtan2Float4Float4Float4(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testAtan2Float4Float4Float4(inNumerator, out);
+ verifyResultsAtan2Float4Float4Float4(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2Float4Float4Float4: " + e.toString());
}
}
- private void verifyResultsAtan2Float4Float4Float4(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
+ private void verifyResultsAtan2Float4Float4Float4(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 4 + j];
- args.inX = arrayInX[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeAtan2(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2.rs
new file mode 100644
index 0000000..e75ec89
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2.rs
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInDenominator;
+
+float __attribute__((kernel)) testAtan2FloatFloatFloat(float inNumerator, unsigned int x) {
+ float inDenominator = rsGetElementAt_float(gAllocInDenominator, x);
+ return atan2(inNumerator, inDenominator);
+}
+
+float2 __attribute__((kernel)) testAtan2Float2Float2Float2(float2 inNumerator, unsigned int x) {
+ float2 inDenominator = rsGetElementAt_float2(gAllocInDenominator, x);
+ return atan2(inNumerator, inDenominator);
+}
+
+float3 __attribute__((kernel)) testAtan2Float3Float3Float3(float3 inNumerator, unsigned int x) {
+ float3 inDenominator = rsGetElementAt_float3(gAllocInDenominator, x);
+ return atan2(inNumerator, inDenominator);
+}
+
+float4 __attribute__((kernel)) testAtan2Float4Float4Float4(float4 inNumerator, unsigned int x) {
+ float4 inDenominator = rsGetElementAt_float4(gAllocInDenominator, x);
+ return atan2(inNumerator, inDenominator);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2Relaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2Relaxed.rs
index 66f3fef..a5fe0ce 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAtan2.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2pi.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2pi.java
similarity index 65%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAtan2pi.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2pi.java
index 8837003..540eede 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2pi.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2pi.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestAtan2pi extends RSBaseCompute {
+public class GeneratedTestAtan2pi extends RSBaseCompute {
- private ScriptC_TestAtan2pi script;
- private ScriptC_TestAtan2piRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAtan2pi script;
+ private ScriptC_GeneratedTestAtan2piRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestAtan2pi(mRS);
- scriptRelaxed = new ScriptC_TestAtan2piRelaxed(mRS);
+ script = new ScriptC_GeneratedTestAtan2pi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAtan2piRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inY;
- public float inX;
+ public float inNumerator;
+ public float inDenominator;
public Target.Floaty out;
}
private void checkAtan2piFloatFloatFloat() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x5a912731bef85233l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x5a912731bef85232l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3276ace81dcb793l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xc4961da25a748df4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testAtan2piFloatFloatFloat(inY, out);
- verifyResultsAtan2piFloatFloatFloat(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testAtan2piFloatFloatFloat(inNumerator, out);
+ verifyResultsAtan2piFloatFloatFloat(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2piFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testAtan2piFloatFloatFloat(inY, out);
- verifyResultsAtan2piFloatFloatFloat(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testAtan2piFloatFloatFloat(inNumerator, out);
+ verifyResultsAtan2piFloatFloatFloat(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2piFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsAtan2piFloatFloatFloat(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
+ private void verifyResultsAtan2piFloatFloatFloat(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 1];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 1];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i];
- args.inX = arrayInX[i];
+ args.inNumerator = arrayInNumerator[i];
+ args.inDenominator = arrayInDenominator[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeAtan2pi(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkAtan2piFloat2Float2Float2() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x8031be184fee8f53l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x8031be184fee8f52l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3b26f42853d1a0b3l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x393d275fcc5c5614l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testAtan2piFloat2Float2Float2(inY, out);
- verifyResultsAtan2piFloat2Float2Float2(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testAtan2piFloat2Float2Float2(inNumerator, out);
+ verifyResultsAtan2piFloat2Float2Float2(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2piFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testAtan2piFloat2Float2Float2(inY, out);
- verifyResultsAtan2piFloat2Float2Float2(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testAtan2piFloat2Float2Float2(inNumerator, out);
+ verifyResultsAtan2piFloat2Float2Float2(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2piFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsAtan2piFloat2Float2Float2(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
+ private void verifyResultsAtan2piFloat2Float2Float2(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 2];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 2];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 2 + j];
- args.inX = arrayInX[i * 2 + j];
+ args.inNumerator = arrayInNumerator[i * 2 + j];
+ args.inDenominator = arrayInDenominator[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeAtan2pi(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkAtan2piFloat3Float3Float3() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd4969c3851cc90f4l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd4969c3851cc90f3l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x16b59d61f69d8cb4l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2a168a89f37e94dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testAtan2piFloat3Float3Float3(inY, out);
- verifyResultsAtan2piFloat3Float3Float3(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testAtan2piFloat3Float3Float3(inNumerator, out);
+ verifyResultsAtan2piFloat3Float3Float3(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2piFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testAtan2piFloat3Float3Float3(inY, out);
- verifyResultsAtan2piFloat3Float3Float3(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testAtan2piFloat3Float3Float3(inNumerator, out);
+ verifyResultsAtan2piFloat3Float3Float3(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2piFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsAtan2piFloat3Float3Float3(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
+ private void verifyResultsAtan2piFloat3Float3Float3(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 4 + j];
- args.inX = arrayInX[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeAtan2pi(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkAtan2piFloat4Float4Float4() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x28fb7a5853aa9295l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x28fb7a5853aa9294l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf244469b996978b5l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xcc05a9f172137c86l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testAtan2piFloat4Float4Float4(inY, out);
- verifyResultsAtan2piFloat4Float4Float4(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testAtan2piFloat4Float4Float4(inNumerator, out);
+ verifyResultsAtan2piFloat4Float4Float4(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2piFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testAtan2piFloat4Float4Float4(inY, out);
- verifyResultsAtan2piFloat4Float4Float4(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testAtan2piFloat4Float4Float4(inNumerator, out);
+ verifyResultsAtan2piFloat4Float4Float4(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAtan2piFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsAtan2piFloat4Float4Float4(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
+ private void verifyResultsAtan2piFloat4Float4Float4(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 4 + j];
- args.inX = arrayInX[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeAtan2pi(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2pi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2pi.rs
similarity index 61%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAtan2pi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2pi.rs
index f0520d7..25064f9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2pi.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2pi.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInX;
+rs_allocation gAllocInDenominator;
-float __attribute__((kernel)) testAtan2piFloatFloatFloat(float inY, unsigned int x) {
- float inX = rsGetElementAt_float(gAllocInX, x);
- return atan2pi(inY, inX);
+float __attribute__((kernel)) testAtan2piFloatFloatFloat(float inNumerator, unsigned int x) {
+ float inDenominator = rsGetElementAt_float(gAllocInDenominator, x);
+ return atan2pi(inNumerator, inDenominator);
}
-float2 __attribute__((kernel)) testAtan2piFloat2Float2Float2(float2 inY, unsigned int x) {
- float2 inX = rsGetElementAt_float2(gAllocInX, x);
- return atan2pi(inY, inX);
+float2 __attribute__((kernel)) testAtan2piFloat2Float2Float2(float2 inNumerator, unsigned int x) {
+ float2 inDenominator = rsGetElementAt_float2(gAllocInDenominator, x);
+ return atan2pi(inNumerator, inDenominator);
}
-float3 __attribute__((kernel)) testAtan2piFloat3Float3Float3(float3 inY, unsigned int x) {
- float3 inX = rsGetElementAt_float3(gAllocInX, x);
- return atan2pi(inY, inX);
+float3 __attribute__((kernel)) testAtan2piFloat3Float3Float3(float3 inNumerator, unsigned int x) {
+ float3 inDenominator = rsGetElementAt_float3(gAllocInDenominator, x);
+ return atan2pi(inNumerator, inDenominator);
}
-float4 __attribute__((kernel)) testAtan2piFloat4Float4Float4(float4 inY, unsigned int x) {
- float4 inX = rsGetElementAt_float4(gAllocInX, x);
- return atan2pi(inY, inX);
+float4 __attribute__((kernel)) testAtan2piFloat4Float4Float4(float4 inNumerator, unsigned int x) {
+ float4 inDenominator = rsGetElementAt_float4(gAllocInDenominator, x);
+ return atan2pi(inNumerator, inDenominator);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2piRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2piRelaxed.rs
index 66f3fef..7c83f66 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtan2piRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAtan2pi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanRelaxed.rs
index 66f3fef..68821a4 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAtan.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanh.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanh.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAtanh.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanh.java
index a07c171..266e4fe 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanh.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanh.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestAtanh extends RSBaseCompute {
+public class GeneratedTestAtanh extends RSBaseCompute {
- private ScriptC_TestAtanh script;
- private ScriptC_TestAtanhRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAtanh script;
+ private ScriptC_GeneratedTestAtanhRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestAtanh(mRS);
- scriptRelaxed = new ScriptC_TestAtanhRelaxed(mRS);
+ script = new ScriptC_GeneratedTestAtanh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAtanhRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanh.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanh.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAtanh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanh.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanhRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanhRelaxed.rs
index 66f3fef..2548366 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanhRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAtanh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanpi.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanpi.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAtanpi.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanpi.java
index 34c4e32..97ad786 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanpi.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanpi.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestAtanpi extends RSBaseCompute {
+public class GeneratedTestAtanpi extends RSBaseCompute {
- private ScriptC_TestAtanpi script;
- private ScriptC_TestAtanpiRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestAtanpi script;
+ private ScriptC_GeneratedTestAtanpiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestAtanpi(mRS);
- scriptRelaxed = new ScriptC_TestAtanpiRelaxed(mRS);
+ script = new ScriptC_GeneratedTestAtanpi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestAtanpiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanpi.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestAtanpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanpi.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanpiRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanpiRelaxed.rs
index 66f3fef..07fcdca 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestAtanpiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestAtanpi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCbrt.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCbrt.java
index 77c467c..337582d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCbrt.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestCbrt extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestCbrt script;
+ private ScriptC_GeneratedTestCbrtRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestCbrt(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestCbrtRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkCbrtFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x21721d33845561d4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testCbrtFloatFloat(inV, out);
+ verifyResultsCbrtFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testCbrtFloatFloat(inV, out);
+ verifyResultsCbrtFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCbrtFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCbrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkCbrtFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkCbrtFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x910f9e5d9129d518l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testCbrtFloat2Float2(inV, out);
+ verifyResultsCbrtFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testCbrtFloat2Float2(inV, out);
+ verifyResultsCbrtFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCbrtFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCbrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkCbrtFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkCbrtFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x911167788744f5f6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testCbrtFloat3Float3(inV, out);
+ verifyResultsCbrtFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testCbrtFloat3Float3(inV, out);
+ verifyResultsCbrtFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCbrtFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCbrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkCbrtFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkCbrtFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x911330937d6016d4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testCbrtFloat4Float4(inV, out);
+ verifyResultsCbrtFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testCbrtFloat4Float4(inV, out);
+ verifyResultsCbrtFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCbrtFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCbrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkCbrtFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testCbrt() {
+ checkCbrtFloatFloat();
+ checkCbrtFloat2Float2();
+ checkCbrtFloat3Float3();
+ checkCbrtFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCbrt.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCbrt.rs
index 1024943..1544c27 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCbrt.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testCbrtFloatFloat(float inV) {
+ return cbrt(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testCbrtFloat2Float2(float2 inV) {
+ return cbrt(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testCbrtFloat3Float3(float3 inV) {
+ return cbrt(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testCbrtFloat4Float4(float4 inV) {
+ return cbrt(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCbrtRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCbrtRelaxed.rs
index 66f3fef..b0ffe69 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCbrtRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestCbrt.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCeil.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCeil.java
index 77c467c..f38345f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCeil.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestCeil extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestCeil script;
+ private ScriptC_GeneratedTestCeilRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestCeil(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestCeilRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkCeilFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf12a662b492bf934l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testCeilFloatFloat(inV, out);
+ verifyResultsCeilFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testCeilFloatFloat(inV, out);
+ verifyResultsCeilFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCeilFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCeil(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkCeilFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkCeilFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xdb16a3ea43152978l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testCeilFloat2Float2(inV, out);
+ verifyResultsCeilFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testCeilFloat2Float2(inV, out);
+ verifyResultsCeilFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCeilFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCeil(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkCeilFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkCeilFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xdb186d0539304a56l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testCeilFloat3Float3(inV, out);
+ verifyResultsCeilFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testCeilFloat3Float3(inV, out);
+ verifyResultsCeilFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCeilFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCeil(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkCeilFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkCeilFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xdb1a36202f4b6b34l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testCeilFloat4Float4(inV, out);
+ verifyResultsCeilFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testCeilFloat4Float4(inV, out);
+ verifyResultsCeilFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCeilFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCeil(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkCeilFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testCeil() {
+ checkCeilFloatFloat();
+ checkCeilFloat2Float2();
+ checkCeilFloat3Float3();
+ checkCeilFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCeil.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCeil.rs
index 1024943..1bfba39 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCeil.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testCeilFloatFloat(float inV) {
+ return ceil(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testCeilFloat2Float2(float2 inV) {
+ return ceil(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testCeilFloat3Float3(float3 inV) {
+ return ceil(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testCeilFloat4Float4(float4 inV) {
+ return ceil(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCeilRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCeilRelaxed.rs
index 66f3fef..960c17b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCeilRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestCeil.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestClamp.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClamp.java
similarity index 99%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestClamp.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClamp.java
index 44f60d6..c302a95 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestClamp.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClamp.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestClamp extends RSBaseCompute {
+public class GeneratedTestClamp extends RSBaseCompute {
- private ScriptC_TestClamp script;
- private ScriptC_TestClampRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestClamp script;
+ private ScriptC_GeneratedTestClampRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestClamp(mRS);
- scriptRelaxed = new ScriptC_TestClampRelaxed(mRS);
+ script = new ScriptC_GeneratedTestClamp(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestClampRelaxed(mRS);
}
public class ArgumentsFloatFloatFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestClamp.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClamp.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestClamp.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClamp.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClampRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClampRelaxed.rs
index 66f3fef..ff33381 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClampRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestClamp.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestClz.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClz.java
similarity index 99%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestClz.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClz.java
index 51241aa..b10fcb9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestClz.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClz.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestClz extends RSBaseCompute {
+public class GeneratedTestClz extends RSBaseCompute {
- private ScriptC_TestClz script;
- private ScriptC_TestClzRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestClz script;
+ private ScriptC_GeneratedTestClzRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestClz(mRS);
- scriptRelaxed = new ScriptC_TestClzRelaxed(mRS);
+ script = new ScriptC_GeneratedTestClz(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestClzRelaxed(mRS);
}
public class ArgumentsCharChar {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestClz.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClz.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestClz.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClz.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClzRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClzRelaxed.rs
index 66f3fef..73df33a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestClzRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestClz.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestConvert.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestConvert.java
similarity index 99%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestConvert.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestConvert.java
index fc56b26..aa28239 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestConvert.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestConvert.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestConvert extends RSBaseCompute {
+public class GeneratedTestConvert extends RSBaseCompute {
- private ScriptC_TestConvert script;
- private ScriptC_TestConvertRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestConvert script;
+ private ScriptC_GeneratedTestConvertRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestConvert(mRS);
- scriptRelaxed = new ScriptC_TestConvertRelaxed(mRS);
+ script = new ScriptC_GeneratedTestConvert(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestConvertRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestConvert.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestConvert.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestConvert.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestConvert.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestConvertRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestConvertRelaxed.rs
index 66f3fef..fa063c7 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestConvertRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestConvert.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCopysign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCopysign.java
similarity index 65%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestCopysign.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCopysign.java
index cb8794a..1391b61 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCopysign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCopysign.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestCopysign extends RSBaseCompute {
+public class GeneratedTestCopysign extends RSBaseCompute {
- private ScriptC_TestCopysign script;
- private ScriptC_TestCopysignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestCopysign script;
+ private ScriptC_GeneratedTestCopysignRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestCopysign(mRS);
- scriptRelaxed = new ScriptC_TestCopysignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestCopysign(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestCopysignRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inX;
- public float inY;
+ public float inMagnitudeValue;
+ public float inSignValue;
public Target.Floaty out;
}
private void checkCopysignFloatFloatFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xeebba96e8c48145l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xeebba96e8c48146l, false);
+ Allocation inMagnitudeValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x4218ae4ccf086614l, false);
+ Allocation inSignValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xd95dacad9d8d3ef5l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testCopysignFloatFloatFloat(inX, out);
- verifyResultsCopysignFloatFloatFloat(inX, inY, out, false);
+ script.set_gAllocInSignValue(inSignValue);
+ script.forEach_testCopysignFloatFloatFloat(inMagnitudeValue, out);
+ verifyResultsCopysignFloatFloatFloat(inMagnitudeValue, inSignValue, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCopysignFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testCopysignFloatFloatFloat(inX, out);
- verifyResultsCopysignFloatFloatFloat(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInSignValue(inSignValue);
+ scriptRelaxed.forEach_testCopysignFloatFloatFloat(inMagnitudeValue, out);
+ verifyResultsCopysignFloatFloatFloat(inMagnitudeValue, inSignValue, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCopysignFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsCopysignFloatFloatFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsCopysignFloatFloatFloat(Allocation inMagnitudeValue, Allocation inSignValue, Allocation out, boolean relaxed) {
+ float[] arrayInMagnitudeValue = new float[INPUTSIZE * 1];
+ inMagnitudeValue.copyTo(arrayInMagnitudeValue);
+ float[] arrayInSignValue = new float[INPUTSIZE * 1];
+ inSignValue.copyTo(arrayInSignValue);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
+ args.inMagnitudeValue = arrayInMagnitudeValue[i];
+ args.inSignValue = arrayInSignValue[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeCopysign(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inMagnitudeValue: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inMagnitudeValue, Float.floatToRawIntBits(args.inMagnitudeValue), args.inMagnitudeValue));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inSignValue: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inSignValue, Float.floatToRawIntBits(args.inSignValue), args.inSignValue));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkCopysignFloat2Float2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xbeb0e1cc912e993bl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xbeb0e1cc912e993cl, false);
+ Allocation inMagnitudeValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x8efe093722e9f786l, false);
+ Allocation inSignValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xb33b4a8420cec72bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testCopysignFloat2Float2Float2(inX, out);
- verifyResultsCopysignFloat2Float2Float2(inX, inY, out, false);
+ script.set_gAllocInSignValue(inSignValue);
+ script.forEach_testCopysignFloat2Float2Float2(inMagnitudeValue, out);
+ verifyResultsCopysignFloat2Float2Float2(inMagnitudeValue, inSignValue, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCopysignFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testCopysignFloat2Float2Float2(inX, out);
- verifyResultsCopysignFloat2Float2Float2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInSignValue(inSignValue);
+ scriptRelaxed.forEach_testCopysignFloat2Float2Float2(inMagnitudeValue, out);
+ verifyResultsCopysignFloat2Float2Float2(inMagnitudeValue, inSignValue, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCopysignFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsCopysignFloat2Float2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
+ private void verifyResultsCopysignFloat2Float2Float2(Allocation inMagnitudeValue, Allocation inSignValue, Allocation out, boolean relaxed) {
+ float[] arrayInMagnitudeValue = new float[INPUTSIZE * 2];
+ inMagnitudeValue.copyTo(arrayInMagnitudeValue);
+ float[] arrayInSignValue = new float[INPUTSIZE * 2];
+ inSignValue.copyTo(arrayInSignValue);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
+ args.inMagnitudeValue = arrayInMagnitudeValue[i * 2 + j];
+ args.inSignValue = arrayInSignValue[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeCopysign(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inMagnitudeValue: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inMagnitudeValue, Float.floatToRawIntBits(args.inMagnitudeValue), args.inMagnitudeValue));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inSignValue: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inSignValue, Float.floatToRawIntBits(args.inSignValue), args.inSignValue));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkCopysignFloat3Float3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1315bfec930c9adcl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1315bfec930c9addl, false);
+ Allocation inMagnitudeValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x9a9db55e1b468741l, false);
+ Allocation inSignValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x8ec9f3bdc39ab32cl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testCopysignFloat3Float3Float3(inX, out);
- verifyResultsCopysignFloat3Float3Float3(inX, inY, out, false);
+ script.set_gAllocInSignValue(inSignValue);
+ script.forEach_testCopysignFloat3Float3Float3(inMagnitudeValue, out);
+ verifyResultsCopysignFloat3Float3Float3(inMagnitudeValue, inSignValue, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCopysignFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testCopysignFloat3Float3Float3(inX, out);
- verifyResultsCopysignFloat3Float3Float3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInSignValue(inSignValue);
+ scriptRelaxed.forEach_testCopysignFloat3Float3Float3(inMagnitudeValue, out);
+ verifyResultsCopysignFloat3Float3Float3(inMagnitudeValue, inSignValue, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCopysignFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsCopysignFloat3Float3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsCopysignFloat3Float3Float3(Allocation inMagnitudeValue, Allocation inSignValue, Allocation out, boolean relaxed) {
+ float[] arrayInMagnitudeValue = new float[INPUTSIZE * 4];
+ inMagnitudeValue.copyTo(arrayInMagnitudeValue);
+ float[] arrayInSignValue = new float[INPUTSIZE * 4];
+ inSignValue.copyTo(arrayInSignValue);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inMagnitudeValue = arrayInMagnitudeValue[i * 4 + j];
+ args.inSignValue = arrayInSignValue[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeCopysign(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inMagnitudeValue: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inMagnitudeValue, Float.floatToRawIntBits(args.inMagnitudeValue), args.inMagnitudeValue));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inSignValue: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inSignValue, Float.floatToRawIntBits(args.inSignValue), args.inSignValue));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkCopysignFloat4Float4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x677a9e0c94ea9c7dl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x677a9e0c94ea9c7el, false);
+ Allocation inMagnitudeValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xa63d618513a316fcl, false);
+ Allocation inSignValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6a589cf766669f2dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testCopysignFloat4Float4Float4(inX, out);
- verifyResultsCopysignFloat4Float4Float4(inX, inY, out, false);
+ script.set_gAllocInSignValue(inSignValue);
+ script.forEach_testCopysignFloat4Float4Float4(inMagnitudeValue, out);
+ verifyResultsCopysignFloat4Float4Float4(inMagnitudeValue, inSignValue, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCopysignFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testCopysignFloat4Float4Float4(inX, out);
- verifyResultsCopysignFloat4Float4Float4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInSignValue(inSignValue);
+ scriptRelaxed.forEach_testCopysignFloat4Float4Float4(inMagnitudeValue, out);
+ verifyResultsCopysignFloat4Float4Float4(inMagnitudeValue, inSignValue, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCopysignFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsCopysignFloat4Float4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsCopysignFloat4Float4Float4(Allocation inMagnitudeValue, Allocation inSignValue, Allocation out, boolean relaxed) {
+ float[] arrayInMagnitudeValue = new float[INPUTSIZE * 4];
+ inMagnitudeValue.copyTo(arrayInMagnitudeValue);
+ float[] arrayInSignValue = new float[INPUTSIZE * 4];
+ inSignValue.copyTo(arrayInSignValue);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inMagnitudeValue = arrayInMagnitudeValue[i * 4 + j];
+ args.inSignValue = arrayInSignValue[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeCopysign(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inMagnitudeValue: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inMagnitudeValue, Float.floatToRawIntBits(args.inMagnitudeValue), args.inMagnitudeValue));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inSignValue: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inSignValue, Float.floatToRawIntBits(args.inSignValue), args.inSignValue));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCopysign.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCopysign.rs
similarity index 60%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestCopysign.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCopysign.rs
index d7bc4d0..ccbf2b7 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCopysign.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCopysign.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInY;
+rs_allocation gAllocInSignValue;
-float __attribute__((kernel)) testCopysignFloatFloatFloat(float inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return copysign(inX, inY);
+float __attribute__((kernel)) testCopysignFloatFloatFloat(float inMagnitudeValue, unsigned int x) {
+ float inSignValue = rsGetElementAt_float(gAllocInSignValue, x);
+ return copysign(inMagnitudeValue, inSignValue);
}
-float2 __attribute__((kernel)) testCopysignFloat2Float2Float2(float2 inX, unsigned int x) {
- float2 inY = rsGetElementAt_float2(gAllocInY, x);
- return copysign(inX, inY);
+float2 __attribute__((kernel)) testCopysignFloat2Float2Float2(float2 inMagnitudeValue, unsigned int x) {
+ float2 inSignValue = rsGetElementAt_float2(gAllocInSignValue, x);
+ return copysign(inMagnitudeValue, inSignValue);
}
-float3 __attribute__((kernel)) testCopysignFloat3Float3Float3(float3 inX, unsigned int x) {
- float3 inY = rsGetElementAt_float3(gAllocInY, x);
- return copysign(inX, inY);
+float3 __attribute__((kernel)) testCopysignFloat3Float3Float3(float3 inMagnitudeValue, unsigned int x) {
+ float3 inSignValue = rsGetElementAt_float3(gAllocInSignValue, x);
+ return copysign(inMagnitudeValue, inSignValue);
}
-float4 __attribute__((kernel)) testCopysignFloat4Float4Float4(float4 inX, unsigned int x) {
- float4 inY = rsGetElementAt_float4(gAllocInY, x);
- return copysign(inX, inY);
+float4 __attribute__((kernel)) testCopysignFloat4Float4Float4(float4 inMagnitudeValue, unsigned int x) {
+ float4 inSignValue = rsGetElementAt_float4(gAllocInSignValue, x);
+ return copysign(inMagnitudeValue, inSignValue);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCopysignRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCopysignRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestCopysignRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCopysignRelaxed.rs
index 01002d7..cc6b1ac 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCopysignRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCopysignRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestCopysign.rs"
+#include "GeneratedTestCopysign.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCos.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCos.java
index 77c467c..ef2d39f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCos.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestCos extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestCos script;
+ private ScriptC_GeneratedTestCosRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestCos(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestCosRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkCosFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe70ae86bb80fef6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testCosFloatFloat(inV, out);
+ verifyResultsCosFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testCosFloatFloat(inV, out);
+ verifyResultsCosFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCosFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCos(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkCosFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkCosFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x4bb740670b2bbfaal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testCosFloat2Float2(inV, out);
+ verifyResultsCosFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testCosFloat2Float2(inV, out);
+ verifyResultsCosFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCosFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCos(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkCosFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkCosFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x4bb909820146e088l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testCosFloat3Float3(inV, out);
+ verifyResultsCosFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testCosFloat3Float3(inV, out);
+ verifyResultsCosFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCosFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCos(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkCosFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkCosFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x4bbad29cf7620166l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testCosFloat4Float4(inV, out);
+ verifyResultsCosFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testCosFloat4Float4(inV, out);
+ verifyResultsCosFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCosFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCos(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkCosFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testCos() {
+ checkCosFloatFloat();
+ checkCosFloat2Float2();
+ checkCosFloat3Float3();
+ checkCosFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCos.rs
similarity index 70%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCos.rs
index 80c8708..005b568 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCos.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testCeilFloatFloat(float in) {
- return ceil(in);
+float __attribute__((kernel)) testCosFloatFloat(float inV) {
+ return cos(inV);
}
-float2 __attribute__((kernel)) testCeilFloat2Float2(float2 in) {
- return ceil(in);
+float2 __attribute__((kernel)) testCosFloat2Float2(float2 inV) {
+ return cos(inV);
}
-float3 __attribute__((kernel)) testCeilFloat3Float3(float3 in) {
- return ceil(in);
+float3 __attribute__((kernel)) testCosFloat3Float3(float3 inV) {
+ return cos(inV);
}
-float4 __attribute__((kernel)) testCeilFloat4Float4(float4 in) {
- return ceil(in);
+float4 __attribute__((kernel)) testCosFloat4Float4(float4 inV) {
+ return cos(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCosRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCosRelaxed.rs
index 66f3fef..8eb98bf 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCosRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestCos.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCosh.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCosh.java
index 77c467c..f1c3a83 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCosh.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestCosh extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestCosh script;
+ private ScriptC_GeneratedTestCoshRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestCosh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestCoshRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkCoshFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xfb54622d108cfb40l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testCoshFloatFloat(inV, out);
+ verifyResultsCoshFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testCoshFloatFloat(inV, out);
+ verifyResultsCoshFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCoshFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCosh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkCoshFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkCoshFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x4453ccc34ebcf224l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testCoshFloat2Float2(inV, out);
+ verifyResultsCoshFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testCoshFloat2Float2(inV, out);
+ verifyResultsCoshFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCoshFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCosh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkCoshFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkCoshFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x445595de44d81302l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testCoshFloat3Float3(inV, out);
+ verifyResultsCoshFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testCoshFloat3Float3(inV, out);
+ verifyResultsCoshFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCoshFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCosh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkCoshFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkCoshFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x44575ef93af333e0l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testCoshFloat4Float4(inV, out);
+ verifyResultsCoshFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testCoshFloat4Float4(inV, out);
+ verifyResultsCoshFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCoshFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCosh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkCoshFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testCosh() {
+ checkCoshFloatFloat();
+ checkCoshFloat2Float2();
+ checkCoshFloat3Float3();
+ checkCoshFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCosh.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCosh.rs
index 1024943..3064edb 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCosh.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testCoshFloatFloat(float inV) {
+ return cosh(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testCoshFloat2Float2(float2 inV) {
+ return cosh(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testCoshFloat3Float3(float3 inV) {
+ return cosh(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testCoshFloat4Float4(float4 inV) {
+ return cosh(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCoshRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCoshRelaxed.rs
index 66f3fef..122308e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCoshRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestCosh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCospi.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCospi.java
index 77c467c..66ad337 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCospi.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestCospi extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestCospi script;
+ private ScriptC_GeneratedTestCospiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestCospi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestCospiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkCospiFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x95c59d24cc7595d1l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testCospiFloatFloat(inV, out);
+ verifyResultsCospiFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testCospiFloatFloat(inV, out);
+ verifyResultsCospiFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCospiFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCospi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkCospiFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkCospiFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc026b40f81c1536dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testCospiFloat2Float2(inV, out);
+ verifyResultsCospiFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testCospiFloat2Float2(inV, out);
+ verifyResultsCospiFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCospiFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCospi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkCospiFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkCospiFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xc0287d2a77dc744bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testCospiFloat3Float3(inV, out);
+ verifyResultsCospiFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testCospiFloat3Float3(inV, out);
+ verifyResultsCospiFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCospiFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCospi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkCospiFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkCospiFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc02a46456df79529l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testCospiFloat4Float4(inV, out);
+ verifyResultsCospiFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testCospiFloat4Float4(inV, out);
+ verifyResultsCospiFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsCospiFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeCospi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkCospiFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testCospi() {
+ checkCospiFloatFloat();
+ checkCospiFloat2Float2();
+ checkCospiFloat3Float3();
+ checkCospiFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCospi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCospi.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestCospi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCospi.rs
index a0cc778..25f9e8e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCospi.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCospi.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testCospiFloatFloat(float in) {
- return cospi(in);
+float __attribute__((kernel)) testCospiFloatFloat(float inV) {
+ return cospi(inV);
}
-float2 __attribute__((kernel)) testCospiFloat2Float2(float2 in) {
- return cospi(in);
+float2 __attribute__((kernel)) testCospiFloat2Float2(float2 inV) {
+ return cospi(inV);
}
-float3 __attribute__((kernel)) testCospiFloat3Float3(float3 in) {
- return cospi(in);
+float3 __attribute__((kernel)) testCospiFloat3Float3(float3 inV) {
+ return cospi(inV);
}
-float4 __attribute__((kernel)) testCospiFloat4Float4(float4 in) {
- return cospi(in);
+float4 __attribute__((kernel)) testCospiFloat4Float4(float4 inV) {
+ return cospi(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCospiRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCospiRelaxed.rs
index 66f3fef..ba1cf13 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCospiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestCospi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCross.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCross.java
similarity index 66%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestCross.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCross.java
index c5dc979..748bdd8 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCross.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCross.java
@@ -22,64 +22,64 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestCross extends RSBaseCompute {
+public class GeneratedTestCross extends RSBaseCompute {
- private ScriptC_TestCross script;
- private ScriptC_TestCrossRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestCross script;
+ private ScriptC_GeneratedTestCrossRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestCross(mRS);
- scriptRelaxed = new ScriptC_TestCrossRelaxed(mRS);
+ script = new ScriptC_GeneratedTestCross(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestCrossRelaxed(mRS);
}
public class ArgumentsFloatNFloatNFloatN {
- public float[] inLhs;
- public float[] inRhs;
+ public float[] inLeftVector;
+ public float[] inRightVector;
public Target.Floaty[] out;
}
private void checkCrossFloat3Float3Float3() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xdec3726a2995edb5l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xdec3726a2996190bl, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x3505ebf7382f1ad4l, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xe9d27bf3de024b21l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testCrossFloat3Float3Float3(inLhs, out);
- verifyResultsCrossFloat3Float3Float3(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testCrossFloat3Float3Float3(inLeftVector, out);
+ verifyResultsCrossFloat3Float3Float3(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCrossFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testCrossFloat3Float3Float3(inLhs, out);
- verifyResultsCrossFloat3Float3Float3(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testCrossFloat3Float3Float3(inLeftVector, out);
+ verifyResultsCrossFloat3Float3Float3(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCrossFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsCrossFloat3Float3Float3(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsCrossFloat3Float3Float3(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloatN args = new ArgumentsFloatNFloatNFloatN();
// Create the appropriate sized arrays in args
- args.inLhs = new float[3];
- args.inRhs = new float[3];
+ args.inLeftVector = new float[3];
+ args.inRightVector = new float[3];
args.out = new Target.Floaty[3];
// Fill args with the input values
for (int j = 0; j < 3 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 4 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 4 + j];
}
for (int j = 0; j < 3 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 4 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 4 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeCross(args, target);
@@ -94,15 +94,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 3 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 4 + j], Float.floatToRawIntBits(arrayInLhs[i * 4 + j]), arrayInLhs[i * 4 + j]));
+ arrayInLeftVector[i * 4 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 4 + j]), arrayInLeftVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 3 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 4 + j], Float.floatToRawIntBits(arrayInRhs[i * 4 + j]), arrayInRhs[i * 4 + j]));
+ arrayInRightVector[i * 4 + j], Float.floatToRawIntBits(arrayInRightVector[i * 4 + j]), arrayInRightVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 3 ; j++) {
@@ -124,45 +124,45 @@
}
private void checkCrossFloat4Float4Float4() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6b4bc797a60fb18el, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6b4bc797a60fdce4l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x15fc58a5906fbeffl, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xb336bd3cb0ddde5al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testCrossFloat4Float4Float4(inLhs, out);
- verifyResultsCrossFloat4Float4Float4(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testCrossFloat4Float4Float4(inLeftVector, out);
+ verifyResultsCrossFloat4Float4Float4(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCrossFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testCrossFloat4Float4Float4(inLhs, out);
- verifyResultsCrossFloat4Float4Float4(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testCrossFloat4Float4Float4(inLeftVector, out);
+ verifyResultsCrossFloat4Float4Float4(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCrossFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsCrossFloat4Float4Float4(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsCrossFloat4Float4Float4(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloatN args = new ArgumentsFloatNFloatNFloatN();
// Create the appropriate sized arrays in args
- args.inLhs = new float[4];
- args.inRhs = new float[4];
+ args.inLeftVector = new float[4];
+ args.inRightVector = new float[4];
args.out = new Target.Floaty[4];
// Fill args with the input values
for (int j = 0; j < 4 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 4 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 4 + j];
}
for (int j = 0; j < 4 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 4 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 4 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeCross(args, target);
@@ -177,15 +177,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 4 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 4 + j], Float.floatToRawIntBits(arrayInLhs[i * 4 + j]), arrayInLhs[i * 4 + j]));
+ arrayInLeftVector[i * 4 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 4 + j]), arrayInLeftVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 4 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 4 + j], Float.floatToRawIntBits(arrayInRhs[i * 4 + j]), arrayInRhs[i * 4 + j]));
+ arrayInRightVector[i * 4 + j], Float.floatToRawIntBits(arrayInRightVector[i * 4 + j]), arrayInRightVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 4 ; j++) {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCross.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCross.rs
similarity index 72%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestCross.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCross.rs
index 16d5d35..7858054 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCross.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCross.rs
@@ -19,14 +19,14 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInRhs;
+rs_allocation gAllocInRightVector;
-float3 __attribute__((kernel)) testCrossFloat3Float3Float3(float3 inLhs, unsigned int x) {
- float3 inRhs = rsGetElementAt_float3(gAllocInRhs, x);
- return cross(inLhs, inRhs);
+float3 __attribute__((kernel)) testCrossFloat3Float3Float3(float3 inLeftVector, unsigned int x) {
+ float3 inRightVector = rsGetElementAt_float3(gAllocInRightVector, x);
+ return cross(inLeftVector, inRightVector);
}
-float4 __attribute__((kernel)) testCrossFloat4Float4Float4(float4 inLhs, unsigned int x) {
- float4 inRhs = rsGetElementAt_float4(gAllocInRhs, x);
- return cross(inLhs, inRhs);
+float4 __attribute__((kernel)) testCrossFloat4Float4Float4(float4 inLeftVector, unsigned int x) {
+ float4 inRightVector = rsGetElementAt_float4(gAllocInRightVector, x);
+ return cross(inLeftVector, inRightVector);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCrossRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCrossRelaxed.rs
index 66f3fef..e5f4e63 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestCrossRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestCross.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestDegrees.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDegrees.java
similarity index 76%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestDegrees.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDegrees.java
index b956dbd..5c0b2fa 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestDegrees.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDegrees.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestDegrees extends RSBaseCompute {
+public class GeneratedTestDegrees extends RSBaseCompute {
- private ScriptC_TestDegrees script;
- private ScriptC_TestDegreesRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestDegrees script;
+ private ScriptC_GeneratedTestDegreesRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestDegrees(mRS);
- scriptRelaxed = new ScriptC_TestDegreesRelaxed(mRS);
+ script = new ScriptC_GeneratedTestDegrees(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestDegreesRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float inValue;
+ public float inV;
public Target.Floaty out;
}
private void checkDegreesFloatFloat() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3325fa58542a6bb5l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x606ed077c5dde30al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testDegreesFloatFloat(inValue, out);
- verifyResultsDegreesFloatFloat(inValue, out, false);
+ script.forEach_testDegreesFloatFloat(inV, out);
+ verifyResultsDegreesFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDegreesFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testDegreesFloatFloat(inValue, out);
- verifyResultsDegreesFloatFloat(inValue, out, true);
+ scriptRelaxed.forEach_testDegreesFloatFloat(inV, out);
+ verifyResultsDegreesFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDegreesFloatFloat: " + e.toString());
}
}
- private void verifyResultsDegreesFloatFloat(Allocation inValue, Allocation out, boolean relaxed) {
- float[] arrayInValue = new float[INPUTSIZE * 1];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsDegreesFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inValue = arrayInValue[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeDegrees(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inValue, Float.floatToRawIntBits(args.inValue), args.inValue));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkDegreesFloat2Float2() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x7a202f393d2a289l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x803a665ae417141el, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testDegreesFloat2Float2(inValue, out);
- verifyResultsDegreesFloat2Float2(inValue, out, false);
+ script.forEach_testDegreesFloat2Float2(inV, out);
+ verifyResultsDegreesFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDegreesFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testDegreesFloat2Float2(inValue, out);
- verifyResultsDegreesFloat2Float2(inValue, out, true);
+ scriptRelaxed.forEach_testDegreesFloat2Float2(inV, out);
+ verifyResultsDegreesFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDegreesFloat2Float2: " + e.toString());
}
}
- private void verifyResultsDegreesFloat2Float2(Allocation inValue, Allocation out, boolean relaxed) {
- float[] arrayInValue = new float[INPUTSIZE * 2];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsDegreesFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inValue = arrayInValue[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeDegrees(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inValue, Float.floatToRawIntBits(args.inValue), args.inValue));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkDegreesFloat3Float3() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2d56787add10c807l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x803c2f75da3234fcl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testDegreesFloat3Float3(inValue, out);
- verifyResultsDegreesFloat3Float3(inValue, out, false);
+ script.forEach_testDegreesFloat3Float3(inV, out);
+ verifyResultsDegreesFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDegreesFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testDegreesFloat3Float3(inValue, out);
- verifyResultsDegreesFloat3Float3(inValue, out, true);
+ scriptRelaxed.forEach_testDegreesFloat3Float3(inV, out);
+ verifyResultsDegreesFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDegreesFloat3Float3: " + e.toString());
}
}
- private void verifyResultsDegreesFloat3Float3(Allocation inValue, Allocation out, boolean relaxed) {
- float[] arrayInValue = new float[INPUTSIZE * 4];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsDegreesFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inValue = arrayInValue[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeDegrees(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inValue, Float.floatToRawIntBits(args.inValue), args.inValue));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkDegreesFloat4Float4() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x530aee02264eed85l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x803df890d04d55dal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testDegreesFloat4Float4(inValue, out);
- verifyResultsDegreesFloat4Float4(inValue, out, false);
+ script.forEach_testDegreesFloat4Float4(inV, out);
+ verifyResultsDegreesFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDegreesFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testDegreesFloat4Float4(inValue, out);
- verifyResultsDegreesFloat4Float4(inValue, out, true);
+ scriptRelaxed.forEach_testDegreesFloat4Float4(inV, out);
+ verifyResultsDegreesFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDegreesFloat4Float4: " + e.toString());
}
}
- private void verifyResultsDegreesFloat4Float4(Allocation inValue, Allocation out, boolean relaxed) {
- float[] arrayInValue = new float[INPUTSIZE * 4];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsDegreesFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inValue = arrayInValue[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeDegrees(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inValue, Float.floatToRawIntBits(args.inValue), args.inValue));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestDegrees.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDegrees.rs
similarity index 82%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestDegrees.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDegrees.rs
index 78741a8..bfbb9f4 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestDegrees.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDegrees.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testDegreesFloatFloat(float inValue) {
- return degrees(inValue);
+float __attribute__((kernel)) testDegreesFloatFloat(float inV) {
+ return degrees(inV);
}
-float2 __attribute__((kernel)) testDegreesFloat2Float2(float2 inValue) {
- return degrees(inValue);
+float2 __attribute__((kernel)) testDegreesFloat2Float2(float2 inV) {
+ return degrees(inV);
}
-float3 __attribute__((kernel)) testDegreesFloat3Float3(float3 inValue) {
- return degrees(inValue);
+float3 __attribute__((kernel)) testDegreesFloat3Float3(float3 inV) {
+ return degrees(inV);
}
-float4 __attribute__((kernel)) testDegreesFloat4Float4(float4 inValue) {
- return degrees(inValue);
+float4 __attribute__((kernel)) testDegreesFloat4Float4(float4 inV) {
+ return degrees(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDegreesRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDegreesRelaxed.rs
index 66f3fef..3ac3eab 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDegreesRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestDegrees.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestDistance.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDistance.java
similarity index 64%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestDistance.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDistance.java
index 091c12c..ee69fc7 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestDistance.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDistance.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestDistance extends RSBaseCompute {
+public class GeneratedTestDistance extends RSBaseCompute {
- private ScriptC_TestDistance script;
- private ScriptC_TestDistanceRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestDistance script;
+ private ScriptC_GeneratedTestDistanceRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestDistance(mRS);
- scriptRelaxed = new ScriptC_TestDistanceRelaxed(mRS);
+ script = new ScriptC_GeneratedTestDistance(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestDistanceRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inLhs;
- public float inRhs;
+ public float inLeftVector;
+ public float inRightVector;
public Target.Floaty out;
}
private void checkDistanceFloatFloatFloat() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf62f685ebafc5b67l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf62f685ebafc86bdl, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xa481527082ced52al, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xa38cb25366d69793l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testDistanceFloatFloatFloat(inLhs, out);
- verifyResultsDistanceFloatFloatFloat(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testDistanceFloatFloatFloat(inLeftVector, out);
+ verifyResultsDistanceFloatFloatFloat(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDistanceFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testDistanceFloatFloatFloat(inLhs, out);
- verifyResultsDistanceFloatFloatFloat(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testDistanceFloatFloatFloat(inLeftVector, out);
+ verifyResultsDistanceFloatFloatFloat(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDistanceFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsDistanceFloatFloatFloat(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 1];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 1];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsDistanceFloatFloatFloat(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 1];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 1];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
// Create the appropriate sized arrays in args
// Fill args with the input values
- args.inLhs = arrayInLhs[i];
- args.inRhs = arrayInRhs[i];
+ args.inLeftVector = arrayInLeftVector[i];
+ args.inRightVector = arrayInRightVector[i];
Target target = new Target(relaxed);
CoreMathVerifier.computeDistance(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i], Float.floatToRawIntBits(arrayInLhs[i]), arrayInLhs[i]));
+ arrayInLeftVector[i], Float.floatToRawIntBits(arrayInLeftVector[i]), arrayInLeftVector[i]));
message.append("\n");
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i], Float.floatToRawIntBits(arrayInRhs[i]), arrayInRhs[i]));
+ arrayInRightVector[i], Float.floatToRawIntBits(arrayInRightVector[i]), arrayInRightVector[i]));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -109,50 +109,50 @@
}
public class ArgumentsFloatNFloatNFloat {
- public float[] inLhs;
- public float[] inRhs;
+ public float[] inLeftVector;
+ public float[] inRightVector;
public Target.Floaty out;
}
private void checkDistanceFloat2Float2Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3fdeb51f89981593l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3fdeb51f899840e9l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xbf71d23b554dab2el, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x29f22964c2248a3fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testDistanceFloat2Float2Float(inLhs, out);
- verifyResultsDistanceFloat2Float2Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testDistanceFloat2Float2Float(inLeftVector, out);
+ verifyResultsDistanceFloat2Float2Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDistanceFloat2Float2Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testDistanceFloat2Float2Float(inLhs, out);
- verifyResultsDistanceFloat2Float2Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testDistanceFloat2Float2Float(inLeftVector, out);
+ verifyResultsDistanceFloat2Float2Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDistanceFloat2Float2Float: " + e.toString());
}
}
- private void verifyResultsDistanceFloat2Float2Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 2];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 2];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsDistanceFloat2Float2Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 2];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 2];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[2];
- args.inRhs = new float[2];
+ args.inLeftVector = new float[2];
+ args.inRightVector = new float[2];
// Fill args with the input values
for (int j = 0; j < 2 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 2 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 2 + j];
}
for (int j = 0; j < 2 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 2 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 2 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeDistance(args, target);
@@ -165,15 +165,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 2 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 2 + j], Float.floatToRawIntBits(arrayInLhs[i * 2 + j]), arrayInLhs[i * 2 + j]));
+ arrayInLeftVector[i * 2 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 2 + j]), arrayInLeftVector[i * 2 + j]));
message.append("\n");
}
for (int j = 0; j < 2 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 2 + j], Float.floatToRawIntBits(arrayInRhs[i * 2 + j]), arrayInRhs[i * 2 + j]));
+ arrayInRightVector[i * 2 + j], Float.floatToRawIntBits(arrayInRightVector[i * 2 + j]), arrayInRightVector[i * 2 + j]));
message.append("\n");
}
message.append("Expected output out: ");
@@ -193,44 +193,44 @@
}
private void checkDistanceFloat3Float3Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6cd0047fd9ae30edl, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6cd0047fd9ae5c43l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x8e1af7b976ec5f7cl, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xe05b759467ccd359l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testDistanceFloat3Float3Float(inLhs, out);
- verifyResultsDistanceFloat3Float3Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testDistanceFloat3Float3Float(inLeftVector, out);
+ verifyResultsDistanceFloat3Float3Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDistanceFloat3Float3Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testDistanceFloat3Float3Float(inLhs, out);
- verifyResultsDistanceFloat3Float3Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testDistanceFloat3Float3Float(inLeftVector, out);
+ verifyResultsDistanceFloat3Float3Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDistanceFloat3Float3Float: " + e.toString());
}
}
- private void verifyResultsDistanceFloat3Float3Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsDistanceFloat3Float3Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[3];
- args.inRhs = new float[3];
+ args.inLeftVector = new float[3];
+ args.inRightVector = new float[3];
// Fill args with the input values
for (int j = 0; j < 3 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 4 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 4 + j];
}
for (int j = 0; j < 3 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 4 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 4 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeDistance(args, target);
@@ -243,15 +243,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 3 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 4 + j], Float.floatToRawIntBits(arrayInLhs[i * 4 + j]), arrayInLhs[i * 4 + j]));
+ arrayInLeftVector[i * 4 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 4 + j]), arrayInLeftVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 3 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 4 + j], Float.floatToRawIntBits(arrayInRhs[i * 4 + j]), arrayInRhs[i * 4 + j]));
+ arrayInRightVector[i * 4 + j], Float.floatToRawIntBits(arrayInRightVector[i * 4 + j]), arrayInRightVector[i * 4 + j]));
message.append("\n");
}
message.append("Expected output out: ");
@@ -271,44 +271,44 @@
}
private void checkDistanceFloat4Float4Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x99c153e029c44c47l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x99c153e029c4779dl, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x5cc41d37988b13cal, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x96c4c1c40d751c73l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testDistanceFloat4Float4Float(inLhs, out);
- verifyResultsDistanceFloat4Float4Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testDistanceFloat4Float4Float(inLeftVector, out);
+ verifyResultsDistanceFloat4Float4Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDistanceFloat4Float4Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testDistanceFloat4Float4Float(inLhs, out);
- verifyResultsDistanceFloat4Float4Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testDistanceFloat4Float4Float(inLeftVector, out);
+ verifyResultsDistanceFloat4Float4Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDistanceFloat4Float4Float: " + e.toString());
}
}
- private void verifyResultsDistanceFloat4Float4Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsDistanceFloat4Float4Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[4];
- args.inRhs = new float[4];
+ args.inLeftVector = new float[4];
+ args.inRightVector = new float[4];
// Fill args with the input values
for (int j = 0; j < 4 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 4 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 4 + j];
}
for (int j = 0; j < 4 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 4 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 4 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeDistance(args, target);
@@ -321,15 +321,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 4 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 4 + j], Float.floatToRawIntBits(arrayInLhs[i * 4 + j]), arrayInLhs[i * 4 + j]));
+ arrayInLeftVector[i * 4 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 4 + j]), arrayInLeftVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 4 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 4 + j], Float.floatToRawIntBits(arrayInRhs[i * 4 + j]), arrayInRhs[i * 4 + j]));
+ arrayInRightVector[i * 4 + j], Float.floatToRawIntBits(arrayInRightVector[i * 4 + j]), arrayInRightVector[i * 4 + j]));
message.append("\n");
}
message.append("Expected output out: ");
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestDistance.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDistance.rs
similarity index 61%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestDistance.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDistance.rs
index fdc1783..cbea040 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestDistance.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDistance.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInRhs;
+rs_allocation gAllocInRightVector;
-float __attribute__((kernel)) testDistanceFloatFloatFloat(float inLhs, unsigned int x) {
- float inRhs = rsGetElementAt_float(gAllocInRhs, x);
- return distance(inLhs, inRhs);
+float __attribute__((kernel)) testDistanceFloatFloatFloat(float inLeftVector, unsigned int x) {
+ float inRightVector = rsGetElementAt_float(gAllocInRightVector, x);
+ return distance(inLeftVector, inRightVector);
}
-float __attribute__((kernel)) testDistanceFloat2Float2Float(float2 inLhs, unsigned int x) {
- float2 inRhs = rsGetElementAt_float2(gAllocInRhs, x);
- return distance(inLhs, inRhs);
+float __attribute__((kernel)) testDistanceFloat2Float2Float(float2 inLeftVector, unsigned int x) {
+ float2 inRightVector = rsGetElementAt_float2(gAllocInRightVector, x);
+ return distance(inLeftVector, inRightVector);
}
-float __attribute__((kernel)) testDistanceFloat3Float3Float(float3 inLhs, unsigned int x) {
- float3 inRhs = rsGetElementAt_float3(gAllocInRhs, x);
- return distance(inLhs, inRhs);
+float __attribute__((kernel)) testDistanceFloat3Float3Float(float3 inLeftVector, unsigned int x) {
+ float3 inRightVector = rsGetElementAt_float3(gAllocInRightVector, x);
+ return distance(inLeftVector, inRightVector);
}
-float __attribute__((kernel)) testDistanceFloat4Float4Float(float4 inLhs, unsigned int x) {
- float4 inRhs = rsGetElementAt_float4(gAllocInRhs, x);
- return distance(inLhs, inRhs);
+float __attribute__((kernel)) testDistanceFloat4Float4Float(float4 inLeftVector, unsigned int x) {
+ float4 inRightVector = rsGetElementAt_float4(gAllocInRightVector, x);
+ return distance(inLeftVector, inRightVector);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFastDistanceRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDistanceRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFastDistanceRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDistanceRelaxed.rs
index 245bc65..d3717d4 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFastDistanceRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDistanceRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestFastDistance.rs"
+#include "GeneratedTestDistance.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestDot.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDot.java
similarity index 62%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestDot.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDot.java
index 666906b..b9b7729 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestDot.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDot.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestDot extends RSBaseCompute {
+public class GeneratedTestDot extends RSBaseCompute {
- private ScriptC_TestDot script;
- private ScriptC_TestDotRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestDot script;
+ private ScriptC_GeneratedTestDotRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestDot(mRS);
- scriptRelaxed = new ScriptC_TestDotRelaxed(mRS);
+ script = new ScriptC_GeneratedTestDot(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestDotRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inLhs;
- public float inRhs;
+ public float inLeftVector;
+ public float inRightVector;
public Target.Floaty out;
}
private void checkDotFloatFloatFloat() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x93a0502d7b6ecc43l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x93a0502d7b6ef799l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x38fe5ebdf7ff2d3el, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x948dc35615f562efl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testDotFloatFloatFloat(inLhs, out);
- verifyResultsDotFloatFloatFloat(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testDotFloatFloatFloat(inLeftVector, out);
+ verifyResultsDotFloatFloatFloat(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDotFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testDotFloatFloatFloat(inLhs, out);
- verifyResultsDotFloatFloatFloat(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testDotFloatFloatFloat(inLeftVector, out);
+ verifyResultsDotFloatFloatFloat(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDotFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsDotFloatFloatFloat(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 1];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 1];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsDotFloatFloatFloat(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 1];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 1];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
// Create the appropriate sized arrays in args
// Fill args with the input values
- args.inLhs = arrayInLhs[i];
- args.inRhs = arrayInRhs[i];
+ args.inLeftVector = arrayInLeftVector[i];
+ args.inRightVector = arrayInRightVector[i];
Target target = new Target(relaxed);
CoreMathVerifier.computeDot(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i], Float.floatToRawIntBits(arrayInLhs[i]), arrayInLhs[i]));
+ arrayInLeftVector[i], Float.floatToRawIntBits(arrayInLeftVector[i]), arrayInLeftVector[i]));
message.append("\n");
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i], Float.floatToRawIntBits(arrayInRhs[i]), arrayInRhs[i]));
+ arrayInRightVector[i], Float.floatToRawIntBits(arrayInRightVector[i]), arrayInRightVector[i]));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -109,50 +109,50 @@
}
public class ArgumentsFloatNFloatNFloat {
- public float[] inLhs;
- public float[] inRhs;
+ public float[] inLeftVector;
+ public float[] inRightVector;
public Target.Floaty out;
}
private void checkDotFloat2Float2Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x6458f96b84293a8fl, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x6458f96b842965e5l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3a9fadaebf79d3a2l, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xdaa605c7978f55bbl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testDotFloat2Float2Float(inLhs, out);
- verifyResultsDotFloat2Float2Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testDotFloat2Float2Float(inLeftVector, out);
+ verifyResultsDotFloat2Float2Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDotFloat2Float2Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testDotFloat2Float2Float(inLhs, out);
- verifyResultsDotFloat2Float2Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testDotFloat2Float2Float(inLeftVector, out);
+ verifyResultsDotFloat2Float2Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDotFloat2Float2Float: " + e.toString());
}
}
- private void verifyResultsDotFloat2Float2Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 2];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 2];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsDotFloat2Float2Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 2];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 2];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[2];
- args.inRhs = new float[2];
+ args.inLeftVector = new float[2];
+ args.inRightVector = new float[2];
// Fill args with the input values
for (int j = 0; j < 2 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 2 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 2 + j];
}
for (int j = 0; j < 2 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 2 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 2 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeDot(args, target);
@@ -165,15 +165,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 2 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 2 + j], Float.floatToRawIntBits(arrayInLhs[i * 2 + j]), arrayInLhs[i * 2 + j]));
+ arrayInLeftVector[i * 2 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 2 + j]), arrayInLeftVector[i * 2 + j]));
message.append("\n");
}
for (int j = 0; j < 2 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 2 + j], Float.floatToRawIntBits(arrayInRhs[i * 2 + j]), arrayInRhs[i * 2 + j]));
+ arrayInRightVector[i * 2 + j], Float.floatToRawIntBits(arrayInRightVector[i * 2 + j]), arrayInRightVector[i * 2 + j]));
message.append("\n");
}
message.append("Expected output out: ");
@@ -193,44 +193,44 @@
}
private void checkDotFloat3Float3Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x914a48cbd43f55e9l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x914a48cbd43f813fl, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x948d32ce11887f0l, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x910f51f73d379ed5l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testDotFloat3Float3Float(inLhs, out);
- verifyResultsDotFloat3Float3Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testDotFloat3Float3Float(inLeftVector, out);
+ verifyResultsDotFloat3Float3Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDotFloat3Float3Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testDotFloat3Float3Float(inLhs, out);
- verifyResultsDotFloat3Float3Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testDotFloat3Float3Float(inLeftVector, out);
+ verifyResultsDotFloat3Float3Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDotFloat3Float3Float: " + e.toString());
}
}
- private void verifyResultsDotFloat3Float3Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsDotFloat3Float3Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[3];
- args.inRhs = new float[3];
+ args.inLeftVector = new float[3];
+ args.inRightVector = new float[3];
// Fill args with the input values
for (int j = 0; j < 3 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 4 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 4 + j];
}
for (int j = 0; j < 3 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 4 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 4 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeDot(args, target);
@@ -243,15 +243,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 3 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 4 + j], Float.floatToRawIntBits(arrayInLhs[i * 4 + j]), arrayInLhs[i * 4 + j]));
+ arrayInLeftVector[i * 4 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 4 + j]), arrayInLeftVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 3 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 4 + j], Float.floatToRawIntBits(arrayInRhs[i * 4 + j]), arrayInRhs[i * 4 + j]));
+ arrayInRightVector[i * 4 + j], Float.floatToRawIntBits(arrayInRightVector[i * 4 + j]), arrayInRightVector[i * 4 + j]));
message.append("\n");
}
message.append("Expected output out: ");
@@ -271,44 +271,44 @@
}
private void checkDotFloat4Float4Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbe3b982c24557143l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbe3b982c24559c99l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd7f1f8ab02b73c3el, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x47789e26e2dfe7efl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testDotFloat4Float4Float(inLhs, out);
- verifyResultsDotFloat4Float4Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testDotFloat4Float4Float(inLeftVector, out);
+ verifyResultsDotFloat4Float4Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDotFloat4Float4Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testDotFloat4Float4Float(inLhs, out);
- verifyResultsDotFloat4Float4Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testDotFloat4Float4Float(inLeftVector, out);
+ verifyResultsDotFloat4Float4Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testDotFloat4Float4Float: " + e.toString());
}
}
- private void verifyResultsDotFloat4Float4Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsDotFloat4Float4Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[4];
- args.inRhs = new float[4];
+ args.inLeftVector = new float[4];
+ args.inRightVector = new float[4];
// Fill args with the input values
for (int j = 0; j < 4 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 4 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 4 + j];
}
for (int j = 0; j < 4 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 4 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 4 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeDot(args, target);
@@ -321,15 +321,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 4 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 4 + j], Float.floatToRawIntBits(arrayInLhs[i * 4 + j]), arrayInLhs[i * 4 + j]));
+ arrayInLeftVector[i * 4 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 4 + j]), arrayInLeftVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 4 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 4 + j], Float.floatToRawIntBits(arrayInRhs[i * 4 + j]), arrayInRhs[i * 4 + j]));
+ arrayInRightVector[i * 4 + j], Float.floatToRawIntBits(arrayInRightVector[i * 4 + j]), arrayInRightVector[i * 4 + j]));
message.append("\n");
}
message.append("Expected output out: ");
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDot.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDot.rs
new file mode 100644
index 0000000..cd531b4
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDot.rs
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInRightVector;
+
+float __attribute__((kernel)) testDotFloatFloatFloat(float inLeftVector, unsigned int x) {
+ float inRightVector = rsGetElementAt_float(gAllocInRightVector, x);
+ return dot(inLeftVector, inRightVector);
+}
+
+float __attribute__((kernel)) testDotFloat2Float2Float(float2 inLeftVector, unsigned int x) {
+ float2 inRightVector = rsGetElementAt_float2(gAllocInRightVector, x);
+ return dot(inLeftVector, inRightVector);
+}
+
+float __attribute__((kernel)) testDotFloat3Float3Float(float3 inLeftVector, unsigned int x) {
+ float3 inRightVector = rsGetElementAt_float3(gAllocInRightVector, x);
+ return dot(inLeftVector, inRightVector);
+}
+
+float __attribute__((kernel)) testDotFloat4Float4Float(float4 inLeftVector, unsigned int x) {
+ float4 inRightVector = rsGetElementAt_float4(gAllocInRightVector, x);
+ return dot(inLeftVector, inRightVector);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDotRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDotRelaxed.rs
index 66f3fef..d9dd162 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestDotRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestDot.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErf.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErf.java
index 77c467c..f46136d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErf.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestErf extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestErf script;
+ private ScriptC_GeneratedTestErfRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestErf(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestErfRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkErfFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xccfbfd30a3951fb8l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testErfFloatFloat(inV, out);
+ verifyResultsErfFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testErfFloatFloat(inV, out);
+ verifyResultsErfFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsErfFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeErf(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkErfFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkErfFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x87e26994448c58dcl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testErfFloat2Float2(inV, out);
+ verifyResultsErfFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testErfFloat2Float2(inV, out);
+ verifyResultsErfFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsErfFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeErf(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkErfFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkErfFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x87e432af3aa779bal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testErfFloat3Float3(inV, out);
+ verifyResultsErfFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testErfFloat3Float3(inV, out);
+ verifyResultsErfFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsErfFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeErf(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkErfFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkErfFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x87e5fbca30c29a98l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testErfFloat4Float4(inV, out);
+ verifyResultsErfFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testErfFloat4Float4(inV, out);
+ verifyResultsErfFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsErfFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeErf(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkErfFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testErf() {
+ checkErfFloatFloat();
+ checkErfFloat2Float2();
+ checkErfFloat3Float3();
+ checkErfFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErf.rs
similarity index 70%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErf.rs
index 80c8708..15b4d0b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErf.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testCeilFloatFloat(float in) {
- return ceil(in);
+float __attribute__((kernel)) testErfFloatFloat(float inV) {
+ return erf(inV);
}
-float2 __attribute__((kernel)) testCeilFloat2Float2(float2 in) {
- return ceil(in);
+float2 __attribute__((kernel)) testErfFloat2Float2(float2 inV) {
+ return erf(inV);
}
-float3 __attribute__((kernel)) testCeilFloat3Float3(float3 in) {
- return ceil(in);
+float3 __attribute__((kernel)) testErfFloat3Float3(float3 inV) {
+ return erf(inV);
}
-float4 __attribute__((kernel)) testCeilFloat4Float4(float4 in) {
- return ceil(in);
+float4 __attribute__((kernel)) testErfFloat4Float4(float4 inV) {
+ return erf(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfRelaxed.rs
index 66f3fef..680cdb9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestErf.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfc.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfc.java
index 77c467c..a8a37c9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfc.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestErfc extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestErfc script;
+ private ScriptC_GeneratedTestErfcRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestErfc(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestErfcRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkErfcFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x40344e4f0dfa008fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testErfcFloatFloat(inV, out);
+ verifyResultsErfcFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testErfcFloatFloat(inV, out);
+ verifyResultsErfcFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsErfcFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeErfc(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkErfcFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkErfcFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xb9a44e42b72849bbl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testErfcFloat2Float2(inV, out);
+ verifyResultsErfcFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testErfcFloat2Float2(inV, out);
+ verifyResultsErfcFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsErfcFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeErfc(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkErfcFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkErfcFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xb9a6175dad436a99l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testErfcFloat3Float3(inV, out);
+ verifyResultsErfcFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testErfcFloat3Float3(inV, out);
+ verifyResultsErfcFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsErfcFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeErfc(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkErfcFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkErfcFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xb9a7e078a35e8b77l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testErfcFloat4Float4(inV, out);
+ verifyResultsErfcFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testErfcFloat4Float4(inV, out);
+ verifyResultsErfcFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsErfcFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeErfc(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkErfcFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testErfc() {
+ checkErfcFloatFloat();
+ checkErfcFloat2Float2();
+ checkErfcFloat3Float3();
+ checkErfcFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfc.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfc.rs
index 1024943..154e7d8 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfc.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testErfcFloatFloat(float inV) {
+ return erfc(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testErfcFloat2Float2(float2 inV) {
+ return erfc(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testErfcFloat3Float3(float3 inV) {
+ return erfc(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testErfcFloat4Float4(float4 inV) {
+ return erfc(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfcRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfcRelaxed.rs
index 66f3fef..5e54893 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestErfcRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestErfc.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp.java
index 77c467c..f2a5042 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestExp extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestExp script;
+ private ScriptC_GeneratedTestExpRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestExp(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestExpRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkExpFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x45e6c49035f888fcl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testExpFloatFloat(inV, out);
+ verifyResultsExpFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testExpFloatFloat(inV, out);
+ verifyResultsExpFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExpFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkExpFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkExpFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xdf9c6adc948fa500l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testExpFloat2Float2(inV, out);
+ verifyResultsExpFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testExpFloat2Float2(inV, out);
+ verifyResultsExpFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExpFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkExpFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkExpFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xdf9e33f78aaac5del, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testExpFloat3Float3(inV, out);
+ verifyResultsExpFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testExpFloat3Float3(inV, out);
+ verifyResultsExpFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExpFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkExpFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkExpFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xdf9ffd1280c5e6bcl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testExpFloat4Float4(inV, out);
+ verifyResultsExpFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testExpFloat4Float4(inV, out);
+ verifyResultsExpFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExpFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkExpFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testExp() {
+ checkExpFloatFloat();
+ checkExpFloat2Float2();
+ checkExpFloat3Float3();
+ checkExpFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp.rs
similarity index 70%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp.rs
index 80c8708..d7e22fa 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testCeilFloatFloat(float in) {
- return ceil(in);
+float __attribute__((kernel)) testExpFloatFloat(float inV) {
+ return exp(inV);
}
-float2 __attribute__((kernel)) testCeilFloat2Float2(float2 in) {
- return ceil(in);
+float2 __attribute__((kernel)) testExpFloat2Float2(float2 inV) {
+ return exp(inV);
}
-float3 __attribute__((kernel)) testCeilFloat3Float3(float3 in) {
- return ceil(in);
+float3 __attribute__((kernel)) testExpFloat3Float3(float3 inV) {
+ return exp(inV);
}
-float4 __attribute__((kernel)) testCeilFloat4Float4(float4 in) {
- return ceil(in);
+float4 __attribute__((kernel)) testExpFloat4Float4(float4 inV) {
+ return exp(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp10.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp10.java
index 77c467c..9253fd4 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp10.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestExp10 extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestExp10 script;
+ private ScriptC_GeneratedTestExp10Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestExp10(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestExp10Relaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkExp10FloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xc5df97aec123e2edl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testExp10FloatFloat(inV, out);
+ verifyResultsExp10FloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10FloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testExp10FloatFloat(inV, out);
+ verifyResultsExp10FloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10FloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExp10FloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp10(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkExp10FloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkExp10Float2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2bc94277c0ac42a9l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testExp10Float2Float2(inV, out);
+ verifyResultsExp10Float2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testExp10Float2Float2(inV, out);
+ verifyResultsExp10Float2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExp10Float2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp10(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkExp10Float2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkExp10Float3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2bcb0b92b6c76387l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testExp10Float3Float3(inV, out);
+ verifyResultsExp10Float3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testExp10Float3Float3(inV, out);
+ verifyResultsExp10Float3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExp10Float3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp10(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkExp10Float3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkExp10Float4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2bccd4adace28465l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testExp10Float4Float4(inV, out);
+ verifyResultsExp10Float4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testExp10Float4Float4(inV, out);
+ verifyResultsExp10Float4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExp10Float4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp10(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkExp10Float4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testExp10() {
+ checkExp10FloatFloat();
+ checkExp10Float2Float2();
+ checkExp10Float3Float3();
+ checkExp10Float4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExp10.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp10.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestExp10.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp10.rs
index 117fe26..95e5548 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExp10.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp10.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testExp10FloatFloat(float in) {
- return exp10(in);
+float __attribute__((kernel)) testExp10FloatFloat(float inV) {
+ return exp10(inV);
}
-float2 __attribute__((kernel)) testExp10Float2Float2(float2 in) {
- return exp10(in);
+float2 __attribute__((kernel)) testExp10Float2Float2(float2 inV) {
+ return exp10(inV);
}
-float3 __attribute__((kernel)) testExp10Float3Float3(float3 in) {
- return exp10(in);
+float3 __attribute__((kernel)) testExp10Float3Float3(float3 inV) {
+ return exp10(inV);
}
-float4 __attribute__((kernel)) testExp10Float4Float4(float4 in) {
- return exp10(in);
+float4 __attribute__((kernel)) testExp10Float4Float4(float4 inV) {
+ return exp10(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp10Relaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp10Relaxed.rs
index 66f3fef..e49cce5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp10Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestExp10.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp2.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp2.java
index 77c467c..32d39fa 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp2.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestExp2 extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestExp2 script;
+ private ScriptC_GeneratedTestExp2Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestExp2(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestExp2Relaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkExp2FloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x58195894b8b72a10l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testExp2FloatFloat(inV, out);
+ verifyResultsExp2FloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2FloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testExp2FloatFloat(inV, out);
+ verifyResultsExp2FloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2FloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExp2FloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp2(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkExp2FloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkExp2Float2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x4eeb7f70e7690e74l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testExp2Float2Float2(inV, out);
+ verifyResultsExp2Float2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testExp2Float2Float2(inV, out);
+ verifyResultsExp2Float2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExp2Float2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp2(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkExp2Float2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkExp2Float3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x4eed488bdd842f52l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testExp2Float3Float3(inV, out);
+ verifyResultsExp2Float3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testExp2Float3Float3(inV, out);
+ verifyResultsExp2Float3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExp2Float3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp2(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkExp2Float3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkExp2Float4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x4eef11a6d39f5030l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testExp2Float4Float4(inV, out);
+ verifyResultsExp2Float4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testExp2Float4Float4(inV, out);
+ verifyResultsExp2Float4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExp2Float4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExp2(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkExp2Float4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testExp2() {
+ checkExp2FloatFloat();
+ checkExp2Float2Float2();
+ checkExp2Float3Float3();
+ checkExp2Float4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp2.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp2.rs
index 1024943..d85f60a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp2.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testExp2FloatFloat(float inV) {
+ return exp2(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testExp2Float2Float2(float2 inV) {
+ return exp2(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testExp2Float3Float3(float3 inV) {
+ return exp2(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testExp2Float4Float4(float4 inV) {
+ return exp2(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp2Relaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp2Relaxed.rs
index 66f3fef..db56a96 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExp2Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestExp2.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpRelaxed.rs
index 66f3fef..1e8fd5f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestExp.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpm1.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpm1.java
index 77c467c..3c9921c 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpm1.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestExpm1 extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestExpm1 script;
+ private ScriptC_GeneratedTestExpm1Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestExpm1(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestExpm1Relaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkExpm1FloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xea420692a183a9e4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testExpm1FloatFloat(inV, out);
+ verifyResultsExpm1FloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1FloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testExpm1FloatFloat(inV, out);
+ verifyResultsExpm1FloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1FloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExpm1FloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExpm1(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkExpm1FloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkExpm1Float2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xf6bc2e57547050a8l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testExpm1Float2Float2(inV, out);
+ verifyResultsExpm1Float2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testExpm1Float2Float2(inV, out);
+ verifyResultsExpm1Float2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExpm1Float2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExpm1(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkExpm1Float2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkExpm1Float3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xf6bdf7724a8b7186l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testExpm1Float3Float3(inV, out);
+ verifyResultsExpm1Float3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testExpm1Float3Float3(inV, out);
+ verifyResultsExpm1Float3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExpm1Float3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExpm1(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkExpm1Float3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkExpm1Float4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf6bfc08d40a69264l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testExpm1Float4Float4(inV, out);
+ verifyResultsExpm1Float4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testExpm1Float4Float4(inV, out);
+ verifyResultsExpm1Float4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsExpm1Float4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeExpm1(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkExpm1Float4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testExpm1() {
+ checkExpm1FloatFloat();
+ checkExpm1Float2Float2();
+ checkExpm1Float3Float3();
+ checkExpm1Float4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExpm1.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpm1.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestExpm1.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpm1.rs
index 9399576..45faabd 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExpm1.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpm1.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testExpm1FloatFloat(float in) {
- return expm1(in);
+float __attribute__((kernel)) testExpm1FloatFloat(float inV) {
+ return expm1(inV);
}
-float2 __attribute__((kernel)) testExpm1Float2Float2(float2 in) {
- return expm1(in);
+float2 __attribute__((kernel)) testExpm1Float2Float2(float2 inV) {
+ return expm1(inV);
}
-float3 __attribute__((kernel)) testExpm1Float3Float3(float3 in) {
- return expm1(in);
+float3 __attribute__((kernel)) testExpm1Float3Float3(float3 inV) {
+ return expm1(inV);
}
-float4 __attribute__((kernel)) testExpm1Float4Float4(float4 in) {
- return expm1(in);
+float4 __attribute__((kernel)) testExpm1Float4Float4(float4 inV) {
+ return expm1(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpm1Relaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpm1Relaxed.rs
index 66f3fef..f0edb36 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestExpm1Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestExpm1.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFabs.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFabs.java
index 77c467c..5f73747 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFabs.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestFabs extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestFabs script;
+ private ScriptC_GeneratedTestFabsRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestFabs(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFabsRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkFabsFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xd84cf8f27f929ae9l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testFabsFloatFloat(inV, out);
+ verifyResultsFabsFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testFabsFloatFloat(inV, out);
+ verifyResultsFabsFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsFabsFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeFabs(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkFabsFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkFabsFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x43ccc4c22e5b1dc5l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testFabsFloat2Float2(inV, out);
+ verifyResultsFabsFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testFabsFloat2Float2(inV, out);
+ verifyResultsFabsFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsFabsFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeFabs(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkFabsFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkFabsFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x43ce8ddd24763ea3l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testFabsFloat3Float3(inV, out);
+ verifyResultsFabsFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testFabsFloat3Float3(inV, out);
+ verifyResultsFabsFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsFabsFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeFabs(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkFabsFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkFabsFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x43d056f81a915f81l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testFabsFloat4Float4(inV, out);
+ verifyResultsFabsFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testFabsFloat4Float4(inV, out);
+ verifyResultsFabsFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsFabsFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeFabs(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkFabsFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testFabs() {
+ checkFabsFloatFloat();
+ checkFabsFloat2Float2();
+ checkFabsFloat3Float3();
+ checkFabsFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFabs.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFabs.rs
index 1024943..61ba16f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFabs.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testFabsFloatFloat(float inV) {
+ return fabs(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testFabsFloat2Float2(float2 inV) {
+ return fabs(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testFabsFloat3Float3(float3 inV) {
+ return fabs(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testFabsFloat4Float4(float4 inV) {
+ return fabs(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFabsRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFabsRelaxed.rs
index 66f3fef..50a30ca 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFabsRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFabs.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFastDistance.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastDistance.java
similarity index 65%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFastDistance.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastDistance.java
index 8091015..817f0bc 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFastDistance.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastDistance.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestFastDistance extends RSBaseCompute {
+public class GeneratedTestFastDistance extends RSBaseCompute {
- private ScriptC_TestFastDistance script;
- private ScriptC_TestFastDistanceRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestFastDistance script;
+ private ScriptC_GeneratedTestFastDistanceRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestFastDistance(mRS);
- scriptRelaxed = new ScriptC_TestFastDistanceRelaxed(mRS);
+ script = new ScriptC_GeneratedTestFastDistance(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFastDistanceRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inLhs;
- public float inRhs;
+ public float inLeftVector;
+ public float inRightVector;
public Target.Floaty out;
}
private void checkFastDistanceFloatFloatFloat() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xfe7e5e843bff0cb7l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xfe7e5e843bff380dl, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xeb32e5abb9b28b1al, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x83606d459f1626e3l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testFastDistanceFloatFloatFloat(inLhs, out);
- verifyResultsFastDistanceFloatFloatFloat(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testFastDistanceFloatFloatFloat(inLeftVector, out);
+ verifyResultsFastDistanceFloatFloatFloat(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFastDistanceFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testFastDistanceFloatFloatFloat(inLhs, out);
- verifyResultsFastDistanceFloatFloatFloat(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testFastDistanceFloatFloatFloat(inLeftVector, out);
+ verifyResultsFastDistanceFloatFloatFloat(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFastDistanceFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsFastDistanceFloatFloatFloat(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 1];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 1];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsFastDistanceFloatFloatFloat(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 1];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 1];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
// Create the appropriate sized arrays in args
// Fill args with the input values
- args.inLhs = arrayInLhs[i];
- args.inRhs = arrayInRhs[i];
+ args.inLeftVector = arrayInLeftVector[i];
+ args.inRightVector = arrayInRightVector[i];
Target target = new Target(relaxed);
CoreMathVerifier.computeFastDistance(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i], Float.floatToRawIntBits(arrayInLhs[i]), arrayInLhs[i]));
+ arrayInLeftVector[i], Float.floatToRawIntBits(arrayInLeftVector[i]), arrayInLeftVector[i]));
message.append("\n");
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i], Float.floatToRawIntBits(arrayInRhs[i]), arrayInRhs[i]));
+ arrayInRightVector[i], Float.floatToRawIntBits(arrayInRightVector[i]), arrayInRightVector[i]));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -109,50 +109,50 @@
}
public class ArgumentsFloatNFloatNFloat {
- public float[] inLhs;
- public float[] inRhs;
+ public float[] inLeftVector;
+ public float[] inRightVector;
public Target.Floaty out;
}
private void checkFastDistanceFloat2Float2Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x422e8a00560ac063l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x422e8a00560aebb9l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x580238eac7fabd9el, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xca3368dd0536a30fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testFastDistanceFloat2Float2Float(inLhs, out);
- verifyResultsFastDistanceFloat2Float2Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testFastDistanceFloat2Float2Float(inLeftVector, out);
+ verifyResultsFastDistanceFloat2Float2Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFastDistanceFloat2Float2Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testFastDistanceFloat2Float2Float(inLhs, out);
- verifyResultsFastDistanceFloat2Float2Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testFastDistanceFloat2Float2Float(inLeftVector, out);
+ verifyResultsFastDistanceFloat2Float2Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFastDistanceFloat2Float2Float: " + e.toString());
}
}
- private void verifyResultsFastDistanceFloat2Float2Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 2];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 2];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsFastDistanceFloat2Float2Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 2];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 2];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[2];
- args.inRhs = new float[2];
+ args.inLeftVector = new float[2];
+ args.inRightVector = new float[2];
// Fill args with the input values
for (int j = 0; j < 2 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 2 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 2 + j];
}
for (int j = 0; j < 2 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 2 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 2 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeFastDistance(args, target);
@@ -165,15 +165,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 2 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 2 + j], Float.floatToRawIntBits(arrayInLhs[i * 2 + j]), arrayInLhs[i * 2 + j]));
+ arrayInLeftVector[i * 2 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 2 + j]), arrayInLeftVector[i * 2 + j]));
message.append("\n");
}
for (int j = 0; j < 2 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 2 + j], Float.floatToRawIntBits(arrayInRhs[i * 2 + j]), arrayInRhs[i * 2 + j]));
+ arrayInRightVector[i * 2 + j], Float.floatToRawIntBits(arrayInRightVector[i * 2 + j]), arrayInRightVector[i * 2 + j]));
message.append("\n");
}
message.append("Expected output out: ");
@@ -193,44 +193,44 @@
}
private void checkFastDistanceFloat3Float3Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6f1fd960a620dbbdl, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6f1fd960a6210713l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x26ab5e68e99971ecl, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x809cb50caadeec29l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testFastDistanceFloat3Float3Float(inLhs, out);
- verifyResultsFastDistanceFloat3Float3Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testFastDistanceFloat3Float3Float(inLeftVector, out);
+ verifyResultsFastDistanceFloat3Float3Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFastDistanceFloat3Float3Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testFastDistanceFloat3Float3Float(inLhs, out);
- verifyResultsFastDistanceFloat3Float3Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testFastDistanceFloat3Float3Float(inLeftVector, out);
+ verifyResultsFastDistanceFloat3Float3Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFastDistanceFloat3Float3Float: " + e.toString());
}
}
- private void verifyResultsFastDistanceFloat3Float3Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsFastDistanceFloat3Float3Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[3];
- args.inRhs = new float[3];
+ args.inLeftVector = new float[3];
+ args.inRightVector = new float[3];
// Fill args with the input values
for (int j = 0; j < 3 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 4 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 4 + j];
}
for (int j = 0; j < 3 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 4 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 4 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeFastDistance(args, target);
@@ -243,15 +243,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 3 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 4 + j], Float.floatToRawIntBits(arrayInLhs[i * 4 + j]), arrayInLhs[i * 4 + j]));
+ arrayInLeftVector[i * 4 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 4 + j]), arrayInLeftVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 3 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 4 + j], Float.floatToRawIntBits(arrayInRhs[i * 4 + j]), arrayInRhs[i * 4 + j]));
+ arrayInRightVector[i * 4 + j], Float.floatToRawIntBits(arrayInRightVector[i * 4 + j]), arrayInRightVector[i * 4 + j]));
message.append("\n");
}
message.append("Expected output out: ");
@@ -271,44 +271,44 @@
}
private void checkFastDistanceFloat4Float4Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x9c1128c0f636f717l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x9c1128c0f637226dl, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf55483e70b38263al, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3706013c50873543l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testFastDistanceFloat4Float4Float(inLhs, out);
- verifyResultsFastDistanceFloat4Float4Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testFastDistanceFloat4Float4Float(inLeftVector, out);
+ verifyResultsFastDistanceFloat4Float4Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFastDistanceFloat4Float4Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testFastDistanceFloat4Float4Float(inLhs, out);
- verifyResultsFastDistanceFloat4Float4Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testFastDistanceFloat4Float4Float(inLeftVector, out);
+ verifyResultsFastDistanceFloat4Float4Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFastDistanceFloat4Float4Float: " + e.toString());
}
}
- private void verifyResultsFastDistanceFloat4Float4Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsFastDistanceFloat4Float4Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[4];
- args.inRhs = new float[4];
+ args.inLeftVector = new float[4];
+ args.inRightVector = new float[4];
// Fill args with the input values
for (int j = 0; j < 4 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 4 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 4 + j];
}
for (int j = 0; j < 4 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 4 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 4 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeFastDistance(args, target);
@@ -321,15 +321,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 4 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 4 + j], Float.floatToRawIntBits(arrayInLhs[i * 4 + j]), arrayInLhs[i * 4 + j]));
+ arrayInLeftVector[i * 4 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 4 + j]), arrayInLeftVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 4 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 4 + j], Float.floatToRawIntBits(arrayInRhs[i * 4 + j]), arrayInRhs[i * 4 + j]));
+ arrayInRightVector[i * 4 + j], Float.floatToRawIntBits(arrayInRightVector[i * 4 + j]), arrayInRightVector[i * 4 + j]));
message.append("\n");
}
message.append("Expected output out: ");
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFastDistance.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastDistance.rs
similarity index 60%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFastDistance.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastDistance.rs
index 62c0931..1101207 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFastDistance.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastDistance.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInRhs;
+rs_allocation gAllocInRightVector;
-float __attribute__((kernel)) testFastDistanceFloatFloatFloat(float inLhs, unsigned int x) {
- float inRhs = rsGetElementAt_float(gAllocInRhs, x);
- return fast_distance(inLhs, inRhs);
+float __attribute__((kernel)) testFastDistanceFloatFloatFloat(float inLeftVector, unsigned int x) {
+ float inRightVector = rsGetElementAt_float(gAllocInRightVector, x);
+ return fast_distance(inLeftVector, inRightVector);
}
-float __attribute__((kernel)) testFastDistanceFloat2Float2Float(float2 inLhs, unsigned int x) {
- float2 inRhs = rsGetElementAt_float2(gAllocInRhs, x);
- return fast_distance(inLhs, inRhs);
+float __attribute__((kernel)) testFastDistanceFloat2Float2Float(float2 inLeftVector, unsigned int x) {
+ float2 inRightVector = rsGetElementAt_float2(gAllocInRightVector, x);
+ return fast_distance(inLeftVector, inRightVector);
}
-float __attribute__((kernel)) testFastDistanceFloat3Float3Float(float3 inLhs, unsigned int x) {
- float3 inRhs = rsGetElementAt_float3(gAllocInRhs, x);
- return fast_distance(inLhs, inRhs);
+float __attribute__((kernel)) testFastDistanceFloat3Float3Float(float3 inLeftVector, unsigned int x) {
+ float3 inRightVector = rsGetElementAt_float3(gAllocInRightVector, x);
+ return fast_distance(inLeftVector, inRightVector);
}
-float __attribute__((kernel)) testFastDistanceFloat4Float4Float(float4 inLhs, unsigned int x) {
- float4 inRhs = rsGetElementAt_float4(gAllocInRhs, x);
- return fast_distance(inLhs, inRhs);
+float __attribute__((kernel)) testFastDistanceFloat4Float4Float(float4 inLeftVector, unsigned int x) {
+ float4 inRightVector = rsGetElementAt_float4(gAllocInRightVector, x);
+ return fast_distance(inLeftVector, inRightVector);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastDistanceRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastDistanceRelaxed.rs
index 66f3fef..1242cbf 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastDistanceRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFastDistance.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFastLength.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastLength.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFastLength.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastLength.java
index e990d15..007a635 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFastLength.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastLength.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestFastLength extends RSBaseCompute {
+public class GeneratedTestFastLength extends RSBaseCompute {
- private ScriptC_TestFastLength script;
- private ScriptC_TestFastLengthRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestFastLength script;
+ private ScriptC_GeneratedTestFastLengthRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestFastLength(mRS);
- scriptRelaxed = new ScriptC_TestFastLengthRelaxed(mRS);
+ script = new ScriptC_GeneratedTestFastLength(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFastLengthRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFastLength.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastLength.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFastLength.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastLength.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastLengthRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastLengthRelaxed.rs
index 66f3fef..47dd33e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastLengthRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFastLength.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFastNormalize.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastNormalize.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFastNormalize.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastNormalize.java
index 4e42575..e5df624 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFastNormalize.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastNormalize.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestFastNormalize extends RSBaseCompute {
+public class GeneratedTestFastNormalize extends RSBaseCompute {
- private ScriptC_TestFastNormalize script;
- private ScriptC_TestFastNormalizeRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestFastNormalize script;
+ private ScriptC_GeneratedTestFastNormalizeRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestFastNormalize(mRS);
- scriptRelaxed = new ScriptC_TestFastNormalizeRelaxed(mRS);
+ script = new ScriptC_GeneratedTestFastNormalize(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFastNormalizeRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFastNormalize.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastNormalize.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFastNormalize.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastNormalize.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastNormalizeRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastNormalizeRelaxed.rs
index 66f3fef..79cd071 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFastNormalizeRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFastNormalize.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFdim.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFdim.java
similarity index 98%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFdim.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFdim.java
index bbe1e7a..eff3e49 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFdim.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFdim.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestFdim extends RSBaseCompute {
+public class GeneratedTestFdim extends RSBaseCompute {
- private ScriptC_TestFdim script;
- private ScriptC_TestFdimRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestFdim script;
+ private ScriptC_GeneratedTestFdimRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestFdim(mRS);
- scriptRelaxed = new ScriptC_TestFdimRelaxed(mRS);
+ script = new ScriptC_GeneratedTestFdim(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFdimRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFdim.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFdim.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFdim.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFdim.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFdimRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFdimRelaxed.rs
index 66f3fef..7fa0a36 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFdimRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFdim.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFloor.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFloor.java
index 77c467c..295c1fe 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFloor.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestFloor extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestFloor script;
+ private ScriptC_GeneratedTestFloorRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestFloor(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFloorRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkFloorFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3b3c924b95badeadl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testFloorFloatFloat(inV, out);
+ verifyResultsFloorFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testFloorFloatFloat(inV, out);
+ verifyResultsFloorFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsFloorFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeFloor(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkFloorFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkFloorFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xd8575933372c9069l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testFloorFloat2Float2(inV, out);
+ verifyResultsFloorFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testFloorFloat2Float2(inV, out);
+ verifyResultsFloorFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsFloorFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeFloor(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkFloorFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkFloorFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd859224e2d47b147l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testFloorFloat3Float3(inV, out);
+ verifyResultsFloorFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testFloorFloat3Float3(inV, out);
+ verifyResultsFloorFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsFloorFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeFloor(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkFloorFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkFloorFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd85aeb692362d225l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testFloorFloat4Float4(inV, out);
+ verifyResultsFloorFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testFloorFloat4Float4(inV, out);
+ verifyResultsFloorFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsFloorFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeFloor(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkFloorFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testFloor() {
+ checkFloorFloatFloat();
+ checkFloorFloat2Float2();
+ checkFloorFloat3Float3();
+ checkFloorFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFloor.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFloor.rs
index 7dae4cf..abb50e3 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFloor.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTgammaFloatFloat(float in) {
- return tgamma(in);
+float __attribute__((kernel)) testFloorFloatFloat(float inV) {
+ return floor(inV);
}
-float2 __attribute__((kernel)) testTgammaFloat2Float2(float2 in) {
- return tgamma(in);
+float2 __attribute__((kernel)) testFloorFloat2Float2(float2 inV) {
+ return floor(inV);
}
-float3 __attribute__((kernel)) testTgammaFloat3Float3(float3 in) {
- return tgamma(in);
+float3 __attribute__((kernel)) testFloorFloat3Float3(float3 inV) {
+ return floor(inV);
}
-float4 __attribute__((kernel)) testTgammaFloat4Float4(float4 in) {
- return tgamma(in);
+float4 __attribute__((kernel)) testFloorFloat4Float4(float4 inV) {
+ return floor(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFloorRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFloorRelaxed.rs
index 66f3fef..755218d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFloorRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFloor.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFma.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFma.java
new file mode 100644
index 0000000..c8b0c0f
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFma.java
@@ -0,0 +1,366 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+package android.renderscript.cts;
+
+import android.renderscript.Allocation;
+import android.renderscript.RSRuntimeException;
+import android.renderscript.Element;
+
+public class GeneratedTestFma extends RSBaseCompute {
+
+ private ScriptC_GeneratedTestFma script;
+ private ScriptC_GeneratedTestFmaRelaxed scriptRelaxed;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ script = new ScriptC_GeneratedTestFma(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFmaRelaxed(mRS);
+ }
+
+ public class ArgumentsFloatFloatFloatFloat {
+ public float inMultiplicand1;
+ public float inMultiplicand2;
+ public float inOffset;
+ public Target.Floaty out;
+ }
+
+ private void checkFmaFloatFloatFloatFloat() {
+ Allocation inMultiplicand1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x716293a685c419bel, false);
+ Allocation inMultiplicand2 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x716293a685c419bfl, false);
+ Allocation inOffset = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x4a235a109d441b0el, false);
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ script.set_gAllocInMultiplicand2(inMultiplicand2);
+ script.set_gAllocInOffset(inOffset);
+ script.forEach_testFmaFloatFloatFloatFloat(inMultiplicand1, out);
+ verifyResultsFmaFloatFloatFloatFloat(inMultiplicand1, inMultiplicand2, inOffset, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloatFloatFloatFloat: " + e.toString());
+ }
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ scriptRelaxed.set_gAllocInMultiplicand2(inMultiplicand2);
+ scriptRelaxed.set_gAllocInOffset(inOffset);
+ scriptRelaxed.forEach_testFmaFloatFloatFloatFloat(inMultiplicand1, out);
+ verifyResultsFmaFloatFloatFloatFloat(inMultiplicand1, inMultiplicand2, inOffset, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloatFloatFloatFloat: " + e.toString());
+ }
+ }
+
+ private void verifyResultsFmaFloatFloatFloatFloat(Allocation inMultiplicand1, Allocation inMultiplicand2, Allocation inOffset, Allocation out, boolean relaxed) {
+ float[] arrayInMultiplicand1 = new float[INPUTSIZE * 1];
+ inMultiplicand1.copyTo(arrayInMultiplicand1);
+ float[] arrayInMultiplicand2 = new float[INPUTSIZE * 1];
+ inMultiplicand2.copyTo(arrayInMultiplicand2);
+ float[] arrayInOffset = new float[INPUTSIZE * 1];
+ inOffset.copyTo(arrayInOffset);
+ float[] arrayOut = new float[INPUTSIZE * 1];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 1 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
+ args.inMultiplicand1 = arrayInMultiplicand1[i];
+ args.inMultiplicand2 = arrayInMultiplicand2[i];
+ args.inOffset = arrayInOffset[i];
+ // Figure out what the outputs should have been.
+ Target target = new Target(relaxed);
+ CoreMathVerifier.computeFma(args, target);
+ // Validate the outputs.
+ boolean valid = true;
+ if (!args.out.couldBe(arrayOut[i * 1 + j])) {
+ valid = false;
+ }
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inMultiplicand1: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand1, Float.floatToRawIntBits(args.inMultiplicand1), args.inMultiplicand1));
+ message.append("\n");
+ message.append("Input inMultiplicand2: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand2, Float.floatToRawIntBits(args.inMultiplicand2), args.inMultiplicand2));
+ message.append("\n");
+ message.append("Input inOffset: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inOffset, Float.floatToRawIntBits(args.inOffset), args.inOffset));
+ message.append("\n");
+ message.append("Expected output out: ");
+ message.append(args.out.toString());
+ message.append("\n");
+ message.append("Actual output out: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
+ if (!args.out.couldBe(arrayOut[i * 1 + j])) {
+ message.append(" FAIL");
+ }
+ message.append("\n");
+ assertTrue("Incorrect output for checkFmaFloatFloatFloatFloat" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ private void checkFmaFloat2Float2Float2Float2() {
+ Allocation inMultiplicand1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x1bb42af9dda15056l, false);
+ Allocation inMultiplicand2 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x1bb42af9dda15057l, false);
+ Allocation inOffset = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x667fbd778aeda396l, false);
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ script.set_gAllocInMultiplicand2(inMultiplicand2);
+ script.set_gAllocInOffset(inOffset);
+ script.forEach_testFmaFloat2Float2Float2Float2(inMultiplicand1, out);
+ verifyResultsFmaFloat2Float2Float2Float2(inMultiplicand1, inMultiplicand2, inOffset, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat2Float2Float2Float2: " + e.toString());
+ }
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ scriptRelaxed.set_gAllocInMultiplicand2(inMultiplicand2);
+ scriptRelaxed.set_gAllocInOffset(inOffset);
+ scriptRelaxed.forEach_testFmaFloat2Float2Float2Float2(inMultiplicand1, out);
+ verifyResultsFmaFloat2Float2Float2Float2(inMultiplicand1, inMultiplicand2, inOffset, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat2Float2Float2Float2: " + e.toString());
+ }
+ }
+
+ private void verifyResultsFmaFloat2Float2Float2Float2(Allocation inMultiplicand1, Allocation inMultiplicand2, Allocation inOffset, Allocation out, boolean relaxed) {
+ float[] arrayInMultiplicand1 = new float[INPUTSIZE * 2];
+ inMultiplicand1.copyTo(arrayInMultiplicand1);
+ float[] arrayInMultiplicand2 = new float[INPUTSIZE * 2];
+ inMultiplicand2.copyTo(arrayInMultiplicand2);
+ float[] arrayInOffset = new float[INPUTSIZE * 2];
+ inOffset.copyTo(arrayInOffset);
+ float[] arrayOut = new float[INPUTSIZE * 2];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 2 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
+ args.inMultiplicand1 = arrayInMultiplicand1[i * 2 + j];
+ args.inMultiplicand2 = arrayInMultiplicand2[i * 2 + j];
+ args.inOffset = arrayInOffset[i * 2 + j];
+ // Figure out what the outputs should have been.
+ Target target = new Target(relaxed);
+ CoreMathVerifier.computeFma(args, target);
+ // Validate the outputs.
+ boolean valid = true;
+ if (!args.out.couldBe(arrayOut[i * 2 + j])) {
+ valid = false;
+ }
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inMultiplicand1: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand1, Float.floatToRawIntBits(args.inMultiplicand1), args.inMultiplicand1));
+ message.append("\n");
+ message.append("Input inMultiplicand2: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand2, Float.floatToRawIntBits(args.inMultiplicand2), args.inMultiplicand2));
+ message.append("\n");
+ message.append("Input inOffset: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inOffset, Float.floatToRawIntBits(args.inOffset), args.inOffset));
+ message.append("\n");
+ message.append("Expected output out: ");
+ message.append(args.out.toString());
+ message.append("\n");
+ message.append("Actual output out: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
+ if (!args.out.couldBe(arrayOut[i * 2 + j])) {
+ message.append(" FAIL");
+ }
+ message.append("\n");
+ assertTrue("Incorrect output for checkFmaFloat2Float2Float2Float2" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ private void checkFmaFloat3Float3Float3Float3() {
+ Allocation inMultiplicand1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x19169f2d349697b2l, false);
+ Allocation inMultiplicand2 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x19169f2d349697b3l, false);
+ Allocation inOffset = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x3a56bf5454d5ec8al, false);
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ script.set_gAllocInMultiplicand2(inMultiplicand2);
+ script.set_gAllocInOffset(inOffset);
+ script.forEach_testFmaFloat3Float3Float3Float3(inMultiplicand1, out);
+ verifyResultsFmaFloat3Float3Float3Float3(inMultiplicand1, inMultiplicand2, inOffset, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat3Float3Float3Float3: " + e.toString());
+ }
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ scriptRelaxed.set_gAllocInMultiplicand2(inMultiplicand2);
+ scriptRelaxed.set_gAllocInOffset(inOffset);
+ scriptRelaxed.forEach_testFmaFloat3Float3Float3Float3(inMultiplicand1, out);
+ verifyResultsFmaFloat3Float3Float3Float3(inMultiplicand1, inMultiplicand2, inOffset, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat3Float3Float3Float3: " + e.toString());
+ }
+ }
+
+ private void verifyResultsFmaFloat3Float3Float3Float3(Allocation inMultiplicand1, Allocation inMultiplicand2, Allocation inOffset, Allocation out, boolean relaxed) {
+ float[] arrayInMultiplicand1 = new float[INPUTSIZE * 4];
+ inMultiplicand1.copyTo(arrayInMultiplicand1);
+ float[] arrayInMultiplicand2 = new float[INPUTSIZE * 4];
+ inMultiplicand2.copyTo(arrayInMultiplicand2);
+ float[] arrayInOffset = new float[INPUTSIZE * 4];
+ inOffset.copyTo(arrayInOffset);
+ float[] arrayOut = new float[INPUTSIZE * 4];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 3 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
+ args.inMultiplicand1 = arrayInMultiplicand1[i * 4 + j];
+ args.inMultiplicand2 = arrayInMultiplicand2[i * 4 + j];
+ args.inOffset = arrayInOffset[i * 4 + j];
+ // Figure out what the outputs should have been.
+ Target target = new Target(relaxed);
+ CoreMathVerifier.computeFma(args, target);
+ // Validate the outputs.
+ boolean valid = true;
+ if (!args.out.couldBe(arrayOut[i * 4 + j])) {
+ valid = false;
+ }
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inMultiplicand1: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand1, Float.floatToRawIntBits(args.inMultiplicand1), args.inMultiplicand1));
+ message.append("\n");
+ message.append("Input inMultiplicand2: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand2, Float.floatToRawIntBits(args.inMultiplicand2), args.inMultiplicand2));
+ message.append("\n");
+ message.append("Input inOffset: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inOffset, Float.floatToRawIntBits(args.inOffset), args.inOffset));
+ message.append("\n");
+ message.append("Expected output out: ");
+ message.append(args.out.toString());
+ message.append("\n");
+ message.append("Actual output out: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
+ if (!args.out.couldBe(arrayOut[i * 4 + j])) {
+ message.append(" FAIL");
+ }
+ message.append("\n");
+ assertTrue("Incorrect output for checkFmaFloat3Float3Float3Float3" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ private void checkFmaFloat4Float4Float4Float4() {
+ Allocation inMultiplicand1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x167913608b8bdf0el, false);
+ Allocation inMultiplicand2 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x167913608b8bdf0fl, false);
+ Allocation inOffset = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xe2dc1311ebe357el, false);
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ script.set_gAllocInMultiplicand2(inMultiplicand2);
+ script.set_gAllocInOffset(inOffset);
+ script.forEach_testFmaFloat4Float4Float4Float4(inMultiplicand1, out);
+ verifyResultsFmaFloat4Float4Float4Float4(inMultiplicand1, inMultiplicand2, inOffset, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat4Float4Float4Float4: " + e.toString());
+ }
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ scriptRelaxed.set_gAllocInMultiplicand2(inMultiplicand2);
+ scriptRelaxed.set_gAllocInOffset(inOffset);
+ scriptRelaxed.forEach_testFmaFloat4Float4Float4Float4(inMultiplicand1, out);
+ verifyResultsFmaFloat4Float4Float4Float4(inMultiplicand1, inMultiplicand2, inOffset, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat4Float4Float4Float4: " + e.toString());
+ }
+ }
+
+ private void verifyResultsFmaFloat4Float4Float4Float4(Allocation inMultiplicand1, Allocation inMultiplicand2, Allocation inOffset, Allocation out, boolean relaxed) {
+ float[] arrayInMultiplicand1 = new float[INPUTSIZE * 4];
+ inMultiplicand1.copyTo(arrayInMultiplicand1);
+ float[] arrayInMultiplicand2 = new float[INPUTSIZE * 4];
+ inMultiplicand2.copyTo(arrayInMultiplicand2);
+ float[] arrayInOffset = new float[INPUTSIZE * 4];
+ inOffset.copyTo(arrayInOffset);
+ float[] arrayOut = new float[INPUTSIZE * 4];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 4 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
+ args.inMultiplicand1 = arrayInMultiplicand1[i * 4 + j];
+ args.inMultiplicand2 = arrayInMultiplicand2[i * 4 + j];
+ args.inOffset = arrayInOffset[i * 4 + j];
+ // Figure out what the outputs should have been.
+ Target target = new Target(relaxed);
+ CoreMathVerifier.computeFma(args, target);
+ // Validate the outputs.
+ boolean valid = true;
+ if (!args.out.couldBe(arrayOut[i * 4 + j])) {
+ valid = false;
+ }
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inMultiplicand1: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand1, Float.floatToRawIntBits(args.inMultiplicand1), args.inMultiplicand1));
+ message.append("\n");
+ message.append("Input inMultiplicand2: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand2, Float.floatToRawIntBits(args.inMultiplicand2), args.inMultiplicand2));
+ message.append("\n");
+ message.append("Input inOffset: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inOffset, Float.floatToRawIntBits(args.inOffset), args.inOffset));
+ message.append("\n");
+ message.append("Expected output out: ");
+ message.append(args.out.toString());
+ message.append("\n");
+ message.append("Actual output out: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
+ if (!args.out.couldBe(arrayOut[i * 4 + j])) {
+ message.append(" FAIL");
+ }
+ message.append("\n");
+ assertTrue("Incorrect output for checkFmaFloat4Float4Float4Float4" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ public void testFma() {
+ checkFmaFloatFloatFloatFloat();
+ checkFmaFloat2Float2Float2Float2();
+ checkFmaFloat3Float3Float3Float3();
+ checkFmaFloat4Float4Float4Float4();
+ }
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFma.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFma.rs
new file mode 100644
index 0000000..cc67007
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFma.rs
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInMultiplicand2;
+rs_allocation gAllocInOffset;
+
+float __attribute__((kernel)) testFmaFloatFloatFloatFloat(float inMultiplicand1, unsigned int x) {
+ float inMultiplicand2 = rsGetElementAt_float(gAllocInMultiplicand2, x);
+ float inOffset = rsGetElementAt_float(gAllocInOffset, x);
+ return fma(inMultiplicand1, inMultiplicand2, inOffset);
+}
+
+float2 __attribute__((kernel)) testFmaFloat2Float2Float2Float2(float2 inMultiplicand1, unsigned int x) {
+ float2 inMultiplicand2 = rsGetElementAt_float2(gAllocInMultiplicand2, x);
+ float2 inOffset = rsGetElementAt_float2(gAllocInOffset, x);
+ return fma(inMultiplicand1, inMultiplicand2, inOffset);
+}
+
+float3 __attribute__((kernel)) testFmaFloat3Float3Float3Float3(float3 inMultiplicand1, unsigned int x) {
+ float3 inMultiplicand2 = rsGetElementAt_float3(gAllocInMultiplicand2, x);
+ float3 inOffset = rsGetElementAt_float3(gAllocInOffset, x);
+ return fma(inMultiplicand1, inMultiplicand2, inOffset);
+}
+
+float4 __attribute__((kernel)) testFmaFloat4Float4Float4Float4(float4 inMultiplicand1, unsigned int x) {
+ float4 inMultiplicand2 = rsGetElementAt_float4(gAllocInMultiplicand2, x);
+ float4 inOffset = rsGetElementAt_float4(gAllocInOffset, x);
+ return fma(inMultiplicand1, inMultiplicand2, inOffset);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmaRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmaRelaxed.rs
index 66f3fef..f1598a4 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmaRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFma.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFmax.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmax.java
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFmax.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmax.java
index 7d4e633..abe0c9e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFmax.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmax.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestFmax extends RSBaseCompute {
+public class GeneratedTestFmax extends RSBaseCompute {
- private ScriptC_TestFmax script;
- private ScriptC_TestFmaxRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestFmax script;
+ private ScriptC_GeneratedTestFmaxRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestFmax(mRS);
- scriptRelaxed = new ScriptC_TestFmaxRelaxed(mRS);
+ script = new ScriptC_GeneratedTestFmax(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFmaxRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inX;
- public float inY;
+ public float inA;
+ public float inB;
public Target.Floaty out;
}
private void checkFmaxFloatFloatFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe6ec75a46e6fdd91l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe6ec75a46e6fdd92l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe6ec75a46e6fdd7al, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe6ec75a46e6fdd7bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFmaxFloatFloatFloat(inX, out);
- verifyResultsFmaxFloatFloatFloat(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFmaxFloatFloatFloat(inA, out);
+ verifyResultsFmaxFloatFloatFloat(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFmaxFloatFloatFloat(inX, out);
- verifyResultsFmaxFloatFloatFloat(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFmaxFloatFloatFloat(inA, out);
+ verifyResultsFmaxFloatFloatFloat(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsFmaxFloatFloatFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsFmaxFloatFloatFloat(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmax(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkFmaxFloat2Float2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xa99eaa6dd458a0dfl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xa99eaa6dd458a0e0l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xa99eaa6dd458a0c8l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xa99eaa6dd458a0c9l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFmaxFloat2Float2Float2(inX, out);
- verifyResultsFmaxFloat2Float2Float2(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFmaxFloat2Float2Float2(inA, out);
+ verifyResultsFmaxFloat2Float2Float2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFmaxFloat2Float2Float2(inX, out);
- verifyResultsFmaxFloat2Float2Float2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFmaxFloat2Float2Float2(inA, out);
+ verifyResultsFmaxFloat2Float2Float2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsFmaxFloat2Float2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
+ private void verifyResultsFmaxFloat2Float2Float2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmax(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkFmaxFloat3Float3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xfe03888dd636a280l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xfe03888dd636a281l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xfe03888dd636a269l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xfe03888dd636a26al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFmaxFloat3Float3Float3(inX, out);
- verifyResultsFmaxFloat3Float3Float3(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFmaxFloat3Float3Float3(inA, out);
+ verifyResultsFmaxFloat3Float3Float3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFmaxFloat3Float3Float3(inX, out);
- verifyResultsFmaxFloat3Float3Float3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFmaxFloat3Float3Float3(inA, out);
+ verifyResultsFmaxFloat3Float3Float3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsFmaxFloat3Float3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsFmaxFloat3Float3Float3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmax(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkFmaxFloat4Float4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x526866add814a421l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x526866add814a422l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x526866add814a40al, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x526866add814a40bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFmaxFloat4Float4Float4(inX, out);
- verifyResultsFmaxFloat4Float4Float4(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFmaxFloat4Float4Float4(inA, out);
+ verifyResultsFmaxFloat4Float4Float4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFmaxFloat4Float4Float4(inX, out);
- verifyResultsFmaxFloat4Float4Float4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFmaxFloat4Float4Float4(inA, out);
+ verifyResultsFmaxFloat4Float4Float4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsFmaxFloat4Float4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsFmaxFloat4Float4Float4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmax(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -317,39 +317,39 @@
}
private void checkFmaxFloat2FloatFloat2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xce5ddc06dc631119l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xce5ddc06dc63111al, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xce5ddc06dc631102l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xce5ddc06dc631103l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFmaxFloat2FloatFloat2(inX, out);
- verifyResultsFmaxFloat2FloatFloat2(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFmaxFloat2FloatFloat2(inA, out);
+ verifyResultsFmaxFloat2FloatFloat2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat2FloatFloat2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFmaxFloat2FloatFloat2(inX, out);
- verifyResultsFmaxFloat2FloatFloat2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFmaxFloat2FloatFloat2(inA, out);
+ verifyResultsFmaxFloat2FloatFloat2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat2FloatFloat2: " + e.toString());
}
}
- private void verifyResultsFmaxFloat2FloatFloat2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsFmaxFloat2FloatFloat2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmax(args, target);
@@ -360,13 +360,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -386,39 +386,39 @@
}
private void checkFmaxFloat3FloatFloat3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x23ad8f1ecace0575l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x23ad8f1ecace0576l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x23ad8f1ecace055el, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x23ad8f1ecace055fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFmaxFloat3FloatFloat3(inX, out);
- verifyResultsFmaxFloat3FloatFloat3(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFmaxFloat3FloatFloat3(inA, out);
+ verifyResultsFmaxFloat3FloatFloat3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat3FloatFloat3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFmaxFloat3FloatFloat3(inX, out);
- verifyResultsFmaxFloat3FloatFloat3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFmaxFloat3FloatFloat3(inA, out);
+ verifyResultsFmaxFloat3FloatFloat3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat3FloatFloat3: " + e.toString());
}
}
- private void verifyResultsFmaxFloat3FloatFloat3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsFmaxFloat3FloatFloat3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmax(args, target);
@@ -429,13 +429,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -455,39 +455,39 @@
}
private void checkFmaxFloat4FloatFloat4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x78fd4236b938f9d1l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x78fd4236b938f9d2l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x78fd4236b938f9bal, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x78fd4236b938f9bbl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFmaxFloat4FloatFloat4(inX, out);
- verifyResultsFmaxFloat4FloatFloat4(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFmaxFloat4FloatFloat4(inA, out);
+ verifyResultsFmaxFloat4FloatFloat4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat4FloatFloat4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFmaxFloat4FloatFloat4(inX, out);
- verifyResultsFmaxFloat4FloatFloat4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFmaxFloat4FloatFloat4(inA, out);
+ verifyResultsFmaxFloat4FloatFloat4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaxFloat4FloatFloat4: " + e.toString());
}
}
- private void verifyResultsFmaxFloat4FloatFloat4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsFmaxFloat4FloatFloat4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmax(args, target);
@@ -498,13 +498,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFmax.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmax.rs
similarity index 60%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFmax.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmax.rs
index 50e5e3f..59eb2bd 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFmax.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmax.rs
@@ -19,39 +19,39 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInY;
+rs_allocation gAllocInB;
-float __attribute__((kernel)) testFmaxFloatFloatFloat(float inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return fmax(inX, inY);
+float __attribute__((kernel)) testFmaxFloatFloatFloat(float inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return fmax(inA, inB);
}
-float2 __attribute__((kernel)) testFmaxFloat2Float2Float2(float2 inX, unsigned int x) {
- float2 inY = rsGetElementAt_float2(gAllocInY, x);
- return fmax(inX, inY);
+float2 __attribute__((kernel)) testFmaxFloat2Float2Float2(float2 inA, unsigned int x) {
+ float2 inB = rsGetElementAt_float2(gAllocInB, x);
+ return fmax(inA, inB);
}
-float3 __attribute__((kernel)) testFmaxFloat3Float3Float3(float3 inX, unsigned int x) {
- float3 inY = rsGetElementAt_float3(gAllocInY, x);
- return fmax(inX, inY);
+float3 __attribute__((kernel)) testFmaxFloat3Float3Float3(float3 inA, unsigned int x) {
+ float3 inB = rsGetElementAt_float3(gAllocInB, x);
+ return fmax(inA, inB);
}
-float4 __attribute__((kernel)) testFmaxFloat4Float4Float4(float4 inX, unsigned int x) {
- float4 inY = rsGetElementAt_float4(gAllocInY, x);
- return fmax(inX, inY);
+float4 __attribute__((kernel)) testFmaxFloat4Float4Float4(float4 inA, unsigned int x) {
+ float4 inB = rsGetElementAt_float4(gAllocInB, x);
+ return fmax(inA, inB);
}
-float2 __attribute__((kernel)) testFmaxFloat2FloatFloat2(float2 inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return fmax(inX, inY);
+float2 __attribute__((kernel)) testFmaxFloat2FloatFloat2(float2 inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return fmax(inA, inB);
}
-float3 __attribute__((kernel)) testFmaxFloat3FloatFloat3(float3 inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return fmax(inX, inY);
+float3 __attribute__((kernel)) testFmaxFloat3FloatFloat3(float3 inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return fmax(inA, inB);
}
-float4 __attribute__((kernel)) testFmaxFloat4FloatFloat4(float4 inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return fmax(inX, inY);
+float4 __attribute__((kernel)) testFmaxFloat4FloatFloat4(float4 inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return fmax(inA, inB);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmaxRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmaxRelaxed.rs
index 66f3fef..05b4ce9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmaxRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFmax.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFmin.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmin.java
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFmin.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmin.java
index f206a74..8183585 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFmin.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmin.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestFmin extends RSBaseCompute {
+public class GeneratedTestFmin extends RSBaseCompute {
- private ScriptC_TestFmin script;
- private ScriptC_TestFminRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestFmin script;
+ private ScriptC_GeneratedTestFminRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestFmin(mRS);
- scriptRelaxed = new ScriptC_TestFminRelaxed(mRS);
+ script = new ScriptC_GeneratedTestFmin(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFminRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inX;
- public float inY;
+ public float inA;
+ public float inB;
public Target.Floaty out;
}
private void checkFminFloatFloatFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x7b46a8451d7b106fl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x7b46a8451d7b1070l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x7b46a8451d7b1058l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x7b46a8451d7b1059l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFminFloatFloatFloat(inX, out);
- verifyResultsFminFloatFloatFloat(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFminFloatFloatFloat(inA, out);
+ verifyResultsFminFloatFloatFloat(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFminFloatFloatFloat(inX, out);
- verifyResultsFminFloatFloatFloat(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFminFloatFloatFloat(inA, out);
+ verifyResultsFminFloatFloatFloat(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsFminFloatFloatFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsFminFloatFloatFloat(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmin(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkFminFloat2Float2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x12b850a9e75faa59l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x12b850a9e75faa5al, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x12b850a9e75faa42l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x12b850a9e75faa43l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFminFloat2Float2Float2(inX, out);
- verifyResultsFminFloat2Float2Float2(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFminFloat2Float2Float2(inA, out);
+ verifyResultsFminFloat2Float2Float2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFminFloat2Float2Float2(inX, out);
- verifyResultsFminFloat2Float2Float2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFminFloat2Float2Float2(inA, out);
+ verifyResultsFminFloat2Float2Float2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsFminFloat2Float2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
+ private void verifyResultsFminFloat2Float2Float2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmin(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkFminFloat3Float3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x671d2ec9e93dabfal, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x671d2ec9e93dabfbl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x671d2ec9e93dabe3l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x671d2ec9e93dabe4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFminFloat3Float3Float3(inX, out);
- verifyResultsFminFloat3Float3Float3(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFminFloat3Float3Float3(inA, out);
+ verifyResultsFminFloat3Float3Float3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFminFloat3Float3Float3(inX, out);
- verifyResultsFminFloat3Float3Float3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFminFloat3Float3Float3(inA, out);
+ verifyResultsFminFloat3Float3Float3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsFminFloat3Float3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsFminFloat3Float3Float3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmin(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkFminFloat4Float4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbb820ce9eb1bad9bl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbb820ce9eb1bad9cl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbb820ce9eb1bad84l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbb820ce9eb1bad85l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFminFloat4Float4Float4(inX, out);
- verifyResultsFminFloat4Float4Float4(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFminFloat4Float4Float4(inA, out);
+ verifyResultsFminFloat4Float4Float4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFminFloat4Float4Float4(inX, out);
- verifyResultsFminFloat4Float4Float4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFminFloat4Float4Float4(inA, out);
+ verifyResultsFminFloat4Float4Float4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsFminFloat4Float4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsFminFloat4Float4Float4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmin(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -317,39 +317,39 @@
}
private void checkFminFloat2FloatFloat2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x4dd5869724457687l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x4dd5869724457688l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x4dd5869724457670l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x4dd5869724457671l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFminFloat2FloatFloat2(inX, out);
- verifyResultsFminFloat2FloatFloat2(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFminFloat2FloatFloat2(inA, out);
+ verifyResultsFminFloat2FloatFloat2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat2FloatFloat2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFminFloat2FloatFloat2(inX, out);
- verifyResultsFminFloat2FloatFloat2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFminFloat2FloatFloat2(inA, out);
+ verifyResultsFminFloat2FloatFloat2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat2FloatFloat2: " + e.toString());
}
}
- private void verifyResultsFminFloat2FloatFloat2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsFminFloat2FloatFloat2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmin(args, target);
@@ -360,13 +360,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -386,39 +386,39 @@
}
private void checkFminFloat3FloatFloat3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xa32539af12b06ae3l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xa32539af12b06ae4l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xa32539af12b06accl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xa32539af12b06acdl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFminFloat3FloatFloat3(inX, out);
- verifyResultsFminFloat3FloatFloat3(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFminFloat3FloatFloat3(inA, out);
+ verifyResultsFminFloat3FloatFloat3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat3FloatFloat3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFminFloat3FloatFloat3(inX, out);
- verifyResultsFminFloat3FloatFloat3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFminFloat3FloatFloat3(inA, out);
+ verifyResultsFminFloat3FloatFloat3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat3FloatFloat3: " + e.toString());
}
}
- private void verifyResultsFminFloat3FloatFloat3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsFminFloat3FloatFloat3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmin(args, target);
@@ -429,13 +429,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -455,39 +455,39 @@
}
private void checkFminFloat4FloatFloat4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf874ecc7011b5f3fl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf874ecc7011b5f40l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf874ecc7011b5f28l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf874ecc7011b5f29l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFminFloat4FloatFloat4(inX, out);
- verifyResultsFminFloat4FloatFloat4(inX, inY, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testFminFloat4FloatFloat4(inA, out);
+ verifyResultsFminFloat4FloatFloat4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat4FloatFloat4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFminFloat4FloatFloat4(inX, out);
- verifyResultsFminFloat4FloatFloat4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testFminFloat4FloatFloat4(inA, out);
+ verifyResultsFminFloat4FloatFloat4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFminFloat4FloatFloat4: " + e.toString());
}
}
- private void verifyResultsFminFloat4FloatFloat4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsFminFloat4FloatFloat4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmin(args, target);
@@ -498,13 +498,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFmin.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmin.rs
similarity index 60%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFmin.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmin.rs
index 28db18f..0846051 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFmin.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmin.rs
@@ -19,39 +19,39 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInY;
+rs_allocation gAllocInB;
-float __attribute__((kernel)) testFminFloatFloatFloat(float inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return fmin(inX, inY);
+float __attribute__((kernel)) testFminFloatFloatFloat(float inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return fmin(inA, inB);
}
-float2 __attribute__((kernel)) testFminFloat2Float2Float2(float2 inX, unsigned int x) {
- float2 inY = rsGetElementAt_float2(gAllocInY, x);
- return fmin(inX, inY);
+float2 __attribute__((kernel)) testFminFloat2Float2Float2(float2 inA, unsigned int x) {
+ float2 inB = rsGetElementAt_float2(gAllocInB, x);
+ return fmin(inA, inB);
}
-float3 __attribute__((kernel)) testFminFloat3Float3Float3(float3 inX, unsigned int x) {
- float3 inY = rsGetElementAt_float3(gAllocInY, x);
- return fmin(inX, inY);
+float3 __attribute__((kernel)) testFminFloat3Float3Float3(float3 inA, unsigned int x) {
+ float3 inB = rsGetElementAt_float3(gAllocInB, x);
+ return fmin(inA, inB);
}
-float4 __attribute__((kernel)) testFminFloat4Float4Float4(float4 inX, unsigned int x) {
- float4 inY = rsGetElementAt_float4(gAllocInY, x);
- return fmin(inX, inY);
+float4 __attribute__((kernel)) testFminFloat4Float4Float4(float4 inA, unsigned int x) {
+ float4 inB = rsGetElementAt_float4(gAllocInB, x);
+ return fmin(inA, inB);
}
-float2 __attribute__((kernel)) testFminFloat2FloatFloat2(float2 inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return fmin(inX, inY);
+float2 __attribute__((kernel)) testFminFloat2FloatFloat2(float2 inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return fmin(inA, inB);
}
-float3 __attribute__((kernel)) testFminFloat3FloatFloat3(float3 inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return fmin(inX, inY);
+float3 __attribute__((kernel)) testFminFloat3FloatFloat3(float3 inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return fmin(inA, inB);
}
-float4 __attribute__((kernel)) testFminFloat4FloatFloat4(float4 inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return fmin(inX, inY);
+float4 __attribute__((kernel)) testFminFloat4FloatFloat4(float4 inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return fmin(inA, inB);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFminRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFminRelaxed.rs
index 66f3fef..d498d0c 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFminRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFmin.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFmod.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmod.java
similarity index 64%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFmod.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmod.java
index 7bd59ef..0096e27 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFmod.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmod.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestFmod extends RSBaseCompute {
+public class GeneratedTestFmod extends RSBaseCompute {
- private ScriptC_TestFmod script;
- private ScriptC_TestFmodRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestFmod script;
+ private ScriptC_GeneratedTestFmodRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestFmod(mRS);
- scriptRelaxed = new ScriptC_TestFmodRelaxed(mRS);
+ script = new ScriptC_GeneratedTestFmod(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFmodRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inX;
- public float inY;
+ public float inNumerator;
+ public float inDenominator;
public Target.Floaty out;
}
private void checkFmodFloatFloatFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x51ab5ae4481379a7l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x51ab5ae4481379a8l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xed70b65ddcc790e8l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xeff8dc0a04b044e1l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFmodFloatFloatFloat(inX, out);
- verifyResultsFmodFloatFloatFloat(inX, inY, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testFmodFloatFloatFloat(inNumerator, out);
+ verifyResultsFmodFloatFloatFloat(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmodFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFmodFloatFloatFloat(inX, out);
- verifyResultsFmodFloatFloatFloat(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testFmodFloatFloatFloat(inNumerator, out);
+ verifyResultsFmodFloatFloatFloat(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmodFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsFmodFloatFloatFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsFmodFloatFloatFloat(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 1];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 1];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
+ args.inNumerator = arrayInNumerator[i];
+ args.inDenominator = arrayInDenominator[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmod(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkFmodFloat2Float2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x1ed79fa3ec4de581l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x1ed79fa3ec4de582l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x84bcef91ebd95a82l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xb582050adc295e2bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFmodFloat2Float2Float2(inX, out);
- verifyResultsFmodFloat2Float2Float2(inX, inY, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testFmodFloat2Float2Float2(inNumerator, out);
+ verifyResultsFmodFloat2Float2Float2(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmodFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFmodFloat2Float2Float2(inX, out);
- verifyResultsFmodFloat2Float2Float2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testFmodFloat2Float2Float2(inNumerator, out);
+ verifyResultsFmodFloat2Float2Float2(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmodFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsFmodFloat2Float2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
+ private void verifyResultsFmodFloat2Float2Float2(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 2];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 2];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
+ args.inNumerator = arrayInNumerator[i * 2 + j];
+ args.inDenominator = arrayInDenominator[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmod(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkFmodFloat3Float3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x733c7dc3ee2be722l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x733c7dc3ee2be723l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x604b98cb8ea54683l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x7ee64653af04f164l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFmodFloat3Float3Float3(inX, out);
- verifyResultsFmodFloat3Float3Float3(inX, inY, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testFmodFloat3Float3Float3(inNumerator, out);
+ verifyResultsFmodFloat3Float3Float3(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmodFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFmodFloat3Float3Float3(inX, out);
- verifyResultsFmodFloat3Float3Float3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testFmodFloat3Float3Float3(inNumerator, out);
+ verifyResultsFmodFloat3Float3Float3(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmodFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsFmodFloat3Float3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsFmodFloat3Float3Float3(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmod(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkFmodFloat4Float4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc7a15be3f009e8c3l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc7a15be3f009e8c4l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3bda420531713284l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x484a879c81e0849dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testFmodFloat4Float4Float4(inX, out);
- verifyResultsFmodFloat4Float4Float4(inX, inY, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testFmodFloat4Float4Float4(inNumerator, out);
+ verifyResultsFmodFloat4Float4Float4(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmodFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testFmodFloat4Float4Float4(inX, out);
- verifyResultsFmodFloat4Float4Float4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testFmodFloat4Float4Float4(inNumerator, out);
+ verifyResultsFmodFloat4Float4Float4(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmodFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsFmodFloat4Float4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsFmodFloat4Float4Float4(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeFmod(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmod.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmod.rs
new file mode 100644
index 0000000..d8238aa
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmod.rs
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInDenominator;
+
+float __attribute__((kernel)) testFmodFloatFloatFloat(float inNumerator, unsigned int x) {
+ float inDenominator = rsGetElementAt_float(gAllocInDenominator, x);
+ return fmod(inNumerator, inDenominator);
+}
+
+float2 __attribute__((kernel)) testFmodFloat2Float2Float2(float2 inNumerator, unsigned int x) {
+ float2 inDenominator = rsGetElementAt_float2(gAllocInDenominator, x);
+ return fmod(inNumerator, inDenominator);
+}
+
+float3 __attribute__((kernel)) testFmodFloat3Float3Float3(float3 inNumerator, unsigned int x) {
+ float3 inDenominator = rsGetElementAt_float3(gAllocInDenominator, x);
+ return fmod(inNumerator, inDenominator);
+}
+
+float4 __attribute__((kernel)) testFmodFloat4Float4Float4(float4 inNumerator, unsigned int x) {
+ float4 inDenominator = rsGetElementAt_float4(gAllocInDenominator, x);
+ return fmod(inNumerator, inDenominator);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmodRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmodRelaxed.rs
index 66f3fef..b4e197b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFmodRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFmod.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFract.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFract.java
similarity index 98%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFract.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFract.java
index 891ad96..0367b05 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFract.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFract.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestFract extends RSBaseCompute {
+public class GeneratedTestFract extends RSBaseCompute {
- private ScriptC_TestFract script;
- private ScriptC_TestFractRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestFract script;
+ private ScriptC_GeneratedTestFractRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestFract(mRS);
- scriptRelaxed = new ScriptC_TestFractRelaxed(mRS);
+ script = new ScriptC_GeneratedTestFract(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFractRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFract.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFract.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFract.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFract.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFractRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFractRelaxed.rs
index 66f3fef..6660366 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFractRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFract.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFrexp.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFrexp.java
similarity index 73%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFrexp.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFrexp.java
index 7258d3c..47e400d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFrexp.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFrexp.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestFrexp extends RSBaseCompute {
+public class GeneratedTestFrexp extends RSBaseCompute {
- private ScriptC_TestFrexp script;
- private ScriptC_TestFrexpRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestFrexp script;
+ private ScriptC_GeneratedTestFrexpRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestFrexp(mRS);
- scriptRelaxed = new ScriptC_TestFrexpRelaxed(mRS);
+ script = new ScriptC_GeneratedTestFrexp(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestFrexpRelaxed(mRS);
}
public class ArgumentsFloatIntFloat {
public float inV;
- public int outIptr;
+ public int outExponent;
public Target.Floaty out;
}
private void checkFrexpFloatIntFloat() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x57ae9fe07384e56dl, false);
try {
- Allocation outIptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
+ Allocation outExponent = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocOutIptr(outIptr);
+ script.set_gAllocOutExponent(outExponent);
script.forEach_testFrexpFloatIntFloat(inV, out);
- verifyResultsFrexpFloatIntFloat(inV, outIptr, out, false);
+ verifyResultsFrexpFloatIntFloat(inV, outExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFrexpFloatIntFloat: " + e.toString());
}
try {
- Allocation outIptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
+ Allocation outExponent = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocOutIptr(outIptr);
+ scriptRelaxed.set_gAllocOutExponent(outExponent);
scriptRelaxed.forEach_testFrexpFloatIntFloat(inV, out);
- verifyResultsFrexpFloatIntFloat(inV, outIptr, out, true);
+ verifyResultsFrexpFloatIntFloat(inV, outExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFrexpFloatIntFloat: " + e.toString());
}
}
- private void verifyResultsFrexpFloatIntFloat(Allocation inV, Allocation outIptr, Allocation out, boolean relaxed) {
+ private void verifyResultsFrexpFloatIntFloat(Allocation inV, Allocation outExponent, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
- int[] arrayOutIptr = new int[INPUTSIZE * 1];
- outIptr.copyTo(arrayOutIptr);
+ int[] arrayOutExponent = new int[INPUTSIZE * 1];
+ outExponent.copyTo(arrayOutExponent);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -79,7 +79,7 @@
CoreMathVerifier.computeFrexp(args, target);
// Validate the outputs.
boolean valid = true;
- if (args.outIptr != arrayOutIptr[i * 1 + j]) {
+ if (args.outExponent != arrayOutExponent[i * 1 + j]) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,12 +91,12 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outIptr: ");
- message.append(String.format("%d", args.outIptr));
+ message.append("Expected output outExponent: ");
+ message.append(String.format("%d", args.outExponent));
message.append("\n");
- message.append("Actual output outIptr: ");
- message.append(String.format("%d", arrayOutIptr[i * 1 + j]));
- if (args.outIptr != arrayOutIptr[i * 1 + j]) {
+ message.append("Actual output outExponent: ");
+ message.append(String.format("%d", arrayOutExponent[i * 1 + j]));
+ if (args.outExponent != arrayOutExponent[i * 1 + j]) {
message.append(" FAIL");
}
message.append("\n");
@@ -120,30 +120,30 @@
private void checkFrexpFloat2Int2Float2() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x544e0a688fe7701l, false);
try {
- Allocation outIptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
+ Allocation outExponent = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocOutIptr(outIptr);
+ script.set_gAllocOutExponent(outExponent);
script.forEach_testFrexpFloat2Int2Float2(inV, out);
- verifyResultsFrexpFloat2Int2Float2(inV, outIptr, out, false);
+ verifyResultsFrexpFloat2Int2Float2(inV, outExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFrexpFloat2Int2Float2: " + e.toString());
}
try {
- Allocation outIptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
+ Allocation outExponent = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocOutIptr(outIptr);
+ scriptRelaxed.set_gAllocOutExponent(outExponent);
scriptRelaxed.forEach_testFrexpFloat2Int2Float2(inV, out);
- verifyResultsFrexpFloat2Int2Float2(inV, outIptr, out, true);
+ verifyResultsFrexpFloat2Int2Float2(inV, outExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFrexpFloat2Int2Float2: " + e.toString());
}
}
- private void verifyResultsFrexpFloat2Int2Float2(Allocation inV, Allocation outIptr, Allocation out, boolean relaxed) {
+ private void verifyResultsFrexpFloat2Int2Float2(Allocation inV, Allocation outExponent, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
- int[] arrayOutIptr = new int[INPUTSIZE * 2];
- outIptr.copyTo(arrayOutIptr);
+ int[] arrayOutExponent = new int[INPUTSIZE * 2];
+ outExponent.copyTo(arrayOutExponent);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -156,7 +156,7 @@
CoreMathVerifier.computeFrexp(args, target);
// Validate the outputs.
boolean valid = true;
- if (args.outIptr != arrayOutIptr[i * 2 + j]) {
+ if (args.outExponent != arrayOutExponent[i * 2 + j]) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -168,12 +168,12 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outIptr: ");
- message.append(String.format("%d", args.outIptr));
+ message.append("Expected output outExponent: ");
+ message.append(String.format("%d", args.outExponent));
message.append("\n");
- message.append("Actual output outIptr: ");
- message.append(String.format("%d", arrayOutIptr[i * 2 + j]));
- if (args.outIptr != arrayOutIptr[i * 2 + j]) {
+ message.append("Actual output outExponent: ");
+ message.append(String.format("%d", arrayOutExponent[i * 2 + j]));
+ if (args.outExponent != arrayOutExponent[i * 2 + j]) {
message.append(" FAIL");
}
message.append("\n");
@@ -197,30 +197,30 @@
private void checkFrexpFloat3Int3Float3() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2afb1f097eb0e3bal, false);
try {
- Allocation outIptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
+ Allocation outExponent = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocOutIptr(outIptr);
+ script.set_gAllocOutExponent(outExponent);
script.forEach_testFrexpFloat3Int3Float3(inV, out);
- verifyResultsFrexpFloat3Int3Float3(inV, outIptr, out, false);
+ verifyResultsFrexpFloat3Int3Float3(inV, outExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFrexpFloat3Int3Float3: " + e.toString());
}
try {
- Allocation outIptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
+ Allocation outExponent = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocOutIptr(outIptr);
+ scriptRelaxed.set_gAllocOutExponent(outExponent);
scriptRelaxed.forEach_testFrexpFloat3Int3Float3(inV, out);
- verifyResultsFrexpFloat3Int3Float3(inV, outIptr, out, true);
+ verifyResultsFrexpFloat3Int3Float3(inV, outExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFrexpFloat3Int3Float3: " + e.toString());
}
}
- private void verifyResultsFrexpFloat3Int3Float3(Allocation inV, Allocation outIptr, Allocation out, boolean relaxed) {
+ private void verifyResultsFrexpFloat3Int3Float3(Allocation inV, Allocation outExponent, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
- int[] arrayOutIptr = new int[INPUTSIZE * 4];
- outIptr.copyTo(arrayOutIptr);
+ int[] arrayOutExponent = new int[INPUTSIZE * 4];
+ outExponent.copyTo(arrayOutExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -233,7 +233,7 @@
CoreMathVerifier.computeFrexp(args, target);
// Validate the outputs.
boolean valid = true;
- if (args.outIptr != arrayOutIptr[i * 4 + j]) {
+ if (args.outExponent != arrayOutExponent[i * 4 + j]) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -245,12 +245,12 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outIptr: ");
- message.append(String.format("%d", args.outIptr));
+ message.append("Expected output outExponent: ");
+ message.append(String.format("%d", args.outExponent));
message.append("\n");
- message.append("Actual output outIptr: ");
- message.append(String.format("%d", arrayOutIptr[i * 4 + j]));
- if (args.outIptr != arrayOutIptr[i * 4 + j]) {
+ message.append("Actual output outExponent: ");
+ message.append(String.format("%d", arrayOutExponent[i * 4 + j]));
+ if (args.outExponent != arrayOutExponent[i * 4 + j]) {
message.append(" FAIL");
}
message.append("\n");
@@ -274,30 +274,30 @@
private void checkFrexpFloat4Int4Float4() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x50b15d6c74635073l, false);
try {
- Allocation outIptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
+ Allocation outExponent = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocOutIptr(outIptr);
+ script.set_gAllocOutExponent(outExponent);
script.forEach_testFrexpFloat4Int4Float4(inV, out);
- verifyResultsFrexpFloat4Int4Float4(inV, outIptr, out, false);
+ verifyResultsFrexpFloat4Int4Float4(inV, outExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFrexpFloat4Int4Float4: " + e.toString());
}
try {
- Allocation outIptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
+ Allocation outExponent = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocOutIptr(outIptr);
+ scriptRelaxed.set_gAllocOutExponent(outExponent);
scriptRelaxed.forEach_testFrexpFloat4Int4Float4(inV, out);
- verifyResultsFrexpFloat4Int4Float4(inV, outIptr, out, true);
+ verifyResultsFrexpFloat4Int4Float4(inV, outExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFrexpFloat4Int4Float4: " + e.toString());
}
}
- private void verifyResultsFrexpFloat4Int4Float4(Allocation inV, Allocation outIptr, Allocation out, boolean relaxed) {
+ private void verifyResultsFrexpFloat4Int4Float4(Allocation inV, Allocation outExponent, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
- int[] arrayOutIptr = new int[INPUTSIZE * 4];
- outIptr.copyTo(arrayOutIptr);
+ int[] arrayOutExponent = new int[INPUTSIZE * 4];
+ outExponent.copyTo(arrayOutExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -310,7 +310,7 @@
CoreMathVerifier.computeFrexp(args, target);
// Validate the outputs.
boolean valid = true;
- if (args.outIptr != arrayOutIptr[i * 4 + j]) {
+ if (args.outExponent != arrayOutExponent[i * 4 + j]) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -322,12 +322,12 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outIptr: ");
- message.append(String.format("%d", args.outIptr));
+ message.append("Expected output outExponent: ");
+ message.append(String.format("%d", args.outExponent));
message.append("\n");
- message.append("Actual output outIptr: ");
- message.append(String.format("%d", arrayOutIptr[i * 4 + j]));
- if (args.outIptr != arrayOutIptr[i * 4 + j]) {
+ message.append("Actual output outExponent: ");
+ message.append(String.format("%d", arrayOutExponent[i * 4 + j]));
+ if (args.outExponent != arrayOutExponent[i * 4 + j]) {
message.append(" FAIL");
}
message.append("\n");
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFrexp.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFrexp.rs
similarity index 68%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestFrexp.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFrexp.rs
index 70c6c13..7193fe6 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFrexp.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFrexp.rs
@@ -19,32 +19,32 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocOutIptr;
+rs_allocation gAllocOutExponent;
float __attribute__((kernel)) testFrexpFloatIntFloat(float inV, unsigned int x) {
- int outIptr = 0;
- float out = frexp(inV, &outIptr);
- rsSetElementAt_int(gAllocOutIptr, outIptr, x);
+ int outExponent = 0;
+ float out = frexp(inV, &outExponent);
+ rsSetElementAt_int(gAllocOutExponent, outExponent, x);
return out;
}
float2 __attribute__((kernel)) testFrexpFloat2Int2Float2(float2 inV, unsigned int x) {
- int2 outIptr = 0;
- float2 out = frexp(inV, &outIptr);
- rsSetElementAt_int2(gAllocOutIptr, outIptr, x);
+ int2 outExponent = 0;
+ float2 out = frexp(inV, &outExponent);
+ rsSetElementAt_int2(gAllocOutExponent, outExponent, x);
return out;
}
float3 __attribute__((kernel)) testFrexpFloat3Int3Float3(float3 inV, unsigned int x) {
- int3 outIptr = 0;
- float3 out = frexp(inV, &outIptr);
- rsSetElementAt_int3(gAllocOutIptr, outIptr, x);
+ int3 outExponent = 0;
+ float3 out = frexp(inV, &outExponent);
+ rsSetElementAt_int3(gAllocOutExponent, outExponent, x);
return out;
}
float4 __attribute__((kernel)) testFrexpFloat4Int4Float4(float4 inV, unsigned int x) {
- int4 outIptr = 0;
- float4 out = frexp(inV, &outIptr);
- rsSetElementAt_int4(gAllocOutIptr, outIptr, x);
+ int4 outExponent = 0;
+ float4 out = frexp(inV, &outExponent);
+ rsSetElementAt_int4(gAllocOutExponent, outExponent, x);
return out;
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFrexpRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFrexpRelaxed.rs
index 66f3fef..0655077 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestFrexpRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestFrexp.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfRecip.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRecip.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestHalfRecip.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRecip.java
index 8d4f1b7..5648d96 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfRecip.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRecip.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestHalfRecip extends RSBaseCompute {
+public class GeneratedTestHalfRecip extends RSBaseCompute {
- private ScriptC_TestHalfRecip script;
- private ScriptC_TestHalfRecipRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestHalfRecip script;
+ private ScriptC_GeneratedTestHalfRecipRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestHalfRecip(mRS);
- scriptRelaxed = new ScriptC_TestHalfRecipRelaxed(mRS);
+ script = new ScriptC_GeneratedTestHalfRecip(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestHalfRecipRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfRecip.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRecip.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestHalfRecip.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRecip.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfRecipRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRecipRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestHalfRecipRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRecipRelaxed.rs
index da453fa..3278236 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfRecipRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRecipRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestHalfRecip.rs"
+#include "GeneratedTestHalfRecip.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfRsqrt.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRsqrt.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestHalfRsqrt.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRsqrt.java
index 5cd4e90..ac3a7d9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfRsqrt.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRsqrt.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestHalfRsqrt extends RSBaseCompute {
+public class GeneratedTestHalfRsqrt extends RSBaseCompute {
- private ScriptC_TestHalfRsqrt script;
- private ScriptC_TestHalfRsqrtRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestHalfRsqrt script;
+ private ScriptC_GeneratedTestHalfRsqrtRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestHalfRsqrt(mRS);
- scriptRelaxed = new ScriptC_TestHalfRsqrtRelaxed(mRS);
+ script = new ScriptC_GeneratedTestHalfRsqrt(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestHalfRsqrtRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfRsqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRsqrt.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestHalfRsqrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRsqrt.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfRsqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRsqrtRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestHalfRsqrtRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRsqrtRelaxed.rs
index 4f94200..d2fd430 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfRsqrtRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfRsqrtRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestHalfRsqrt.rs"
+#include "GeneratedTestHalfRsqrt.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfSqrt.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfSqrt.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestHalfSqrt.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfSqrt.java
index b57291d..ee7ae11 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfSqrt.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfSqrt.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestHalfSqrt extends RSBaseCompute {
+public class GeneratedTestHalfSqrt extends RSBaseCompute {
- private ScriptC_TestHalfSqrt script;
- private ScriptC_TestHalfSqrtRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestHalfSqrt script;
+ private ScriptC_GeneratedTestHalfSqrtRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestHalfSqrt(mRS);
- scriptRelaxed = new ScriptC_TestHalfSqrtRelaxed(mRS);
+ script = new ScriptC_GeneratedTestHalfSqrt(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestHalfSqrtRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfSqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfSqrt.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestHalfSqrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfSqrt.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfSqrtRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestSqrtRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfSqrtRelaxed.rs
index ee5b6a8..b3dd234 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSqrtRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHalfSqrtRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestSqrt.rs"
+#include "GeneratedTestHalfSqrt.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFdim.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHypot.java
similarity index 77%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestFdim.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHypot.java
index bbe1e7a..006562f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFdim.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHypot.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestFdim extends RSBaseCompute {
+public class GeneratedTestHypot extends RSBaseCompute {
- private ScriptC_TestFdim script;
- private ScriptC_TestFdimRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestHypot script;
+ private ScriptC_GeneratedTestHypotRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestFdim(mRS);
- scriptRelaxed = new ScriptC_TestFdimRelaxed(mRS);
+ script = new ScriptC_GeneratedTestHypot(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestHypotRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
@@ -40,28 +40,28 @@
public Target.Floaty out;
}
- private void checkFdimFloatFloatFloat() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf5dd38fbc3a47366l, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf5dd38fbc3a47367l, false);
+ private void checkHypotFloatFloatFloat() {
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x7deb65e7738c74c4l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x7deb65e7738c74c5l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
script.set_gAllocInB(inB);
- script.forEach_testFdimFloatFloatFloat(inA, out);
- verifyResultsFdimFloatFloatFloat(inA, inB, out, false);
+ script.forEach_testHypotFloatFloatFloat(inA, out);
+ verifyResultsHypotFloatFloatFloat(inA, inB, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloatFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.forEach_testFdimFloatFloatFloat(inA, out);
- verifyResultsFdimFloatFloatFloat(inA, inB, out, true);
+ scriptRelaxed.forEach_testHypotFloatFloatFloat(inA, out);
+ verifyResultsHypotFloatFloatFloat(inA, inB, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloatFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsFdimFloatFloatFloat(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ private void verifyResultsHypotFloatFloatFloat(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
float[] arrayInA = new float[INPUTSIZE * 1];
inA.copyTo(arrayInA);
float[] arrayInB = new float[INPUTSIZE * 1];
@@ -76,7 +76,7 @@
args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeFdim(args, target);
+ CoreMathVerifier.computeHypot(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -102,35 +102,35 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkFdimFloatFloatFloat" +
+ assertTrue("Incorrect output for checkHypotFloatFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkFdimFloat2Float2Float2() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xca6a96c16f167f4cl, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xca6a96c16f167f4dl, false);
+ private void checkHypotFloat2Float2Float2() {
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x14f3c91a62f71c46l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x14f3c91a62f71c47l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
script.set_gAllocInB(inB);
- script.forEach_testFdimFloat2Float2Float2(inA, out);
- verifyResultsFdimFloat2Float2Float2(inA, inB, out, false);
+ script.forEach_testHypotFloat2Float2Float2(inA, out);
+ verifyResultsHypotFloat2Float2Float2(inA, inB, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat2Float2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.forEach_testFdimFloat2Float2Float2(inA, out);
- verifyResultsFdimFloat2Float2Float2(inA, inB, out, true);
+ scriptRelaxed.forEach_testHypotFloat2Float2Float2(inA, out);
+ verifyResultsHypotFloat2Float2Float2(inA, inB, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat2Float2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsFdimFloat2Float2Float2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ private void verifyResultsHypotFloat2Float2Float2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
float[] arrayInA = new float[INPUTSIZE * 2];
inA.copyTo(arrayInA);
float[] arrayInB = new float[INPUTSIZE * 2];
@@ -145,7 +145,7 @@
args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeFdim(args, target);
+ CoreMathVerifier.computeHypot(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -171,35 +171,35 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkFdimFloat2Float2Float2" +
+ assertTrue("Incorrect output for checkHypotFloat2Float2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkFdimFloat3Float3Float3() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1ecf74e170f480edl, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1ecf74e170f480eel, false);
+ private void checkHypotFloat3Float3Float3() {
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6958a73a64d51de7l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6958a73a64d51de8l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
script.set_gAllocInB(inB);
- script.forEach_testFdimFloat3Float3Float3(inA, out);
- verifyResultsFdimFloat3Float3Float3(inA, inB, out, false);
+ script.forEach_testHypotFloat3Float3Float3(inA, out);
+ verifyResultsHypotFloat3Float3Float3(inA, inB, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat3Float3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.forEach_testFdimFloat3Float3Float3(inA, out);
- verifyResultsFdimFloat3Float3Float3(inA, inB, out, true);
+ scriptRelaxed.forEach_testHypotFloat3Float3Float3(inA, out);
+ verifyResultsHypotFloat3Float3Float3(inA, inB, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat3Float3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsFdimFloat3Float3Float3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ private void verifyResultsHypotFloat3Float3Float3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
float[] arrayInA = new float[INPUTSIZE * 4];
inA.copyTo(arrayInA);
float[] arrayInB = new float[INPUTSIZE * 4];
@@ -214,7 +214,7 @@
args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeFdim(args, target);
+ CoreMathVerifier.computeHypot(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -240,35 +240,35 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkFdimFloat3Float3Float3" +
+ assertTrue("Incorrect output for checkHypotFloat3Float3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkFdimFloat4Float4Float4() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x7334530172d2828el, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x7334530172d2828fl, false);
+ private void checkHypotFloat4Float4Float4() {
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbdbd855a66b31f88l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbdbd855a66b31f89l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
script.set_gAllocInB(inB);
- script.forEach_testFdimFloat4Float4Float4(inA, out);
- verifyResultsFdimFloat4Float4Float4(inA, inB, out, false);
+ script.forEach_testHypotFloat4Float4Float4(inA, out);
+ verifyResultsHypotFloat4Float4Float4(inA, inB, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat4Float4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.forEach_testFdimFloat4Float4Float4(inA, out);
- verifyResultsFdimFloat4Float4Float4(inA, inB, out, true);
+ scriptRelaxed.forEach_testHypotFloat4Float4Float4(inA, out);
+ verifyResultsHypotFloat4Float4Float4(inA, inB, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat4Float4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsFdimFloat4Float4Float4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ private void verifyResultsHypotFloat4Float4Float4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
float[] arrayInA = new float[INPUTSIZE * 4];
inA.copyTo(arrayInA);
float[] arrayInB = new float[INPUTSIZE * 4];
@@ -283,7 +283,7 @@
args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeFdim(args, target);
+ CoreMathVerifier.computeHypot(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -309,17 +309,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkFdimFloat4Float4Float4" +
+ assertTrue("Incorrect output for checkHypotFloat4Float4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testFdim() {
- checkFdimFloatFloatFloat();
- checkFdimFloat2Float2Float2();
- checkFdimFloat3Float3Float3();
- checkFdimFloat4Float4Float4();
+ public void testHypot() {
+ checkHypotFloatFloatFloat();
+ checkHypotFloat2Float2Float2();
+ checkHypotFloat3Float3Float3();
+ checkHypotFloat4Float4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHypot.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHypot.rs
similarity index 67%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestHypot.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHypot.rs
index 9425121..655344c 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestHypot.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHypot.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInY;
+rs_allocation gAllocInB;
-float __attribute__((kernel)) testHypotFloatFloatFloat(float inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return hypot(inX, inY);
+float __attribute__((kernel)) testHypotFloatFloatFloat(float inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return hypot(inA, inB);
}
-float2 __attribute__((kernel)) testHypotFloat2Float2Float2(float2 inX, unsigned int x) {
- float2 inY = rsGetElementAt_float2(gAllocInY, x);
- return hypot(inX, inY);
+float2 __attribute__((kernel)) testHypotFloat2Float2Float2(float2 inA, unsigned int x) {
+ float2 inB = rsGetElementAt_float2(gAllocInB, x);
+ return hypot(inA, inB);
}
-float3 __attribute__((kernel)) testHypotFloat3Float3Float3(float3 inX, unsigned int x) {
- float3 inY = rsGetElementAt_float3(gAllocInY, x);
- return hypot(inX, inY);
+float3 __attribute__((kernel)) testHypotFloat3Float3Float3(float3 inA, unsigned int x) {
+ float3 inB = rsGetElementAt_float3(gAllocInB, x);
+ return hypot(inA, inB);
}
-float4 __attribute__((kernel)) testHypotFloat4Float4Float4(float4 inX, unsigned int x) {
- float4 inY = rsGetElementAt_float4(gAllocInY, x);
- return hypot(inX, inY);
+float4 __attribute__((kernel)) testHypotFloat4Float4Float4(float4 inA, unsigned int x) {
+ float4 inB = rsGetElementAt_float4(gAllocInB, x);
+ return hypot(inA, inB);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHypotRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHypotRelaxed.rs
index 66f3fef..c026536 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestHypotRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestHypot.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestIlogb.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestIlogb.java
similarity index 72%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestIlogb.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestIlogb.java
index 9bac16f..dd72973 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestIlogb.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestIlogb.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestIlogb extends RSBaseCompute {
+public class GeneratedTestIlogb extends RSBaseCompute {
- private ScriptC_TestIlogb script;
- private ScriptC_TestIlogbRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestIlogb script;
+ private ScriptC_GeneratedTestIlogbRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestIlogb(mRS);
- scriptRelaxed = new ScriptC_TestIlogbRelaxed(mRS);
+ script = new ScriptC_GeneratedTestIlogb(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestIlogbRelaxed(mRS);
}
public class ArgumentsFloatInt {
- public float in;
+ public float inV;
public int out;
}
private void checkIlogbFloatInt() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xc0c48da27f084aefl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x6103ca4b5664967bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
- script.forEach_testIlogbFloatInt(in, out);
- verifyResultsIlogbFloatInt(in, out, false);
+ script.forEach_testIlogbFloatInt(inV, out);
+ verifyResultsIlogbFloatInt(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testIlogbFloatInt: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testIlogbFloatInt(in, out);
- verifyResultsIlogbFloatInt(in, out, true);
+ scriptRelaxed.forEach_testIlogbFloatInt(inV, out);
+ verifyResultsIlogbFloatInt(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testIlogbFloatInt: " + e.toString());
}
}
- private void verifyResultsIlogbFloatInt(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsIlogbFloatInt(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
int[] arrayOut = new int[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatInt args = new ArgumentsFloatInt();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Extract the outputs.
args.out = arrayOut[i * 1 + j];
// Ask the CoreMathVerifier to validate.
@@ -74,9 +74,9 @@
boolean valid = errorMessage == null;
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Output out: ");
message.append(String.format("%d", args.out));
@@ -90,33 +90,33 @@
}
private void checkIlogbFloat2Int2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x4ba2fa846382ada1l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xb460143cb6f32a61l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
- script.forEach_testIlogbFloat2Int2(in, out);
- verifyResultsIlogbFloat2Int2(in, out, false);
+ script.forEach_testIlogbFloat2Int2(inV, out);
+ verifyResultsIlogbFloat2Int2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testIlogbFloat2Int2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testIlogbFloat2Int2(in, out);
- verifyResultsIlogbFloat2Int2(in, out, true);
+ scriptRelaxed.forEach_testIlogbFloat2Int2(inV, out);
+ verifyResultsIlogbFloat2Int2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testIlogbFloat2Int2: " + e.toString());
}
}
- private void verifyResultsIlogbFloat2Int2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsIlogbFloat2Int2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
int[] arrayOut = new int[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatInt args = new ArgumentsFloatInt();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Extract the outputs.
args.out = arrayOut[i * 2 + j];
// Ask the CoreMathVerifier to validate.
@@ -124,9 +124,9 @@
boolean valid = errorMessage == null;
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Output out: ");
message.append(String.format("%d", args.out));
@@ -140,33 +140,33 @@
}
private void checkIlogbFloat3Int3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x4ba2fa85dc4b0d43l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xb460147c009b3a97l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
- script.forEach_testIlogbFloat3Int3(in, out);
- verifyResultsIlogbFloat3Int3(in, out, false);
+ script.forEach_testIlogbFloat3Int3(inV, out);
+ verifyResultsIlogbFloat3Int3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testIlogbFloat3Int3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testIlogbFloat3Int3(in, out);
- verifyResultsIlogbFloat3Int3(in, out, true);
+ scriptRelaxed.forEach_testIlogbFloat3Int3(inV, out);
+ verifyResultsIlogbFloat3Int3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testIlogbFloat3Int3: " + e.toString());
}
}
- private void verifyResultsIlogbFloat3Int3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsIlogbFloat3Int3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatInt args = new ArgumentsFloatInt();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Extract the outputs.
args.out = arrayOut[i * 4 + j];
// Ask the CoreMathVerifier to validate.
@@ -174,9 +174,9 @@
boolean valid = errorMessage == null;
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Output out: ");
message.append(String.format("%d", args.out));
@@ -190,33 +190,33 @@
}
private void checkIlogbFloat4Int4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x4ba2fa8755136ce5l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xb46014bb4a434acdl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
- script.forEach_testIlogbFloat4Int4(in, out);
- verifyResultsIlogbFloat4Int4(in, out, false);
+ script.forEach_testIlogbFloat4Int4(inV, out);
+ verifyResultsIlogbFloat4Int4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testIlogbFloat4Int4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testIlogbFloat4Int4(in, out);
- verifyResultsIlogbFloat4Int4(in, out, true);
+ scriptRelaxed.forEach_testIlogbFloat4Int4(inV, out);
+ verifyResultsIlogbFloat4Int4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testIlogbFloat4Int4: " + e.toString());
}
}
- private void verifyResultsIlogbFloat4Int4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsIlogbFloat4Int4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatInt args = new ArgumentsFloatInt();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Extract the outputs.
args.out = arrayOut[i * 4 + j];
// Ask the CoreMathVerifier to validate.
@@ -224,9 +224,9 @@
boolean valid = errorMessage == null;
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Output out: ");
message.append(String.format("%d", args.out));
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestIlogb.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestIlogb.rs
index 1024943..fbc070d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestIlogb.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+int __attribute__((kernel)) testIlogbFloatInt(float inV) {
+ return ilogb(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+int2 __attribute__((kernel)) testIlogbFloat2Int2(float2 inV) {
+ return ilogb(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+int3 __attribute__((kernel)) testIlogbFloat3Int3(float3 inV) {
+ return ilogb(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+int4 __attribute__((kernel)) testIlogbFloat4Int4(float4 inV) {
+ return ilogb(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestIlogbRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestIlogbRelaxed.rs
index 66f3fef..4b1ea2d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestIlogbRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestIlogb.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLdexp.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLdexp.java
similarity index 65%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestLdexp.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLdexp.java
index 3f3aee9..6ac13b7 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLdexp.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLdexp.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestLdexp extends RSBaseCompute {
+public class GeneratedTestLdexp extends RSBaseCompute {
- private ScriptC_TestLdexp script;
- private ScriptC_TestLdexpRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestLdexp script;
+ private ScriptC_GeneratedTestLdexpRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestLdexp(mRS);
- scriptRelaxed = new ScriptC_TestLdexpRelaxed(mRS);
+ script = new ScriptC_GeneratedTestLdexp(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestLdexpRelaxed(mRS);
}
public class ArgumentsFloatIntFloat {
- public float inX;
- public int inY;
+ public float inMantissa;
+ public int inExponent;
public Target.Floaty out;
}
private void checkLdexpFloatIntFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xdeada0999238fe8bl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0xdeada0999238fe8cl, false);
+ Allocation inMantissa = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xdffd225490f0e26fl, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0xdffd207c2e4133c4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testLdexpFloatIntFloat(inX, out);
- verifyResultsLdexpFloatIntFloat(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testLdexpFloatIntFloat(inMantissa, out);
+ verifyResultsLdexpFloatIntFloat(inMantissa, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloatIntFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testLdexpFloatIntFloat(inX, out);
- verifyResultsLdexpFloatIntFloat(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testLdexpFloatIntFloat(inMantissa, out);
+ verifyResultsLdexpFloatIntFloat(inMantissa, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloatIntFloat: " + e.toString());
}
}
- private void verifyResultsLdexpFloatIntFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- int[] arrayInY = new int[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsLdexpFloatIntFloat(Allocation inMantissa, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInMantissa = new float[INPUTSIZE * 1];
+ inMantissa.copyTo(arrayInMantissa);
+ int[] arrayInExponent = new int[INPUTSIZE * 1];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
+ args.inMantissa = arrayInMantissa[i];
+ args.inExponent = arrayInExponent[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeLdexp(args, target);
@@ -84,12 +84,12 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inMantissa: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inMantissa, Float.floatToRawIntBits(args.inMantissa), args.inMantissa));
message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%d", args.inY));
+ message.append("Input inExponent: ");
+ message.append(String.format("%d", args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -109,39 +109,39 @@
}
private void checkLdexpFloat2Int2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x5492762140d0ca17l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0x5492762140d0ca18l, false);
+ Allocation inMantissa = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x7d0b1a44fe92893l, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0x7d0afcbed3979e8l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testLdexpFloat2Int2Float2(inX, out);
- verifyResultsLdexpFloat2Int2Float2(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testLdexpFloat2Int2Float2(inMantissa, out);
+ verifyResultsLdexpFloat2Int2Float2(inMantissa, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat2Int2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testLdexpFloat2Int2Float2(inX, out);
- verifyResultsLdexpFloat2Int2Float2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testLdexpFloat2Int2Float2(inMantissa, out);
+ verifyResultsLdexpFloat2Int2Float2(inMantissa, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat2Int2Float2: " + e.toString());
}
}
- private void verifyResultsLdexpFloat2Int2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- int[] arrayInY = new int[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
+ private void verifyResultsLdexpFloat2Int2Float2(Allocation inMantissa, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInMantissa = new float[INPUTSIZE * 2];
+ inMantissa.copyTo(arrayInMantissa);
+ int[] arrayInExponent = new int[INPUTSIZE * 2];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
+ args.inMantissa = arrayInMantissa[i * 2 + j];
+ args.inExponent = arrayInExponent[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeLdexp(args, target);
@@ -152,12 +152,12 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inMantissa: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inMantissa, Float.floatToRawIntBits(args.inMantissa), args.inMantissa));
message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%d", args.inY));
+ message.append("Input inExponent: ");
+ message.append(String.format("%d", args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -177,39 +177,39 @@
}
private void checkLdexpFloat3Int3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x7a48b484368336d0l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0x7a48b484368336d1l, false);
+ Allocation inMantissa = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xa8e041253fa3335el, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0xa8e03f4cdcf384b3l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testLdexpFloat3Int3Float3(inX, out);
- verifyResultsLdexpFloat3Int3Float3(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testLdexpFloat3Int3Float3(inMantissa, out);
+ verifyResultsLdexpFloat3Int3Float3(inMantissa, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat3Int3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testLdexpFloat3Int3Float3(inX, out);
- verifyResultsLdexpFloat3Int3Float3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testLdexpFloat3Int3Float3(inMantissa, out);
+ verifyResultsLdexpFloat3Int3Float3(inMantissa, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat3Int3Float3: " + e.toString());
}
}
- private void verifyResultsLdexpFloat3Int3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- int[] arrayInY = new int[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsLdexpFloat3Int3Float3(Allocation inMantissa, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInMantissa = new float[INPUTSIZE * 4];
+ inMantissa.copyTo(arrayInMantissa);
+ int[] arrayInExponent = new int[INPUTSIZE * 4];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inMantissa = arrayInMantissa[i * 4 + j];
+ args.inExponent = arrayInExponent[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeLdexp(args, target);
@@ -220,12 +220,12 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inMantissa: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inMantissa, Float.floatToRawIntBits(args.inMantissa), args.inMantissa));
message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%d", args.inY));
+ message.append("Input inExponent: ");
+ message.append(String.format("%d", args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -245,39 +245,39 @@
}
private void checkLdexpFloat4Int4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x9ffef2e72c35a389l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0x9ffef2e72c35a38al, false);
+ Allocation inMantissa = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x49efd0a62f5d3e29l, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0x49efcecdccad8f7el, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testLdexpFloat4Int4Float4(inX, out);
- verifyResultsLdexpFloat4Int4Float4(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testLdexpFloat4Int4Float4(inMantissa, out);
+ verifyResultsLdexpFloat4Int4Float4(inMantissa, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat4Int4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testLdexpFloat4Int4Float4(inX, out);
- verifyResultsLdexpFloat4Int4Float4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testLdexpFloat4Int4Float4(inMantissa, out);
+ verifyResultsLdexpFloat4Int4Float4(inMantissa, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat4Int4Float4: " + e.toString());
}
}
- private void verifyResultsLdexpFloat4Int4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- int[] arrayInY = new int[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsLdexpFloat4Int4Float4(Allocation inMantissa, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInMantissa = new float[INPUTSIZE * 4];
+ inMantissa.copyTo(arrayInMantissa);
+ int[] arrayInExponent = new int[INPUTSIZE * 4];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inMantissa = arrayInMantissa[i * 4 + j];
+ args.inExponent = arrayInExponent[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeLdexp(args, target);
@@ -288,12 +288,12 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inMantissa: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inMantissa, Float.floatToRawIntBits(args.inMantissa), args.inMantissa));
message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%d", args.inY));
+ message.append("Input inExponent: ");
+ message.append(String.format("%d", args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -313,39 +313,39 @@
}
private void checkLdexpFloat2IntFloat2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xa2b6e0c39777b8c1l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0xa2b6e0c39777b8c2l, false);
+ Allocation inMantissa = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x6a72b89838bd38d1l, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0x6a72b6bfd60d8a26l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testLdexpFloat2IntFloat2(inX, out);
- verifyResultsLdexpFloat2IntFloat2(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testLdexpFloat2IntFloat2(inMantissa, out);
+ verifyResultsLdexpFloat2IntFloat2(inMantissa, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat2IntFloat2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testLdexpFloat2IntFloat2(inX, out);
- verifyResultsLdexpFloat2IntFloat2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testLdexpFloat2IntFloat2(inMantissa, out);
+ verifyResultsLdexpFloat2IntFloat2(inMantissa, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat2IntFloat2: " + e.toString());
}
}
- private void verifyResultsLdexpFloat2IntFloat2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- int[] arrayInY = new int[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsLdexpFloat2IntFloat2(Allocation inMantissa, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInMantissa = new float[INPUTSIZE * 2];
+ inMantissa.copyTo(arrayInMantissa);
+ int[] arrayInExponent = new int[INPUTSIZE * 1];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i];
+ args.inMantissa = arrayInMantissa[i * 2 + j];
+ args.inExponent = arrayInExponent[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeLdexp(args, target);
@@ -356,12 +356,12 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inMantissa: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inMantissa, Float.floatToRawIntBits(args.inMantissa), args.inMantissa));
message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%d", args.inY));
+ message.append("Input inExponent: ");
+ message.append(String.format("%d", args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -381,39 +381,39 @@
}
private void checkLdexpFloat3IntFloat3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xcd4401424a114a65l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0xcd4401424a114a66l, false);
+ Allocation inMantissa = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x49ba40205150f83dl, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0x49ba3e47eea14992l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testLdexpFloat3IntFloat3(inX, out);
- verifyResultsLdexpFloat3IntFloat3(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testLdexpFloat3IntFloat3(inMantissa, out);
+ verifyResultsLdexpFloat3IntFloat3(inMantissa, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat3IntFloat3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testLdexpFloat3IntFloat3(inX, out);
- verifyResultsLdexpFloat3IntFloat3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testLdexpFloat3IntFloat3(inMantissa, out);
+ verifyResultsLdexpFloat3IntFloat3(inMantissa, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat3IntFloat3: " + e.toString());
}
}
- private void verifyResultsLdexpFloat3IntFloat3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- int[] arrayInY = new int[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsLdexpFloat3IntFloat3(Allocation inMantissa, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInMantissa = new float[INPUTSIZE * 4];
+ inMantissa.copyTo(arrayInMantissa);
+ int[] arrayInExponent = new int[INPUTSIZE * 1];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i];
+ args.inMantissa = arrayInMantissa[i * 4 + j];
+ args.inExponent = arrayInExponent[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeLdexp(args, target);
@@ -424,12 +424,12 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inMantissa: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inMantissa, Float.floatToRawIntBits(args.inMantissa), args.inMantissa));
message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%d", args.inY));
+ message.append("Input inExponent: ");
+ message.append(String.format("%d", args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -449,39 +449,39 @@
}
private void checkLdexpFloat4IntFloat4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf7d121c0fcaadc09l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0xf7d121c0fcaadc0al, false);
+ Allocation inMantissa = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2901c7a869e4b7a9l, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0x2901c5d0073508fel, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testLdexpFloat4IntFloat4(inX, out);
- verifyResultsLdexpFloat4IntFloat4(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testLdexpFloat4IntFloat4(inMantissa, out);
+ verifyResultsLdexpFloat4IntFloat4(inMantissa, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat4IntFloat4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testLdexpFloat4IntFloat4(inX, out);
- verifyResultsLdexpFloat4IntFloat4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testLdexpFloat4IntFloat4(inMantissa, out);
+ verifyResultsLdexpFloat4IntFloat4(inMantissa, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLdexpFloat4IntFloat4: " + e.toString());
}
}
- private void verifyResultsLdexpFloat4IntFloat4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- int[] arrayInY = new int[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsLdexpFloat4IntFloat4(Allocation inMantissa, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInMantissa = new float[INPUTSIZE * 4];
+ inMantissa.copyTo(arrayInMantissa);
+ int[] arrayInExponent = new int[INPUTSIZE * 1];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i];
+ args.inMantissa = arrayInMantissa[i * 4 + j];
+ args.inExponent = arrayInExponent[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeLdexp(args, target);
@@ -492,12 +492,12 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inMantissa: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inMantissa, Float.floatToRawIntBits(args.inMantissa), args.inMantissa));
message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%d", args.inY));
+ message.append("Input inExponent: ");
+ message.append(String.format("%d", args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLdexp.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLdexp.rs
new file mode 100644
index 0000000..b08dee7
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLdexp.rs
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInExponent;
+
+float __attribute__((kernel)) testLdexpFloatIntFloat(float inMantissa, unsigned int x) {
+ int inExponent = rsGetElementAt_int(gAllocInExponent, x);
+ return ldexp(inMantissa, inExponent);
+}
+
+float2 __attribute__((kernel)) testLdexpFloat2Int2Float2(float2 inMantissa, unsigned int x) {
+ int2 inExponent = rsGetElementAt_int2(gAllocInExponent, x);
+ return ldexp(inMantissa, inExponent);
+}
+
+float3 __attribute__((kernel)) testLdexpFloat3Int3Float3(float3 inMantissa, unsigned int x) {
+ int3 inExponent = rsGetElementAt_int3(gAllocInExponent, x);
+ return ldexp(inMantissa, inExponent);
+}
+
+float4 __attribute__((kernel)) testLdexpFloat4Int4Float4(float4 inMantissa, unsigned int x) {
+ int4 inExponent = rsGetElementAt_int4(gAllocInExponent, x);
+ return ldexp(inMantissa, inExponent);
+}
+
+float2 __attribute__((kernel)) testLdexpFloat2IntFloat2(float2 inMantissa, unsigned int x) {
+ int inExponent = rsGetElementAt_int(gAllocInExponent, x);
+ return ldexp(inMantissa, inExponent);
+}
+
+float3 __attribute__((kernel)) testLdexpFloat3IntFloat3(float3 inMantissa, unsigned int x) {
+ int inExponent = rsGetElementAt_int(gAllocInExponent, x);
+ return ldexp(inMantissa, inExponent);
+}
+
+float4 __attribute__((kernel)) testLdexpFloat4IntFloat4(float4 inMantissa, unsigned int x) {
+ int inExponent = rsGetElementAt_int(gAllocInExponent, x);
+ return ldexp(inMantissa, inExponent);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLdexpRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLdexpRelaxed.rs
index 66f3fef..86d0ee0 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLdexpRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestLdexp.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLength.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLength.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestLength.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLength.java
index 2d89536..30a9ed5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLength.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLength.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestLength extends RSBaseCompute {
+public class GeneratedTestLength extends RSBaseCompute {
- private ScriptC_TestLength script;
- private ScriptC_TestLengthRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestLength script;
+ private ScriptC_GeneratedTestLengthRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestLength(mRS);
- scriptRelaxed = new ScriptC_TestLengthRelaxed(mRS);
+ script = new ScriptC_GeneratedTestLength(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestLengthRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLength.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLength.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestLength.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLength.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLengthRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLengthRelaxed.rs
index 66f3fef..7036a69 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLengthRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestLength.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLgamma.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLgamma.java
similarity index 67%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestLgamma.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLgamma.java
index 113df19..773b92a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLgamma.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLgamma.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestLgamma extends RSBaseCompute {
+public class GeneratedTestLgamma extends RSBaseCompute {
- private ScriptC_TestLgamma script;
- private ScriptC_TestLgammaRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestLgamma script;
+ private ScriptC_GeneratedTestLgammaRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestLgamma(mRS);
- scriptRelaxed = new ScriptC_TestLgammaRelaxed(mRS);
+ script = new ScriptC_GeneratedTestLgamma(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestLgammaRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkLgammaFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe748c67429cab138l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xd9395583050bc4bel, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testLgammaFloatFloat(in, out);
- verifyResultsLgammaFloatFloat(in, out, false);
+ script.forEach_testLgammaFloatFloat(inV, out);
+ verifyResultsLgammaFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testLgammaFloatFloat(in, out);
- verifyResultsLgammaFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testLgammaFloatFloat(inV, out);
+ verifyResultsLgammaFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloatFloat: " + e.toString());
}
}
- private void verifyResultsLgammaFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsLgammaFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeLgamma(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkLgammaFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x7ca07efd8a327894l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xeef55496367a4132l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testLgammaFloat2Float2(in, out);
- verifyResultsLgammaFloat2Float2(in, out, false);
+ script.forEach_testLgammaFloat2Float2(inV, out);
+ verifyResultsLgammaFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testLgammaFloat2Float2(in, out);
- verifyResultsLgammaFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testLgammaFloat2Float2(inV, out);
+ verifyResultsLgammaFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat2Float2: " + e.toString());
}
}
- private void verifyResultsLgammaFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsLgammaFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeLgamma(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkLgammaFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x7ca0899ee9390e2el, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xeef71db12c956210l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testLgammaFloat3Float3(in, out);
- verifyResultsLgammaFloat3Float3(in, out, false);
+ script.forEach_testLgammaFloat3Float3(inV, out);
+ verifyResultsLgammaFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testLgammaFloat3Float3(in, out);
- verifyResultsLgammaFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testLgammaFloat3Float3(inV, out);
+ verifyResultsLgammaFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat3Float3: " + e.toString());
}
}
- private void verifyResultsLgammaFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsLgammaFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeLgamma(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkLgammaFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x7ca09440483fa3c8l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xeef8e6cc22b082eel, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testLgammaFloat4Float4(in, out);
- verifyResultsLgammaFloat4Float4(in, out, false);
+ script.forEach_testLgammaFloat4Float4(inV, out);
+ verifyResultsLgammaFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testLgammaFloat4Float4(in, out);
- verifyResultsLgammaFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testLgammaFloat4Float4(inV, out);
+ verifyResultsLgammaFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat4Float4: " + e.toString());
}
}
- private void verifyResultsLgammaFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsLgammaFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeLgamma(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -276,47 +276,47 @@
}
public class ArgumentsFloatIntFloat {
- public float inX;
- public int outY;
+ public float inV;
+ public int outSignOfGamma;
public float out;
}
private void checkLgammaFloatIntFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2a62d992979c4bb9l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2a62d992979c4bb7l, false);
try {
- Allocation outY = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
+ Allocation outSignOfGamma = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocOutY(outY);
- script.forEach_testLgammaFloatIntFloat(inX, out);
- verifyResultsLgammaFloatIntFloat(inX, outY, out, false);
+ script.set_gAllocOutSignOfGamma(outSignOfGamma);
+ script.forEach_testLgammaFloatIntFloat(inV, out);
+ verifyResultsLgammaFloatIntFloat(inV, outSignOfGamma, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloatIntFloat: " + e.toString());
}
try {
- Allocation outY = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
+ Allocation outSignOfGamma = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocOutY(outY);
- scriptRelaxed.forEach_testLgammaFloatIntFloat(inX, out);
- verifyResultsLgammaFloatIntFloat(inX, outY, out, true);
+ scriptRelaxed.set_gAllocOutSignOfGamma(outSignOfGamma);
+ scriptRelaxed.forEach_testLgammaFloatIntFloat(inV, out);
+ verifyResultsLgammaFloatIntFloat(inV, outSignOfGamma, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloatIntFloat: " + e.toString());
}
}
- private void verifyResultsLgammaFloatIntFloat(Allocation inX, Allocation outY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- int[] arrayOutY = new int[INPUTSIZE * 1];
- outY.copyTo(arrayOutY);
+ private void verifyResultsLgammaFloatIntFloat(Allocation inV, Allocation outSignOfGamma, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
+ int[] arrayOutSignOfGamma = new int[INPUTSIZE * 1];
+ outSignOfGamma.copyTo(arrayOutSignOfGamma);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i];
+ args.inV = arrayInV[i];
// Extract the outputs.
- args.outY = arrayOutY[i * 1 + j];
+ args.outSignOfGamma = arrayOutSignOfGamma[i * 1 + j];
args.out = arrayOut[i * 1 + j];
// Ask the CoreMathVerifier to validate.
Target target = new Target(relaxed);
@@ -324,12 +324,12 @@
boolean valid = errorMessage == null;
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Output outY: ");
- message.append(String.format("%d", args.outY));
+ message.append("Output outSignOfGamma: ");
+ message.append(String.format("%d", args.outSignOfGamma));
message.append("\n");
message.append("Output out: ");
message.append(Float.toString(args.out));
@@ -343,41 +343,41 @@
}
private void checkLgammaFloat2Int2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x409fb9a5984bcf81l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x409fb9a5984bcf7fl, false);
try {
- Allocation outY = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
+ Allocation outSignOfGamma = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocOutY(outY);
- script.forEach_testLgammaFloat2Int2Float2(inX, out);
- verifyResultsLgammaFloat2Int2Float2(inX, outY, out, false);
+ script.set_gAllocOutSignOfGamma(outSignOfGamma);
+ script.forEach_testLgammaFloat2Int2Float2(inV, out);
+ verifyResultsLgammaFloat2Int2Float2(inV, outSignOfGamma, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat2Int2Float2: " + e.toString());
}
try {
- Allocation outY = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
+ Allocation outSignOfGamma = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocOutY(outY);
- scriptRelaxed.forEach_testLgammaFloat2Int2Float2(inX, out);
- verifyResultsLgammaFloat2Int2Float2(inX, outY, out, true);
+ scriptRelaxed.set_gAllocOutSignOfGamma(outSignOfGamma);
+ scriptRelaxed.forEach_testLgammaFloat2Int2Float2(inV, out);
+ verifyResultsLgammaFloat2Int2Float2(inV, outSignOfGamma, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat2Int2Float2: " + e.toString());
}
}
- private void verifyResultsLgammaFloat2Int2Float2(Allocation inX, Allocation outY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- int[] arrayOutY = new int[INPUTSIZE * 2];
- outY.copyTo(arrayOutY);
+ private void verifyResultsLgammaFloat2Int2Float2(Allocation inV, Allocation outSignOfGamma, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
+ int[] arrayOutSignOfGamma = new int[INPUTSIZE * 2];
+ outSignOfGamma.copyTo(arrayOutSignOfGamma);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Extract the outputs.
- args.outY = arrayOutY[i * 2 + j];
+ args.outSignOfGamma = arrayOutSignOfGamma[i * 2 + j];
args.out = arrayOut[i * 2 + j];
// Ask the CoreMathVerifier to validate.
Target target = new Target(relaxed);
@@ -385,12 +385,12 @@
boolean valid = errorMessage == null;
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Output outY: ");
- message.append(String.format("%d", args.outY));
+ message.append("Output outSignOfGamma: ");
+ message.append(String.format("%d", args.outSignOfGamma));
message.append("\n");
message.append("Output out: ");
message.append(Float.toString(args.out));
@@ -404,41 +404,41 @@
}
private void checkLgammaFloat3Int3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6655f8088dfe3c3al, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6655f8088dfe3c38l, false);
try {
- Allocation outY = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
+ Allocation outSignOfGamma = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocOutY(outY);
- script.forEach_testLgammaFloat3Int3Float3(inX, out);
- verifyResultsLgammaFloat3Int3Float3(inX, outY, out, false);
+ script.set_gAllocOutSignOfGamma(outSignOfGamma);
+ script.forEach_testLgammaFloat3Int3Float3(inV, out);
+ verifyResultsLgammaFloat3Int3Float3(inV, outSignOfGamma, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat3Int3Float3: " + e.toString());
}
try {
- Allocation outY = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
+ Allocation outSignOfGamma = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocOutY(outY);
- scriptRelaxed.forEach_testLgammaFloat3Int3Float3(inX, out);
- verifyResultsLgammaFloat3Int3Float3(inX, outY, out, true);
+ scriptRelaxed.set_gAllocOutSignOfGamma(outSignOfGamma);
+ scriptRelaxed.forEach_testLgammaFloat3Int3Float3(inV, out);
+ verifyResultsLgammaFloat3Int3Float3(inV, outSignOfGamma, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat3Int3Float3: " + e.toString());
}
}
- private void verifyResultsLgammaFloat3Int3Float3(Allocation inX, Allocation outY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- int[] arrayOutY = new int[INPUTSIZE * 4];
- outY.copyTo(arrayOutY);
+ private void verifyResultsLgammaFloat3Int3Float3(Allocation inV, Allocation outSignOfGamma, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
+ int[] arrayOutSignOfGamma = new int[INPUTSIZE * 4];
+ outSignOfGamma.copyTo(arrayOutSignOfGamma);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Extract the outputs.
- args.outY = arrayOutY[i * 4 + j];
+ args.outSignOfGamma = arrayOutSignOfGamma[i * 4 + j];
args.out = arrayOut[i * 4 + j];
// Ask the CoreMathVerifier to validate.
Target target = new Target(relaxed);
@@ -446,12 +446,12 @@
boolean valid = errorMessage == null;
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Output outY: ");
- message.append(String.format("%d", args.outY));
+ message.append("Output outSignOfGamma: ");
+ message.append(String.format("%d", args.outSignOfGamma));
message.append("\n");
message.append("Output out: ");
message.append(Float.toString(args.out));
@@ -465,41 +465,41 @@
}
private void checkLgammaFloat4Int4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x8c0c366b83b0a8f3l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x8c0c366b83b0a8f1l, false);
try {
- Allocation outY = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
+ Allocation outSignOfGamma = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocOutY(outY);
- script.forEach_testLgammaFloat4Int4Float4(inX, out);
- verifyResultsLgammaFloat4Int4Float4(inX, outY, out, false);
+ script.set_gAllocOutSignOfGamma(outSignOfGamma);
+ script.forEach_testLgammaFloat4Int4Float4(inV, out);
+ verifyResultsLgammaFloat4Int4Float4(inV, outSignOfGamma, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat4Int4Float4: " + e.toString());
}
try {
- Allocation outY = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
+ Allocation outSignOfGamma = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocOutY(outY);
- scriptRelaxed.forEach_testLgammaFloat4Int4Float4(inX, out);
- verifyResultsLgammaFloat4Int4Float4(inX, outY, out, true);
+ scriptRelaxed.set_gAllocOutSignOfGamma(outSignOfGamma);
+ scriptRelaxed.forEach_testLgammaFloat4Int4Float4(inV, out);
+ verifyResultsLgammaFloat4Int4Float4(inV, outSignOfGamma, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLgammaFloat4Int4Float4: " + e.toString());
}
}
- private void verifyResultsLgammaFloat4Int4Float4(Allocation inX, Allocation outY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- int[] arrayOutY = new int[INPUTSIZE * 4];
- outY.copyTo(arrayOutY);
+ private void verifyResultsLgammaFloat4Int4Float4(Allocation inV, Allocation outSignOfGamma, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
+ int[] arrayOutSignOfGamma = new int[INPUTSIZE * 4];
+ outSignOfGamma.copyTo(arrayOutSignOfGamma);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Extract the outputs.
- args.outY = arrayOutY[i * 4 + j];
+ args.outSignOfGamma = arrayOutSignOfGamma[i * 4 + j];
args.out = arrayOut[i * 4 + j];
// Ask the CoreMathVerifier to validate.
Target target = new Target(relaxed);
@@ -507,12 +507,12 @@
boolean valid = errorMessage == null;
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Output outY: ");
- message.append(String.format("%d", args.outY));
+ message.append("Output outSignOfGamma: ");
+ message.append(String.format("%d", args.outSignOfGamma));
message.append("\n");
message.append("Output out: ");
message.append(Float.toString(args.out));
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLgamma.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLgamma.rs
new file mode 100644
index 0000000..c07df46
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLgamma.rs
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+
+float __attribute__((kernel)) testLgammaFloatFloat(float inV) {
+ return lgamma(inV);
+}
+
+float2 __attribute__((kernel)) testLgammaFloat2Float2(float2 inV) {
+ return lgamma(inV);
+}
+
+float3 __attribute__((kernel)) testLgammaFloat3Float3(float3 inV) {
+ return lgamma(inV);
+}
+
+float4 __attribute__((kernel)) testLgammaFloat4Float4(float4 inV) {
+ return lgamma(inV);
+}
+rs_allocation gAllocOutSignOfGamma;
+
+float __attribute__((kernel)) testLgammaFloatIntFloat(float inV, unsigned int x) {
+ int outSignOfGamma = 0;
+ float out = lgamma(inV, &outSignOfGamma);
+ rsSetElementAt_int(gAllocOutSignOfGamma, outSignOfGamma, x);
+ return out;
+}
+
+float2 __attribute__((kernel)) testLgammaFloat2Int2Float2(float2 inV, unsigned int x) {
+ int2 outSignOfGamma = 0;
+ float2 out = lgamma(inV, &outSignOfGamma);
+ rsSetElementAt_int2(gAllocOutSignOfGamma, outSignOfGamma, x);
+ return out;
+}
+
+float3 __attribute__((kernel)) testLgammaFloat3Int3Float3(float3 inV, unsigned int x) {
+ int3 outSignOfGamma = 0;
+ float3 out = lgamma(inV, &outSignOfGamma);
+ rsSetElementAt_int3(gAllocOutSignOfGamma, outSignOfGamma, x);
+ return out;
+}
+
+float4 __attribute__((kernel)) testLgammaFloat4Int4Float4(float4 inV, unsigned int x) {
+ int4 outSignOfGamma = 0;
+ float4 out = lgamma(inV, &outSignOfGamma);
+ rsSetElementAt_int4(gAllocOutSignOfGamma, outSignOfGamma, x);
+ return out;
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLgammaRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLgammaRelaxed.rs
index 66f3fef..362c072 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLgammaRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestLgamma.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog.java
index 77c467c..cd593d3 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestLog extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestLog script;
+ private ScriptC_GeneratedTestLogRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestLog(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestLogRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkLogFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x4176ec542a43578dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testLogFloatFloat(inV, out);
+ verifyResultsLogFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testLogFloatFloat(inV, out);
+ verifyResultsLogFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLogFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkLogFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkLogFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xd3cba12c04dd9a49l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testLogFloat2Float2(inV, out);
+ verifyResultsLogFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testLogFloat2Float2(inV, out);
+ verifyResultsLogFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLogFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkLogFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkLogFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd3cd6a46faf8bb27l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testLogFloat3Float3(inV, out);
+ verifyResultsLogFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testLogFloat3Float3(inV, out);
+ verifyResultsLogFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLogFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkLogFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkLogFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd3cf3361f113dc05l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testLogFloat4Float4(inV, out);
+ verifyResultsLogFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testLogFloat4Float4(inV, out);
+ verifyResultsLogFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLogFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkLogFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testLog() {
+ checkLogFloatFloat();
+ checkLogFloat2Float2();
+ checkLogFloat3Float3();
+ checkLogFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog.rs
similarity index 70%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog.rs
index 80c8708..b228e97 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testCeilFloatFloat(float in) {
- return ceil(in);
+float __attribute__((kernel)) testLogFloatFloat(float inV) {
+ return log(inV);
}
-float2 __attribute__((kernel)) testCeilFloat2Float2(float2 in) {
- return ceil(in);
+float2 __attribute__((kernel)) testLogFloat2Float2(float2 inV) {
+ return log(inV);
}
-float3 __attribute__((kernel)) testCeilFloat3Float3(float3 in) {
- return ceil(in);
+float3 __attribute__((kernel)) testLogFloat3Float3(float3 inV) {
+ return log(inV);
}
-float4 __attribute__((kernel)) testCeilFloat4Float4(float4 in) {
- return ceil(in);
+float4 __attribute__((kernel)) testLogFloat4Float4(float4 inV) {
+ return log(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog10.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog10.java
index 77c467c..c3a815e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog10.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestLog10 extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestLog10 script;
+ private ScriptC_GeneratedTestLog10Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestLog10(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestLog10Relaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkLog10FloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xba0ecdfe3171d836l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testLog10FloatFloat(inV, out);
+ verifyResultsLog10FloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10FloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testLog10FloatFloat(inV, out);
+ verifyResultsLog10FloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10FloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog10FloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog10(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkLog10FloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkLog10Float2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xd4c88639e3bcdeeal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testLog10Float2Float2(inV, out);
+ verifyResultsLog10Float2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testLog10Float2Float2(inV, out);
+ verifyResultsLog10Float2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog10Float2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog10(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkLog10Float2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkLog10Float3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd4ca4f54d9d7ffc8l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testLog10Float3Float3(inV, out);
+ verifyResultsLog10Float3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testLog10Float3Float3(inV, out);
+ verifyResultsLog10Float3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog10Float3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog10(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkLog10Float3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkLog10Float4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd4cc186fcff320a6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testLog10Float4Float4(inV, out);
+ verifyResultsLog10Float4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testLog10Float4Float4(inV, out);
+ verifyResultsLog10Float4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog10Float4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog10(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkLog10Float4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testLog10() {
+ checkLog10FloatFloat();
+ checkLog10Float2Float2();
+ checkLog10Float3Float3();
+ checkLog10Float4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLog10.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog10.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestLog10.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog10.rs
index 18fb3c3..601c02b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLog10.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog10.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testLog10FloatFloat(float in) {
- return log10(in);
+float __attribute__((kernel)) testLog10FloatFloat(float inV) {
+ return log10(inV);
}
-float2 __attribute__((kernel)) testLog10Float2Float2(float2 in) {
- return log10(in);
+float2 __attribute__((kernel)) testLog10Float2Float2(float2 inV) {
+ return log10(inV);
}
-float3 __attribute__((kernel)) testLog10Float3Float3(float3 in) {
- return log10(in);
+float3 __attribute__((kernel)) testLog10Float3Float3(float3 inV) {
+ return log10(inV);
}
-float4 __attribute__((kernel)) testLog10Float4Float4(float4 in) {
- return log10(in);
+float4 __attribute__((kernel)) testLog10Float4Float4(float4 inV) {
+ return log10(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog10Relaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog10Relaxed.rs
index 66f3fef..7529f68 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog10Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestLog10.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog1p.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog1p.java
index 77c467c..20d39f8 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog1p.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestLog1p extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestLog1p script;
+ private ScriptC_GeneratedTestLog1pRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestLog1p(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestLog1pRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkLog1pFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x272c1ffe1744cef6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testLog1pFloatFloat(inV, out);
+ verifyResultsLog1pFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testLog1pFloatFloat(inV, out);
+ verifyResultsLog1pFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog1pFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog1p(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkLog1pFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkLog1pFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xed8dc77cd4750faal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testLog1pFloat2Float2(inV, out);
+ verifyResultsLog1pFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testLog1pFloat2Float2(inV, out);
+ verifyResultsLog1pFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog1pFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog1p(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkLog1pFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkLog1pFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xed8f9097ca903088l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testLog1pFloat3Float3(inV, out);
+ verifyResultsLog1pFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testLog1pFloat3Float3(inV, out);
+ verifyResultsLog1pFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog1pFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog1p(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkLog1pFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkLog1pFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xed9159b2c0ab5166l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testLog1pFloat4Float4(inV, out);
+ verifyResultsLog1pFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testLog1pFloat4Float4(inV, out);
+ verifyResultsLog1pFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog1pFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog1p(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkLog1pFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testLog1p() {
+ checkLog1pFloatFloat();
+ checkLog1pFloat2Float2();
+ checkLog1pFloat3Float3();
+ checkLog1pFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog1p.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog1p.rs
index 7dae4cf..27ea4af 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog1p.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTgammaFloatFloat(float in) {
- return tgamma(in);
+float __attribute__((kernel)) testLog1pFloatFloat(float inV) {
+ return log1p(inV);
}
-float2 __attribute__((kernel)) testTgammaFloat2Float2(float2 in) {
- return tgamma(in);
+float2 __attribute__((kernel)) testLog1pFloat2Float2(float2 inV) {
+ return log1p(inV);
}
-float3 __attribute__((kernel)) testTgammaFloat3Float3(float3 in) {
- return tgamma(in);
+float3 __attribute__((kernel)) testLog1pFloat3Float3(float3 inV) {
+ return log1p(inV);
}
-float4 __attribute__((kernel)) testTgammaFloat4Float4(float4 in) {
- return tgamma(in);
+float4 __attribute__((kernel)) testLog1pFloat4Float4(float4 inV) {
+ return log1p(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog1pRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog1pRelaxed.rs
index 66f3fef..6afe105 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog1pRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestLog1p.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog2.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog2.java
index 77c467c..850f283 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog2.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestLog2 extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestLog2 script;
+ private ScriptC_GeneratedTestLog2Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestLog2(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestLog2Relaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkLog2FloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x9950067ec147dc6bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testLog2FloatFloat(inV, out);
+ verifyResultsLog2FloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2FloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testLog2FloatFloat(inV, out);
+ verifyResultsLog2FloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2FloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog2FloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog2(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkLog2FloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkLog2Float2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x52d99ec8c48141b7l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testLog2Float2Float2(inV, out);
+ verifyResultsLog2Float2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testLog2Float2Float2(inV, out);
+ verifyResultsLog2Float2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog2Float2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog2(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkLog2Float2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkLog2Float3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x52db67e3ba9c6295l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testLog2Float3Float3(inV, out);
+ verifyResultsLog2Float3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testLog2Float3Float3(inV, out);
+ verifyResultsLog2Float3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog2Float3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog2(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkLog2Float3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkLog2Float4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x52dd30feb0b78373l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testLog2Float4Float4(inV, out);
+ verifyResultsLog2Float4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testLog2Float4Float4(inV, out);
+ verifyResultsLog2Float4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLog2Float4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLog2(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkLog2Float4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testLog2() {
+ checkLog2FloatFloat();
+ checkLog2Float2Float2();
+ checkLog2Float3Float3();
+ checkLog2Float4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog2.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog2.rs
index 1024943..a9d6a06 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog2.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testLog2FloatFloat(float inV) {
+ return log2(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testLog2Float2Float2(float2 inV) {
+ return log2(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testLog2Float3Float3(float3 inV) {
+ return log2(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testLog2Float4Float4(float4 inV) {
+ return log2(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog2Relaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog2Relaxed.rs
index 66f3fef..6caa3a0 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLog2Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestLog2.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogRelaxed.rs
index 66f3fef..f749edf 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestLog.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogb.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogb.java
index 77c467c..bf4abe0 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogb.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestLogb extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestLogb script;
+ private ScriptC_GeneratedTestLogbRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestLogb(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestLogbRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkLogbFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xab2603feada6157bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testLogbFloatFloat(inV, out);
+ verifyResultsLogbFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testLogbFloatFloat(inV, out);
+ verifyResultsLogbFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLogbFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLogb(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkLogbFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkLogbFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x256d8fbaf90b6647l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testLogbFloat2Float2(inV, out);
+ verifyResultsLogbFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testLogbFloat2Float2(inV, out);
+ verifyResultsLogbFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLogbFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLogb(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkLogbFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkLogbFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x256f58d5ef268725l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testLogbFloat3Float3(inV, out);
+ verifyResultsLogbFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testLogbFloat3Float3(inV, out);
+ verifyResultsLogbFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLogbFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLogb(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkLogbFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkLogbFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x257121f0e541a803l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testLogbFloat4Float4(inV, out);
+ verifyResultsLogbFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testLogbFloat4Float4(inV, out);
+ verifyResultsLogbFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsLogbFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeLogb(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkLogbFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testLogb() {
+ checkLogbFloatFloat();
+ checkLogbFloat2Float2();
+ checkLogbFloat3Float3();
+ checkLogbFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogb.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogb.rs
index 1024943..e0ca286 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogb.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testLogbFloatFloat(float inV) {
+ return logb(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testLogbFloat2Float2(float2 inV) {
+ return logb(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testLogbFloat3Float3(float3 inV) {
+ return logb(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testLogbFloat4Float4(float4 inV) {
+ return logb(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogbRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogbRelaxed.rs
index 66f3fef..6acab70 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestLogbRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestLogb.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMad.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMad.java
new file mode 100644
index 0000000..418bd9d
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMad.java
@@ -0,0 +1,366 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+package android.renderscript.cts;
+
+import android.renderscript.Allocation;
+import android.renderscript.RSRuntimeException;
+import android.renderscript.Element;
+
+public class GeneratedTestMad extends RSBaseCompute {
+
+ private ScriptC_GeneratedTestMad script;
+ private ScriptC_GeneratedTestMadRelaxed scriptRelaxed;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ script = new ScriptC_GeneratedTestMad(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestMadRelaxed(mRS);
+ }
+
+ public class ArgumentsFloatFloatFloatFloat {
+ public float inMultiplicand1;
+ public float inMultiplicand2;
+ public float inOffset;
+ public Target.Floaty out;
+ }
+
+ private void checkMadFloatFloatFloatFloat() {
+ Allocation inMultiplicand1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2a4461e340b4de48l, false);
+ Allocation inMultiplicand2 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2a4461e340b4de49l, false);
+ Allocation inOffset = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xcea3b86dc50ce0fcl, false);
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ script.set_gAllocInMultiplicand2(inMultiplicand2);
+ script.set_gAllocInOffset(inOffset);
+ script.forEach_testMadFloatFloatFloatFloat(inMultiplicand1, out);
+ verifyResultsMadFloatFloatFloatFloat(inMultiplicand1, inMultiplicand2, inOffset, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloatFloatFloatFloat: " + e.toString());
+ }
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ scriptRelaxed.set_gAllocInMultiplicand2(inMultiplicand2);
+ scriptRelaxed.set_gAllocInOffset(inOffset);
+ scriptRelaxed.forEach_testMadFloatFloatFloatFloat(inMultiplicand1, out);
+ verifyResultsMadFloatFloatFloatFloat(inMultiplicand1, inMultiplicand2, inOffset, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloatFloatFloatFloat: " + e.toString());
+ }
+ }
+
+ private void verifyResultsMadFloatFloatFloatFloat(Allocation inMultiplicand1, Allocation inMultiplicand2, Allocation inOffset, Allocation out, boolean relaxed) {
+ float[] arrayInMultiplicand1 = new float[INPUTSIZE * 1];
+ inMultiplicand1.copyTo(arrayInMultiplicand1);
+ float[] arrayInMultiplicand2 = new float[INPUTSIZE * 1];
+ inMultiplicand2.copyTo(arrayInMultiplicand2);
+ float[] arrayInOffset = new float[INPUTSIZE * 1];
+ inOffset.copyTo(arrayInOffset);
+ float[] arrayOut = new float[INPUTSIZE * 1];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 1 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
+ args.inMultiplicand1 = arrayInMultiplicand1[i];
+ args.inMultiplicand2 = arrayInMultiplicand2[i];
+ args.inOffset = arrayInOffset[i];
+ // Figure out what the outputs should have been.
+ Target target = new Target(relaxed);
+ CoreMathVerifier.computeMad(args, target);
+ // Validate the outputs.
+ boolean valid = true;
+ if (!args.out.couldBe(arrayOut[i * 1 + j])) {
+ valid = false;
+ }
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inMultiplicand1: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand1, Float.floatToRawIntBits(args.inMultiplicand1), args.inMultiplicand1));
+ message.append("\n");
+ message.append("Input inMultiplicand2: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand2, Float.floatToRawIntBits(args.inMultiplicand2), args.inMultiplicand2));
+ message.append("\n");
+ message.append("Input inOffset: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inOffset, Float.floatToRawIntBits(args.inOffset), args.inOffset));
+ message.append("\n");
+ message.append("Expected output out: ");
+ message.append(args.out.toString());
+ message.append("\n");
+ message.append("Actual output out: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
+ if (!args.out.couldBe(arrayOut[i * 1 + j])) {
+ message.append(" FAIL");
+ }
+ message.append("\n");
+ assertTrue("Incorrect output for checkMadFloatFloatFloatFloat" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ private void checkMadFloat2Float2Float2Float2() {
+ Allocation inMultiplicand1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xdfffb28a8a5fd7c0l, false);
+ Allocation inMultiplicand2 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xdfffb28a8a5fd7c1l, false);
+ Allocation inOffset = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3da8592f318f8924l, false);
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ script.set_gAllocInMultiplicand2(inMultiplicand2);
+ script.set_gAllocInOffset(inOffset);
+ script.forEach_testMadFloat2Float2Float2Float2(inMultiplicand1, out);
+ verifyResultsMadFloat2Float2Float2Float2(inMultiplicand1, inMultiplicand2, inOffset, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat2Float2Float2Float2: " + e.toString());
+ }
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ scriptRelaxed.set_gAllocInMultiplicand2(inMultiplicand2);
+ scriptRelaxed.set_gAllocInOffset(inOffset);
+ scriptRelaxed.forEach_testMadFloat2Float2Float2Float2(inMultiplicand1, out);
+ verifyResultsMadFloat2Float2Float2Float2(inMultiplicand1, inMultiplicand2, inOffset, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat2Float2Float2Float2: " + e.toString());
+ }
+ }
+
+ private void verifyResultsMadFloat2Float2Float2Float2(Allocation inMultiplicand1, Allocation inMultiplicand2, Allocation inOffset, Allocation out, boolean relaxed) {
+ float[] arrayInMultiplicand1 = new float[INPUTSIZE * 2];
+ inMultiplicand1.copyTo(arrayInMultiplicand1);
+ float[] arrayInMultiplicand2 = new float[INPUTSIZE * 2];
+ inMultiplicand2.copyTo(arrayInMultiplicand2);
+ float[] arrayInOffset = new float[INPUTSIZE * 2];
+ inOffset.copyTo(arrayInOffset);
+ float[] arrayOut = new float[INPUTSIZE * 2];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 2 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
+ args.inMultiplicand1 = arrayInMultiplicand1[i * 2 + j];
+ args.inMultiplicand2 = arrayInMultiplicand2[i * 2 + j];
+ args.inOffset = arrayInOffset[i * 2 + j];
+ // Figure out what the outputs should have been.
+ Target target = new Target(relaxed);
+ CoreMathVerifier.computeMad(args, target);
+ // Validate the outputs.
+ boolean valid = true;
+ if (!args.out.couldBe(arrayOut[i * 2 + j])) {
+ valid = false;
+ }
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inMultiplicand1: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand1, Float.floatToRawIntBits(args.inMultiplicand1), args.inMultiplicand1));
+ message.append("\n");
+ message.append("Input inMultiplicand2: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand2, Float.floatToRawIntBits(args.inMultiplicand2), args.inMultiplicand2));
+ message.append("\n");
+ message.append("Input inOffset: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inOffset, Float.floatToRawIntBits(args.inOffset), args.inOffset));
+ message.append("\n");
+ message.append("Expected output out: ");
+ message.append(args.out.toString());
+ message.append("\n");
+ message.append("Actual output out: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
+ if (!args.out.couldBe(arrayOut[i * 2 + j])) {
+ message.append(" FAIL");
+ }
+ message.append("\n");
+ assertTrue("Incorrect output for checkMadFloat2Float2Float2Float2" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ private void checkMadFloat3Float3Float3Float3() {
+ Allocation inMultiplicand1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xdd6226bde1551f1cl, false);
+ Allocation inMultiplicand2 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xdd6226bde1551f1dl, false);
+ Allocation inOffset = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x117f5b0bfb77d218l, false);
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ script.set_gAllocInMultiplicand2(inMultiplicand2);
+ script.set_gAllocInOffset(inOffset);
+ script.forEach_testMadFloat3Float3Float3Float3(inMultiplicand1, out);
+ verifyResultsMadFloat3Float3Float3Float3(inMultiplicand1, inMultiplicand2, inOffset, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat3Float3Float3Float3: " + e.toString());
+ }
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ scriptRelaxed.set_gAllocInMultiplicand2(inMultiplicand2);
+ scriptRelaxed.set_gAllocInOffset(inOffset);
+ scriptRelaxed.forEach_testMadFloat3Float3Float3Float3(inMultiplicand1, out);
+ verifyResultsMadFloat3Float3Float3Float3(inMultiplicand1, inMultiplicand2, inOffset, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat3Float3Float3Float3: " + e.toString());
+ }
+ }
+
+ private void verifyResultsMadFloat3Float3Float3Float3(Allocation inMultiplicand1, Allocation inMultiplicand2, Allocation inOffset, Allocation out, boolean relaxed) {
+ float[] arrayInMultiplicand1 = new float[INPUTSIZE * 4];
+ inMultiplicand1.copyTo(arrayInMultiplicand1);
+ float[] arrayInMultiplicand2 = new float[INPUTSIZE * 4];
+ inMultiplicand2.copyTo(arrayInMultiplicand2);
+ float[] arrayInOffset = new float[INPUTSIZE * 4];
+ inOffset.copyTo(arrayInOffset);
+ float[] arrayOut = new float[INPUTSIZE * 4];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 3 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
+ args.inMultiplicand1 = arrayInMultiplicand1[i * 4 + j];
+ args.inMultiplicand2 = arrayInMultiplicand2[i * 4 + j];
+ args.inOffset = arrayInOffset[i * 4 + j];
+ // Figure out what the outputs should have been.
+ Target target = new Target(relaxed);
+ CoreMathVerifier.computeMad(args, target);
+ // Validate the outputs.
+ boolean valid = true;
+ if (!args.out.couldBe(arrayOut[i * 4 + j])) {
+ valid = false;
+ }
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inMultiplicand1: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand1, Float.floatToRawIntBits(args.inMultiplicand1), args.inMultiplicand1));
+ message.append("\n");
+ message.append("Input inMultiplicand2: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand2, Float.floatToRawIntBits(args.inMultiplicand2), args.inMultiplicand2));
+ message.append("\n");
+ message.append("Input inOffset: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inOffset, Float.floatToRawIntBits(args.inOffset), args.inOffset));
+ message.append("\n");
+ message.append("Expected output out: ");
+ message.append(args.out.toString());
+ message.append("\n");
+ message.append("Actual output out: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
+ if (!args.out.couldBe(arrayOut[i * 4 + j])) {
+ message.append(" FAIL");
+ }
+ message.append("\n");
+ assertTrue("Incorrect output for checkMadFloat3Float3Float3Float3" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ private void checkMadFloat4Float4Float4Float4() {
+ Allocation inMultiplicand1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xdac49af1384a6678l, false);
+ Allocation inMultiplicand2 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xdac49af1384a6679l, false);
+ Allocation inOffset = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xe5565ce8c5601b0cl, false);
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ script.set_gAllocInMultiplicand2(inMultiplicand2);
+ script.set_gAllocInOffset(inOffset);
+ script.forEach_testMadFloat4Float4Float4Float4(inMultiplicand1, out);
+ verifyResultsMadFloat4Float4Float4Float4(inMultiplicand1, inMultiplicand2, inOffset, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat4Float4Float4Float4: " + e.toString());
+ }
+ try {
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ scriptRelaxed.set_gAllocInMultiplicand2(inMultiplicand2);
+ scriptRelaxed.set_gAllocInOffset(inOffset);
+ scriptRelaxed.forEach_testMadFloat4Float4Float4Float4(inMultiplicand1, out);
+ verifyResultsMadFloat4Float4Float4Float4(inMultiplicand1, inMultiplicand2, inOffset, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat4Float4Float4Float4: " + e.toString());
+ }
+ }
+
+ private void verifyResultsMadFloat4Float4Float4Float4(Allocation inMultiplicand1, Allocation inMultiplicand2, Allocation inOffset, Allocation out, boolean relaxed) {
+ float[] arrayInMultiplicand1 = new float[INPUTSIZE * 4];
+ inMultiplicand1.copyTo(arrayInMultiplicand1);
+ float[] arrayInMultiplicand2 = new float[INPUTSIZE * 4];
+ inMultiplicand2.copyTo(arrayInMultiplicand2);
+ float[] arrayInOffset = new float[INPUTSIZE * 4];
+ inOffset.copyTo(arrayInOffset);
+ float[] arrayOut = new float[INPUTSIZE * 4];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 4 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
+ args.inMultiplicand1 = arrayInMultiplicand1[i * 4 + j];
+ args.inMultiplicand2 = arrayInMultiplicand2[i * 4 + j];
+ args.inOffset = arrayInOffset[i * 4 + j];
+ // Figure out what the outputs should have been.
+ Target target = new Target(relaxed);
+ CoreMathVerifier.computeMad(args, target);
+ // Validate the outputs.
+ boolean valid = true;
+ if (!args.out.couldBe(arrayOut[i * 4 + j])) {
+ valid = false;
+ }
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inMultiplicand1: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand1, Float.floatToRawIntBits(args.inMultiplicand1), args.inMultiplicand1));
+ message.append("\n");
+ message.append("Input inMultiplicand2: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inMultiplicand2, Float.floatToRawIntBits(args.inMultiplicand2), args.inMultiplicand2));
+ message.append("\n");
+ message.append("Input inOffset: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inOffset, Float.floatToRawIntBits(args.inOffset), args.inOffset));
+ message.append("\n");
+ message.append("Expected output out: ");
+ message.append(args.out.toString());
+ message.append("\n");
+ message.append("Actual output out: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
+ if (!args.out.couldBe(arrayOut[i * 4 + j])) {
+ message.append(" FAIL");
+ }
+ message.append("\n");
+ assertTrue("Incorrect output for checkMadFloat4Float4Float4Float4" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ public void testMad() {
+ checkMadFloatFloatFloatFloat();
+ checkMadFloat2Float2Float2Float2();
+ checkMadFloat3Float3Float3Float3();
+ checkMadFloat4Float4Float4Float4();
+ }
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMad.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMad.rs
new file mode 100644
index 0000000..3808b26
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMad.rs
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInMultiplicand2;
+rs_allocation gAllocInOffset;
+
+float __attribute__((kernel)) testMadFloatFloatFloatFloat(float inMultiplicand1, unsigned int x) {
+ float inMultiplicand2 = rsGetElementAt_float(gAllocInMultiplicand2, x);
+ float inOffset = rsGetElementAt_float(gAllocInOffset, x);
+ return mad(inMultiplicand1, inMultiplicand2, inOffset);
+}
+
+float2 __attribute__((kernel)) testMadFloat2Float2Float2Float2(float2 inMultiplicand1, unsigned int x) {
+ float2 inMultiplicand2 = rsGetElementAt_float2(gAllocInMultiplicand2, x);
+ float2 inOffset = rsGetElementAt_float2(gAllocInOffset, x);
+ return mad(inMultiplicand1, inMultiplicand2, inOffset);
+}
+
+float3 __attribute__((kernel)) testMadFloat3Float3Float3Float3(float3 inMultiplicand1, unsigned int x) {
+ float3 inMultiplicand2 = rsGetElementAt_float3(gAllocInMultiplicand2, x);
+ float3 inOffset = rsGetElementAt_float3(gAllocInOffset, x);
+ return mad(inMultiplicand1, inMultiplicand2, inOffset);
+}
+
+float4 __attribute__((kernel)) testMadFloat4Float4Float4Float4(float4 inMultiplicand1, unsigned int x) {
+ float4 inMultiplicand2 = rsGetElementAt_float4(gAllocInMultiplicand2, x);
+ float4 inOffset = rsGetElementAt_float4(gAllocInOffset, x);
+ return mad(inMultiplicand1, inMultiplicand2, inOffset);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMadRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMadRelaxed.rs
index 66f3fef..17bd9ea 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMadRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestMad.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMax.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMax.java
similarity index 67%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestMax.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMax.java
index e52ef48..1961200 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMax.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMax.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestMax extends RSBaseCompute {
+public class GeneratedTestMax extends RSBaseCompute {
- private ScriptC_TestMax script;
- private ScriptC_TestMaxRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestMax script;
+ private ScriptC_GeneratedTestMaxRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestMax(mRS);
- scriptRelaxed = new ScriptC_TestMaxRelaxed(mRS);
+ script = new ScriptC_GeneratedTestMax(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestMaxRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float in;
- public float in1;
+ public float inA;
+ public float inB;
public Target.Floaty out;
}
private void checkMaxFloatFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xfb01ed3804837dddl, false);
- Allocation in1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2952d868c2162450l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2952d868c2162460l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2952d868c2162461l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocIn1(in1);
- script.forEach_testMaxFloatFloatFloat(in, out);
- verifyResultsMaxFloatFloatFloat(in, in1, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxFloatFloatFloat(inA, out);
+ verifyResultsMaxFloatFloatFloat(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocIn1(in1);
- scriptRelaxed.forEach_testMaxFloatFloatFloat(in, out);
- verifyResultsMaxFloatFloatFloat(in, in1, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxFloatFloatFloat(inA, out);
+ verifyResultsMaxFloatFloatFloat(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsMaxFloatFloatFloat(Allocation in, Allocation in1, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayIn1 = new float[INPUTSIZE * 1];
- in1.copyTo(arrayIn1);
+ private void verifyResultsMaxFloatFloatFloat(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.in = arrayIn[i];
- args.in1 = arrayIn1[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMax(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input in1: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in1, Float.floatToRawIntBits(args.in1), args.in1));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkMaxFloat2Float2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x63dc5a02b9d46a4bl, false);
- Allocation in1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc6031e7536addacal, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc6031e7536addadal, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc6031e7536addadbl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocIn1(in1);
- script.forEach_testMaxFloat2Float2Float2(in, out);
- verifyResultsMaxFloat2Float2Float2(in, in1, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxFloat2Float2Float2(inA, out);
+ verifyResultsMaxFloat2Float2Float2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocIn1(in1);
- scriptRelaxed.forEach_testMaxFloat2Float2Float2(in, out);
- verifyResultsMaxFloat2Float2Float2(in, in1, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxFloat2Float2Float2(inA, out);
+ verifyResultsMaxFloat2Float2Float2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsMaxFloat2Float2Float2(Allocation in, Allocation in1, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayIn1 = new float[INPUTSIZE * 2];
- in1.copyTo(arrayIn1);
+ private void verifyResultsMaxFloat2Float2Float2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.in = arrayIn[i * 2 + j];
- args.in1 = arrayIn1[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMax(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input in1: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in1, Float.floatToRawIntBits(args.in1), args.in1));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkMaxFloat3Float3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xb92c17bc0744bdael, false);
- Allocation in1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1a67fc95388bdc6bl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1a67fc95388bdc7bl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1a67fc95388bdc7cl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocIn1(in1);
- script.forEach_testMaxFloat3Float3Float3(in, out);
- verifyResultsMaxFloat3Float3Float3(in, in1, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxFloat3Float3Float3(inA, out);
+ verifyResultsMaxFloat3Float3Float3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocIn1(in1);
- scriptRelaxed.forEach_testMaxFloat3Float3Float3(in, out);
- verifyResultsMaxFloat3Float3Float3(in, in1, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxFloat3Float3Float3(inA, out);
+ verifyResultsMaxFloat3Float3Float3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsMaxFloat3Float3Float3(Allocation in, Allocation in1, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayIn1 = new float[INPUTSIZE * 4];
- in1.copyTo(arrayIn1);
+ private void verifyResultsMaxFloat3Float3Float3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.in = arrayIn[i * 4 + j];
- args.in1 = arrayIn1[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMax(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input in1: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in1, Float.floatToRawIntBits(args.in1), args.in1));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkMaxFloat4Float4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xe7bd57554b51111l, false);
- Allocation in1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6eccdab53a69de0cl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6eccdab53a69de1cl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6eccdab53a69de1dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocIn1(in1);
- script.forEach_testMaxFloat4Float4Float4(in, out);
- verifyResultsMaxFloat4Float4Float4(in, in1, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxFloat4Float4Float4(inA, out);
+ verifyResultsMaxFloat4Float4Float4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocIn1(in1);
- scriptRelaxed.forEach_testMaxFloat4Float4Float4(in, out);
- verifyResultsMaxFloat4Float4Float4(in, in1, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxFloat4Float4Float4(inA, out);
+ verifyResultsMaxFloat4Float4Float4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsMaxFloat4Float4Float4(Allocation in, Allocation in1, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayIn1 = new float[INPUTSIZE * 4];
- in1.copyTo(arrayIn1);
+ private void verifyResultsMaxFloat4Float4Float4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.in = arrayIn[i * 4 + j];
- args.in1 = arrayIn1[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMax(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input in1: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in1, Float.floatToRawIntBits(args.in1), args.in1));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -317,45 +317,45 @@
}
public class ArgumentsCharCharChar {
- public byte inV1;
- public byte inV2;
+ public byte inA;
+ public byte inB;
public byte out;
}
private void checkMaxCharCharChar() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 1, 0x91fcf329ccedf8al, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 1, 0x91fcf329ccedf8bl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 1, 0x5f77cf3cb6405876l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 1, 0x5f77cf3cb6405877l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxCharCharChar(inV1, out);
- verifyResultsMaxCharCharChar(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxCharCharChar(inA, out);
+ verifyResultsMaxCharCharChar(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxCharCharChar: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxCharCharChar(inV1, out);
- verifyResultsMaxCharCharChar(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxCharCharChar(inA, out);
+ verifyResultsMaxCharCharChar(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxCharCharChar: " + e.toString());
}
}
- private void verifyResultsMaxCharCharChar(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxCharCharChar(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsCharCharChar args = new ArgumentsCharCharChar();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -365,11 +365,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -388,39 +388,39 @@
}
private void checkMaxChar2Char2Char2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 2, 0x12084b25952bc64l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 2, 0x12084b25952bc65l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 2, 0x94dd090a19e42804l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 2, 0x94dd090a19e42805l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxChar2Char2Char2(inV1, out);
- verifyResultsMaxChar2Char2Char2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxChar2Char2Char2(inA, out);
+ verifyResultsMaxChar2Char2Char2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxChar2Char2Char2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxChar2Char2Char2(inV1, out);
- verifyResultsMaxChar2Char2Char2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxChar2Char2Char2(inA, out);
+ verifyResultsMaxChar2Char2Char2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxChar2Char2Char2: " + e.toString());
}
}
- private void verifyResultsMaxChar2Char2Char2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxChar2Char2Char2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsCharCharChar args = new ArgumentsCharCharChar();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -430,11 +430,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -453,39 +453,39 @@
}
private void checkMaxChar3Char3Char3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 3, 0x567200e53e0a8f29l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 3, 0x567200e53e0a8f2al, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 3, 0xba9188f3788338d3l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 3, 0xba9188f3788338d4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxChar3Char3Char3(inV1, out);
- verifyResultsMaxChar3Char3Char3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxChar3Char3Char3(inA, out);
+ verifyResultsMaxChar3Char3Char3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxChar3Char3Char3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxChar3Char3Char3(inV1, out);
- verifyResultsMaxChar3Char3Char3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxChar3Char3Char3(inA, out);
+ verifyResultsMaxChar3Char3Char3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxChar3Char3Char3: " + e.toString());
}
}
- private void verifyResultsMaxChar3Char3Char3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxChar3Char3Char3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsCharCharChar args = new ArgumentsCharCharChar();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -495,11 +495,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -518,39 +518,39 @@
}
private void checkMaxChar4Char4Char4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 4, 0xabc37d1822c261eel, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 4, 0xabc37d1822c261efl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 4, 0xe04608dcd72249a2l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 4, 0xe04608dcd72249a3l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxChar4Char4Char4(inV1, out);
- verifyResultsMaxChar4Char4Char4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxChar4Char4Char4(inA, out);
+ verifyResultsMaxChar4Char4Char4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxChar4Char4Char4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxChar4Char4Char4(inV1, out);
- verifyResultsMaxChar4Char4Char4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxChar4Char4Char4(inA, out);
+ verifyResultsMaxChar4Char4Char4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxChar4Char4Char4: " + e.toString());
}
}
- private void verifyResultsMaxChar4Char4Char4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxChar4Char4Char4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsCharCharChar args = new ArgumentsCharCharChar();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -560,11 +560,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -583,45 +583,45 @@
}
public class ArgumentsUcharUcharUchar {
- public byte inV1;
- public byte inV2;
+ public byte inA;
+ public byte inB;
public byte out;
}
private void checkMaxUcharUcharUchar() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 1, 0x829ebf2e60c1bd47l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 1, 0x829ebf2e60c1bd48l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 1, 0x800f9948853a162dl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 1, 0x800f9948853a162el, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUcharUcharUchar(inV1, out);
- verifyResultsMaxUcharUcharUchar(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUcharUcharUchar(inA, out);
+ verifyResultsMaxUcharUcharUchar(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUcharUcharUchar: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUcharUcharUchar(inV1, out);
- verifyResultsMaxUcharUcharUchar(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUcharUcharUchar(inA, out);
+ verifyResultsMaxUcharUcharUchar(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUcharUcharUchar: " + e.toString());
}
}
- private void verifyResultsMaxUcharUcharUchar(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUcharUcharUchar(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsUcharUcharUchar args = new ArgumentsUcharUcharUchar();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -631,11 +631,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -654,39 +654,39 @@
}
private void checkMaxUchar2Uchar2Uchar2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 2, 0x75eda605e43f8b81l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 2, 0x75eda605e43f8b82l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 2, 0xd31d5735b7e9a9dbl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 2, 0xd31d5735b7e9a9dcl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUchar2Uchar2Uchar2(inV1, out);
- verifyResultsMaxUchar2Uchar2Uchar2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUchar2Uchar2Uchar2(inA, out);
+ verifyResultsMaxUchar2Uchar2Uchar2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUchar2Uchar2Uchar2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUchar2Uchar2Uchar2(inV1, out);
- verifyResultsMaxUchar2Uchar2Uchar2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUchar2Uchar2Uchar2(inA, out);
+ verifyResultsMaxUchar2Uchar2Uchar2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUchar2Uchar2Uchar2: " + e.toString());
}
}
- private void verifyResultsMaxUchar2Uchar2Uchar2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUchar2Uchar2Uchar2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsUcharUcharUchar args = new ArgumentsUcharUcharUchar();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -696,11 +696,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -719,39 +719,39 @@
}
private void checkMaxUchar3Uchar3Uchar3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 3, 0xa2def5663489d18cl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 3, 0xa2def5663489d18dl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 3, 0x27823555b9c7ab7cl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 3, 0x27823555b9c7ab7dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUchar3Uchar3Uchar3(inV1, out);
- verifyResultsMaxUchar3Uchar3Uchar3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUchar3Uchar3Uchar3(inA, out);
+ verifyResultsMaxUchar3Uchar3Uchar3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUchar3Uchar3Uchar3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUchar3Uchar3Uchar3(inV1, out);
- verifyResultsMaxUchar3Uchar3Uchar3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUchar3Uchar3Uchar3(inA, out);
+ verifyResultsMaxUchar3Uchar3Uchar3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUchar3Uchar3Uchar3: " + e.toString());
}
}
- private void verifyResultsMaxUchar3Uchar3Uchar3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUchar3Uchar3Uchar3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsUcharUcharUchar args = new ArgumentsUcharUcharUchar();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -761,11 +761,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -784,39 +784,39 @@
}
private void checkMaxUchar4Uchar4Uchar4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 4, 0xcfd044c684d41797l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 4, 0xcfd044c684d41798l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 4, 0x7be71375bba5ad1dl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 4, 0x7be71375bba5ad1el, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUchar4Uchar4Uchar4(inV1, out);
- verifyResultsMaxUchar4Uchar4Uchar4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUchar4Uchar4Uchar4(inA, out);
+ verifyResultsMaxUchar4Uchar4Uchar4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUchar4Uchar4Uchar4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUchar4Uchar4Uchar4(inV1, out);
- verifyResultsMaxUchar4Uchar4Uchar4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUchar4Uchar4Uchar4(inA, out);
+ verifyResultsMaxUchar4Uchar4Uchar4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUchar4Uchar4Uchar4: " + e.toString());
}
}
- private void verifyResultsMaxUchar4Uchar4Uchar4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUchar4Uchar4Uchar4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsUcharUcharUchar args = new ArgumentsUcharUcharUchar();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -826,11 +826,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -849,45 +849,45 @@
}
public class ArgumentsShortShortShort {
- public short inV1;
- public short inV2;
+ public short inA;
+ public short inB;
public short out;
}
private void checkMaxShortShortShort() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 1, 0x868a0cd65f7a4294l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 1, 0x868a0cd65f7a4295l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 1, 0x920335e143b57294l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 1, 0x920335e143b57295l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxShortShortShort(inV1, out);
- verifyResultsMaxShortShortShort(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxShortShortShort(inA, out);
+ verifyResultsMaxShortShortShort(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxShortShortShort: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxShortShortShort(inV1, out);
- verifyResultsMaxShortShortShort(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxShortShortShort(inA, out);
+ verifyResultsMaxShortShortShort(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxShortShortShort: " + e.toString());
}
}
- private void verifyResultsMaxShortShortShort(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxShortShortShort(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsShortShortShort args = new ArgumentsShortShortShort();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -897,11 +897,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -920,39 +920,39 @@
}
private void checkMaxShort2Short2Short2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 2, 0x3d46ae0799c33c02l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 2, 0x3d46ae0799c33c03l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 2, 0x42e9d46b56ecb9del, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 2, 0x42e9d46b56ecb9dfl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxShort2Short2Short2(inV1, out);
- verifyResultsMaxShort2Short2Short2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxShort2Short2Short2(inA, out);
+ verifyResultsMaxShort2Short2Short2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxShort2Short2Short2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxShort2Short2Short2(inV1, out);
- verifyResultsMaxShort2Short2Short2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxShort2Short2Short2(inA, out);
+ verifyResultsMaxShort2Short2Short2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxShort2Short2Short2: " + e.toString());
}
}
- private void verifyResultsMaxShort2Short2Short2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxShort2Short2Short2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsShortShortShort args = new ArgumentsShortShortShort();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -962,11 +962,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -985,39 +985,39 @@
}
private void checkMaxShort3Short3Short3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 3, 0x6a37fd67ea0d820dl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 3, 0x6a37fd67ea0d820el, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 3, 0x974eb28b58cabb7fl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 3, 0x974eb28b58cabb80l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxShort3Short3Short3(inV1, out);
- verifyResultsMaxShort3Short3Short3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxShort3Short3Short3(inA, out);
+ verifyResultsMaxShort3Short3Short3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxShort3Short3Short3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxShort3Short3Short3(inV1, out);
- verifyResultsMaxShort3Short3Short3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxShort3Short3Short3(inA, out);
+ verifyResultsMaxShort3Short3Short3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxShort3Short3Short3: " + e.toString());
}
}
- private void verifyResultsMaxShort3Short3Short3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxShort3Short3Short3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsShortShortShort args = new ArgumentsShortShortShort();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1027,11 +1027,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1050,39 +1050,39 @@
}
private void checkMaxShort4Short4Short4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 4, 0x97294cc83a57c818l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 4, 0x97294cc83a57c819l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 4, 0xebb390ab5aa8bd20l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 4, 0xebb390ab5aa8bd21l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxShort4Short4Short4(inV1, out);
- verifyResultsMaxShort4Short4Short4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxShort4Short4Short4(inA, out);
+ verifyResultsMaxShort4Short4Short4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxShort4Short4Short4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxShort4Short4Short4(inV1, out);
- verifyResultsMaxShort4Short4Short4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxShort4Short4Short4(inA, out);
+ verifyResultsMaxShort4Short4Short4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxShort4Short4Short4: " + e.toString());
}
}
- private void verifyResultsMaxShort4Short4Short4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxShort4Short4Short4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsShortShortShort args = new ArgumentsShortShortShort();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1092,11 +1092,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1115,45 +1115,45 @@
}
public class ArgumentsUshortUshortUshort {
- public short inV1;
- public short inV2;
+ public short inA;
+ public short inB;
public short out;
}
private void checkMaxUshortUshortUshort() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 1, 0x1b9c47701effe051l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 1, 0x1b9c47701effe052l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 1, 0x8f869c73b947704bl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 1, 0x8f869c73b947704cl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUshortUshortUshort(inV1, out);
- verifyResultsMaxUshortUshortUshort(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUshortUshortUshort(inA, out);
+ verifyResultsMaxUshortUshortUshort(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUshortUshortUshort: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUshortUshortUshort(inV1, out);
- verifyResultsMaxUshortUshortUshort(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUshortUshortUshort(inA, out);
+ verifyResultsMaxUshortUshortUshort(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUshortUshortUshort: " + e.toString());
}
}
- private void verifyResultsMaxUshortUshortUshort(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUshortUshortUshort(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsUshortUshortUshort args = new ArgumentsUshortUshortUshort();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1163,11 +1163,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1186,39 +1186,39 @@
}
private void checkMaxUshort2Ushort2Ushort2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 2, 0xf42196a588de51bfl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 2, 0xf42196a588de51c0l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 2, 0xbe3c50e6150b1f95l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 2, 0xbe3c50e6150b1f96l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUshort2Ushort2Ushort2(inV1, out);
- verifyResultsMaxUshort2Ushort2Ushort2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUshort2Ushort2Ushort2(inA, out);
+ verifyResultsMaxUshort2Ushort2Ushort2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUshort2Ushort2Ushort2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUshort2Ushort2Ushort2(inV1, out);
- verifyResultsMaxUshort2Ushort2Ushort2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUshort2Ushort2Ushort2(inA, out);
+ verifyResultsMaxUshort2Ushort2Ushort2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUshort2Ushort2Ushort2: " + e.toString());
}
}
- private void verifyResultsMaxUshort2Ushort2Ushort2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUshort2Ushort2Ushort2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsUshortUshortUshort args = new ArgumentsUshortUshortUshort();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1228,11 +1228,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1251,39 +1251,39 @@
}
private void checkMaxUshort3Ushort3Ushort3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 3, 0x71604884c752e61cl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 3, 0x71604884c752e61dl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 3, 0x3e2be9df5df0112cl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 3, 0x3e2be9df5df0112dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUshort3Ushort3Ushort3(inV1, out);
- verifyResultsMaxUshort3Ushort3Ushort3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUshort3Ushort3Ushort3(inA, out);
+ verifyResultsMaxUshort3Ushort3Ushort3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUshort3Ushort3Ushort3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUshort3Ushort3Ushort3(inV1, out);
- verifyResultsMaxUshort3Ushort3Ushort3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUshort3Ushort3Ushort3(inA, out);
+ verifyResultsMaxUshort3Ushort3Ushort3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUshort3Ushort3Ushort3: " + e.toString());
}
}
- private void verifyResultsMaxUshort3Ushort3Ushort3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUshort3Ushort3Ushort3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsUshortUshortUshort args = new ArgumentsUshortUshortUshort();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1293,11 +1293,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1316,39 +1316,39 @@
}
private void checkMaxUshort4Ushort4Ushort4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 4, 0xee9efa6405c77a79l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 4, 0xee9efa6405c77a7al, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 4, 0xbe1b82d8a6d502c3l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 4, 0xbe1b82d8a6d502c4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUshort4Ushort4Ushort4(inV1, out);
- verifyResultsMaxUshort4Ushort4Ushort4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUshort4Ushort4Ushort4(inA, out);
+ verifyResultsMaxUshort4Ushort4Ushort4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUshort4Ushort4Ushort4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUshort4Ushort4Ushort4(inV1, out);
- verifyResultsMaxUshort4Ushort4Ushort4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUshort4Ushort4Ushort4(inA, out);
+ verifyResultsMaxUshort4Ushort4Ushort4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUshort4Ushort4Ushort4: " + e.toString());
}
}
- private void verifyResultsMaxUshort4Ushort4Ushort4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUshort4Ushort4Ushort4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsUshortUshortUshort args = new ArgumentsUshortUshortUshort();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1358,11 +1358,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1381,45 +1381,45 @@
}
public class ArgumentsIntIntInt {
- public int inV1;
- public int inV2;
+ public int inA;
+ public int inB;
public int out;
}
private void checkMaxIntIntInt() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0x7413f465641a51bl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0x7413f465641a51cl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0x773d0d60e43d0fa9l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0x773d0d60e43d0faal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxIntIntInt(inV1, out);
- verifyResultsMaxIntIntInt(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxIntIntInt(inA, out);
+ verifyResultsMaxIntIntInt(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxIntIntInt: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxIntIntInt(inV1, out);
- verifyResultsMaxIntIntInt(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxIntIntInt(inA, out);
+ verifyResultsMaxIntIntInt(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxIntIntInt: " + e.toString());
}
}
- private void verifyResultsMaxIntIntInt(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxIntIntInt(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsIntIntInt args = new ArgumentsIntIntInt();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1429,11 +1429,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1452,39 +1452,39 @@
}
private void checkMaxInt2Int2Int2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0x7bba1e4a83816bd5l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0x7bba1e4a83816bd6l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0x32815a01bb9dccd7l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0x32815a01bb9dccd8l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxInt2Int2Int2(inV1, out);
- verifyResultsMaxInt2Int2Int2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxInt2Int2Int2(inA, out);
+ verifyResultsMaxInt2Int2Int2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxInt2Int2Int2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxInt2Int2Int2(inV1, out);
- verifyResultsMaxInt2Int2Int2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxInt2Int2Int2(inA, out);
+ verifyResultsMaxInt2Int2Int2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxInt2Int2Int2: " + e.toString());
}
}
- private void verifyResultsMaxInt2Int2Int2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxInt2Int2Int2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsIntIntInt args = new ArgumentsIntIntInt();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1494,11 +1494,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1517,39 +1517,39 @@
}
private void checkMaxInt3Int3Int3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0xa647496a95547ff8l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0xa647496a95547ff9l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0x3f66ddfc867314c0l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0x3f66ddfc867314c1l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxInt3Int3Int3(inV1, out);
- verifyResultsMaxInt3Int3Int3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxInt3Int3Int3(inA, out);
+ verifyResultsMaxInt3Int3Int3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxInt3Int3Int3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxInt3Int3Int3(inV1, out);
- verifyResultsMaxInt3Int3Int3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxInt3Int3Int3(inA, out);
+ verifyResultsMaxInt3Int3Int3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxInt3Int3Int3: " + e.toString());
}
}
- private void verifyResultsMaxInt3Int3Int3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxInt3Int3Int3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsIntIntInt args = new ArgumentsIntIntInt();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1559,11 +1559,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1582,39 +1582,39 @@
}
private void checkMaxInt4Int4Int4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0xd0d4748aa727941bl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0xd0d4748aa727941cl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0x4c4c61f751485ca9l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0x4c4c61f751485caal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxInt4Int4Int4(inV1, out);
- verifyResultsMaxInt4Int4Int4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxInt4Int4Int4(inA, out);
+ verifyResultsMaxInt4Int4Int4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxInt4Int4Int4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxInt4Int4Int4(inV1, out);
- verifyResultsMaxInt4Int4Int4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxInt4Int4Int4(inA, out);
+ verifyResultsMaxInt4Int4Int4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxInt4Int4Int4: " + e.toString());
}
}
- private void verifyResultsMaxInt4Int4Int4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxInt4Int4Int4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsIntIntInt args = new ArgumentsIntIntInt();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1624,11 +1624,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1647,45 +1647,45 @@
}
public class ArgumentsUintUintUint {
- public int inV1;
- public int inV2;
+ public int inA;
+ public int inB;
public int out;
}
private void checkMaxUintUintUint() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 1, 0x75328d17808776cal, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 1, 0x75328d17808776cbl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 1, 0xcd24e58385f73e36l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 1, 0xcd24e58385f73e37l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUintUintUint(inV1, out);
- verifyResultsMaxUintUintUint(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUintUintUint(inA, out);
+ verifyResultsMaxUintUintUint(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUintUintUint: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUintUintUint(inV1, out);
- verifyResultsMaxUintUintUint(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUintUintUint(inA, out);
+ verifyResultsMaxUintUintUint(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUintUintUint: " + e.toString());
}
}
- private void verifyResultsMaxUintUintUint(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUintUintUint(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsUintUintUint args = new ArgumentsUintUintUint();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1695,11 +1695,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1718,39 +1718,39 @@
}
private void checkMaxUint2Uint2Uint2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 2, 0xcda90384705016a4l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 2, 0xcda90384705016a5l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 2, 0xbd5747860e84d6c4l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 2, 0xbd5747860e84d6c5l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUint2Uint2Uint2(inV1, out);
- verifyResultsMaxUint2Uint2Uint2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUint2Uint2Uint2(inA, out);
+ verifyResultsMaxUint2Uint2Uint2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUint2Uint2Uint2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUint2Uint2Uint2(inV1, out);
- verifyResultsMaxUint2Uint2Uint2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUint2Uint2Uint2(inA, out);
+ verifyResultsMaxUint2Uint2Uint2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUint2Uint2Uint2: " + e.toString());
}
}
- private void verifyResultsMaxUint2Uint2Uint2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUint2Uint2Uint2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsUintUintUint args = new ArgumentsUintUintUint();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1760,11 +1760,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1783,39 +1783,39 @@
}
private void checkMaxUint3Uint3Uint3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 3, 0x22fa7fb75507e969l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 3, 0x22fa7fb75507e96al, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 3, 0xe30bc76f6d23e793l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 3, 0xe30bc76f6d23e794l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUint3Uint3Uint3(inV1, out);
- verifyResultsMaxUint3Uint3Uint3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUint3Uint3Uint3(inA, out);
+ verifyResultsMaxUint3Uint3Uint3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUint3Uint3Uint3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUint3Uint3Uint3(inV1, out);
- verifyResultsMaxUint3Uint3Uint3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUint3Uint3Uint3(inA, out);
+ verifyResultsMaxUint3Uint3Uint3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUint3Uint3Uint3: " + e.toString());
}
}
- private void verifyResultsMaxUint3Uint3Uint3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUint3Uint3Uint3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsUintUintUint args = new ArgumentsUintUintUint();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1825,11 +1825,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1848,39 +1848,39 @@
}
private void checkMaxUint4Uint4Uint4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 4, 0x784bfbea39bfbc2el, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 4, 0x784bfbea39bfbc2fl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 4, 0x8c04758cbc2f862l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 4, 0x8c04758cbc2f863l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUint4Uint4Uint4(inV1, out);
- verifyResultsMaxUint4Uint4Uint4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUint4Uint4Uint4(inA, out);
+ verifyResultsMaxUint4Uint4Uint4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUint4Uint4Uint4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUint4Uint4Uint4(inV1, out);
- verifyResultsMaxUint4Uint4Uint4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUint4Uint4Uint4(inA, out);
+ verifyResultsMaxUint4Uint4Uint4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUint4Uint4Uint4: " + e.toString());
}
}
- private void verifyResultsMaxUint4Uint4Uint4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUint4Uint4Uint4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsUintUintUint args = new ArgumentsUintUintUint();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1890,11 +1890,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1913,45 +1913,45 @@
}
public class ArgumentsLongLongLong {
- public long inV1;
- public long inV2;
+ public long inA;
+ public long inB;
public long out;
}
private void checkMaxLongLongLong() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 1, 0xe224db3c7ecb92e4l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 1, 0xe224db3c7ecb92e5l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 1, 0x542587285eceb84l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 1, 0x542587285eceb85l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxLongLongLong(inV1, out);
- verifyResultsMaxLongLongLong(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxLongLongLong(inA, out);
+ verifyResultsMaxLongLongLong(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxLongLongLong: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxLongLongLong(inV1, out);
- verifyResultsMaxLongLongLong(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxLongLongLong(inA, out);
+ verifyResultsMaxLongLongLong(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxLongLongLong: " + e.toString());
}
}
- private void verifyResultsMaxLongLongLong(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxLongLongLong(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsLongLongLong args = new ArgumentsLongLongLong();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -1961,11 +1961,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1984,39 +1984,39 @@
}
private void checkMaxLong2Long2Long2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 2, 0x375f5f0ca264eb56l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 2, 0x375f5f0ca264eb57l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 2, 0xc5c0bac4c249c9dal, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 2, 0xc5c0bac4c249c9dbl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxLong2Long2Long2(inV1, out);
- verifyResultsMaxLong2Long2Long2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxLong2Long2Long2(inA, out);
+ verifyResultsMaxLong2Long2Long2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxLong2Long2Long2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxLong2Long2Long2(inV1, out);
- verifyResultsMaxLong2Long2Long2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxLong2Long2Long2(inA, out);
+ verifyResultsMaxLong2Long2Long2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxLong2Long2Long2: " + e.toString());
}
}
- private void verifyResultsMaxLong2Long2Long2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxLong2Long2Long2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsLongLongLong args = new ArgumentsLongLongLong();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -2026,11 +2026,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -2049,39 +2049,39 @@
}
private void checkMaxLong3Long3Long3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 3, 0x8cb0db3f871cbe1bl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 3, 0x8cb0db3f871cbe1cl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 3, 0xeb753aae20e8daa9l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 3, 0xeb753aae20e8daaal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxLong3Long3Long3(inV1, out);
- verifyResultsMaxLong3Long3Long3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxLong3Long3Long3(inA, out);
+ verifyResultsMaxLong3Long3Long3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxLong3Long3Long3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxLong3Long3Long3(inV1, out);
- verifyResultsMaxLong3Long3Long3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxLong3Long3Long3(inA, out);
+ verifyResultsMaxLong3Long3Long3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxLong3Long3Long3: " + e.toString());
}
}
- private void verifyResultsMaxLong3Long3Long3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxLong3Long3Long3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsLongLongLong args = new ArgumentsLongLongLong();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -2091,11 +2091,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -2114,39 +2114,39 @@
}
private void checkMaxLong4Long4Long4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 4, 0xe20257726bd490e0l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 4, 0xe20257726bd490e1l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 4, 0x1129ba977f87eb78l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 4, 0x1129ba977f87eb79l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxLong4Long4Long4(inV1, out);
- verifyResultsMaxLong4Long4Long4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxLong4Long4Long4(inA, out);
+ verifyResultsMaxLong4Long4Long4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxLong4Long4Long4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxLong4Long4Long4(inV1, out);
- verifyResultsMaxLong4Long4Long4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxLong4Long4Long4(inA, out);
+ verifyResultsMaxLong4Long4Long4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxLong4Long4Long4: " + e.toString());
}
}
- private void verifyResultsMaxLong4Long4Long4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxLong4Long4Long4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsLongLongLong args = new ArgumentsLongLongLong();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -2156,11 +2156,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -2179,45 +2179,45 @@
}
public class ArgumentsUlongUlongUlong {
- public long inV1;
- public long inV2;
+ public long inA;
+ public long inB;
public long out;
}
private void checkMaxUlongUlongUlong() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 1, 0xb38270e909275f1dl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 1, 0xb38270e909275f1el, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 1, 0x8d1ad8f38f18baafl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 1, 0x8d1ad8f38f18bab0l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUlongUlongUlong(inV1, out);
- verifyResultsMaxUlongUlongUlong(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUlongUlongUlong(inA, out);
+ verifyResultsMaxUlongUlongUlong(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUlongUlongUlong: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUlongUlongUlong(inV1, out);
- verifyResultsMaxUlongUlongUlong(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUlongUlongUlong(inA, out);
+ verifyResultsMaxUlongUlongUlong(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUlongUlongUlong: " + e.toString());
}
}
- private void verifyResultsMaxUlongUlongUlong(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUlongUlongUlong(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsUlongUlongUlong args = new ArgumentsUlongUlongUlong();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -2227,11 +2227,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -2250,39 +2250,39 @@
}
private void checkMaxUlong2Ulong2Ulong2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 2, 0x7f6c5ec5fee1a8afl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 2, 0x7f6c5ec5fee1a8b0l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 2, 0x6e2049a55946bc65l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 2, 0x6e2049a55946bc66l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUlong2Ulong2Ulong2(inV1, out);
- verifyResultsMaxUlong2Ulong2Ulong2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUlong2Ulong2Ulong2(inA, out);
+ verifyResultsMaxUlong2Ulong2Ulong2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUlong2Ulong2Ulong2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUlong2Ulong2Ulong2(inV1, out);
- verifyResultsMaxUlong2Ulong2Ulong2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUlong2Ulong2Ulong2(inA, out);
+ verifyResultsMaxUlong2Ulong2Ulong2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUlong2Ulong2Ulong2: " + e.toString());
}
}
- private void verifyResultsMaxUlong2Ulong2Ulong2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUlong2Ulong2Ulong2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsUlongUlongUlong args = new ArgumentsUlongUlongUlong();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -2292,11 +2292,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -2315,39 +2315,39 @@
}
private void checkMaxUlong3Ulong3Ulong3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 3, 0xac5dae264f2beebal, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 3, 0xac5dae264f2beebbl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 3, 0xc28527c55b24be06l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 3, 0xc28527c55b24be07l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUlong3Ulong3Ulong3(inV1, out);
- verifyResultsMaxUlong3Ulong3Ulong3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUlong3Ulong3Ulong3(inA, out);
+ verifyResultsMaxUlong3Ulong3Ulong3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUlong3Ulong3Ulong3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUlong3Ulong3Ulong3(inV1, out);
- verifyResultsMaxUlong3Ulong3Ulong3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUlong3Ulong3Ulong3(inA, out);
+ verifyResultsMaxUlong3Ulong3Ulong3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUlong3Ulong3Ulong3: " + e.toString());
}
}
- private void verifyResultsMaxUlong3Ulong3Ulong3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUlong3Ulong3Ulong3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsUlongUlongUlong args = new ArgumentsUlongUlongUlong();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -2357,11 +2357,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -2380,39 +2380,39 @@
}
private void checkMaxUlong4Ulong4Ulong4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 4, 0xd94efd869f7634c5l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 4, 0xd94efd869f7634c6l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 4, 0x16ea05e55d02bfa7l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 4, 0x16ea05e55d02bfa8l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMaxUlong4Ulong4Ulong4(inV1, out);
- verifyResultsMaxUlong4Ulong4Ulong4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMaxUlong4Ulong4Ulong4(inA, out);
+ verifyResultsMaxUlong4Ulong4Ulong4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUlong4Ulong4Ulong4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMaxUlong4Ulong4Ulong4(inV1, out);
- verifyResultsMaxUlong4Ulong4Ulong4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMaxUlong4Ulong4Ulong4(inA, out);
+ verifyResultsMaxUlong4Ulong4Ulong4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMaxUlong4Ulong4Ulong4: " + e.toString());
}
}
- private void verifyResultsMaxUlong4Ulong4Ulong4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMaxUlong4Ulong4Ulong4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsUlongUlongUlong args = new ArgumentsUlongUlongUlong();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMax(args);
// Validate the outputs.
@@ -2422,11 +2422,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMax.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMax.rs
new file mode 100644
index 0000000..ae8dd6a
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMax.rs
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInB;
+
+float __attribute__((kernel)) testMaxFloatFloatFloat(float inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return max(inA, inB);
+}
+
+float2 __attribute__((kernel)) testMaxFloat2Float2Float2(float2 inA, unsigned int x) {
+ float2 inB = rsGetElementAt_float2(gAllocInB, x);
+ return max(inA, inB);
+}
+
+float3 __attribute__((kernel)) testMaxFloat3Float3Float3(float3 inA, unsigned int x) {
+ float3 inB = rsGetElementAt_float3(gAllocInB, x);
+ return max(inA, inB);
+}
+
+float4 __attribute__((kernel)) testMaxFloat4Float4Float4(float4 inA, unsigned int x) {
+ float4 inB = rsGetElementAt_float4(gAllocInB, x);
+ return max(inA, inB);
+}
+
+char __attribute__((kernel)) testMaxCharCharChar(char inA, unsigned int x) {
+ char inB = rsGetElementAt_char(gAllocInB, x);
+ return max(inA, inB);
+}
+
+char2 __attribute__((kernel)) testMaxChar2Char2Char2(char2 inA, unsigned int x) {
+ char2 inB = rsGetElementAt_char2(gAllocInB, x);
+ return max(inA, inB);
+}
+
+char3 __attribute__((kernel)) testMaxChar3Char3Char3(char3 inA, unsigned int x) {
+ char3 inB = rsGetElementAt_char3(gAllocInB, x);
+ return max(inA, inB);
+}
+
+char4 __attribute__((kernel)) testMaxChar4Char4Char4(char4 inA, unsigned int x) {
+ char4 inB = rsGetElementAt_char4(gAllocInB, x);
+ return max(inA, inB);
+}
+
+uchar __attribute__((kernel)) testMaxUcharUcharUchar(uchar inA, unsigned int x) {
+ uchar inB = rsGetElementAt_uchar(gAllocInB, x);
+ return max(inA, inB);
+}
+
+uchar2 __attribute__((kernel)) testMaxUchar2Uchar2Uchar2(uchar2 inA, unsigned int x) {
+ uchar2 inB = rsGetElementAt_uchar2(gAllocInB, x);
+ return max(inA, inB);
+}
+
+uchar3 __attribute__((kernel)) testMaxUchar3Uchar3Uchar3(uchar3 inA, unsigned int x) {
+ uchar3 inB = rsGetElementAt_uchar3(gAllocInB, x);
+ return max(inA, inB);
+}
+
+uchar4 __attribute__((kernel)) testMaxUchar4Uchar4Uchar4(uchar4 inA, unsigned int x) {
+ uchar4 inB = rsGetElementAt_uchar4(gAllocInB, x);
+ return max(inA, inB);
+}
+
+short __attribute__((kernel)) testMaxShortShortShort(short inA, unsigned int x) {
+ short inB = rsGetElementAt_short(gAllocInB, x);
+ return max(inA, inB);
+}
+
+short2 __attribute__((kernel)) testMaxShort2Short2Short2(short2 inA, unsigned int x) {
+ short2 inB = rsGetElementAt_short2(gAllocInB, x);
+ return max(inA, inB);
+}
+
+short3 __attribute__((kernel)) testMaxShort3Short3Short3(short3 inA, unsigned int x) {
+ short3 inB = rsGetElementAt_short3(gAllocInB, x);
+ return max(inA, inB);
+}
+
+short4 __attribute__((kernel)) testMaxShort4Short4Short4(short4 inA, unsigned int x) {
+ short4 inB = rsGetElementAt_short4(gAllocInB, x);
+ return max(inA, inB);
+}
+
+ushort __attribute__((kernel)) testMaxUshortUshortUshort(ushort inA, unsigned int x) {
+ ushort inB = rsGetElementAt_ushort(gAllocInB, x);
+ return max(inA, inB);
+}
+
+ushort2 __attribute__((kernel)) testMaxUshort2Ushort2Ushort2(ushort2 inA, unsigned int x) {
+ ushort2 inB = rsGetElementAt_ushort2(gAllocInB, x);
+ return max(inA, inB);
+}
+
+ushort3 __attribute__((kernel)) testMaxUshort3Ushort3Ushort3(ushort3 inA, unsigned int x) {
+ ushort3 inB = rsGetElementAt_ushort3(gAllocInB, x);
+ return max(inA, inB);
+}
+
+ushort4 __attribute__((kernel)) testMaxUshort4Ushort4Ushort4(ushort4 inA, unsigned int x) {
+ ushort4 inB = rsGetElementAt_ushort4(gAllocInB, x);
+ return max(inA, inB);
+}
+
+int __attribute__((kernel)) testMaxIntIntInt(int inA, unsigned int x) {
+ int inB = rsGetElementAt_int(gAllocInB, x);
+ return max(inA, inB);
+}
+
+int2 __attribute__((kernel)) testMaxInt2Int2Int2(int2 inA, unsigned int x) {
+ int2 inB = rsGetElementAt_int2(gAllocInB, x);
+ return max(inA, inB);
+}
+
+int3 __attribute__((kernel)) testMaxInt3Int3Int3(int3 inA, unsigned int x) {
+ int3 inB = rsGetElementAt_int3(gAllocInB, x);
+ return max(inA, inB);
+}
+
+int4 __attribute__((kernel)) testMaxInt4Int4Int4(int4 inA, unsigned int x) {
+ int4 inB = rsGetElementAt_int4(gAllocInB, x);
+ return max(inA, inB);
+}
+
+uint __attribute__((kernel)) testMaxUintUintUint(uint inA, unsigned int x) {
+ uint inB = rsGetElementAt_uint(gAllocInB, x);
+ return max(inA, inB);
+}
+
+uint2 __attribute__((kernel)) testMaxUint2Uint2Uint2(uint2 inA, unsigned int x) {
+ uint2 inB = rsGetElementAt_uint2(gAllocInB, x);
+ return max(inA, inB);
+}
+
+uint3 __attribute__((kernel)) testMaxUint3Uint3Uint3(uint3 inA, unsigned int x) {
+ uint3 inB = rsGetElementAt_uint3(gAllocInB, x);
+ return max(inA, inB);
+}
+
+uint4 __attribute__((kernel)) testMaxUint4Uint4Uint4(uint4 inA, unsigned int x) {
+ uint4 inB = rsGetElementAt_uint4(gAllocInB, x);
+ return max(inA, inB);
+}
+
+long __attribute__((kernel)) testMaxLongLongLong(long inA, unsigned int x) {
+ long inB = rsGetElementAt_long(gAllocInB, x);
+ return max(inA, inB);
+}
+
+long2 __attribute__((kernel)) testMaxLong2Long2Long2(long2 inA, unsigned int x) {
+ long2 inB = rsGetElementAt_long2(gAllocInB, x);
+ return max(inA, inB);
+}
+
+long3 __attribute__((kernel)) testMaxLong3Long3Long3(long3 inA, unsigned int x) {
+ long3 inB = rsGetElementAt_long3(gAllocInB, x);
+ return max(inA, inB);
+}
+
+long4 __attribute__((kernel)) testMaxLong4Long4Long4(long4 inA, unsigned int x) {
+ long4 inB = rsGetElementAt_long4(gAllocInB, x);
+ return max(inA, inB);
+}
+
+ulong __attribute__((kernel)) testMaxUlongUlongUlong(ulong inA, unsigned int x) {
+ ulong inB = rsGetElementAt_ulong(gAllocInB, x);
+ return max(inA, inB);
+}
+
+ulong2 __attribute__((kernel)) testMaxUlong2Ulong2Ulong2(ulong2 inA, unsigned int x) {
+ ulong2 inB = rsGetElementAt_ulong2(gAllocInB, x);
+ return max(inA, inB);
+}
+
+ulong3 __attribute__((kernel)) testMaxUlong3Ulong3Ulong3(ulong3 inA, unsigned int x) {
+ ulong3 inB = rsGetElementAt_ulong3(gAllocInB, x);
+ return max(inA, inB);
+}
+
+ulong4 __attribute__((kernel)) testMaxUlong4Ulong4Ulong4(ulong4 inA, unsigned int x) {
+ ulong4 inB = rsGetElementAt_ulong4(gAllocInB, x);
+ return max(inA, inB);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMaxRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMaxRelaxed.rs
index 66f3fef..2f229a5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMaxRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestMax.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMin.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMin.java
similarity index 67%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestMin.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMin.java
index a04ef55..46a888e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMin.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMin.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestMin extends RSBaseCompute {
+public class GeneratedTestMin extends RSBaseCompute {
- private ScriptC_TestMin script;
- private ScriptC_TestMinRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestMin script;
+ private ScriptC_GeneratedTestMinRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestMin(mRS);
- scriptRelaxed = new ScriptC_TestMinRelaxed(mRS);
+ script = new ScriptC_GeneratedTestMin(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestMinRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float in;
- public float in1;
+ public float inA;
+ public float inB;
public Target.Floaty out;
}
private void checkMinFloatFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x816f2fe273bf4977l, false);
- Allocation in1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xbdad0b097121572el, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xbdad0b097121573el, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xbdad0b097121573fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocIn1(in1);
- script.forEach_testMinFloatFloatFloat(in, out);
- verifyResultsMinFloatFloatFloat(in, in1, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinFloatFloatFloat(inA, out);
+ verifyResultsMinFloatFloatFloat(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocIn1(in1);
- scriptRelaxed.forEach_testMinFloatFloatFloat(in, out);
- verifyResultsMinFloatFloatFloat(in, in1, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinFloatFloatFloat(inA, out);
+ verifyResultsMinFloatFloatFloat(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsMinFloatFloatFloat(Allocation in, Allocation in1, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayIn1 = new float[INPUTSIZE * 1];
- in1.copyTo(arrayIn1);
+ private void verifyResultsMinFloatFloatFloat(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.in = arrayIn[i];
- args.in1 = arrayIn1[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMin(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input in1: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in1, Float.floatToRawIntBits(args.in1), args.in1));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkMinFloat2Float2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xe354049301b6cfb9l, false);
- Allocation in1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2f1cc4b149b4e444l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2f1cc4b149b4e454l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2f1cc4b149b4e455l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocIn1(in1);
- script.forEach_testMinFloat2Float2Float2(in, out);
- verifyResultsMinFloat2Float2Float2(in, in1, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinFloat2Float2Float2(inA, out);
+ verifyResultsMinFloat2Float2Float2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocIn1(in1);
- scriptRelaxed.forEach_testMinFloat2Float2Float2(in, out);
- verifyResultsMinFloat2Float2Float2(in, in1, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinFloat2Float2Float2(inA, out);
+ verifyResultsMinFloat2Float2Float2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsMinFloat2Float2Float2(Allocation in, Allocation in1, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayIn1 = new float[INPUTSIZE * 2];
- in1.copyTo(arrayIn1);
+ private void verifyResultsMinFloat2Float2Float2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.in = arrayIn[i * 2 + j];
- args.in1 = arrayIn1[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMin(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input in1: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in1, Float.floatToRawIntBits(args.in1), args.in1));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkMinFloat3Float3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x38a3c24c4f27231cl, false);
- Allocation in1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x8381a2d14b92e5e5l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x8381a2d14b92e5f5l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x8381a2d14b92e5f6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocIn1(in1);
- script.forEach_testMinFloat3Float3Float3(in, out);
- verifyResultsMinFloat3Float3Float3(in, in1, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinFloat3Float3Float3(inA, out);
+ verifyResultsMinFloat3Float3Float3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocIn1(in1);
- scriptRelaxed.forEach_testMinFloat3Float3Float3(in, out);
- verifyResultsMinFloat3Float3Float3(in, in1, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinFloat3Float3Float3(inA, out);
+ verifyResultsMinFloat3Float3Float3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsMinFloat3Float3Float3(Allocation in, Allocation in1, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayIn1 = new float[INPUTSIZE * 4];
- in1.copyTo(arrayIn1);
+ private void verifyResultsMinFloat3Float3Float3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.in = arrayIn[i * 4 + j];
- args.in1 = arrayIn1[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMin(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input in1: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in1, Float.floatToRawIntBits(args.in1), args.in1));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkMinFloat4Float4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x8df380059c97767fl, false);
- Allocation in1 = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd7e680f14d70e786l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd7e680f14d70e796l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd7e680f14d70e797l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocIn1(in1);
- script.forEach_testMinFloat4Float4Float4(in, out);
- verifyResultsMinFloat4Float4Float4(in, in1, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinFloat4Float4Float4(inA, out);
+ verifyResultsMinFloat4Float4Float4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocIn1(in1);
- scriptRelaxed.forEach_testMinFloat4Float4Float4(in, out);
- verifyResultsMinFloat4Float4Float4(in, in1, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinFloat4Float4Float4(inA, out);
+ verifyResultsMinFloat4Float4Float4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsMinFloat4Float4Float4(Allocation in, Allocation in1, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayIn1 = new float[INPUTSIZE * 4];
- in1.copyTo(arrayIn1);
+ private void verifyResultsMinFloat4Float4Float4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ float[] arrayInA = new float[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ float[] arrayInB = new float[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.in = arrayIn[i * 4 + j];
- args.in1 = arrayIn1[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMin(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inA: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inA, Float.floatToRawIntBits(args.inA), args.inA));
message.append("\n");
- message.append("Input in1: ");
+ message.append("Input inB: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in1, Float.floatToRawIntBits(args.in1), args.in1));
+ args.inB, Float.floatToRawIntBits(args.inB), args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -317,45 +317,45 @@
}
public class ArgumentsCharCharChar {
- public byte inV1;
- public byte inV2;
+ public byte inA;
+ public byte inB;
public byte out;
}
private void checkMinCharCharChar() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 1, 0x47c90c486fc45b58l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 1, 0x47c90c486fc45b59l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 1, 0x78bd3bd20e8196e0l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 1, 0x78bd3bd20e8196e1l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinCharCharChar(inV1, out);
- verifyResultsMinCharCharChar(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinCharCharChar(inA, out);
+ verifyResultsMinCharCharChar(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinCharCharChar: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinCharCharChar(inV1, out);
- verifyResultsMinCharCharChar(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinCharCharChar(inA, out);
+ verifyResultsMinCharCharChar(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinCharCharChar: " + e.toString());
}
}
- private void verifyResultsMinCharCharChar(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinCharCharChar(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsCharCharChar args = new ArgumentsCharCharChar();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -365,11 +365,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -388,39 +388,39 @@
}
private void checkMinChar2Char2Char2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 2, 0xec4705afc03447ael, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 2, 0xec4705afc03447afl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 2, 0x29373baac8ef5ae2l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 2, 0x29373baac8ef5ae3l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinChar2Char2Char2(inV1, out);
- verifyResultsMinChar2Char2Char2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinChar2Char2Char2(inA, out);
+ verifyResultsMinChar2Char2Char2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinChar2Char2Char2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinChar2Char2Char2(inV1, out);
- verifyResultsMinChar2Char2Char2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinChar2Char2Char2(inA, out);
+ verifyResultsMinChar2Char2Char2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinChar2Char2Char2: " + e.toString());
}
}
- private void verifyResultsMinChar2Char2Char2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinChar2Char2Char2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsCharCharChar args = new ArgumentsCharCharChar();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -430,11 +430,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -453,39 +453,39 @@
}
private void checkMinChar3Char3Char3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 3, 0x419881e2a4ec1a73l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 3, 0x419881e2a4ec1a74l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 3, 0x4eebbb94278e6bb1l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 3, 0x4eebbb94278e6bb2l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinChar3Char3Char3(inV1, out);
- verifyResultsMinChar3Char3Char3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinChar3Char3Char3(inA, out);
+ verifyResultsMinChar3Char3Char3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinChar3Char3Char3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinChar3Char3Char3(inV1, out);
- verifyResultsMinChar3Char3Char3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinChar3Char3Char3(inA, out);
+ verifyResultsMinChar3Char3Char3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinChar3Char3Char3: " + e.toString());
}
}
- private void verifyResultsMinChar3Char3Char3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinChar3Char3Char3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsCharCharChar args = new ArgumentsCharCharChar();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -495,11 +495,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -518,39 +518,39 @@
}
private void checkMinChar4Char4Char4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 4, 0x96e9fe1589a3ed38l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 4, 0x96e9fe1589a3ed39l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 4, 0x74a03b7d862d7c80l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_8, 4, 0x74a03b7d862d7c81l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinChar4Char4Char4(inV1, out);
- verifyResultsMinChar4Char4Char4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinChar4Char4Char4(inA, out);
+ verifyResultsMinChar4Char4Char4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinChar4Char4Char4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_8, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinChar4Char4Char4(inV1, out);
- verifyResultsMinChar4Char4Char4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinChar4Char4Char4(inA, out);
+ verifyResultsMinChar4Char4Char4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinChar4Char4Char4: " + e.toString());
}
}
- private void verifyResultsMinChar4Char4Char4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinChar4Char4Char4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsCharCharChar args = new ArgumentsCharCharChar();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -560,11 +560,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -583,45 +583,45 @@
}
public class ArgumentsUcharUcharUchar {
- public byte inV1;
- public byte inV2;
+ public byte inA;
+ public byte inB;
public byte out;
}
private void checkMinUcharUcharUchar() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 1, 0x6dc5402bc7a34891l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 1, 0x6dc5402bc7a34892l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 1, 0x1469cbe93445490bl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 1, 0x1469cbe93445490cl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUcharUcharUchar(inV1, out);
- verifyResultsMinUcharUcharUchar(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUcharUcharUchar(inA, out);
+ verifyResultsMinUcharUcharUchar(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUcharUcharUchar: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUcharUcharUchar(inV1, out);
- verifyResultsMinUcharUcharUchar(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUcharUcharUchar(inA, out);
+ verifyResultsMinUcharUcharUchar(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUcharUcharUchar: " + e.toString());
}
}
- private void verifyResultsMinUcharUcharUchar(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUcharUcharUchar(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsUcharUcharUchar args = new ArgumentsUcharUcharUchar();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -631,11 +631,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -654,39 +654,39 @@
}
private void checkMinUchar2Uchar2Uchar2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 2, 0x1d3c921d166e22ffl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 2, 0x1d3c921d166e2300l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 2, 0x3c36fd71caf0b355l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 2, 0x3c36fd71caf0b356l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUchar2Uchar2Uchar2(inV1, out);
- verifyResultsMinUchar2Uchar2Uchar2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUchar2Uchar2Uchar2(inA, out);
+ verifyResultsMinUchar2Uchar2Uchar2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUchar2Uchar2Uchar2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUchar2Uchar2Uchar2(inV1, out);
- verifyResultsMinUchar2Uchar2Uchar2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUchar2Uchar2Uchar2(inA, out);
+ verifyResultsMinUchar2Uchar2Uchar2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUchar2Uchar2Uchar2: " + e.toString());
}
}
- private void verifyResultsMinUchar2Uchar2Uchar2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUchar2Uchar2Uchar2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsUcharUcharUchar args = new ArgumentsUcharUcharUchar();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -696,11 +696,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -719,39 +719,39 @@
}
private void checkMinUchar3Uchar3Uchar3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 3, 0x4a2de17d66b8690al, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 3, 0x4a2de17d66b8690bl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 3, 0x909bdb91ccceb4f6l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 3, 0x909bdb91ccceb4f7l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUchar3Uchar3Uchar3(inV1, out);
- verifyResultsMinUchar3Uchar3Uchar3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUchar3Uchar3Uchar3(inA, out);
+ verifyResultsMinUchar3Uchar3Uchar3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUchar3Uchar3Uchar3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUchar3Uchar3Uchar3(inV1, out);
- verifyResultsMinUchar3Uchar3Uchar3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUchar3Uchar3Uchar3(inA, out);
+ verifyResultsMinUchar3Uchar3Uchar3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUchar3Uchar3Uchar3: " + e.toString());
}
}
- private void verifyResultsMinUchar3Uchar3Uchar3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUchar3Uchar3Uchar3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsUcharUcharUchar args = new ArgumentsUcharUcharUchar();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -761,11 +761,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -784,39 +784,39 @@
}
private void checkMinUchar4Uchar4Uchar4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 4, 0x771f30ddb702af15l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 4, 0x771f30ddb702af16l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 4, 0xe500b9b1ceacb697l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_8, 4, 0xe500b9b1ceacb698l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUchar4Uchar4Uchar4(inV1, out);
- verifyResultsMinUchar4Uchar4Uchar4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUchar4Uchar4Uchar4(inA, out);
+ verifyResultsMinUchar4Uchar4Uchar4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUchar4Uchar4Uchar4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_8, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUchar4Uchar4Uchar4(inV1, out);
- verifyResultsMinUchar4Uchar4Uchar4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUchar4Uchar4Uchar4(inA, out);
+ verifyResultsMinUchar4Uchar4Uchar4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUchar4Uchar4Uchar4: " + e.toString());
}
}
- private void verifyResultsMinUchar4Uchar4Uchar4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- byte[] arrayInV1 = new byte[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- byte[] arrayInV2 = new byte[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUchar4Uchar4Uchar4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ byte[] arrayInA = new byte[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ byte[] arrayInB = new byte[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
byte[] arrayOut = new byte[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsUcharUcharUchar args = new ArgumentsUcharUcharUchar();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -826,11 +826,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -849,45 +849,45 @@
}
public class ArgumentsShortShortShort {
- public short inV1;
- public short inV2;
+ public short inA;
+ public short inB;
public short out;
}
private void checkMinShortShortShort() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 1, 0x71b08dd3c65bcddel, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 1, 0x71b08dd3c65bcddfl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 1, 0x265d6881f2c0a572l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 1, 0x265d6881f2c0a573l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinShortShortShort(inV1, out);
- verifyResultsMinShortShortShort(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinShortShortShort(inA, out);
+ verifyResultsMinShortShortShort(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinShortShortShort: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinShortShortShort(inV1, out);
- verifyResultsMinShortShortShort(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinShortShortShort(inA, out);
+ verifyResultsMinShortShortShort(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinShortShortShort: " + e.toString());
}
}
- private void verifyResultsMinShortShortShort(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinShortShortShort(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsShortShortShort args = new ArgumentsShortShortShort();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -897,11 +897,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -920,39 +920,39 @@
}
private void checkMinShort2Short2Short2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 2, 0xe4959a1ecbf1d380l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 2, 0xe4959a1ecbf1d381l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 2, 0xac037aa769f3c358l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 2, 0xac037aa769f3c359l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinShort2Short2Short2(inV1, out);
- verifyResultsMinShort2Short2Short2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinShort2Short2Short2(inA, out);
+ verifyResultsMinShort2Short2Short2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinShort2Short2Short2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinShort2Short2Short2(inV1, out);
- verifyResultsMinShort2Short2Short2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinShort2Short2Short2(inA, out);
+ verifyResultsMinShort2Short2Short2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinShort2Short2Short2: " + e.toString());
}
}
- private void verifyResultsMinShort2Short2Short2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinShort2Short2Short2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsShortShortShort args = new ArgumentsShortShortShort();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -962,11 +962,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -985,39 +985,39 @@
}
private void checkMinShort3Short3Short3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 3, 0x1186e97f1c3c198bl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 3, 0x1186e97f1c3c198cl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 3, 0x6858c76bd1c4f9l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 3, 0x6858c76bd1c4fal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinShort3Short3Short3(inV1, out);
- verifyResultsMinShort3Short3Short3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinShort3Short3Short3(inA, out);
+ verifyResultsMinShort3Short3Short3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinShort3Short3Short3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinShort3Short3Short3(inV1, out);
- verifyResultsMinShort3Short3Short3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinShort3Short3Short3(inA, out);
+ verifyResultsMinShort3Short3Short3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinShort3Short3Short3: " + e.toString());
}
}
- private void verifyResultsMinShort3Short3Short3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinShort3Short3Short3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsShortShortShort args = new ArgumentsShortShortShort();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1027,11 +1027,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1050,39 +1050,39 @@
}
private void checkMinShort4Short4Short4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 4, 0x3e7838df6c865f96l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 4, 0x3e7838df6c865f97l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 4, 0x54cd36e76dafc69al, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_16, 4, 0x54cd36e76dafc69bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinShort4Short4Short4(inV1, out);
- verifyResultsMinShort4Short4Short4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinShort4Short4Short4(inA, out);
+ verifyResultsMinShort4Short4Short4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinShort4Short4Short4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_16, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinShort4Short4Short4(inV1, out);
- verifyResultsMinShort4Short4Short4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinShort4Short4Short4(inA, out);
+ verifyResultsMinShort4Short4Short4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinShort4Short4Short4: " + e.toString());
}
}
- private void verifyResultsMinShort4Short4Short4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinShort4Short4Short4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsShortShortShort args = new ArgumentsShortShortShort();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1092,11 +1092,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1115,45 +1115,45 @@
}
public class ArgumentsUshortUshortUshort {
- public short inV1;
- public short inV2;
+ public short inA;
+ public short inB;
public short out;
}
private void checkMinUshortUshortUshort() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 1, 0xc2eb3387512e77cfl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 1, 0xc2eb3387512e77d0l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 1, 0xf8a042afcc4e79c5l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 1, 0xf8a042afcc4e79c6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUshortUshortUshort(inV1, out);
- verifyResultsMinUshortUshortUshort(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUshortUshortUshort(inA, out);
+ verifyResultsMinUshortUshortUshort(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUshortUshortUshort: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUshortUshortUshort(inV1, out);
- verifyResultsMinUshortUshortUshort(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUshortUshortUshort(inA, out);
+ verifyResultsMinUshortUshortUshort(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUshortUshortUshort: " + e.toString());
}
}
- private void verifyResultsMinUshortUshortUshort(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUshortUshortUshort(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsUshortUshortUshort args = new ArgumentsUshortUshortUshort();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1163,11 +1163,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1186,39 +1186,39 @@
}
private void checkMinUshort2Ushort2Ushort2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 2, 0x98573ebbc511e319l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 2, 0x98573ebbc511e31al, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 2, 0x2743846f878f4ca3l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 2, 0x2743846f878f4ca4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUshort2Ushort2Ushort2(inV1, out);
- verifyResultsMinUshort2Ushort2Ushort2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUshort2Ushort2Ushort2(inA, out);
+ verifyResultsMinUshort2Ushort2Ushort2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUshort2Ushort2Ushort2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUshort2Ushort2Ushort2(inV1, out);
- verifyResultsMinUshort2Ushort2Ushort2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUshort2Ushort2Ushort2(inA, out);
+ verifyResultsMinUshort2Ushort2Ushort2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUshort2Ushort2Ushort2: " + e.toString());
}
}
- private void verifyResultsMinUshort2Ushort2Ushort2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUshort2Ushort2Ushort2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsUshortUshortUshort args = new ArgumentsUshortUshortUshort();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1228,11 +1228,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1251,39 +1251,39 @@
}
private void checkMinUshort3Ushort3Ushort3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 3, 0x1595f09b03867776l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 3, 0x1595f09b03867777l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 3, 0xa7331d68d0743e3al, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 3, 0xa7331d68d0743e3bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUshort3Ushort3Ushort3(inV1, out);
- verifyResultsMinUshort3Ushort3Ushort3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUshort3Ushort3Ushort3(inA, out);
+ verifyResultsMinUshort3Ushort3Ushort3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUshort3Ushort3Ushort3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUshort3Ushort3Ushort3(inV1, out);
- verifyResultsMinUshort3Ushort3Ushort3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUshort3Ushort3Ushort3(inA, out);
+ verifyResultsMinUshort3Ushort3Ushort3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUshort3Ushort3Ushort3: " + e.toString());
}
}
- private void verifyResultsMinUshort3Ushort3Ushort3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUshort3Ushort3Ushort3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsUshortUshortUshort args = new ArgumentsUshortUshortUshort();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1293,11 +1293,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1316,39 +1316,39 @@
}
private void checkMinUshort4Ushort4Ushort4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 4, 0x92d4a27a41fb0bd3l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 4, 0x92d4a27a41fb0bd4l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 4, 0x2722b66219592fd1l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_16, 4, 0x2722b66219592fd2l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUshort4Ushort4Ushort4(inV1, out);
- verifyResultsMinUshort4Ushort4Ushort4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUshort4Ushort4Ushort4(inA, out);
+ verifyResultsMinUshort4Ushort4Ushort4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUshort4Ushort4Ushort4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_16, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUshort4Ushort4Ushort4(inV1, out);
- verifyResultsMinUshort4Ushort4Ushort4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUshort4Ushort4Ushort4(inA, out);
+ verifyResultsMinUshort4Ushort4Ushort4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUshort4Ushort4Ushort4: " + e.toString());
}
}
- private void verifyResultsMinUshort4Ushort4Ushort4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- short[] arrayInV1 = new short[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- short[] arrayInV2 = new short[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUshort4Ushort4Ushort4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ short[] arrayInA = new short[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ short[] arrayInB = new short[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
short[] arrayOut = new short[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsUshortUshortUshort args = new ArgumentsUshortUshortUshort();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1358,11 +1358,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1381,45 +1381,45 @@
}
public class ArgumentsIntIntInt {
- public int inV1;
- public int inV2;
+ public int inA;
+ public int inB;
public int out;
}
private void checkMinIntIntInt() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0x38b24335cda69cd5l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0x38b24335cda69cd6l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0xfb5d72ade703dfd7l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0xfb5d72ade703dfd8l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinIntIntInt(inV1, out);
- verifyResultsMinIntIntInt(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinIntIntInt(inA, out);
+ verifyResultsMinIntIntInt(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinIntIntInt: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinIntIntInt(inV1, out);
- verifyResultsMinIntIntInt(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinIntIntInt(inA, out);
+ verifyResultsMinIntIntInt(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinIntIntInt: " + e.toString());
}
}
- private void verifyResultsMinIntIntInt(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinIntIntInt(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsIntIntInt args = new ArgumentsIntIntInt();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1429,11 +1429,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1452,39 +1452,39 @@
}
private void checkMinInt2Int2Int2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0xba635b605676e7a3l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0xba635b605676e7a4l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0x4bc6c69713df0b41l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0x4bc6c69713df0b42l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinInt2Int2Int2(inV1, out);
- verifyResultsMinInt2Int2Int2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinInt2Int2Int2(inA, out);
+ verifyResultsMinInt2Int2Int2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinInt2Int2Int2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinInt2Int2Int2(inV1, out);
- verifyResultsMinInt2Int2Int2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinInt2Int2Int2(inA, out);
+ verifyResultsMinInt2Int2Int2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinInt2Int2Int2: " + e.toString());
}
}
- private void verifyResultsMinInt2Int2Int2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinInt2Int2Int2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsIntIntInt args = new ArgumentsIntIntInt();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1494,11 +1494,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1517,39 +1517,39 @@
}
private void checkMinInt3Int3Int3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0xe4f086806849fbc6l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0xe4f086806849fbc7l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0x58ac4a91deb4532al, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0x58ac4a91deb4532bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinInt3Int3Int3(inV1, out);
- verifyResultsMinInt3Int3Int3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinInt3Int3Int3(inA, out);
+ verifyResultsMinInt3Int3Int3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinInt3Int3Int3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinInt3Int3Int3(inV1, out);
- verifyResultsMinInt3Int3Int3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinInt3Int3Int3(inA, out);
+ verifyResultsMinInt3Int3Int3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinInt3Int3Int3: " + e.toString());
}
}
- private void verifyResultsMinInt3Int3Int3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinInt3Int3Int3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsIntIntInt args = new ArgumentsIntIntInt();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1559,11 +1559,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1582,39 +1582,39 @@
}
private void checkMinInt4Int4Int4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0xf7db1a07a1d0fe9l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0xf7db1a07a1d0feal, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0x6591ce8ca9899b13l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0x6591ce8ca9899b14l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinInt4Int4Int4(inV1, out);
- verifyResultsMinInt4Int4Int4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinInt4Int4Int4(inA, out);
+ verifyResultsMinInt4Int4Int4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinInt4Int4Int4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinInt4Int4Int4(inV1, out);
- verifyResultsMinInt4Int4Int4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinInt4Int4Int4(inA, out);
+ verifyResultsMinInt4Int4Int4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinInt4Int4Int4: " + e.toString());
}
}
- private void verifyResultsMinInt4Int4Int4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinInt4Int4Int4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsIntIntInt args = new ArgumentsIntIntInt();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1624,11 +1624,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1647,45 +1647,45 @@
}
public class ArgumentsUintUintUint {
- public int inV1;
- public int inV2;
+ public int inA;
+ public int inB;
public int out;
}
private void checkMinUintUintUint() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 1, 0xb3dbca2d537cf298l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 1, 0xb3dbca2d537cf299l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 1, 0xe66a5218de387ca0l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 1, 0xe66a5218de387ca1l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUintUintUint(inV1, out);
- verifyResultsMinUintUintUint(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUintUintUint(inA, out);
+ verifyResultsMinUintUintUint(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUintUintUint: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUintUintUint(inV1, out);
- verifyResultsMinUintUintUint(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUintUintUint(inA, out);
+ verifyResultsMinUintUintUint(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUintUintUint: " + e.toString());
}
}
- private void verifyResultsMinUintUintUint(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUintUintUint(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsUintUintUint args = new ArgumentsUintUintUint();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1695,11 +1695,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1718,39 +1718,39 @@
}
private void checkMinUint2Uint2Uint2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 2, 0xb8cf8481d731a1eel, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 2, 0xb8cf8481d731a1efl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 2, 0x51b17a26bd9009a2l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 2, 0x51b17a26bd9009a3l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUint2Uint2Uint2(inV1, out);
- verifyResultsMinUint2Uint2Uint2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUint2Uint2Uint2(inA, out);
+ verifyResultsMinUint2Uint2Uint2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUint2Uint2Uint2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUint2Uint2Uint2(inV1, out);
- verifyResultsMinUint2Uint2Uint2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUint2Uint2Uint2(inA, out);
+ verifyResultsMinUint2Uint2Uint2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUint2Uint2Uint2: " + e.toString());
}
}
- private void verifyResultsMinUint2Uint2Uint2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUint2Uint2Uint2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsUintUintUint args = new ArgumentsUintUintUint();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1760,11 +1760,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1783,39 +1783,39 @@
}
private void checkMinUint3Uint3Uint3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 3, 0xe2100b4bbe974b3l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 3, 0xe2100b4bbe974b4l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 3, 0x7765fa101c2f1a71l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 3, 0x7765fa101c2f1a72l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUint3Uint3Uint3(inV1, out);
- verifyResultsMinUint3Uint3Uint3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUint3Uint3Uint3(inA, out);
+ verifyResultsMinUint3Uint3Uint3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUint3Uint3Uint3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUint3Uint3Uint3(inV1, out);
- verifyResultsMinUint3Uint3Uint3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUint3Uint3Uint3(inA, out);
+ verifyResultsMinUint3Uint3Uint3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUint3Uint3Uint3: " + e.toString());
}
}
- private void verifyResultsMinUint3Uint3Uint3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUint3Uint3Uint3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsUintUintUint args = new ArgumentsUintUintUint();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1825,11 +1825,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1848,39 +1848,39 @@
}
private void checkMinUint4Uint4Uint4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 4, 0x63727ce7a0a14778l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 4, 0x63727ce7a0a14779l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 4, 0x9d1a79f97ace2b40l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 4, 0x9d1a79f97ace2b41l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUint4Uint4Uint4(inV1, out);
- verifyResultsMinUint4Uint4Uint4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUint4Uint4Uint4(inA, out);
+ verifyResultsMinUint4Uint4Uint4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUint4Uint4Uint4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUint4Uint4Uint4(inV1, out);
- verifyResultsMinUint4Uint4Uint4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUint4Uint4Uint4(inA, out);
+ verifyResultsMinUint4Uint4Uint4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUint4Uint4Uint4: " + e.toString());
}
}
- private void verifyResultsMinUint4Uint4Uint4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- int[] arrayInV1 = new int[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- int[] arrayInV2 = new int[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUint4Uint4Uint4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ int[] arrayInA = new int[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ int[] arrayInB = new int[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
int[] arrayOut = new int[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsUintUintUint args = new ArgumentsUintUintUint();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1890,11 +1890,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -1913,45 +1913,45 @@
}
public class ArgumentsLongLongLong {
- public long inV1;
- public long inV2;
+ public long inA;
+ public long inB;
public long out;
}
private void checkMinLongLongLong() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 1, 0x20ce185251c10eb2l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 1, 0x20ce185251c10eb3l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 1, 0x1e87c507de2e29eel, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 1, 0x1e87c507de2e29efl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinLongLongLong(inV1, out);
- verifyResultsMinLongLongLong(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinLongLongLong(inA, out);
+ verifyResultsMinLongLongLong(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinLongLongLong: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinLongLongLong(inV1, out);
- verifyResultsMinLongLongLong(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinLongLongLong(inA, out);
+ verifyResultsMinLongLongLong(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinLongLongLong: " + e.toString());
}
}
- private void verifyResultsMinLongLongLong(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinLongLongLong(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsLongLongLong args = new ArgumentsLongLongLong();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -1961,11 +1961,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -1984,39 +1984,39 @@
}
private void checkMinLong2Long2Long2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 2, 0x2285e00a094676a0l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 2, 0x2285e00a094676a1l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 2, 0x5a1aed657154fcb8l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 2, 0x5a1aed657154fcb9l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinLong2Long2Long2(inV1, out);
- verifyResultsMinLong2Long2Long2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinLong2Long2Long2(inA, out);
+ verifyResultsMinLong2Long2Long2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinLong2Long2Long2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinLong2Long2Long2(inV1, out);
- verifyResultsMinLong2Long2Long2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinLong2Long2Long2(inA, out);
+ verifyResultsMinLong2Long2Long2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinLong2Long2Long2: " + e.toString());
}
}
- private void verifyResultsMinLong2Long2Long2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinLong2Long2Long2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsLongLongLong args = new ArgumentsLongLongLong();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -2026,11 +2026,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -2049,39 +2049,39 @@
}
private void checkMinLong3Long3Long3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 3, 0x77d75c3cedfe4965l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 3, 0x77d75c3cedfe4966l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 3, 0x7fcf6d4ecff40d87l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 3, 0x7fcf6d4ecff40d88l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinLong3Long3Long3(inV1, out);
- verifyResultsMinLong3Long3Long3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinLong3Long3Long3(inA, out);
+ verifyResultsMinLong3Long3Long3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinLong3Long3Long3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinLong3Long3Long3(inV1, out);
- verifyResultsMinLong3Long3Long3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinLong3Long3Long3(inA, out);
+ verifyResultsMinLong3Long3Long3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinLong3Long3Long3: " + e.toString());
}
}
- private void verifyResultsMinLong3Long3Long3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinLong3Long3Long3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsLongLongLong args = new ArgumentsLongLongLong();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -2091,11 +2091,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -2114,39 +2114,39 @@
}
private void checkMinLong4Long4Long4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 4, 0xcd28d86fd2b61c2al, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 4, 0xcd28d86fd2b61c2bl, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 4, 0xa583ed382e931e56l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.SIGNED_64, 4, 0xa583ed382e931e57l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinLong4Long4Long4(inV1, out);
- verifyResultsMinLong4Long4Long4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinLong4Long4Long4(inA, out);
+ verifyResultsMinLong4Long4Long4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinLong4Long4Long4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_64, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinLong4Long4Long4(inV1, out);
- verifyResultsMinLong4Long4Long4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinLong4Long4Long4(inA, out);
+ verifyResultsMinLong4Long4Long4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinLong4Long4Long4: " + e.toString());
}
}
- private void verifyResultsMinLong4Long4Long4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinLong4Long4Long4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsLongLongLong args = new ArgumentsLongLongLong();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -2156,11 +2156,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("%d", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("%d", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("%d", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("%d", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("%d", args.out));
@@ -2179,45 +2179,45 @@
}
public class ArgumentsUlongUlongUlong {
- public long inV1;
- public long inV2;
+ public long inA;
+ public long inB;
public long out;
}
private void checkMinUlongUlongUlong() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 1, 0x9ea8f1e67008ea67l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 1, 0x9ea8f1e67008ea68l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 1, 0x21750b943e23ed8dl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 1, 0x21750b943e23ed8el, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 1), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUlongUlongUlong(inV1, out);
- verifyResultsMinUlongUlongUlong(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUlongUlongUlong(inA, out);
+ verifyResultsMinUlongUlongUlong(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUlongUlongUlong: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUlongUlongUlong(inV1, out);
- verifyResultsMinUlongUlongUlong(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUlongUlongUlong(inA, out);
+ verifyResultsMinUlongUlongUlong(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUlongUlongUlong: " + e.toString());
}
}
- private void verifyResultsMinUlongUlongUlong(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 1];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 1];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUlongUlongUlong(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 1];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 1];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsUlongUlongUlong args = new ArgumentsUlongUlongUlong();
- args.inV1 = arrayInV1[i];
- args.inV2 = arrayInV2[i];
+ args.inA = arrayInA[i];
+ args.inB = arrayInB[i];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -2227,11 +2227,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -2250,39 +2250,39 @@
}
private void checkMinUlong2Ulong2Ulong2() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 2, 0x26bb4add3110402dl, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 2, 0x26bb4add3110402el, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 2, 0xd739efe16c4dc5dfl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 2, 0xd739efe16c4dc5e0l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 2), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUlong2Ulong2Ulong2(inV1, out);
- verifyResultsMinUlong2Ulong2Ulong2(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUlong2Ulong2Ulong2(inA, out);
+ verifyResultsMinUlong2Ulong2Ulong2(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUlong2Ulong2Ulong2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUlong2Ulong2Ulong2(inV1, out);
- verifyResultsMinUlong2Ulong2Ulong2(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUlong2Ulong2Ulong2(inA, out);
+ verifyResultsMinUlong2Ulong2Ulong2(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUlong2Ulong2Ulong2: " + e.toString());
}
}
- private void verifyResultsMinUlong2Ulong2Ulong2(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 2];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 2];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUlong2Ulong2Ulong2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 2];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 2];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsUlongUlongUlong args = new ArgumentsUlongUlongUlong();
- args.inV1 = arrayInV1[i * 2 + j];
- args.inV2 = arrayInV2[i * 2 + j];
+ args.inA = arrayInA[i * 2 + j];
+ args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -2292,11 +2292,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -2315,39 +2315,39 @@
}
private void checkMinUlong3Ulong3Ulong3() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 3, 0x53ac9a3d815a8638l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 3, 0x53ac9a3d815a8639l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 3, 0x2b9ece016e2bc780l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 3, 0x2b9ece016e2bc781l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 3), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUlong3Ulong3Ulong3(inV1, out);
- verifyResultsMinUlong3Ulong3Ulong3(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUlong3Ulong3Ulong3(inA, out);
+ verifyResultsMinUlong3Ulong3Ulong3(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUlong3Ulong3Ulong3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUlong3Ulong3Ulong3(inV1, out);
- verifyResultsMinUlong3Ulong3Ulong3(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUlong3Ulong3Ulong3(inA, out);
+ verifyResultsMinUlong3Ulong3Ulong3(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUlong3Ulong3Ulong3: " + e.toString());
}
}
- private void verifyResultsMinUlong3Ulong3Ulong3(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUlong3Ulong3Ulong3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsUlongUlongUlong args = new ArgumentsUlongUlongUlong();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -2357,11 +2357,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
@@ -2380,39 +2380,39 @@
}
private void checkMinUlong4Ulong4Ulong4() {
- Allocation inV1 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 4, 0x809de99dd1a4cc43l, false);
- Allocation inV2 = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 4, 0x809de99dd1a4cc44l, false);
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 4, 0x8003ac217009c921l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.UNSIGNED_64, 4, 0x8003ac217009c922l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 4), INPUTSIZE);
- script.set_gAllocInV2(inV2);
- script.forEach_testMinUlong4Ulong4Ulong4(inV1, out);
- verifyResultsMinUlong4Ulong4Ulong4(inV1, inV2, out, false);
+ script.set_gAllocInB(inB);
+ script.forEach_testMinUlong4Ulong4Ulong4(inA, out);
+ verifyResultsMinUlong4Ulong4Ulong4(inA, inB, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUlong4Ulong4Ulong4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.UNSIGNED_64, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInV2(inV2);
- scriptRelaxed.forEach_testMinUlong4Ulong4Ulong4(inV1, out);
- verifyResultsMinUlong4Ulong4Ulong4(inV1, inV2, out, true);
+ scriptRelaxed.set_gAllocInB(inB);
+ scriptRelaxed.forEach_testMinUlong4Ulong4Ulong4(inA, out);
+ verifyResultsMinUlong4Ulong4Ulong4(inA, inB, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMinUlong4Ulong4Ulong4: " + e.toString());
}
}
- private void verifyResultsMinUlong4Ulong4Ulong4(Allocation inV1, Allocation inV2, Allocation out, boolean relaxed) {
- long[] arrayInV1 = new long[INPUTSIZE * 4];
- inV1.copyTo(arrayInV1);
- long[] arrayInV2 = new long[INPUTSIZE * 4];
- inV2.copyTo(arrayInV2);
+ private void verifyResultsMinUlong4Ulong4Ulong4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ long[] arrayInA = new long[INPUTSIZE * 4];
+ inA.copyTo(arrayInA);
+ long[] arrayInB = new long[INPUTSIZE * 4];
+ inB.copyTo(arrayInB);
long[] arrayOut = new long[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsUlongUlongUlong args = new ArgumentsUlongUlongUlong();
- args.inV1 = arrayInV1[i * 4 + j];
- args.inV2 = arrayInV2[i * 4 + j];
+ args.inA = arrayInA[i * 4 + j];
+ args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
CoreMathVerifier.computeMin(args);
// Validate the outputs.
@@ -2422,11 +2422,11 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV1: ");
- message.append(String.format("0x%x", args.inV1));
+ message.append("Input inA: ");
+ message.append(String.format("0x%x", args.inA));
message.append("\n");
- message.append("Input inV2: ");
- message.append(String.format("0x%x", args.inV2));
+ message.append("Input inB: ");
+ message.append(String.format("0x%x", args.inB));
message.append("\n");
message.append("Expected output out: ");
message.append(String.format("0x%x", args.out));
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMin.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMin.rs
new file mode 100644
index 0000000..4242cf2
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMin.rs
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInB;
+
+float __attribute__((kernel)) testMinFloatFloatFloat(float inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return min(inA, inB);
+}
+
+float2 __attribute__((kernel)) testMinFloat2Float2Float2(float2 inA, unsigned int x) {
+ float2 inB = rsGetElementAt_float2(gAllocInB, x);
+ return min(inA, inB);
+}
+
+float3 __attribute__((kernel)) testMinFloat3Float3Float3(float3 inA, unsigned int x) {
+ float3 inB = rsGetElementAt_float3(gAllocInB, x);
+ return min(inA, inB);
+}
+
+float4 __attribute__((kernel)) testMinFloat4Float4Float4(float4 inA, unsigned int x) {
+ float4 inB = rsGetElementAt_float4(gAllocInB, x);
+ return min(inA, inB);
+}
+
+char __attribute__((kernel)) testMinCharCharChar(char inA, unsigned int x) {
+ char inB = rsGetElementAt_char(gAllocInB, x);
+ return min(inA, inB);
+}
+
+char2 __attribute__((kernel)) testMinChar2Char2Char2(char2 inA, unsigned int x) {
+ char2 inB = rsGetElementAt_char2(gAllocInB, x);
+ return min(inA, inB);
+}
+
+char3 __attribute__((kernel)) testMinChar3Char3Char3(char3 inA, unsigned int x) {
+ char3 inB = rsGetElementAt_char3(gAllocInB, x);
+ return min(inA, inB);
+}
+
+char4 __attribute__((kernel)) testMinChar4Char4Char4(char4 inA, unsigned int x) {
+ char4 inB = rsGetElementAt_char4(gAllocInB, x);
+ return min(inA, inB);
+}
+
+uchar __attribute__((kernel)) testMinUcharUcharUchar(uchar inA, unsigned int x) {
+ uchar inB = rsGetElementAt_uchar(gAllocInB, x);
+ return min(inA, inB);
+}
+
+uchar2 __attribute__((kernel)) testMinUchar2Uchar2Uchar2(uchar2 inA, unsigned int x) {
+ uchar2 inB = rsGetElementAt_uchar2(gAllocInB, x);
+ return min(inA, inB);
+}
+
+uchar3 __attribute__((kernel)) testMinUchar3Uchar3Uchar3(uchar3 inA, unsigned int x) {
+ uchar3 inB = rsGetElementAt_uchar3(gAllocInB, x);
+ return min(inA, inB);
+}
+
+uchar4 __attribute__((kernel)) testMinUchar4Uchar4Uchar4(uchar4 inA, unsigned int x) {
+ uchar4 inB = rsGetElementAt_uchar4(gAllocInB, x);
+ return min(inA, inB);
+}
+
+short __attribute__((kernel)) testMinShortShortShort(short inA, unsigned int x) {
+ short inB = rsGetElementAt_short(gAllocInB, x);
+ return min(inA, inB);
+}
+
+short2 __attribute__((kernel)) testMinShort2Short2Short2(short2 inA, unsigned int x) {
+ short2 inB = rsGetElementAt_short2(gAllocInB, x);
+ return min(inA, inB);
+}
+
+short3 __attribute__((kernel)) testMinShort3Short3Short3(short3 inA, unsigned int x) {
+ short3 inB = rsGetElementAt_short3(gAllocInB, x);
+ return min(inA, inB);
+}
+
+short4 __attribute__((kernel)) testMinShort4Short4Short4(short4 inA, unsigned int x) {
+ short4 inB = rsGetElementAt_short4(gAllocInB, x);
+ return min(inA, inB);
+}
+
+ushort __attribute__((kernel)) testMinUshortUshortUshort(ushort inA, unsigned int x) {
+ ushort inB = rsGetElementAt_ushort(gAllocInB, x);
+ return min(inA, inB);
+}
+
+ushort2 __attribute__((kernel)) testMinUshort2Ushort2Ushort2(ushort2 inA, unsigned int x) {
+ ushort2 inB = rsGetElementAt_ushort2(gAllocInB, x);
+ return min(inA, inB);
+}
+
+ushort3 __attribute__((kernel)) testMinUshort3Ushort3Ushort3(ushort3 inA, unsigned int x) {
+ ushort3 inB = rsGetElementAt_ushort3(gAllocInB, x);
+ return min(inA, inB);
+}
+
+ushort4 __attribute__((kernel)) testMinUshort4Ushort4Ushort4(ushort4 inA, unsigned int x) {
+ ushort4 inB = rsGetElementAt_ushort4(gAllocInB, x);
+ return min(inA, inB);
+}
+
+int __attribute__((kernel)) testMinIntIntInt(int inA, unsigned int x) {
+ int inB = rsGetElementAt_int(gAllocInB, x);
+ return min(inA, inB);
+}
+
+int2 __attribute__((kernel)) testMinInt2Int2Int2(int2 inA, unsigned int x) {
+ int2 inB = rsGetElementAt_int2(gAllocInB, x);
+ return min(inA, inB);
+}
+
+int3 __attribute__((kernel)) testMinInt3Int3Int3(int3 inA, unsigned int x) {
+ int3 inB = rsGetElementAt_int3(gAllocInB, x);
+ return min(inA, inB);
+}
+
+int4 __attribute__((kernel)) testMinInt4Int4Int4(int4 inA, unsigned int x) {
+ int4 inB = rsGetElementAt_int4(gAllocInB, x);
+ return min(inA, inB);
+}
+
+uint __attribute__((kernel)) testMinUintUintUint(uint inA, unsigned int x) {
+ uint inB = rsGetElementAt_uint(gAllocInB, x);
+ return min(inA, inB);
+}
+
+uint2 __attribute__((kernel)) testMinUint2Uint2Uint2(uint2 inA, unsigned int x) {
+ uint2 inB = rsGetElementAt_uint2(gAllocInB, x);
+ return min(inA, inB);
+}
+
+uint3 __attribute__((kernel)) testMinUint3Uint3Uint3(uint3 inA, unsigned int x) {
+ uint3 inB = rsGetElementAt_uint3(gAllocInB, x);
+ return min(inA, inB);
+}
+
+uint4 __attribute__((kernel)) testMinUint4Uint4Uint4(uint4 inA, unsigned int x) {
+ uint4 inB = rsGetElementAt_uint4(gAllocInB, x);
+ return min(inA, inB);
+}
+
+long __attribute__((kernel)) testMinLongLongLong(long inA, unsigned int x) {
+ long inB = rsGetElementAt_long(gAllocInB, x);
+ return min(inA, inB);
+}
+
+long2 __attribute__((kernel)) testMinLong2Long2Long2(long2 inA, unsigned int x) {
+ long2 inB = rsGetElementAt_long2(gAllocInB, x);
+ return min(inA, inB);
+}
+
+long3 __attribute__((kernel)) testMinLong3Long3Long3(long3 inA, unsigned int x) {
+ long3 inB = rsGetElementAt_long3(gAllocInB, x);
+ return min(inA, inB);
+}
+
+long4 __attribute__((kernel)) testMinLong4Long4Long4(long4 inA, unsigned int x) {
+ long4 inB = rsGetElementAt_long4(gAllocInB, x);
+ return min(inA, inB);
+}
+
+ulong __attribute__((kernel)) testMinUlongUlongUlong(ulong inA, unsigned int x) {
+ ulong inB = rsGetElementAt_ulong(gAllocInB, x);
+ return min(inA, inB);
+}
+
+ulong2 __attribute__((kernel)) testMinUlong2Ulong2Ulong2(ulong2 inA, unsigned int x) {
+ ulong2 inB = rsGetElementAt_ulong2(gAllocInB, x);
+ return min(inA, inB);
+}
+
+ulong3 __attribute__((kernel)) testMinUlong3Ulong3Ulong3(ulong3 inA, unsigned int x) {
+ ulong3 inB = rsGetElementAt_ulong3(gAllocInB, x);
+ return min(inA, inB);
+}
+
+ulong4 __attribute__((kernel)) testMinUlong4Ulong4Ulong4(ulong4 inA, unsigned int x) {
+ ulong4 inB = rsGetElementAt_ulong4(gAllocInB, x);
+ return min(inA, inB);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMinRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMinRelaxed.rs
index 66f3fef..1481223 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMinRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestMin.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMix.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMix.java
similarity index 84%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestMix.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMix.java
index 3500e41..9853a0c 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMix.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMix.java
@@ -22,56 +22,56 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestMix extends RSBaseCompute {
+public class GeneratedTestMix extends RSBaseCompute {
- private ScriptC_TestMix script;
- private ScriptC_TestMixRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestMix script;
+ private ScriptC_GeneratedTestMixRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestMix(mRS);
- scriptRelaxed = new ScriptC_TestMixRelaxed(mRS);
+ script = new ScriptC_GeneratedTestMix(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestMixRelaxed(mRS);
}
public class ArgumentsFloatFloatFloatFloat {
public float inStart;
public float inStop;
- public float inAmount;
+ public float inFraction;
public Target.Floaty out;
}
private void checkMixFloatFloatFloatFloat() {
Allocation inStart = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x9f4beff6471d6db1l, false);
Allocation inStop = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x6ede0b88b4422e8fl, false);
- Allocation inAmount = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xc1c14e5d52dc3fe5l, false);
+ Allocation inFraction = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x6d2f014ec6a51d9fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
script.set_gAllocInStop(inStop);
- script.set_gAllocInAmount(inAmount);
+ script.set_gAllocInFraction(inFraction);
script.forEach_testMixFloatFloatFloatFloat(inStart, out);
- verifyResultsMixFloatFloatFloatFloat(inStart, inStop, inAmount, out, false);
+ verifyResultsMixFloatFloatFloatFloat(inStart, inStop, inFraction, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloatFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
scriptRelaxed.set_gAllocInStop(inStop);
- scriptRelaxed.set_gAllocInAmount(inAmount);
+ scriptRelaxed.set_gAllocInFraction(inFraction);
scriptRelaxed.forEach_testMixFloatFloatFloatFloat(inStart, out);
- verifyResultsMixFloatFloatFloatFloat(inStart, inStop, inAmount, out, true);
+ verifyResultsMixFloatFloatFloatFloat(inStart, inStop, inFraction, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloatFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsMixFloatFloatFloatFloat(Allocation inStart, Allocation inStop, Allocation inAmount, Allocation out, boolean relaxed) {
+ private void verifyResultsMixFloatFloatFloatFloat(Allocation inStart, Allocation inStop, Allocation inFraction, Allocation out, boolean relaxed) {
float[] arrayInStart = new float[INPUTSIZE * 1];
inStart.copyTo(arrayInStart);
float[] arrayInStop = new float[INPUTSIZE * 1];
inStop.copyTo(arrayInStop);
- float[] arrayInAmount = new float[INPUTSIZE * 1];
- inAmount.copyTo(arrayInAmount);
+ float[] arrayInFraction = new float[INPUTSIZE * 1];
+ inFraction.copyTo(arrayInFraction);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -80,7 +80,7 @@
ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
args.inStart = arrayInStart[i];
args.inStop = arrayInStop[i];
- args.inAmount = arrayInAmount[i];
+ args.inFraction = arrayInFraction[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMix(args, target);
@@ -99,9 +99,9 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inStop, Float.floatToRawIntBits(args.inStop), args.inStop));
message.append("\n");
- message.append("Input inAmount: ");
+ message.append("Input inFraction: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inAmount, Float.floatToRawIntBits(args.inAmount), args.inAmount));
+ args.inFraction, Float.floatToRawIntBits(args.inFraction), args.inFraction));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -123,34 +123,34 @@
private void checkMixFloat2Float2Float2Float2() {
Allocation inStart = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x45502e8f0a2d9ce9l, false);
Allocation inStop = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xba2b8a035395e837l, false);
- Allocation inAmount = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xa477d20616942e4dl, false);
+ Allocation inFraction = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xe56bef3c621e0ac7l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
script.set_gAllocInStop(inStop);
- script.set_gAllocInAmount(inAmount);
+ script.set_gAllocInFraction(inFraction);
script.forEach_testMixFloat2Float2Float2Float2(inStart, out);
- verifyResultsMixFloat2Float2Float2Float2(inStart, inStop, inAmount, out, false);
+ verifyResultsMixFloat2Float2Float2Float2(inStart, inStop, inFraction, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat2Float2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
scriptRelaxed.set_gAllocInStop(inStop);
- scriptRelaxed.set_gAllocInAmount(inAmount);
+ scriptRelaxed.set_gAllocInFraction(inFraction);
scriptRelaxed.forEach_testMixFloat2Float2Float2Float2(inStart, out);
- verifyResultsMixFloat2Float2Float2Float2(inStart, inStop, inAmount, out, true);
+ verifyResultsMixFloat2Float2Float2Float2(inStart, inStop, inFraction, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat2Float2Float2Float2: " + e.toString());
}
}
- private void verifyResultsMixFloat2Float2Float2Float2(Allocation inStart, Allocation inStop, Allocation inAmount, Allocation out, boolean relaxed) {
+ private void verifyResultsMixFloat2Float2Float2Float2(Allocation inStart, Allocation inStop, Allocation inFraction, Allocation out, boolean relaxed) {
float[] arrayInStart = new float[INPUTSIZE * 2];
inStart.copyTo(arrayInStart);
float[] arrayInStop = new float[INPUTSIZE * 2];
inStop.copyTo(arrayInStop);
- float[] arrayInAmount = new float[INPUTSIZE * 2];
- inAmount.copyTo(arrayInAmount);
+ float[] arrayInFraction = new float[INPUTSIZE * 2];
+ inFraction.copyTo(arrayInFraction);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -159,7 +159,7 @@
ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
args.inStart = arrayInStart[i * 2 + j];
args.inStop = arrayInStop[i * 2 + j];
- args.inAmount = arrayInAmount[i * 2 + j];
+ args.inFraction = arrayInFraction[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMix(args, target);
@@ -178,9 +178,9 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inStop, Float.floatToRawIntBits(args.inStop), args.inStop));
message.append("\n");
- message.append("Input inAmount: ");
+ message.append("Input inFraction: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inAmount, Float.floatToRawIntBits(args.inAmount), args.inAmount));
+ args.inFraction, Float.floatToRawIntBits(args.inFraction), args.inFraction));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -202,34 +202,34 @@
private void checkMixFloat3Float3Float3Float3() {
Allocation inStart = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xeb4701726b009c5l, false);
Allocation inStop = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x9b21f6b3249ee4cbl, false);
- Allocation inAmount = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x784ed3e2e07c7741l, false);
+ Allocation inFraction = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xf15862eab0d4f51bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
script.set_gAllocInStop(inStop);
- script.set_gAllocInAmount(inAmount);
+ script.set_gAllocInFraction(inFraction);
script.forEach_testMixFloat3Float3Float3Float3(inStart, out);
- verifyResultsMixFloat3Float3Float3Float3(inStart, inStop, inAmount, out, false);
+ verifyResultsMixFloat3Float3Float3Float3(inStart, inStop, inFraction, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat3Float3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
scriptRelaxed.set_gAllocInStop(inStop);
- scriptRelaxed.set_gAllocInAmount(inAmount);
+ scriptRelaxed.set_gAllocInFraction(inFraction);
scriptRelaxed.forEach_testMixFloat3Float3Float3Float3(inStart, out);
- verifyResultsMixFloat3Float3Float3Float3(inStart, inStop, inAmount, out, true);
+ verifyResultsMixFloat3Float3Float3Float3(inStart, inStop, inFraction, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat3Float3Float3Float3: " + e.toString());
}
}
- private void verifyResultsMixFloat3Float3Float3Float3(Allocation inStart, Allocation inStop, Allocation inAmount, Allocation out, boolean relaxed) {
+ private void verifyResultsMixFloat3Float3Float3Float3(Allocation inStart, Allocation inStop, Allocation inFraction, Allocation out, boolean relaxed) {
float[] arrayInStart = new float[INPUTSIZE * 4];
inStart.copyTo(arrayInStart);
float[] arrayInStop = new float[INPUTSIZE * 4];
inStop.copyTo(arrayInStop);
- float[] arrayInAmount = new float[INPUTSIZE * 4];
- inAmount.copyTo(arrayInAmount);
+ float[] arrayInFraction = new float[INPUTSIZE * 4];
+ inFraction.copyTo(arrayInFraction);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -238,7 +238,7 @@
ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
args.inStart = arrayInStart[i * 4 + j];
args.inStop = arrayInStop[i * 4 + j];
- args.inAmount = arrayInAmount[i * 4 + j];
+ args.inFraction = arrayInFraction[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMix(args, target);
@@ -257,9 +257,9 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inStop, Float.floatToRawIntBits(args.inStop), args.inStop));
message.append("\n");
- message.append("Input inAmount: ");
+ message.append("Input inFraction: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inAmount, Float.floatToRawIntBits(args.inAmount), args.inAmount));
+ args.inFraction, Float.floatToRawIntBits(args.inFraction), args.inFraction));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -281,34 +281,34 @@
private void checkMixFloat4Float4Float4Float4() {
Allocation inStart = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd818b19f433276a1l, false);
Allocation inStop = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x7c186362f5a7e15fl, false);
- Allocation inAmount = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x4c25d5bfaa64c035l, false);
+ Allocation inFraction = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xfd44d698ff8bdf6fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
script.set_gAllocInStop(inStop);
- script.set_gAllocInAmount(inAmount);
+ script.set_gAllocInFraction(inFraction);
script.forEach_testMixFloat4Float4Float4Float4(inStart, out);
- verifyResultsMixFloat4Float4Float4Float4(inStart, inStop, inAmount, out, false);
+ verifyResultsMixFloat4Float4Float4Float4(inStart, inStop, inFraction, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat4Float4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
scriptRelaxed.set_gAllocInStop(inStop);
- scriptRelaxed.set_gAllocInAmount(inAmount);
+ scriptRelaxed.set_gAllocInFraction(inFraction);
scriptRelaxed.forEach_testMixFloat4Float4Float4Float4(inStart, out);
- verifyResultsMixFloat4Float4Float4Float4(inStart, inStop, inAmount, out, true);
+ verifyResultsMixFloat4Float4Float4Float4(inStart, inStop, inFraction, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat4Float4Float4Float4: " + e.toString());
}
}
- private void verifyResultsMixFloat4Float4Float4Float4(Allocation inStart, Allocation inStop, Allocation inAmount, Allocation out, boolean relaxed) {
+ private void verifyResultsMixFloat4Float4Float4Float4(Allocation inStart, Allocation inStop, Allocation inFraction, Allocation out, boolean relaxed) {
float[] arrayInStart = new float[INPUTSIZE * 4];
inStart.copyTo(arrayInStart);
float[] arrayInStop = new float[INPUTSIZE * 4];
inStop.copyTo(arrayInStop);
- float[] arrayInAmount = new float[INPUTSIZE * 4];
- inAmount.copyTo(arrayInAmount);
+ float[] arrayInFraction = new float[INPUTSIZE * 4];
+ inFraction.copyTo(arrayInFraction);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -317,7 +317,7 @@
ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
args.inStart = arrayInStart[i * 4 + j];
args.inStop = arrayInStop[i * 4 + j];
- args.inAmount = arrayInAmount[i * 4 + j];
+ args.inFraction = arrayInFraction[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMix(args, target);
@@ -336,9 +336,9 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inStop, Float.floatToRawIntBits(args.inStop), args.inStop));
message.append("\n");
- message.append("Input inAmount: ");
+ message.append("Input inFraction: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inAmount, Float.floatToRawIntBits(args.inAmount), args.inAmount));
+ args.inFraction, Float.floatToRawIntBits(args.inFraction), args.inFraction));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -360,34 +360,34 @@
private void checkMixFloat2Float2FloatFloat2() {
Allocation inStart = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xf811b2d52bd1d7c3l, false);
Allocation inStop = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x17a127e13c8dd1c5l, false);
- Allocation inAmount = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xaaf909cdbd2a10ebl, false);
+ Allocation inFraction = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe0b7d03e92afd1f5l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
script.set_gAllocInStop(inStop);
- script.set_gAllocInAmount(inAmount);
+ script.set_gAllocInFraction(inFraction);
script.forEach_testMixFloat2Float2FloatFloat2(inStart, out);
- verifyResultsMixFloat2Float2FloatFloat2(inStart, inStop, inAmount, out, false);
+ verifyResultsMixFloat2Float2FloatFloat2(inStart, inStop, inFraction, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat2Float2FloatFloat2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
scriptRelaxed.set_gAllocInStop(inStop);
- scriptRelaxed.set_gAllocInAmount(inAmount);
+ scriptRelaxed.set_gAllocInFraction(inFraction);
scriptRelaxed.forEach_testMixFloat2Float2FloatFloat2(inStart, out);
- verifyResultsMixFloat2Float2FloatFloat2(inStart, inStop, inAmount, out, true);
+ verifyResultsMixFloat2Float2FloatFloat2(inStart, inStop, inFraction, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat2Float2FloatFloat2: " + e.toString());
}
}
- private void verifyResultsMixFloat2Float2FloatFloat2(Allocation inStart, Allocation inStop, Allocation inAmount, Allocation out, boolean relaxed) {
+ private void verifyResultsMixFloat2Float2FloatFloat2(Allocation inStart, Allocation inStop, Allocation inFraction, Allocation out, boolean relaxed) {
float[] arrayInStart = new float[INPUTSIZE * 2];
inStart.copyTo(arrayInStart);
float[] arrayInStop = new float[INPUTSIZE * 2];
inStop.copyTo(arrayInStop);
- float[] arrayInAmount = new float[INPUTSIZE * 1];
- inAmount.copyTo(arrayInAmount);
+ float[] arrayInFraction = new float[INPUTSIZE * 1];
+ inFraction.copyTo(arrayInFraction);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -396,7 +396,7 @@
ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
args.inStart = arrayInStart[i * 2 + j];
args.inStop = arrayInStop[i * 2 + j];
- args.inAmount = arrayInAmount[i];
+ args.inFraction = arrayInFraction[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMix(args, target);
@@ -415,9 +415,9 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inStop, Float.floatToRawIntBits(args.inStop), args.inStop));
message.append("\n");
- message.append("Input inAmount: ");
+ message.append("Input inFraction: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inAmount, Float.floatToRawIntBits(args.inAmount), args.inAmount));
+ args.inFraction, Float.floatToRawIntBits(args.inFraction), args.inFraction));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -439,34 +439,34 @@
private void checkMixFloat3Float3FloatFloat3() {
Allocation inStart = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xae7aff441b20fa80l, false);
Allocation inStop = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xe64a4d60d6f4de7cl, false);
- Allocation inAmount = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x4ea8e06fef74e6aal, false);
+ Allocation inFraction = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x21bd09bbd131a27cl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
script.set_gAllocInStop(inStop);
- script.set_gAllocInAmount(inAmount);
+ script.set_gAllocInFraction(inFraction);
script.forEach_testMixFloat3Float3FloatFloat3(inStart, out);
- verifyResultsMixFloat3Float3FloatFloat3(inStart, inStop, inAmount, out, false);
+ verifyResultsMixFloat3Float3FloatFloat3(inStart, inStop, inFraction, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat3Float3FloatFloat3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
scriptRelaxed.set_gAllocInStop(inStop);
- scriptRelaxed.set_gAllocInAmount(inAmount);
+ scriptRelaxed.set_gAllocInFraction(inFraction);
scriptRelaxed.forEach_testMixFloat3Float3FloatFloat3(inStart, out);
- verifyResultsMixFloat3Float3FloatFloat3(inStart, inStop, inAmount, out, true);
+ verifyResultsMixFloat3Float3FloatFloat3(inStart, inStop, inFraction, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat3Float3FloatFloat3: " + e.toString());
}
}
- private void verifyResultsMixFloat3Float3FloatFloat3(Allocation inStart, Allocation inStop, Allocation inAmount, Allocation out, boolean relaxed) {
+ private void verifyResultsMixFloat3Float3FloatFloat3(Allocation inStart, Allocation inStop, Allocation inFraction, Allocation out, boolean relaxed) {
float[] arrayInStart = new float[INPUTSIZE * 4];
inStart.copyTo(arrayInStart);
float[] arrayInStop = new float[INPUTSIZE * 4];
inStop.copyTo(arrayInStop);
- float[] arrayInAmount = new float[INPUTSIZE * 1];
- inAmount.copyTo(arrayInAmount);
+ float[] arrayInFraction = new float[INPUTSIZE * 1];
+ inFraction.copyTo(arrayInFraction);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -475,7 +475,7 @@
ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
args.inStart = arrayInStart[i * 4 + j];
args.inStop = arrayInStop[i * 4 + j];
- args.inAmount = arrayInAmount[i];
+ args.inFraction = arrayInFraction[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMix(args, target);
@@ -494,9 +494,9 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inStop, Float.floatToRawIntBits(args.inStop), args.inStop));
message.append("\n");
- message.append("Input inAmount: ");
+ message.append("Input inFraction: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inAmount, Float.floatToRawIntBits(args.inAmount), args.inAmount));
+ args.inFraction, Float.floatToRawIntBits(args.inFraction), args.inFraction));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -518,34 +518,34 @@
private void checkMixFloat4Float4FloatFloat4() {
Allocation inStart = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x64e44bb30a701d3dl, false);
Allocation inStop = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xb4f372e0715beb33l, false);
- Allocation inAmount = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf258b71221bfbc69l, false);
+ Allocation inFraction = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x62c243390fb37303l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
script.set_gAllocInStop(inStop);
- script.set_gAllocInAmount(inAmount);
+ script.set_gAllocInFraction(inFraction);
script.forEach_testMixFloat4Float4FloatFloat4(inStart, out);
- verifyResultsMixFloat4Float4FloatFloat4(inStart, inStop, inAmount, out, false);
+ verifyResultsMixFloat4Float4FloatFloat4(inStart, inStop, inFraction, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat4Float4FloatFloat4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
scriptRelaxed.set_gAllocInStop(inStop);
- scriptRelaxed.set_gAllocInAmount(inAmount);
+ scriptRelaxed.set_gAllocInFraction(inFraction);
scriptRelaxed.forEach_testMixFloat4Float4FloatFloat4(inStart, out);
- verifyResultsMixFloat4Float4FloatFloat4(inStart, inStop, inAmount, out, true);
+ verifyResultsMixFloat4Float4FloatFloat4(inStart, inStop, inFraction, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMixFloat4Float4FloatFloat4: " + e.toString());
}
}
- private void verifyResultsMixFloat4Float4FloatFloat4(Allocation inStart, Allocation inStop, Allocation inAmount, Allocation out, boolean relaxed) {
+ private void verifyResultsMixFloat4Float4FloatFloat4(Allocation inStart, Allocation inStop, Allocation inFraction, Allocation out, boolean relaxed) {
float[] arrayInStart = new float[INPUTSIZE * 4];
inStart.copyTo(arrayInStart);
float[] arrayInStop = new float[INPUTSIZE * 4];
inStop.copyTo(arrayInStop);
- float[] arrayInAmount = new float[INPUTSIZE * 1];
- inAmount.copyTo(arrayInAmount);
+ float[] arrayInFraction = new float[INPUTSIZE * 1];
+ inFraction.copyTo(arrayInFraction);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -554,7 +554,7 @@
ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
args.inStart = arrayInStart[i * 4 + j];
args.inStop = arrayInStop[i * 4 + j];
- args.inAmount = arrayInAmount[i];
+ args.inFraction = arrayInFraction[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeMix(args, target);
@@ -573,9 +573,9 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inStop, Float.floatToRawIntBits(args.inStop), args.inStop));
message.append("\n");
- message.append("Input inAmount: ");
+ message.append("Input inFraction: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inAmount, Float.floatToRawIntBits(args.inAmount), args.inAmount));
+ args.inFraction, Float.floatToRawIntBits(args.inFraction), args.inFraction));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMix.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMix.rs
similarity index 70%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestMix.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMix.rs
index c2ebcb3..bb4e2dc 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMix.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMix.rs
@@ -20,46 +20,46 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
rs_allocation gAllocInStop;
-rs_allocation gAllocInAmount;
+rs_allocation gAllocInFraction;
float __attribute__((kernel)) testMixFloatFloatFloatFloat(float inStart, unsigned int x) {
float inStop = rsGetElementAt_float(gAllocInStop, x);
- float inAmount = rsGetElementAt_float(gAllocInAmount, x);
- return mix(inStart, inStop, inAmount);
+ float inFraction = rsGetElementAt_float(gAllocInFraction, x);
+ return mix(inStart, inStop, inFraction);
}
float2 __attribute__((kernel)) testMixFloat2Float2Float2Float2(float2 inStart, unsigned int x) {
float2 inStop = rsGetElementAt_float2(gAllocInStop, x);
- float2 inAmount = rsGetElementAt_float2(gAllocInAmount, x);
- return mix(inStart, inStop, inAmount);
+ float2 inFraction = rsGetElementAt_float2(gAllocInFraction, x);
+ return mix(inStart, inStop, inFraction);
}
float3 __attribute__((kernel)) testMixFloat3Float3Float3Float3(float3 inStart, unsigned int x) {
float3 inStop = rsGetElementAt_float3(gAllocInStop, x);
- float3 inAmount = rsGetElementAt_float3(gAllocInAmount, x);
- return mix(inStart, inStop, inAmount);
+ float3 inFraction = rsGetElementAt_float3(gAllocInFraction, x);
+ return mix(inStart, inStop, inFraction);
}
float4 __attribute__((kernel)) testMixFloat4Float4Float4Float4(float4 inStart, unsigned int x) {
float4 inStop = rsGetElementAt_float4(gAllocInStop, x);
- float4 inAmount = rsGetElementAt_float4(gAllocInAmount, x);
- return mix(inStart, inStop, inAmount);
+ float4 inFraction = rsGetElementAt_float4(gAllocInFraction, x);
+ return mix(inStart, inStop, inFraction);
}
float2 __attribute__((kernel)) testMixFloat2Float2FloatFloat2(float2 inStart, unsigned int x) {
float2 inStop = rsGetElementAt_float2(gAllocInStop, x);
- float inAmount = rsGetElementAt_float(gAllocInAmount, x);
- return mix(inStart, inStop, inAmount);
+ float inFraction = rsGetElementAt_float(gAllocInFraction, x);
+ return mix(inStart, inStop, inFraction);
}
float3 __attribute__((kernel)) testMixFloat3Float3FloatFloat3(float3 inStart, unsigned int x) {
float3 inStop = rsGetElementAt_float3(gAllocInStop, x);
- float inAmount = rsGetElementAt_float(gAllocInAmount, x);
- return mix(inStart, inStop, inAmount);
+ float inFraction = rsGetElementAt_float(gAllocInFraction, x);
+ return mix(inStart, inStop, inFraction);
}
float4 __attribute__((kernel)) testMixFloat4Float4FloatFloat4(float4 inStart, unsigned int x) {
float4 inStop = rsGetElementAt_float4(gAllocInStop, x);
- float inAmount = rsGetElementAt_float(gAllocInAmount, x);
- return mix(inStart, inStop, inAmount);
+ float inFraction = rsGetElementAt_float(gAllocInFraction, x);
+ return mix(inStart, inStop, inFraction);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMixRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMixRelaxed.rs
index 66f3fef..5a49fa6 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestMixRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestMix.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestModf.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestModf.java
similarity index 61%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestModf.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestModf.java
index 25d7765..a5d5d4c 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestModf.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestModf.java
@@ -22,64 +22,64 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestModf extends RSBaseCompute {
+public class GeneratedTestModf extends RSBaseCompute {
- private ScriptC_TestModf script;
- private ScriptC_TestModfRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestModf script;
+ private ScriptC_GeneratedTestModfRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestModf(mRS);
- scriptRelaxed = new ScriptC_TestModfRelaxed(mRS);
+ script = new ScriptC_GeneratedTestModf(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestModfRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inX;
- public Target.Floaty outIret;
+ public float inV;
+ public Target.Floaty outIntegralPart;
public Target.Floaty out;
}
private void checkModfFloatFloatFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xd655dc05ccaef47l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xd655dc05ccaef45l, false);
try {
- Allocation outIret = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ Allocation outIntegralPart = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocOutIret(outIret);
- script.forEach_testModfFloatFloatFloat(inX, out);
- verifyResultsModfFloatFloatFloat(inX, outIret, out, false);
+ script.set_gAllocOutIntegralPart(outIntegralPart);
+ script.forEach_testModfFloatFloatFloat(inV, out);
+ verifyResultsModfFloatFloatFloat(inV, outIntegralPart, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testModfFloatFloatFloat: " + e.toString());
}
try {
- Allocation outIret = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ Allocation outIntegralPart = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocOutIret(outIret);
- scriptRelaxed.forEach_testModfFloatFloatFloat(inX, out);
- verifyResultsModfFloatFloatFloat(inX, outIret, out, true);
+ scriptRelaxed.set_gAllocOutIntegralPart(outIntegralPart);
+ scriptRelaxed.forEach_testModfFloatFloatFloat(inV, out);
+ verifyResultsModfFloatFloatFloat(inV, outIntegralPart, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testModfFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsModfFloatFloatFloat(Allocation inX, Allocation outIret, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- float[] arrayOutIret = new float[INPUTSIZE * 1];
- outIret.copyTo(arrayOutIret);
+ private void verifyResultsModfFloatFloatFloat(Allocation inV, Allocation outIntegralPart, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
+ float[] arrayOutIntegralPart = new float[INPUTSIZE * 1];
+ outIntegralPart.copyTo(arrayOutIntegralPart);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeModf(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outIret.couldBe(arrayOutIret[i * 1 + j])) {
+ if (!args.outIntegralPart.couldBe(arrayOutIntegralPart[i * 1 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -87,17 +87,17 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outIret: ");
- message.append(args.outIret.toString());
+ message.append("Expected output outIntegralPart: ");
+ message.append(args.outIntegralPart.toString());
message.append("\n");
- message.append("Actual output outIret: ");
+ message.append("Actual output outIntegralPart: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutIret[i * 1 + j], Float.floatToRawIntBits(arrayOutIret[i * 1 + j]), arrayOutIret[i * 1 + j]));
- if (!args.outIret.couldBe(arrayOutIret[i * 1 + j])) {
+ arrayOutIntegralPart[i * 1 + j], Float.floatToRawIntBits(arrayOutIntegralPart[i * 1 + j]), arrayOutIntegralPart[i * 1 + j]));
+ if (!args.outIntegralPart.couldBe(arrayOutIntegralPart[i * 1 + j])) {
message.append(" FAIL");
}
message.append("\n");
@@ -119,45 +119,45 @@
}
private void checkModfFloat2Float2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2a1dc519fa163061l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2a1dc519fa16305fl, false);
try {
- Allocation outIret = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ Allocation outIntegralPart = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocOutIret(outIret);
- script.forEach_testModfFloat2Float2Float2(inX, out);
- verifyResultsModfFloat2Float2Float2(inX, outIret, out, false);
+ script.set_gAllocOutIntegralPart(outIntegralPart);
+ script.forEach_testModfFloat2Float2Float2(inV, out);
+ verifyResultsModfFloat2Float2Float2(inV, outIntegralPart, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testModfFloat2Float2Float2: " + e.toString());
}
try {
- Allocation outIret = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ Allocation outIntegralPart = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocOutIret(outIret);
- scriptRelaxed.forEach_testModfFloat2Float2Float2(inX, out);
- verifyResultsModfFloat2Float2Float2(inX, outIret, out, true);
+ scriptRelaxed.set_gAllocOutIntegralPart(outIntegralPart);
+ scriptRelaxed.forEach_testModfFloat2Float2Float2(inV, out);
+ verifyResultsModfFloat2Float2Float2(inV, outIntegralPart, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testModfFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsModfFloat2Float2Float2(Allocation inX, Allocation outIret, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayOutIret = new float[INPUTSIZE * 2];
- outIret.copyTo(arrayOutIret);
+ private void verifyResultsModfFloat2Float2Float2(Allocation inV, Allocation outIntegralPart, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
+ float[] arrayOutIntegralPart = new float[INPUTSIZE * 2];
+ outIntegralPart.copyTo(arrayOutIntegralPart);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeModf(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outIret.couldBe(arrayOutIret[i * 2 + j])) {
+ if (!args.outIntegralPart.couldBe(arrayOutIntegralPart[i * 2 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -165,17 +165,17 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outIret: ");
- message.append(args.outIret.toString());
+ message.append("Expected output outIntegralPart: ");
+ message.append(args.outIntegralPart.toString());
message.append("\n");
- message.append("Actual output outIret: ");
+ message.append("Actual output outIntegralPart: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutIret[i * 2 + j], Float.floatToRawIntBits(arrayOutIret[i * 2 + j]), arrayOutIret[i * 2 + j]));
- if (!args.outIret.couldBe(arrayOutIret[i * 2 + j])) {
+ arrayOutIntegralPart[i * 2 + j], Float.floatToRawIntBits(arrayOutIntegralPart[i * 2 + j]), arrayOutIntegralPart[i * 2 + j]));
+ if (!args.outIntegralPart.couldBe(arrayOutIntegralPart[i * 2 + j])) {
message.append(" FAIL");
}
message.append("\n");
@@ -197,45 +197,45 @@
}
private void checkModfFloat3Float3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x7e82a339fbf43202l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x7e82a339fbf43200l, false);
try {
- Allocation outIret = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ Allocation outIntegralPart = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocOutIret(outIret);
- script.forEach_testModfFloat3Float3Float3(inX, out);
- verifyResultsModfFloat3Float3Float3(inX, outIret, out, false);
+ script.set_gAllocOutIntegralPart(outIntegralPart);
+ script.forEach_testModfFloat3Float3Float3(inV, out);
+ verifyResultsModfFloat3Float3Float3(inV, outIntegralPart, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testModfFloat3Float3Float3: " + e.toString());
}
try {
- Allocation outIret = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ Allocation outIntegralPart = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocOutIret(outIret);
- scriptRelaxed.forEach_testModfFloat3Float3Float3(inX, out);
- verifyResultsModfFloat3Float3Float3(inX, outIret, out, true);
+ scriptRelaxed.set_gAllocOutIntegralPart(outIntegralPart);
+ scriptRelaxed.forEach_testModfFloat3Float3Float3(inV, out);
+ verifyResultsModfFloat3Float3Float3(inV, outIntegralPart, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testModfFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsModfFloat3Float3Float3(Allocation inX, Allocation outIret, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayOutIret = new float[INPUTSIZE * 4];
- outIret.copyTo(arrayOutIret);
+ private void verifyResultsModfFloat3Float3Float3(Allocation inV, Allocation outIntegralPart, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
+ float[] arrayOutIntegralPart = new float[INPUTSIZE * 4];
+ outIntegralPart.copyTo(arrayOutIntegralPart);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeModf(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outIret.couldBe(arrayOutIret[i * 4 + j])) {
+ if (!args.outIntegralPart.couldBe(arrayOutIntegralPart[i * 4 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -243,17 +243,17 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outIret: ");
- message.append(args.outIret.toString());
+ message.append("Expected output outIntegralPart: ");
+ message.append(args.outIntegralPart.toString());
message.append("\n");
- message.append("Actual output outIret: ");
+ message.append("Actual output outIntegralPart: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutIret[i * 4 + j], Float.floatToRawIntBits(arrayOutIret[i * 4 + j]), arrayOutIret[i * 4 + j]));
- if (!args.outIret.couldBe(arrayOutIret[i * 4 + j])) {
+ arrayOutIntegralPart[i * 4 + j], Float.floatToRawIntBits(arrayOutIntegralPart[i * 4 + j]), arrayOutIntegralPart[i * 4 + j]));
+ if (!args.outIntegralPart.couldBe(arrayOutIntegralPart[i * 4 + j])) {
message.append(" FAIL");
}
message.append("\n");
@@ -275,45 +275,45 @@
}
private void checkModfFloat4Float4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd2e78159fdd233a3l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd2e78159fdd233a1l, false);
try {
- Allocation outIret = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ Allocation outIntegralPart = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocOutIret(outIret);
- script.forEach_testModfFloat4Float4Float4(inX, out);
- verifyResultsModfFloat4Float4Float4(inX, outIret, out, false);
+ script.set_gAllocOutIntegralPart(outIntegralPart);
+ script.forEach_testModfFloat4Float4Float4(inV, out);
+ verifyResultsModfFloat4Float4Float4(inV, outIntegralPart, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testModfFloat4Float4Float4: " + e.toString());
}
try {
- Allocation outIret = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ Allocation outIntegralPart = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocOutIret(outIret);
- scriptRelaxed.forEach_testModfFloat4Float4Float4(inX, out);
- verifyResultsModfFloat4Float4Float4(inX, outIret, out, true);
+ scriptRelaxed.set_gAllocOutIntegralPart(outIntegralPart);
+ scriptRelaxed.forEach_testModfFloat4Float4Float4(inV, out);
+ verifyResultsModfFloat4Float4Float4(inV, outIntegralPart, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testModfFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsModfFloat4Float4Float4(Allocation inX, Allocation outIret, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayOutIret = new float[INPUTSIZE * 4];
- outIret.copyTo(arrayOutIret);
+ private void verifyResultsModfFloat4Float4Float4(Allocation inV, Allocation outIntegralPart, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
+ float[] arrayOutIntegralPart = new float[INPUTSIZE * 4];
+ outIntegralPart.copyTo(arrayOutIntegralPart);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeModf(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outIret.couldBe(arrayOutIret[i * 4 + j])) {
+ if (!args.outIntegralPart.couldBe(arrayOutIntegralPart[i * 4 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -321,17 +321,17 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outIret: ");
- message.append(args.outIret.toString());
+ message.append("Expected output outIntegralPart: ");
+ message.append(args.outIntegralPart.toString());
message.append("\n");
- message.append("Actual output outIret: ");
+ message.append("Actual output outIntegralPart: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutIret[i * 4 + j], Float.floatToRawIntBits(arrayOutIret[i * 4 + j]), arrayOutIret[i * 4 + j]));
- if (!args.outIret.couldBe(arrayOutIret[i * 4 + j])) {
+ arrayOutIntegralPart[i * 4 + j], Float.floatToRawIntBits(arrayOutIntegralPart[i * 4 + j]), arrayOutIntegralPart[i * 4 + j]));
+ if (!args.outIntegralPart.couldBe(arrayOutIntegralPart[i * 4 + j])) {
message.append(" FAIL");
}
message.append("\n");
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestModf.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestModf.rs
new file mode 100644
index 0000000..3e7aa15
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestModf.rs
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocOutIntegralPart;
+
+float __attribute__((kernel)) testModfFloatFloatFloat(float inV, unsigned int x) {
+ float outIntegralPart = 0;
+ float out = modf(inV, &outIntegralPart);
+ rsSetElementAt_float(gAllocOutIntegralPart, outIntegralPart, x);
+ return out;
+}
+
+float2 __attribute__((kernel)) testModfFloat2Float2Float2(float2 inV, unsigned int x) {
+ float2 outIntegralPart = 0;
+ float2 out = modf(inV, &outIntegralPart);
+ rsSetElementAt_float2(gAllocOutIntegralPart, outIntegralPart, x);
+ return out;
+}
+
+float3 __attribute__((kernel)) testModfFloat3Float3Float3(float3 inV, unsigned int x) {
+ float3 outIntegralPart = 0;
+ float3 out = modf(inV, &outIntegralPart);
+ rsSetElementAt_float3(gAllocOutIntegralPart, outIntegralPart, x);
+ return out;
+}
+
+float4 __attribute__((kernel)) testModfFloat4Float4Float4(float4 inV, unsigned int x) {
+ float4 outIntegralPart = 0;
+ float4 out = modf(inV, &outIntegralPart);
+ rsSetElementAt_float4(gAllocOutIntegralPart, outIntegralPart, x);
+ return out;
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestModfRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestModfRelaxed.rs
index 66f3fef..84fb128 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestModfRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestModf.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNan.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNan.java
similarity index 78%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNan.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNan.java
index 1be946d..29bbab7 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNan.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNan.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNan extends RSBaseCompute {
+public class GeneratedTestNan extends RSBaseCompute {
- private ScriptC_TestNan script;
- private ScriptC_TestNanRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNan script;
+ private ScriptC_GeneratedTestNanRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNan(mRS);
- scriptRelaxed = new ScriptC_TestNanRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNan(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNanRelaxed(mRS);
}
public class ArgumentsUintFloat {
- public int in;
+ public int inV;
public Target.Floaty out;
}
private void checkNanUintFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 1, 0x757e939c0e627774l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.UNSIGNED_32, 1, 0xbc42cb366a8a10d2l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNanUintFloat(in, out);
- verifyResultsNanUintFloat(in, out, false);
+ script.forEach_testNanUintFloat(inV, out);
+ verifyResultsNanUintFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNanUintFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNanUintFloat(in, out);
- verifyResultsNanUintFloat(in, out, true);
+ scriptRelaxed.forEach_testNanUintFloat(inV, out);
+ verifyResultsNanUintFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNanUintFloat: " + e.toString());
}
}
- private void verifyResultsNanUintFloat(Allocation in, Allocation out, boolean relaxed) {
- int[] arrayIn = new int[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNanUintFloat(Allocation inV, Allocation out, boolean relaxed) {
+ int[] arrayInV = new int[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsUintFloat args = new ArgumentsUintFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNan(args, target);
@@ -77,8 +77,8 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("0x%x", args.in));
+ message.append("Input inV: ");
+ message.append(String.format("0x%x", args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNan.rs
similarity index 90%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNan.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNan.rs
index bb434d6..0e9ab96 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNan.rs
@@ -20,6 +20,6 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNanUintFloat(uint in) {
- return nan(in);
+float __attribute__((kernel)) testNanUintFloat(uint inV) {
+ return nan(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNanRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNanRelaxed.rs
index 66f3fef..1760b34 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNanRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNan.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcos.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcos.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcos.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcos.java
index 430cf59..68ef91f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcos.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcos.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeAcos extends RSBaseCompute {
+public class GeneratedTestNativeAcos extends RSBaseCompute {
- private ScriptC_TestNativeAcos script;
- private ScriptC_TestNativeAcosRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeAcos script;
+ private ScriptC_GeneratedTestNativeAcosRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeAcos(mRS);
- scriptRelaxed = new ScriptC_TestNativeAcosRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeAcos(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeAcosRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcos.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcos.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcos.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcos.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcosRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcosRelaxed.rs
index 66f3fef..76ec4ce 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcosRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeAcos.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcosh.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcosh.java
similarity index 79%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcosh.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcosh.java
index d4a840a..d39f4bc 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcosh.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcosh.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeAcosh extends RSBaseCompute {
+public class GeneratedTestNativeAcosh extends RSBaseCompute {
- private ScriptC_TestNativeAcosh script;
- private ScriptC_TestNativeAcoshRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeAcosh script;
+ private ScriptC_GeneratedTestNativeAcoshRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeAcosh(mRS);
- scriptRelaxed = new ScriptC_TestNativeAcoshRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeAcosh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeAcoshRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeAcoshFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x332857238c9c505cl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x97c6a2f89e417fcal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeAcoshFloatFloat(in, out);
- verifyResultsNativeAcoshFloatFloat(in, out, false);
+ script.forEach_testNativeAcoshFloatFloat(inV, out);
+ verifyResultsNativeAcoshFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAcoshFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAcoshFloatFloat(in, out);
- verifyResultsNativeAcoshFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeAcoshFloatFloat(inV, out);
+ verifyResultsNativeAcoshFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAcoshFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeAcoshFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeAcoshFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAcosh(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeAcoshFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x7e5c81be4638e398l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3989caf5cb8e3adel, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeAcoshFloat2Float2(in, out);
- verifyResultsNativeAcoshFloat2Float2(in, out, false);
+ script.forEach_testNativeAcoshFloat2Float2(inV, out);
+ verifyResultsNativeAcoshFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAcoshFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAcoshFloat2Float2(in, out);
- verifyResultsNativeAcoshFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeAcoshFloat2Float2(inV, out);
+ verifyResultsNativeAcoshFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAcoshFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeAcoshFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeAcoshFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAcosh(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeAcoshFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x7e5c8c5fa53f7932l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x398b9410c1a95bbcl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeAcoshFloat3Float3(in, out);
- verifyResultsNativeAcoshFloat3Float3(in, out, false);
+ script.forEach_testNativeAcoshFloat3Float3(inV, out);
+ verifyResultsNativeAcoshFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAcoshFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAcoshFloat3Float3(in, out);
- verifyResultsNativeAcoshFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeAcoshFloat3Float3(inV, out);
+ verifyResultsNativeAcoshFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAcoshFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeAcoshFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeAcoshFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAcosh(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeAcoshFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x7e5c970104460eccl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x398d5d2bb7c47c9al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeAcoshFloat4Float4(in, out);
- verifyResultsNativeAcoshFloat4Float4(in, out, false);
+ script.forEach_testNativeAcoshFloat4Float4(inV, out);
+ verifyResultsNativeAcoshFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAcoshFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAcoshFloat4Float4(in, out);
- verifyResultsNativeAcoshFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeAcoshFloat4Float4(inV, out);
+ verifyResultsNativeAcoshFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAcoshFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeAcoshFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeAcoshFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAcosh(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcosh.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcosh.rs
similarity index 87%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcosh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcosh.rs
index 370f4ed..9e48292 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcosh.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcosh.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeAcoshFloatFloat(float in) {
- return native_acosh(in);
+float __attribute__((kernel)) testNativeAcoshFloatFloat(float inV) {
+ return native_acosh(inV);
}
-float2 __attribute__((kernel)) testNativeAcoshFloat2Float2(float2 in) {
- return native_acosh(in);
+float2 __attribute__((kernel)) testNativeAcoshFloat2Float2(float2 inV) {
+ return native_acosh(inV);
}
-float3 __attribute__((kernel)) testNativeAcoshFloat3Float3(float3 in) {
- return native_acosh(in);
+float3 __attribute__((kernel)) testNativeAcoshFloat3Float3(float3 inV) {
+ return native_acosh(inV);
}
-float4 __attribute__((kernel)) testNativeAcoshFloat4Float4(float4 in) {
- return native_acosh(in);
+float4 __attribute__((kernel)) testNativeAcoshFloat4Float4(float4 inV) {
+ return native_acosh(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcoshRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcoshRelaxed.rs
index 66f3fef..e31d1e1 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcoshRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeAcosh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcospi.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcospi.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcospi.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcospi.java
index 187b787..c08a500 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcospi.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcospi.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeAcospi extends RSBaseCompute {
+public class GeneratedTestNativeAcospi extends RSBaseCompute {
- private ScriptC_TestNativeAcospi script;
- private ScriptC_TestNativeAcospiRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeAcospi script;
+ private ScriptC_GeneratedTestNativeAcospiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeAcospi(mRS);
- scriptRelaxed = new ScriptC_TestNativeAcospiRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeAcospi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeAcospiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcospi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcospi.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcospi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcospi.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcospiRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcospiRelaxed.rs
index 66f3fef..bfe1714 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAcospiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeAcospi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsin.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsin.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsin.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsin.java
index b9f61a6..87d980a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsin.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsin.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeAsin extends RSBaseCompute {
+public class GeneratedTestNativeAsin extends RSBaseCompute {
- private ScriptC_TestNativeAsin script;
- private ScriptC_TestNativeAsinRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeAsin script;
+ private ScriptC_GeneratedTestNativeAsinRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeAsin(mRS);
- scriptRelaxed = new ScriptC_TestNativeAsinRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeAsin(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeAsinRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsin.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsin.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsin.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsin.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinRelaxed.rs
index 66f3fef..9b2fb90 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeAsin.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinh.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinh.java
similarity index 79%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinh.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinh.java
index f8382a8..b60600b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinh.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinh.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeAsinh extends RSBaseCompute {
+public class GeneratedTestNativeAsinh extends RSBaseCompute {
- private ScriptC_TestNativeAsinh script;
- private ScriptC_TestNativeAsinhRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeAsinh script;
+ private ScriptC_GeneratedTestNativeAsinhRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeAsinh(mRS);
- scriptRelaxed = new ScriptC_TestNativeAsinhRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeAsinh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeAsinhRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeAsinhFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xbcf52a7cb45b6e8fl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xbd2e22f24b5b925bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeAsinhFloatFloat(in, out);
- verifyResultsNativeAsinhFloatFloat(in, out, false);
+ script.forEach_testNativeAsinhFloatFloat(inV, out);
+ verifyResultsNativeAsinhFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAsinhFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAsinhFloatFloat(in, out);
- verifyResultsNativeAsinhFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeAsinhFloatFloat(inV, out);
+ verifyResultsNativeAsinhFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAsinhFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeAsinhFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeAsinhFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAsinh(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeAsinhFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc6bf00ae599a01f3l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x62151d490cde5427l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeAsinhFloat2Float2(in, out);
- verifyResultsNativeAsinhFloat2Float2(in, out, false);
+ script.forEach_testNativeAsinhFloat2Float2(inV, out);
+ verifyResultsNativeAsinhFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAsinhFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAsinhFloat2Float2(in, out);
- verifyResultsNativeAsinhFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeAsinhFloat2Float2(inV, out);
+ verifyResultsNativeAsinhFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAsinhFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeAsinhFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeAsinhFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAsinh(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeAsinhFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xc6bf0b4fb8a0978dl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6216e66402f97505l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeAsinhFloat3Float3(in, out);
- verifyResultsNativeAsinhFloat3Float3(in, out, false);
+ script.forEach_testNativeAsinhFloat3Float3(inV, out);
+ verifyResultsNativeAsinhFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAsinhFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAsinhFloat3Float3(in, out);
- verifyResultsNativeAsinhFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeAsinhFloat3Float3(inV, out);
+ verifyResultsNativeAsinhFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAsinhFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeAsinhFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeAsinhFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAsinh(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeAsinhFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc6bf15f117a72d27l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6218af7ef91495e3l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeAsinhFloat4Float4(in, out);
- verifyResultsNativeAsinhFloat4Float4(in, out, false);
+ script.forEach_testNativeAsinhFloat4Float4(inV, out);
+ verifyResultsNativeAsinhFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAsinhFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAsinhFloat4Float4(in, out);
- verifyResultsNativeAsinhFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeAsinhFloat4Float4(inV, out);
+ verifyResultsNativeAsinhFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAsinhFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeAsinhFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeAsinhFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAsinh(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinh.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinh.rs
similarity index 87%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinh.rs
index 2c40a7a..8e9ac3c 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinh.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinh.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeAsinhFloatFloat(float in) {
- return native_asinh(in);
+float __attribute__((kernel)) testNativeAsinhFloatFloat(float inV) {
+ return native_asinh(inV);
}
-float2 __attribute__((kernel)) testNativeAsinhFloat2Float2(float2 in) {
- return native_asinh(in);
+float2 __attribute__((kernel)) testNativeAsinhFloat2Float2(float2 inV) {
+ return native_asinh(inV);
}
-float3 __attribute__((kernel)) testNativeAsinhFloat3Float3(float3 in) {
- return native_asinh(in);
+float3 __attribute__((kernel)) testNativeAsinhFloat3Float3(float3 inV) {
+ return native_asinh(inV);
}
-float4 __attribute__((kernel)) testNativeAsinhFloat4Float4(float4 in) {
- return native_asinh(in);
+float4 __attribute__((kernel)) testNativeAsinhFloat4Float4(float4 inV) {
+ return native_asinh(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinhRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinhRelaxed.rs
index 66f3fef..746f0ce 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinhRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeAsinh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinpi.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinpi.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinpi.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinpi.java
index e0029b7..1e2d2ac 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinpi.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinpi.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeAsinpi extends RSBaseCompute {
+public class GeneratedTestNativeAsinpi extends RSBaseCompute {
- private ScriptC_TestNativeAsinpi script;
- private ScriptC_TestNativeAsinpiRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeAsinpi script;
+ private ScriptC_GeneratedTestNativeAsinpiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeAsinpi(mRS);
- scriptRelaxed = new ScriptC_TestNativeAsinpiRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeAsinpi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeAsinpiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinpi.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinpi.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinpiRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinpiRelaxed.rs
index 66f3fef..fdd04f9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAsinpiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeAsinpi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan.java
index 26225c5..827c84b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeAtan extends RSBaseCompute {
+public class GeneratedTestNativeAtan extends RSBaseCompute {
- private ScriptC_TestNativeAtan script;
- private ScriptC_TestNativeAtanRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeAtan script;
+ private ScriptC_GeneratedTestNativeAtanRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeAtan(mRS);
- scriptRelaxed = new ScriptC_TestNativeAtanRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeAtan(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeAtanRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2.java
similarity index 65%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2.java
index c33523c..ebcfc9a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeAtan2 extends RSBaseCompute {
+public class GeneratedTestNativeAtan2 extends RSBaseCompute {
- private ScriptC_TestNativeAtan2 script;
- private ScriptC_TestNativeAtan2Relaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeAtan2 script;
+ private ScriptC_GeneratedTestNativeAtan2Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeAtan2(mRS);
- scriptRelaxed = new ScriptC_TestNativeAtan2Relaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeAtan2(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeAtan2Relaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inY;
- public float inX;
+ public float inNumerator;
+ public float inDenominator;
public Target.Floaty out;
}
private void checkNativeAtan2FloatFloatFloat() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x4ecf7d3b9e2a276fl, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x4ecf7d3b9e2a276el, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2139aa61fb6dcb4fl, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf6634dcb634c16d0l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testNativeAtan2FloatFloatFloat(inY, out);
- verifyResultsNativeAtan2FloatFloatFloat(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testNativeAtan2FloatFloatFloat(inNumerator, out);
+ verifyResultsNativeAtan2FloatFloatFloat(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2FloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testNativeAtan2FloatFloatFloat(inY, out);
- verifyResultsNativeAtan2FloatFloatFloat(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testNativeAtan2FloatFloatFloat(inNumerator, out);
+ verifyResultsNativeAtan2FloatFloatFloat(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2FloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeAtan2FloatFloatFloat(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
+ private void verifyResultsNativeAtan2FloatFloatFloat(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 1];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 1];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i];
- args.inX = arrayInX[i];
+ args.inNumerator = arrayInNumerator[i];
+ args.inDenominator = arrayInDenominator[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtan2(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkNativeAtan2Float2Float2Float2() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3c2d1a09d1c2a8c7l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3c2d1a09d1c2a8c6l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x989e0b0cd0059da7l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x4a617fa4dfda5468l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testNativeAtan2Float2Float2Float2(inY, out);
- verifyResultsNativeAtan2Float2Float2Float2(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testNativeAtan2Float2Float2Float2(inNumerator, out);
+ verifyResultsNativeAtan2Float2Float2Float2(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2Float2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testNativeAtan2Float2Float2Float2(inY, out);
- verifyResultsNativeAtan2Float2Float2Float2(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testNativeAtan2Float2Float2Float2(inNumerator, out);
+ verifyResultsNativeAtan2Float2Float2Float2(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2Float2Float2Float2: " + e.toString());
}
}
- private void verifyResultsNativeAtan2Float2Float2Float2(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
+ private void verifyResultsNativeAtan2Float2Float2Float2(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 2];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 2];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 2 + j];
- args.inX = arrayInX[i * 2 + j];
+ args.inNumerator = arrayInNumerator[i * 2 + j];
+ args.inDenominator = arrayInDenominator[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtan2(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkNativeAtan2Float3Float3Float3() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x9091f829d3a0aa68l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x9091f829d3a0aa67l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x742cb44672d189a8l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x13c5c0edb2b5e7a1l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testNativeAtan2Float3Float3Float3(inY, out);
- verifyResultsNativeAtan2Float3Float3Float3(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testNativeAtan2Float3Float3Float3(inNumerator, out);
+ verifyResultsNativeAtan2Float3Float3Float3(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2Float3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testNativeAtan2Float3Float3Float3(inY, out);
- verifyResultsNativeAtan2Float3Float3Float3(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testNativeAtan2Float3Float3Float3(inNumerator, out);
+ verifyResultsNativeAtan2Float3Float3Float3(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2Float3Float3Float3: " + e.toString());
}
}
- private void verifyResultsNativeAtan2Float3Float3Float3(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
+ private void verifyResultsNativeAtan2Float3Float3Float3(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 4 + j];
- args.inX = arrayInX[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtan2(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkNativeAtan2Float4Float4Float4() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xe4f6d649d57eac09l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xe4f6d649d57eac08l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x4fbb5d80159d75a9l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xdd2a023685917adal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testNativeAtan2Float4Float4Float4(inY, out);
- verifyResultsNativeAtan2Float4Float4Float4(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testNativeAtan2Float4Float4Float4(inNumerator, out);
+ verifyResultsNativeAtan2Float4Float4Float4(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2Float4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testNativeAtan2Float4Float4Float4(inY, out);
- verifyResultsNativeAtan2Float4Float4Float4(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testNativeAtan2Float4Float4Float4(inNumerator, out);
+ verifyResultsNativeAtan2Float4Float4Float4(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2Float4Float4Float4: " + e.toString());
}
}
- private void verifyResultsNativeAtan2Float4Float4Float4(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
+ private void verifyResultsNativeAtan2Float4Float4Float4(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 4 + j];
- args.inX = arrayInX[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtan2(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2.rs
similarity index 60%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2.rs
index 3ab222c..0443b0f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInX;
+rs_allocation gAllocInDenominator;
-float __attribute__((kernel)) testNativeAtan2FloatFloatFloat(float inY, unsigned int x) {
- float inX = rsGetElementAt_float(gAllocInX, x);
- return native_atan2(inY, inX);
+float __attribute__((kernel)) testNativeAtan2FloatFloatFloat(float inNumerator, unsigned int x) {
+ float inDenominator = rsGetElementAt_float(gAllocInDenominator, x);
+ return native_atan2(inNumerator, inDenominator);
}
-float2 __attribute__((kernel)) testNativeAtan2Float2Float2Float2(float2 inY, unsigned int x) {
- float2 inX = rsGetElementAt_float2(gAllocInX, x);
- return native_atan2(inY, inX);
+float2 __attribute__((kernel)) testNativeAtan2Float2Float2Float2(float2 inNumerator, unsigned int x) {
+ float2 inDenominator = rsGetElementAt_float2(gAllocInDenominator, x);
+ return native_atan2(inNumerator, inDenominator);
}
-float3 __attribute__((kernel)) testNativeAtan2Float3Float3Float3(float3 inY, unsigned int x) {
- float3 inX = rsGetElementAt_float3(gAllocInX, x);
- return native_atan2(inY, inX);
+float3 __attribute__((kernel)) testNativeAtan2Float3Float3Float3(float3 inNumerator, unsigned int x) {
+ float3 inDenominator = rsGetElementAt_float3(gAllocInDenominator, x);
+ return native_atan2(inNumerator, inDenominator);
}
-float4 __attribute__((kernel)) testNativeAtan2Float4Float4Float4(float4 inY, unsigned int x) {
- float4 inX = rsGetElementAt_float4(gAllocInX, x);
- return native_atan2(inY, inX);
+float4 __attribute__((kernel)) testNativeAtan2Float4Float4Float4(float4 inNumerator, unsigned int x) {
+ float4 inDenominator = rsGetElementAt_float4(gAllocInDenominator, x);
+ return native_atan2(inNumerator, inDenominator);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2Relaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2Relaxed.rs
index 66f3fef..b70ad87 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeAtan2.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2pi.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2pi.java
similarity index 66%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2pi.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2pi.java
index dd62b78..03a7e87 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2pi.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2pi.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeAtan2pi extends RSBaseCompute {
+public class GeneratedTestNativeAtan2pi extends RSBaseCompute {
- private ScriptC_TestNativeAtan2pi script;
- private ScriptC_TestNativeAtan2piRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeAtan2pi script;
+ private ScriptC_GeneratedTestNativeAtan2piRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeAtan2pi(mRS);
- scriptRelaxed = new ScriptC_TestNativeAtan2piRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeAtan2pi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeAtan2piRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inY;
- public float inX;
+ public float inNumerator;
+ public float inDenominator;
public Target.Floaty out;
}
private void checkNativeAtan2piFloatFloatFloat() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x39c4f8fd35fc5dc8l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x39c4f8fd35fc5dc7l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xc2172a04694fc108l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xd63229f70853dc01l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testNativeAtan2piFloatFloatFloat(inY, out);
- verifyResultsNativeAtan2piFloatFloatFloat(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testNativeAtan2piFloatFloatFloat(inNumerator, out);
+ verifyResultsNativeAtan2piFloatFloatFloat(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2piFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testNativeAtan2piFloatFloatFloat(inY, out);
- verifyResultsNativeAtan2piFloatFloatFloat(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testNativeAtan2piFloatFloatFloat(inNumerator, out);
+ verifyResultsNativeAtan2piFloatFloatFloat(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2piFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeAtan2piFloatFloatFloat(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
+ private void verifyResultsNativeAtan2piFloatFloatFloat(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 1];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 1];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i];
- args.inX = arrayInX[i];
+ args.inNumerator = arrayInNumerator[i];
+ args.inDenominator = arrayInDenominator[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtan2pi(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkNativeAtan2piFloat2Float2Float2() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x6aff980c8d47a3e2l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x6aff980c8d47a3e1l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x305d06618853bce2l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x4cc6c68c0c19e58bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testNativeAtan2piFloat2Float2Float2(inY, out);
- verifyResultsNativeAtan2piFloat2Float2Float2(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testNativeAtan2piFloat2Float2Float2(inNumerator, out);
+ verifyResultsNativeAtan2piFloat2Float2Float2(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2piFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testNativeAtan2piFloat2Float2Float2(inY, out);
- verifyResultsNativeAtan2piFloat2Float2Float2(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testNativeAtan2piFloat2Float2Float2(inNumerator, out);
+ verifyResultsNativeAtan2piFloat2Float2Float2(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2piFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsNativeAtan2piFloat2Float2Float2(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
+ private void verifyResultsNativeAtan2piFloat2Float2Float2(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 2];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 2];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 2 + j];
- args.inX = arrayInX[i * 2 + j];
+ args.inNumerator = arrayInNumerator[i * 2 + j];
+ args.inDenominator = arrayInDenominator[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtan2pi(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkNativeAtan2piFloat3Float3Float3() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xbf64762c8f25a583l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xbf64762c8f25a582l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xbebaf9b2b1fa8e3l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x162b07d4def578c4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testNativeAtan2piFloat3Float3Float3(inY, out);
- verifyResultsNativeAtan2piFloat3Float3Float3(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testNativeAtan2piFloat3Float3Float3(inNumerator, out);
+ verifyResultsNativeAtan2piFloat3Float3Float3(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2piFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testNativeAtan2piFloat3Float3Float3(inY, out);
- verifyResultsNativeAtan2piFloat3Float3Float3(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testNativeAtan2piFloat3Float3Float3(inNumerator, out);
+ verifyResultsNativeAtan2piFloat3Float3Float3(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2piFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsNativeAtan2piFloat3Float3Float3(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
+ private void verifyResultsNativeAtan2piFloat3Float3Float3(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 4 + j];
- args.inX = arrayInX[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtan2pi(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkNativeAtan2piFloat4Float4Float4() {
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x13c9544c9103a724l, false);
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x13c9544c9103a723l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xe77a58d4cdeb94e4l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xdf8f491db1d10bfdl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInX(inX);
- script.forEach_testNativeAtan2piFloat4Float4Float4(inY, out);
- verifyResultsNativeAtan2piFloat4Float4Float4(inY, inX, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testNativeAtan2piFloat4Float4Float4(inNumerator, out);
+ verifyResultsNativeAtan2piFloat4Float4Float4(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2piFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInX(inX);
- scriptRelaxed.forEach_testNativeAtan2piFloat4Float4Float4(inY, out);
- verifyResultsNativeAtan2piFloat4Float4Float4(inY, inX, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testNativeAtan2piFloat4Float4Float4(inNumerator, out);
+ verifyResultsNativeAtan2piFloat4Float4Float4(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtan2piFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsNativeAtan2piFloat4Float4Float4(Allocation inY, Allocation inX, Allocation out, boolean relaxed) {
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
+ private void verifyResultsNativeAtan2piFloat4Float4Float4(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inY = arrayInY[i * 4 + j];
- args.inX = arrayInX[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtan2pi(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inY: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inX: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2pi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2pi.rs
new file mode 100644
index 0000000..7637041
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2pi.rs
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInDenominator;
+
+float __attribute__((kernel)) testNativeAtan2piFloatFloatFloat(float inNumerator, unsigned int x) {
+ float inDenominator = rsGetElementAt_float(gAllocInDenominator, x);
+ return native_atan2pi(inNumerator, inDenominator);
+}
+
+float2 __attribute__((kernel)) testNativeAtan2piFloat2Float2Float2(float2 inNumerator, unsigned int x) {
+ float2 inDenominator = rsGetElementAt_float2(gAllocInDenominator, x);
+ return native_atan2pi(inNumerator, inDenominator);
+}
+
+float3 __attribute__((kernel)) testNativeAtan2piFloat3Float3Float3(float3 inNumerator, unsigned int x) {
+ float3 inDenominator = rsGetElementAt_float3(gAllocInDenominator, x);
+ return native_atan2pi(inNumerator, inDenominator);
+}
+
+float4 __attribute__((kernel)) testNativeAtan2piFloat4Float4Float4(float4 inNumerator, unsigned int x) {
+ float4 inDenominator = rsGetElementAt_float4(gAllocInDenominator, x);
+ return native_atan2pi(inNumerator, inDenominator);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2piRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2piRelaxed.rs
index 66f3fef..4cd22fc 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtan2piRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeAtan2pi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanRelaxed.rs
index 66f3fef..c77ea39 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeAtan.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanh.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanh.java
similarity index 79%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanh.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanh.java
index 6161483..db2f189 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanh.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanh.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeAtanh extends RSBaseCompute {
+public class GeneratedTestNativeAtanh extends RSBaseCompute {
- private ScriptC_TestNativeAtanh script;
- private ScriptC_TestNativeAtanhRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeAtanh script;
+ private ScriptC_GeneratedTestNativeAtanhRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeAtanh(mRS);
- scriptRelaxed = new ScriptC_TestNativeAtanhRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeAtanh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeAtanhRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float inIn;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeAtanhFloatFloat() {
- Allocation inIn = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe13e715ccd0cedebl, -1, 1);
+ Allocation inV = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x46ba02a2e7004d04l, -1, 1);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeAtanhFloatFloat(inIn, out);
- verifyResultsNativeAtanhFloatFloat(inIn, out, false);
+ script.forEach_testNativeAtanhFloatFloat(inV, out);
+ verifyResultsNativeAtanhFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtanhFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAtanhFloatFloat(inIn, out);
- verifyResultsNativeAtanhFloatFloat(inIn, out, true);
+ scriptRelaxed.forEach_testNativeAtanhFloatFloat(inV, out);
+ verifyResultsNativeAtanhFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtanhFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeAtanhFloatFloat(Allocation inIn, Allocation out, boolean relaxed) {
- float[] arrayInIn = new float[INPUTSIZE * 1];
- inIn.copyTo(arrayInIn);
+ private void verifyResultsNativeAtanhFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inIn = arrayInIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtanh(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inIn: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inIn, Float.floatToRawIntBits(args.inIn), args.inIn));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeAtanhFloat2Float2() {
- Allocation inIn = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xd5bd3a2802f7f5d7l, -1, 1);
+ Allocation inV = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xd557bfdd35a682c8l, -1, 1);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeAtanhFloat2Float2(inIn, out);
- verifyResultsNativeAtanhFloat2Float2(inIn, out, false);
+ script.forEach_testNativeAtanhFloat2Float2(inV, out);
+ verifyResultsNativeAtanhFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtanhFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAtanhFloat2Float2(inIn, out);
- verifyResultsNativeAtanhFloat2Float2(inIn, out, true);
+ scriptRelaxed.forEach_testNativeAtanhFloat2Float2(inV, out);
+ verifyResultsNativeAtanhFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtanhFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeAtanhFloat2Float2(Allocation inIn, Allocation out, boolean relaxed) {
- float[] arrayInIn = new float[INPUTSIZE * 2];
- inIn.copyTo(arrayInIn);
+ private void verifyResultsNativeAtanhFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inIn = arrayInIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtanh(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inIn: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inIn, Float.floatToRawIntBits(args.inIn), args.inIn));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeAtanhFloat3Float3() {
- Allocation inIn = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd60a01af59867b21l, -1, 1);
+ Allocation inV = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd55988f82bc1a3a6l, -1, 1);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeAtanhFloat3Float3(inIn, out);
- verifyResultsNativeAtanhFloat3Float3(inIn, out, false);
+ script.forEach_testNativeAtanhFloat3Float3(inV, out);
+ verifyResultsNativeAtanhFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtanhFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAtanhFloat3Float3(inIn, out);
- verifyResultsNativeAtanhFloat3Float3(inIn, out, true);
+ scriptRelaxed.forEach_testNativeAtanhFloat3Float3(inV, out);
+ verifyResultsNativeAtanhFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtanhFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeAtanhFloat3Float3(Allocation inIn, Allocation out, boolean relaxed) {
- float[] arrayInIn = new float[INPUTSIZE * 4];
- inIn.copyTo(arrayInIn);
+ private void verifyResultsNativeAtanhFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inIn = arrayInIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtanh(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inIn: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inIn, Float.floatToRawIntBits(args.inIn), args.inIn));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeAtanhFloat4Float4() {
- Allocation inIn = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd656c936b015006bl, -1, 1);
+ Allocation inV = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd55b521321dcc484l, -1, 1);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeAtanhFloat4Float4(inIn, out);
- verifyResultsNativeAtanhFloat4Float4(inIn, out, false);
+ script.forEach_testNativeAtanhFloat4Float4(inV, out);
+ verifyResultsNativeAtanhFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtanhFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeAtanhFloat4Float4(inIn, out);
- verifyResultsNativeAtanhFloat4Float4(inIn, out, true);
+ scriptRelaxed.forEach_testNativeAtanhFloat4Float4(inV, out);
+ verifyResultsNativeAtanhFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeAtanhFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeAtanhFloat4Float4(Allocation inIn, Allocation out, boolean relaxed) {
- float[] arrayInIn = new float[INPUTSIZE * 4];
- inIn.copyTo(arrayInIn);
+ private void verifyResultsNativeAtanhFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inIn = arrayInIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeAtanh(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inIn: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inIn, Float.floatToRawIntBits(args.inIn), args.inIn));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanh.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanh.rs
similarity index 86%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanh.rs
index de772e7..7c20382 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanh.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanh.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeAtanhFloatFloat(float inIn) {
- return native_atanh(inIn);
+float __attribute__((kernel)) testNativeAtanhFloatFloat(float inV) {
+ return native_atanh(inV);
}
-float2 __attribute__((kernel)) testNativeAtanhFloat2Float2(float2 inIn) {
- return native_atanh(inIn);
+float2 __attribute__((kernel)) testNativeAtanhFloat2Float2(float2 inV) {
+ return native_atanh(inV);
}
-float3 __attribute__((kernel)) testNativeAtanhFloat3Float3(float3 inIn) {
- return native_atanh(inIn);
+float3 __attribute__((kernel)) testNativeAtanhFloat3Float3(float3 inV) {
+ return native_atanh(inV);
}
-float4 __attribute__((kernel)) testNativeAtanhFloat4Float4(float4 inIn) {
- return native_atanh(inIn);
+float4 __attribute__((kernel)) testNativeAtanhFloat4Float4(float4 inV) {
+ return native_atanh(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanhRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanhRelaxed.rs
index 66f3fef..e2c00fc 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanhRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeAtanh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanpi.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanpi.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanpi.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanpi.java
index 1e88568..35be2e7 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanpi.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanpi.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeAtanpi extends RSBaseCompute {
+public class GeneratedTestNativeAtanpi extends RSBaseCompute {
- private ScriptC_TestNativeAtanpi script;
- private ScriptC_TestNativeAtanpiRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeAtanpi script;
+ private ScriptC_GeneratedTestNativeAtanpiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeAtanpi(mRS);
- scriptRelaxed = new ScriptC_TestNativeAtanpiRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeAtanpi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeAtanpiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanpi.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanpi.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanpiRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanpiRelaxed.rs
index 66f3fef..e32d10f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeAtanpiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeAtanpi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCbrt.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCbrt.java
similarity index 77%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCbrt.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCbrt.java
index cd6a030..0a2b1fb 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCbrt.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCbrt.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeCbrt extends RSBaseCompute {
+public class GeneratedTestNativeCbrt extends RSBaseCompute {
- private ScriptC_TestNativeCbrt script;
- private ScriptC_TestNativeCbrtRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeCbrt script;
+ private ScriptC_GeneratedTestNativeCbrtRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeCbrt(mRS);
- scriptRelaxed = new ScriptC_TestNativeCbrtRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeCbrt(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeCbrtRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeCbrtFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x6eed1901e2ca9d19l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xa1d3335118086389l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeCbrtFloatFloat(in, out);
- verifyResultsNativeCbrtFloatFloat(in, out, false);
+ script.forEach_testNativeCbrtFloatFloat(inV, out);
+ verifyResultsNativeCbrtFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCbrtFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCbrtFloatFloat(in, out);
- verifyResultsNativeCbrtFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeCbrtFloatFloat(inV, out);
+ verifyResultsNativeCbrtFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCbrtFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeCbrtFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCbrtFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCbrt(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeCbrtFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2e78c09abaa124adl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xce4859fd59112965l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeCbrtFloat2Float2(in, out);
- verifyResultsNativeCbrtFloat2Float2(in, out, false);
+ script.forEach_testNativeCbrtFloat2Float2(inV, out);
+ verifyResultsNativeCbrtFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCbrtFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCbrtFloat2Float2(in, out);
- verifyResultsNativeCbrtFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeCbrtFloat2Float2(inV, out);
+ verifyResultsNativeCbrtFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCbrtFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeCbrtFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCbrtFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCbrt(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeCbrtFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2e78cb3c19a7ba47l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xce4a23184f2c4a43l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeCbrtFloat3Float3(in, out);
- verifyResultsNativeCbrtFloat3Float3(in, out, false);
+ script.forEach_testNativeCbrtFloat3Float3(inV, out);
+ verifyResultsNativeCbrtFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCbrtFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCbrtFloat3Float3(in, out);
- verifyResultsNativeCbrtFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeCbrtFloat3Float3(inV, out);
+ verifyResultsNativeCbrtFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCbrtFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeCbrtFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCbrtFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCbrt(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeCbrtFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2e78d5dd78ae4fe1l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xce4bec3345476b21l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeCbrtFloat4Float4(in, out);
- verifyResultsNativeCbrtFloat4Float4(in, out, false);
+ script.forEach_testNativeCbrtFloat4Float4(inV, out);
+ verifyResultsNativeCbrtFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCbrtFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCbrtFloat4Float4(in, out);
- verifyResultsNativeCbrtFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeCbrtFloat4Float4(inV, out);
+ verifyResultsNativeCbrtFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCbrtFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeCbrtFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCbrtFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCbrt(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCbrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCbrt.rs
similarity index 82%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCbrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCbrt.rs
index 828214b..9b8e4e9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCbrt.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCbrt.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeCbrtFloatFloat(float in) {
- return native_cbrt(in);
+float __attribute__((kernel)) testNativeCbrtFloatFloat(float inV) {
+ return native_cbrt(inV);
}
-float2 __attribute__((kernel)) testNativeCbrtFloat2Float2(float2 in) {
- return native_cbrt(in);
+float2 __attribute__((kernel)) testNativeCbrtFloat2Float2(float2 inV) {
+ return native_cbrt(inV);
}
-float3 __attribute__((kernel)) testNativeCbrtFloat3Float3(float3 in) {
- return native_cbrt(in);
+float3 __attribute__((kernel)) testNativeCbrtFloat3Float3(float3 inV) {
+ return native_cbrt(inV);
}
-float4 __attribute__((kernel)) testNativeCbrtFloat4Float4(float4 in) {
- return native_cbrt(in);
+float4 __attribute__((kernel)) testNativeCbrtFloat4Float4(float4 inV) {
+ return native_cbrt(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCbrtRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCbrtRelaxed.rs
index 66f3fef..af4ede2 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCbrtRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeCbrt.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCos.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCos.java
similarity index 77%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCos.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCos.java
index d7c9ebf..70c734e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCos.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCos.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeCos extends RSBaseCompute {
+public class GeneratedTestNativeCos extends RSBaseCompute {
- private ScriptC_TestNativeCos script;
- private ScriptC_TestNativeCosRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeCos script;
+ private ScriptC_GeneratedTestNativeCosRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeCos(mRS);
- scriptRelaxed = new ScriptC_TestNativeCosRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeCos(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeCosRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeCosFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x95ef4a20c73e7e3dl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2f317381777f3495l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeCosFloatFloat(in, out);
- verifyResultsNativeCosFloatFloat(in, out, false);
+ script.forEach_testNativeCosFloatFloat(inV, out);
+ verifyResultsNativeCosFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCosFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCosFloatFloat(in, out);
- verifyResultsNativeCosFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeCosFloatFloat(inV, out);
+ verifyResultsNativeCosFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCosFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeCosFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCosFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCos(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeCosFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xed4d88bac39641b1l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xdc05f75eda3d0911l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeCosFloat2Float2(in, out);
- verifyResultsNativeCosFloat2Float2(in, out, false);
+ script.forEach_testNativeCosFloat2Float2(inV, out);
+ verifyResultsNativeCosFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCosFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCosFloat2Float2(in, out);
- verifyResultsNativeCosFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeCosFloat2Float2(inV, out);
+ verifyResultsNativeCosFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCosFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeCosFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCosFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCos(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeCosFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xed4d935c229cd74bl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xdc07c079d05829efl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeCosFloat3Float3(in, out);
- verifyResultsNativeCosFloat3Float3(in, out, false);
+ script.forEach_testNativeCosFloat3Float3(inV, out);
+ verifyResultsNativeCosFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCosFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCosFloat3Float3(in, out);
- verifyResultsNativeCosFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeCosFloat3Float3(inV, out);
+ verifyResultsNativeCosFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCosFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeCosFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCosFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCos(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeCosFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xed4d9dfd81a36ce5l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xdc098994c6734acdl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeCosFloat4Float4(in, out);
- verifyResultsNativeCosFloat4Float4(in, out, false);
+ script.forEach_testNativeCosFloat4Float4(inV, out);
+ verifyResultsNativeCosFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCosFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCosFloat4Float4(in, out);
- verifyResultsNativeCosFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeCosFloat4Float4(inV, out);
+ verifyResultsNativeCosFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCosFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeCosFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCosFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCos(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCos.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCos.rs
similarity index 83%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCos.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCos.rs
index 212c12e..d608991 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCos.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCos.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeCosFloatFloat(float in) {
- return native_cos(in);
+float __attribute__((kernel)) testNativeCosFloatFloat(float inV) {
+ return native_cos(inV);
}
-float2 __attribute__((kernel)) testNativeCosFloat2Float2(float2 in) {
- return native_cos(in);
+float2 __attribute__((kernel)) testNativeCosFloat2Float2(float2 inV) {
+ return native_cos(inV);
}
-float3 __attribute__((kernel)) testNativeCosFloat3Float3(float3 in) {
- return native_cos(in);
+float3 __attribute__((kernel)) testNativeCosFloat3Float3(float3 inV) {
+ return native_cos(inV);
}
-float4 __attribute__((kernel)) testNativeCosFloat4Float4(float4 in) {
- return native_cos(in);
+float4 __attribute__((kernel)) testNativeCosFloat4Float4(float4 inV) {
+ return native_cos(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCosRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCosRelaxed.rs
index 66f3fef..7f74626 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCosRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeCos.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosh.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCosh.java
similarity index 77%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosh.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCosh.java
index 4e841c6..1ca49c5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosh.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCosh.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeCosh extends RSBaseCompute {
+public class GeneratedTestNativeCosh extends RSBaseCompute {
- private ScriptC_TestNativeCosh script;
- private ScriptC_TestNativeCoshRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeCosh script;
+ private ScriptC_GeneratedTestNativeCoshRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeCosh(mRS);
- scriptRelaxed = new ScriptC_TestNativeCoshRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeCosh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeCoshRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeCoshFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xeb1020909e9c475dl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x7bb5784aa43ffcf5l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeCoshFloatFloat(in, out);
- verifyResultsNativeCoshFloatFloat(in, out, false);
+ script.forEach_testNativeCoshFloatFloat(inV, out);
+ verifyResultsNativeCoshFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCoshFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCoshFloatFloat(in, out);
- verifyResultsNativeCoshFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeCoshFloatFloat(inV, out);
+ verifyResultsNativeCoshFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCoshFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeCoshFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCoshFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCosh(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeCoshFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc77a568547f7e9d1l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x818c886316a44671l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeCoshFloat2Float2(in, out);
- verifyResultsNativeCoshFloat2Float2(in, out, false);
+ script.forEach_testNativeCoshFloat2Float2(inV, out);
+ verifyResultsNativeCoshFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCoshFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCoshFloat2Float2(in, out);
- verifyResultsNativeCoshFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeCoshFloat2Float2(inV, out);
+ verifyResultsNativeCoshFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCoshFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeCoshFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCoshFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCosh(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeCoshFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xc77a6126a6fe7f6bl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x818e517e0cbf674fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeCoshFloat3Float3(in, out);
- verifyResultsNativeCoshFloat3Float3(in, out, false);
+ script.forEach_testNativeCoshFloat3Float3(inV, out);
+ verifyResultsNativeCoshFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCoshFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCoshFloat3Float3(in, out);
- verifyResultsNativeCoshFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeCoshFloat3Float3(inV, out);
+ verifyResultsNativeCoshFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCoshFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeCoshFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCoshFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCosh(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeCoshFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc77a6bc806051505l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x81901a9902da882dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeCoshFloat4Float4(in, out);
- verifyResultsNativeCoshFloat4Float4(in, out, false);
+ script.forEach_testNativeCoshFloat4Float4(inV, out);
+ verifyResultsNativeCoshFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCoshFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCoshFloat4Float4(in, out);
- verifyResultsNativeCoshFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeCoshFloat4Float4(inV, out);
+ verifyResultsNativeCoshFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCoshFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeCoshFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCoshFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCosh(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosh.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCosh.rs
similarity index 82%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCosh.rs
index f3635d8..665e915 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosh.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCosh.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeCoshFloatFloat(float in) {
- return native_cosh(in);
+float __attribute__((kernel)) testNativeCoshFloatFloat(float inV) {
+ return native_cosh(inV);
}
-float2 __attribute__((kernel)) testNativeCoshFloat2Float2(float2 in) {
- return native_cosh(in);
+float2 __attribute__((kernel)) testNativeCoshFloat2Float2(float2 inV) {
+ return native_cosh(inV);
}
-float3 __attribute__((kernel)) testNativeCoshFloat3Float3(float3 in) {
- return native_cosh(in);
+float3 __attribute__((kernel)) testNativeCoshFloat3Float3(float3 inV) {
+ return native_cosh(inV);
}
-float4 __attribute__((kernel)) testNativeCoshFloat4Float4(float4 in) {
- return native_cosh(in);
+float4 __attribute__((kernel)) testNativeCoshFloat4Float4(float4 inV) {
+ return native_cosh(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCoshRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCoshRelaxed.rs
index 66f3fef..a12ce15 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCoshRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeCosh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCospi.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCospi.java
similarity index 79%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCospi.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCospi.java
index ab5065b..72a5c5d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCospi.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCospi.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeCospi extends RSBaseCompute {
+public class GeneratedTestNativeCospi extends RSBaseCompute {
- private ScriptC_TestNativeCospi script;
- private ScriptC_TestNativeCospiRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeCospi script;
+ private ScriptC_GeneratedTestNativeCospiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeCospi(mRS);
- scriptRelaxed = new ScriptC_TestNativeCospiRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeCospi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeCospiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeCospiFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x8fc4f0187aafc9a6l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2614541c9b86df38l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeCospiFloatFloat(in, out);
- verifyResultsNativeCospiFloatFloat(in, out, false);
+ script.forEach_testNativeCospiFloatFloat(inV, out);
+ verifyResultsNativeCospiFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCospiFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCospiFloatFloat(in, out);
- verifyResultsNativeCospiFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeCospiFloatFloat(inV, out);
+ verifyResultsNativeCospiFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCospiFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeCospiFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCospiFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCospi(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeCospiFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x656942c9d0dfeb12l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x8ae37e6159c7c5cl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeCospiFloat2Float2(in, out);
- verifyResultsNativeCospiFloat2Float2(in, out, false);
+ script.forEach_testNativeCospiFloat2Float2(inV, out);
+ verifyResultsNativeCospiFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCospiFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCospiFloat2Float2(in, out);
- verifyResultsNativeCospiFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeCospiFloat2Float2(inV, out);
+ verifyResultsNativeCospiFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCospiFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeCospiFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCospiFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCospi(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeCospiFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x65694d6b2fe680acl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x8b001010bb79d3al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeCospiFloat3Float3(in, out);
- verifyResultsNativeCospiFloat3Float3(in, out, false);
+ script.forEach_testNativeCospiFloat3Float3(inV, out);
+ verifyResultsNativeCospiFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCospiFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCospiFloat3Float3(in, out);
- verifyResultsNativeCospiFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeCospiFloat3Float3(inV, out);
+ verifyResultsNativeCospiFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCospiFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeCospiFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCospiFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCospi(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeCospiFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6569580c8eed1646l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x8b1ca1c01d2be18l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeCospiFloat4Float4(in, out);
- verifyResultsNativeCospiFloat4Float4(in, out, false);
+ script.forEach_testNativeCospiFloat4Float4(inV, out);
+ verifyResultsNativeCospiFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCospiFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeCospiFloat4Float4(in, out);
- verifyResultsNativeCospiFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeCospiFloat4Float4(inV, out);
+ verifyResultsNativeCospiFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeCospiFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeCospiFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeCospiFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeCospi(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCospi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCospi.rs
similarity index 87%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCospi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCospi.rs
index 471403f..dab1603 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCospi.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCospi.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeCospiFloatFloat(float in) {
- return native_cospi(in);
+float __attribute__((kernel)) testNativeCospiFloatFloat(float inV) {
+ return native_cospi(inV);
}
-float2 __attribute__((kernel)) testNativeCospiFloat2Float2(float2 in) {
- return native_cospi(in);
+float2 __attribute__((kernel)) testNativeCospiFloat2Float2(float2 inV) {
+ return native_cospi(inV);
}
-float3 __attribute__((kernel)) testNativeCospiFloat3Float3(float3 in) {
- return native_cospi(in);
+float3 __attribute__((kernel)) testNativeCospiFloat3Float3(float3 inV) {
+ return native_cospi(inV);
}
-float4 __attribute__((kernel)) testNativeCospiFloat4Float4(float4 in) {
- return native_cospi(in);
+float4 __attribute__((kernel)) testNativeCospiFloat4Float4(float4 inV) {
+ return native_cospi(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCospiRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCospiRelaxed.rs
index 66f3fef..ff8b91e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeCospiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeCospi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDistance.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDistance.java
similarity index 65%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeDistance.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDistance.java
index 360da34..17ebe90 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDistance.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDistance.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeDistance extends RSBaseCompute {
+public class GeneratedTestNativeDistance extends RSBaseCompute {
- private ScriptC_TestNativeDistance script;
- private ScriptC_TestNativeDistanceRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeDistance script;
+ private ScriptC_GeneratedTestNativeDistanceRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeDistance(mRS);
- scriptRelaxed = new ScriptC_TestNativeDistanceRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeDistance(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeDistanceRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inLhs;
- public float inRhs;
+ public float inLeftVector;
+ public float inRightVector;
public Target.Floaty out;
}
private void checkNativeDistanceFloatFloatFloat() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe0fd4252f8556ff6l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe0fd4252f8559b4cl, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb61d5ec530ae2337l, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x98c2c48c9b58b3c2l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testNativeDistanceFloatFloatFloat(inLhs, out);
- verifyResultsNativeDistanceFloatFloatFloat(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testNativeDistanceFloatFloatFloat(inLeftVector, out);
+ verifyResultsNativeDistanceFloatFloatFloat(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDistanceFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testNativeDistanceFloatFloatFloat(inLhs, out);
- verifyResultsNativeDistanceFloatFloatFloat(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testNativeDistanceFloatFloatFloat(inLeftVector, out);
+ verifyResultsNativeDistanceFloatFloatFloat(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDistanceFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeDistanceFloatFloatFloat(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 1];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 1];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsNativeDistanceFloatFloatFloat(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 1];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 1];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
// Create the appropriate sized arrays in args
// Fill args with the input values
- args.inLhs = arrayInLhs[i];
- args.inRhs = arrayInRhs[i];
+ args.inLeftVector = arrayInLeftVector[i];
+ args.inRightVector = arrayInRightVector[i];
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeDistance(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i], Float.floatToRawIntBits(arrayInLhs[i]), arrayInLhs[i]));
+ arrayInLeftVector[i], Float.floatToRawIntBits(arrayInLeftVector[i]), arrayInLeftVector[i]));
message.append("\n");
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i], Float.floatToRawIntBits(arrayInRhs[i]), arrayInRhs[i]));
+ arrayInRightVector[i], Float.floatToRawIntBits(arrayInRightVector[i]), arrayInRightVector[i]));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -109,50 +109,50 @@
}
public class ArgumentsFloatNFloatNFloat {
- public float[] inLhs;
- public float[] inRhs;
+ public float[] inLeftVector;
+ public float[] inRightVector;
public Target.Floaty out;
}
private void checkNativeDistanceFloat2Float2Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x28a9ea2ea1fd926al, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x28a9ea2ea1fdbdc0l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xef86e1d727286713l, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3d7bc89101e219b6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testNativeDistanceFloat2Float2Float(inLhs, out);
- verifyResultsNativeDistanceFloat2Float2Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testNativeDistanceFloat2Float2Float(inLeftVector, out);
+ verifyResultsNativeDistanceFloat2Float2Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDistanceFloat2Float2Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testNativeDistanceFloat2Float2Float(inLhs, out);
- verifyResultsNativeDistanceFloat2Float2Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testNativeDistanceFloat2Float2Float(inLeftVector, out);
+ verifyResultsNativeDistanceFloat2Float2Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDistanceFloat2Float2Float: " + e.toString());
}
}
- private void verifyResultsNativeDistanceFloat2Float2Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 2];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 2];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsNativeDistanceFloat2Float2Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 2];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 2];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[2];
- args.inRhs = new float[2];
+ args.inLeftVector = new float[2];
+ args.inRightVector = new float[2];
// Fill args with the input values
for (int j = 0; j < 2 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 2 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 2 + j];
}
for (int j = 0; j < 2 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 2 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 2 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeDistance(args, target);
@@ -165,15 +165,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 2 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 2 + j], Float.floatToRawIntBits(arrayInLhs[i * 2 + j]), arrayInLhs[i * 2 + j]));
+ arrayInLeftVector[i * 2 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 2 + j]), arrayInLeftVector[i * 2 + j]));
message.append("\n");
}
for (int j = 0; j < 2 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 2 + j], Float.floatToRawIntBits(arrayInRhs[i * 2 + j]), arrayInRhs[i * 2 + j]));
+ arrayInRightVector[i * 2 + j], Float.floatToRawIntBits(arrayInRightVector[i * 2 + j]), arrayInRightVector[i * 2 + j]));
message.append("\n");
}
message.append("Expected output out: ");
@@ -193,44 +193,44 @@
}
private void checkNativeDistanceFloat3Float3Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x559b398ef213adc4l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x559b398ef213d91al, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xbe30075548c71b61l, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xf3e514c0a78a62d0l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testNativeDistanceFloat3Float3Float(inLhs, out);
- verifyResultsNativeDistanceFloat3Float3Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testNativeDistanceFloat3Float3Float(inLeftVector, out);
+ verifyResultsNativeDistanceFloat3Float3Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDistanceFloat3Float3Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testNativeDistanceFloat3Float3Float(inLhs, out);
- verifyResultsNativeDistanceFloat3Float3Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testNativeDistanceFloat3Float3Float(inLeftVector, out);
+ verifyResultsNativeDistanceFloat3Float3Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDistanceFloat3Float3Float: " + e.toString());
}
}
- private void verifyResultsNativeDistanceFloat3Float3Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsNativeDistanceFloat3Float3Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[3];
- args.inRhs = new float[3];
+ args.inLeftVector = new float[3];
+ args.inRightVector = new float[3];
// Fill args with the input values
for (int j = 0; j < 3 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 4 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 4 + j];
}
for (int j = 0; j < 3 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 4 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 4 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeDistance(args, target);
@@ -243,15 +243,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 3 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 4 + j], Float.floatToRawIntBits(arrayInLhs[i * 4 + j]), arrayInLhs[i * 4 + j]));
+ arrayInLeftVector[i * 4 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 4 + j]), arrayInLeftVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 3 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 4 + j], Float.floatToRawIntBits(arrayInRhs[i * 4 + j]), arrayInRhs[i * 4 + j]));
+ arrayInRightVector[i * 4 + j], Float.floatToRawIntBits(arrayInRightVector[i * 4 + j]), arrayInRightVector[i * 4 + j]));
message.append("\n");
}
message.append("Expected output out: ");
@@ -271,44 +271,44 @@
}
private void checkNativeDistanceFloat4Float4Float() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x828c88ef4229c91el, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x828c88ef4229f474l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x8cd92cd36a65cfafl, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xaa4e60f04d32abeal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testNativeDistanceFloat4Float4Float(inLhs, out);
- verifyResultsNativeDistanceFloat4Float4Float(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testNativeDistanceFloat4Float4Float(inLeftVector, out);
+ verifyResultsNativeDistanceFloat4Float4Float(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDistanceFloat4Float4Float: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testNativeDistanceFloat4Float4Float(inLhs, out);
- verifyResultsNativeDistanceFloat4Float4Float(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testNativeDistanceFloat4Float4Float(inLeftVector, out);
+ verifyResultsNativeDistanceFloat4Float4Float(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDistanceFloat4Float4Float: " + e.toString());
}
}
- private void verifyResultsNativeDistanceFloat4Float4Float(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsNativeDistanceFloat4Float4Float(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
ArgumentsFloatNFloatNFloat args = new ArgumentsFloatNFloatNFloat();
// Create the appropriate sized arrays in args
- args.inLhs = new float[4];
- args.inRhs = new float[4];
+ args.inLeftVector = new float[4];
+ args.inRightVector = new float[4];
// Fill args with the input values
for (int j = 0; j < 4 ; j++) {
- args.inLhs[j] = arrayInLhs[i * 4 + j];
+ args.inLeftVector[j] = arrayInLeftVector[i * 4 + j];
}
for (int j = 0; j < 4 ; j++) {
- args.inRhs[j] = arrayInRhs[i * 4 + j];
+ args.inRightVector[j] = arrayInRightVector[i * 4 + j];
}
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeDistance(args, target);
@@ -321,15 +321,15 @@
if (!valid) {
StringBuilder message = new StringBuilder();
for (int j = 0; j < 4 ; j++) {
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInLhs[i * 4 + j], Float.floatToRawIntBits(arrayInLhs[i * 4 + j]), arrayInLhs[i * 4 + j]));
+ arrayInLeftVector[i * 4 + j], Float.floatToRawIntBits(arrayInLeftVector[i * 4 + j]), arrayInLeftVector[i * 4 + j]));
message.append("\n");
}
for (int j = 0; j < 4 ; j++) {
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayInRhs[i * 4 + j], Float.floatToRawIntBits(arrayInRhs[i * 4 + j]), arrayInRhs[i * 4 + j]));
+ arrayInRightVector[i * 4 + j], Float.floatToRawIntBits(arrayInRightVector[i * 4 + j]), arrayInRightVector[i * 4 + j]));
message.append("\n");
}
message.append("Expected output out: ");
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDistance.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDistance.rs
new file mode 100644
index 0000000..872db3e
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDistance.rs
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInRightVector;
+
+float __attribute__((kernel)) testNativeDistanceFloatFloatFloat(float inLeftVector, unsigned int x) {
+ float inRightVector = rsGetElementAt_float(gAllocInRightVector, x);
+ return native_distance(inLeftVector, inRightVector);
+}
+
+float __attribute__((kernel)) testNativeDistanceFloat2Float2Float(float2 inLeftVector, unsigned int x) {
+ float2 inRightVector = rsGetElementAt_float2(gAllocInRightVector, x);
+ return native_distance(inLeftVector, inRightVector);
+}
+
+float __attribute__((kernel)) testNativeDistanceFloat3Float3Float(float3 inLeftVector, unsigned int x) {
+ float3 inRightVector = rsGetElementAt_float3(gAllocInRightVector, x);
+ return native_distance(inLeftVector, inRightVector);
+}
+
+float __attribute__((kernel)) testNativeDistanceFloat4Float4Float(float4 inLeftVector, unsigned int x) {
+ float4 inRightVector = rsGetElementAt_float4(gAllocInRightVector, x);
+ return native_distance(inLeftVector, inRightVector);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDistanceRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDistanceRelaxed.rs
index 66f3fef..60c3aaf 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDistanceRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeDistance.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDivide.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDivide.java
similarity index 66%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeDivide.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDivide.java
index c546724..f8ae8e5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDivide.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDivide.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeDivide extends RSBaseCompute {
+public class GeneratedTestNativeDivide extends RSBaseCompute {
- private ScriptC_TestNativeDivide script;
- private ScriptC_TestNativeDivideRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeDivide script;
+ private ScriptC_GeneratedTestNativeDivideRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeDivide(mRS);
- scriptRelaxed = new ScriptC_TestNativeDivideRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeDivide(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeDivideRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inLhs;
- public float inRhs;
+ public float inLeftVector;
+ public float inRightVector;
public Target.Floaty out;
}
private void checkNativeDivideFloatFloatFloat() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe2845ef0c23d02del, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe2845ef0c23d2e34l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x73477387751754efl, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x5ed4412e19040daal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testNativeDivideFloatFloatFloat(inLhs, out);
- verifyResultsNativeDivideFloatFloatFloat(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testNativeDivideFloatFloatFloat(inLeftVector, out);
+ verifyResultsNativeDivideFloatFloatFloat(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDivideFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testNativeDivideFloatFloatFloat(inLhs, out);
- verifyResultsNativeDivideFloatFloatFloat(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testNativeDivideFloatFloatFloat(inLeftVector, out);
+ verifyResultsNativeDivideFloatFloatFloat(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDivideFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeDivideFloatFloatFloat(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 1];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 1];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsNativeDivideFloatFloatFloat(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 1];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 1];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inLhs = arrayInLhs[i];
- args.inRhs = arrayInRhs[i];
+ args.inLeftVector = arrayInLeftVector[i];
+ args.inRightVector = arrayInRightVector[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeDivide(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inLhs, Float.floatToRawIntBits(args.inLhs), args.inLhs));
+ args.inLeftVector, Float.floatToRawIntBits(args.inLeftVector), args.inLeftVector));
message.append("\n");
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inRhs, Float.floatToRawIntBits(args.inRhs), args.inRhs));
+ args.inRightVector, Float.floatToRawIntBits(args.inRightVector), args.inRightVector));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkNativeDivideFloat2Float2Float2() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x51c6d6ecaeab1c48l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x51c6d6ecaeab479el, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x752d5a1207785d6dl, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xb071fa74af507ad4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testNativeDivideFloat2Float2Float2(inLhs, out);
- verifyResultsNativeDivideFloat2Float2Float2(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testNativeDivideFloat2Float2Float2(inLeftVector, out);
+ verifyResultsNativeDivideFloat2Float2Float2(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDivideFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testNativeDivideFloat2Float2Float2(inLhs, out);
- verifyResultsNativeDivideFloat2Float2Float2(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testNativeDivideFloat2Float2Float2(inLeftVector, out);
+ verifyResultsNativeDivideFloat2Float2Float2(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDivideFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsNativeDivideFloat2Float2Float2(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 2];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 2];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsNativeDivideFloat2Float2Float2(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 2];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 2];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inLhs = arrayInLhs[i * 2 + j];
- args.inRhs = arrayInRhs[i * 2 + j];
+ args.inLeftVector = arrayInLeftVector[i * 2 + j];
+ args.inRightVector = arrayInRightVector[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeDivide(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inLhs, Float.floatToRawIntBits(args.inLhs), args.inLhs));
+ args.inLeftVector, Float.floatToRawIntBits(args.inLeftVector), args.inLeftVector));
message.append("\n");
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inRhs, Float.floatToRawIntBits(args.inRhs), args.inRhs));
+ args.inRightVector, Float.floatToRawIntBits(args.inRightVector), args.inRightVector));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkNativeDivideFloat3Float3Float3() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xde4f2c1a2b24e021l, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xde4f2c1a2b250b77l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x5623c6c05fb90198l, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x79d63bbd822c0e0dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testNativeDivideFloat3Float3Float3(inLhs, out);
- verifyResultsNativeDivideFloat3Float3Float3(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testNativeDivideFloat3Float3Float3(inLeftVector, out);
+ verifyResultsNativeDivideFloat3Float3Float3(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDivideFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testNativeDivideFloat3Float3Float3(inLhs, out);
- verifyResultsNativeDivideFloat3Float3Float3(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testNativeDivideFloat3Float3Float3(inLeftVector, out);
+ verifyResultsNativeDivideFloat3Float3Float3(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDivideFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsNativeDivideFloat3Float3Float3(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsNativeDivideFloat3Float3Float3(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inLhs = arrayInLhs[i * 4 + j];
- args.inRhs = arrayInRhs[i * 4 + j];
+ args.inLeftVector = arrayInLeftVector[i * 4 + j];
+ args.inRightVector = arrayInRightVector[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeDivide(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inLhs, Float.floatToRawIntBits(args.inLhs), args.inLhs));
+ args.inLeftVector, Float.floatToRawIntBits(args.inLeftVector), args.inLeftVector));
message.append("\n");
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inRhs, Float.floatToRawIntBits(args.inRhs), args.inRhs));
+ args.inRightVector, Float.floatToRawIntBits(args.inRightVector), args.inRightVector));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkNativeDivideFloat4Float4Float4() {
- Allocation inLhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6ad78147a79ea3fal, false);
- Allocation inRhs = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6ad78147a79ecf50l, false);
+ Allocation inLeftVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x371a336eb7f9a5c3l, false);
+ Allocation inRightVector = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x433a7d065507a146l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInRhs(inRhs);
- script.forEach_testNativeDivideFloat4Float4Float4(inLhs, out);
- verifyResultsNativeDivideFloat4Float4Float4(inLhs, inRhs, out, false);
+ script.set_gAllocInRightVector(inRightVector);
+ script.forEach_testNativeDivideFloat4Float4Float4(inLeftVector, out);
+ verifyResultsNativeDivideFloat4Float4Float4(inLeftVector, inRightVector, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDivideFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInRhs(inRhs);
- scriptRelaxed.forEach_testNativeDivideFloat4Float4Float4(inLhs, out);
- verifyResultsNativeDivideFloat4Float4Float4(inLhs, inRhs, out, true);
+ scriptRelaxed.set_gAllocInRightVector(inRightVector);
+ scriptRelaxed.forEach_testNativeDivideFloat4Float4Float4(inLeftVector, out);
+ verifyResultsNativeDivideFloat4Float4Float4(inLeftVector, inRightVector, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeDivideFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsNativeDivideFloat4Float4Float4(Allocation inLhs, Allocation inRhs, Allocation out, boolean relaxed) {
- float[] arrayInLhs = new float[INPUTSIZE * 4];
- inLhs.copyTo(arrayInLhs);
- float[] arrayInRhs = new float[INPUTSIZE * 4];
- inRhs.copyTo(arrayInRhs);
+ private void verifyResultsNativeDivideFloat4Float4Float4(Allocation inLeftVector, Allocation inRightVector, Allocation out, boolean relaxed) {
+ float[] arrayInLeftVector = new float[INPUTSIZE * 4];
+ inLeftVector.copyTo(arrayInLeftVector);
+ float[] arrayInRightVector = new float[INPUTSIZE * 4];
+ inRightVector.copyTo(arrayInRightVector);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inLhs = arrayInLhs[i * 4 + j];
- args.inRhs = arrayInRhs[i * 4 + j];
+ args.inLeftVector = arrayInLeftVector[i * 4 + j];
+ args.inRightVector = arrayInRightVector[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeDivide(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inLhs: ");
+ message.append("Input inLeftVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inLhs, Float.floatToRawIntBits(args.inLhs), args.inLhs));
+ args.inLeftVector, Float.floatToRawIntBits(args.inLeftVector), args.inLeftVector));
message.append("\n");
- message.append("Input inRhs: ");
+ message.append("Input inRightVector: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inRhs, Float.floatToRawIntBits(args.inRhs), args.inRhs));
+ args.inRightVector, Float.floatToRawIntBits(args.inRightVector), args.inRightVector));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDivide.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDivide.rs
new file mode 100644
index 0000000..db501c5
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDivide.rs
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInRightVector;
+
+float __attribute__((kernel)) testNativeDivideFloatFloatFloat(float inLeftVector, unsigned int x) {
+ float inRightVector = rsGetElementAt_float(gAllocInRightVector, x);
+ return native_divide(inLeftVector, inRightVector);
+}
+
+float2 __attribute__((kernel)) testNativeDivideFloat2Float2Float2(float2 inLeftVector, unsigned int x) {
+ float2 inRightVector = rsGetElementAt_float2(gAllocInRightVector, x);
+ return native_divide(inLeftVector, inRightVector);
+}
+
+float3 __attribute__((kernel)) testNativeDivideFloat3Float3Float3(float3 inLeftVector, unsigned int x) {
+ float3 inRightVector = rsGetElementAt_float3(gAllocInRightVector, x);
+ return native_divide(inLeftVector, inRightVector);
+}
+
+float4 __attribute__((kernel)) testNativeDivideFloat4Float4Float4(float4 inLeftVector, unsigned int x) {
+ float4 inRightVector = rsGetElementAt_float4(gAllocInRightVector, x);
+ return native_divide(inLeftVector, inRightVector);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDivideRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDivideRelaxed.rs
index 66f3fef..6bb458d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeDivideRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeDivide.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp.java
index 3c9a847..229c8b0 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeExp extends RSBaseCompute {
+public class GeneratedTestNativeExp extends RSBaseCompute {
- private ScriptC_TestNativeExp script;
- private ScriptC_TestNativeExpRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeExp script;
+ private ScriptC_GeneratedTestNativeExpRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeExp(mRS);
- scriptRelaxed = new ScriptC_TestNativeExpRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeExp(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeExpRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp10.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp10.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp10.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp10.java
index 75eb8df..d172b5d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp10.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp10.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeExp10 extends RSBaseCompute {
+public class GeneratedTestNativeExp10 extends RSBaseCompute {
- private ScriptC_TestNativeExp10 script;
- private ScriptC_TestNativeExp10Relaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeExp10 script;
+ private ScriptC_GeneratedTestNativeExp10Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeExp10(mRS);
- scriptRelaxed = new ScriptC_TestNativeExp10Relaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeExp10(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeExp10Relaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp10.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp10.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp10.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp10.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp10Relaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp10Relaxed.rs
index 66f3fef..fd63d34 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp10Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeExp10.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp2.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp2.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp2.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp2.java
index bb0e9b3..50b995d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp2.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp2.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeExp2 extends RSBaseCompute {
+public class GeneratedTestNativeExp2 extends RSBaseCompute {
- private ScriptC_TestNativeExp2 script;
- private ScriptC_TestNativeExp2Relaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeExp2 script;
+ private ScriptC_GeneratedTestNativeExp2Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeExp2(mRS);
- scriptRelaxed = new ScriptC_TestNativeExp2Relaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeExp2(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeExp2Relaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp2.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp2.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp2.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp2.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp2Relaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp2Relaxed.rs
index 66f3fef..7eb5b32 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExp2Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeExp2.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpRelaxed.rs
index dd3a73c..ab965b2 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeExp.rs"
+#include "GeneratedTestNativeExp.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpm1.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpm1.java
similarity index 79%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpm1.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpm1.java
index 3eecc32..c183fe6 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpm1.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpm1.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeExpm1 extends RSBaseCompute {
+public class GeneratedTestNativeExpm1 extends RSBaseCompute {
- private ScriptC_TestNativeExpm1 script;
- private ScriptC_TestNativeExpm1Relaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeExpm1 script;
+ private ScriptC_GeneratedTestNativeExpm1Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeExpm1(mRS);
- scriptRelaxed = new ScriptC_TestNativeExpm1Relaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeExpm1(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeExpm1Relaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeExpm1FloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x209e2820fcaa295fl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x7a90bd8a7094f34bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeExpm1FloatFloat(in, out);
- verifyResultsNativeExpm1FloatFloat(in, out, false);
+ script.forEach_testNativeExpm1FloatFloat(inV, out);
+ verifyResultsNativeExpm1FloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeExpm1FloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeExpm1FloatFloat(in, out);
- verifyResultsNativeExpm1FloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeExpm1FloatFloat(inV, out);
+ verifyResultsNativeExpm1FloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeExpm1FloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeExpm1FloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeExpm1FloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeExpm1(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeExpm1Float2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x964ef83c9a3d4a43l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3f43b22de84b7997l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeExpm1Float2Float2(in, out);
- verifyResultsNativeExpm1Float2Float2(in, out, false);
+ script.forEach_testNativeExpm1Float2Float2(inV, out);
+ verifyResultsNativeExpm1Float2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeExpm1Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeExpm1Float2Float2(in, out);
- verifyResultsNativeExpm1Float2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeExpm1Float2Float2(inV, out);
+ verifyResultsNativeExpm1Float2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeExpm1Float2Float2: " + e.toString());
}
}
- private void verifyResultsNativeExpm1Float2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeExpm1Float2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeExpm1(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeExpm1Float3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x964f02ddf943dfddl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x3f457b48de669a75l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeExpm1Float3Float3(in, out);
- verifyResultsNativeExpm1Float3Float3(in, out, false);
+ script.forEach_testNativeExpm1Float3Float3(inV, out);
+ verifyResultsNativeExpm1Float3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeExpm1Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeExpm1Float3Float3(in, out);
- verifyResultsNativeExpm1Float3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeExpm1Float3Float3(inV, out);
+ verifyResultsNativeExpm1Float3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeExpm1Float3Float3: " + e.toString());
}
}
- private void verifyResultsNativeExpm1Float3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeExpm1Float3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeExpm1(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeExpm1Float4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x964f0d7f584a7577l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3f474463d481bb53l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeExpm1Float4Float4(in, out);
- verifyResultsNativeExpm1Float4Float4(in, out, false);
+ script.forEach_testNativeExpm1Float4Float4(inV, out);
+ verifyResultsNativeExpm1Float4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeExpm1Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeExpm1Float4Float4(in, out);
- verifyResultsNativeExpm1Float4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeExpm1Float4Float4(inV, out);
+ verifyResultsNativeExpm1Float4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeExpm1Float4Float4: " + e.toString());
}
}
- private void verifyResultsNativeExpm1Float4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeExpm1Float4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeExpm1(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpm1.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpm1.rs
similarity index 87%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpm1.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpm1.rs
index 6d265d6..aca1745 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpm1.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpm1.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeExpm1FloatFloat(float in) {
- return native_expm1(in);
+float __attribute__((kernel)) testNativeExpm1FloatFloat(float inV) {
+ return native_expm1(inV);
}
-float2 __attribute__((kernel)) testNativeExpm1Float2Float2(float2 in) {
- return native_expm1(in);
+float2 __attribute__((kernel)) testNativeExpm1Float2Float2(float2 inV) {
+ return native_expm1(inV);
}
-float3 __attribute__((kernel)) testNativeExpm1Float3Float3(float3 in) {
- return native_expm1(in);
+float3 __attribute__((kernel)) testNativeExpm1Float3Float3(float3 inV) {
+ return native_expm1(inV);
}
-float4 __attribute__((kernel)) testNativeExpm1Float4Float4(float4 in) {
- return native_expm1(in);
+float4 __attribute__((kernel)) testNativeExpm1Float4Float4(float4 inV) {
+ return native_expm1(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpm1Relaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpm1Relaxed.rs
index 66f3fef..cad0784 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeExpm1Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeExpm1.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFdim.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeHypot.java
similarity index 75%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestFdim.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeHypot.java
index bbe1e7a..fcb86f3 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFdim.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeHypot.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestFdim extends RSBaseCompute {
+public class GeneratedTestNativeHypot extends RSBaseCompute {
- private ScriptC_TestFdim script;
- private ScriptC_TestFdimRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeHypot script;
+ private ScriptC_GeneratedTestNativeHypotRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestFdim(mRS);
- scriptRelaxed = new ScriptC_TestFdimRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeHypot(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeHypotRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
@@ -40,28 +40,28 @@
public Target.Floaty out;
}
- private void checkFdimFloatFloatFloat() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf5dd38fbc3a47366l, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf5dd38fbc3a47367l, false);
+ private void checkNativeHypotFloatFloatFloat() {
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3d61f129bdf66001l, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3d61f129bdf66002l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
script.set_gAllocInB(inB);
- script.forEach_testFdimFloatFloatFloat(inA, out);
- verifyResultsFdimFloatFloatFloat(inA, inB, out, false);
+ script.forEach_testNativeHypotFloatFloatFloat(inA, out);
+ verifyResultsNativeHypotFloatFloatFloat(inA, inB, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloatFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.forEach_testFdimFloatFloatFloat(inA, out);
- verifyResultsFdimFloatFloatFloat(inA, inB, out, true);
+ scriptRelaxed.forEach_testNativeHypotFloatFloatFloat(inA, out);
+ verifyResultsNativeHypotFloatFloatFloat(inA, inB, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloatFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsFdimFloatFloatFloat(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ private void verifyResultsNativeHypotFloatFloatFloat(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
float[] arrayInA = new float[INPUTSIZE * 1];
inA.copyTo(arrayInA);
float[] arrayInB = new float[INPUTSIZE * 1];
@@ -76,7 +76,7 @@
args.inB = arrayInB[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeFdim(args, target);
+ CoreMathVerifier.computeNativeHypot(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -102,35 +102,35 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkFdimFloatFloatFloat" +
+ assertTrue("Incorrect output for checkNativeHypotFloatFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkFdimFloat2Float2Float2() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xca6a96c16f167f4cl, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xca6a96c16f167f4dl, false);
+ private void checkNativeHypotFloat2Float2Float2() {
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x92a8064760a50e4dl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x92a8064760a50e4el, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
script.set_gAllocInB(inB);
- script.forEach_testFdimFloat2Float2Float2(inA, out);
- verifyResultsFdimFloat2Float2Float2(inA, inB, out, false);
+ script.forEach_testNativeHypotFloat2Float2Float2(inA, out);
+ verifyResultsNativeHypotFloat2Float2Float2(inA, inB, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat2Float2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.forEach_testFdimFloat2Float2Float2(inA, out);
- verifyResultsFdimFloat2Float2Float2(inA, inB, out, true);
+ scriptRelaxed.forEach_testNativeHypotFloat2Float2Float2(inA, out);
+ verifyResultsNativeHypotFloat2Float2Float2(inA, inB, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat2Float2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsFdimFloat2Float2Float2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ private void verifyResultsNativeHypotFloat2Float2Float2(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
float[] arrayInA = new float[INPUTSIZE * 2];
inA.copyTo(arrayInA);
float[] arrayInB = new float[INPUTSIZE * 2];
@@ -145,7 +145,7 @@
args.inB = arrayInB[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeFdim(args, target);
+ CoreMathVerifier.computeNativeHypot(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -171,35 +171,35 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkFdimFloat2Float2Float2" +
+ assertTrue("Incorrect output for checkNativeHypotFloat2Float2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkFdimFloat3Float3Float3() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1ecf74e170f480edl, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1ecf74e170f480eel, false);
+ private void checkNativeHypotFloat3Float3Float3() {
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xe70ce46762830feel, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xe70ce46762830fefl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
script.set_gAllocInB(inB);
- script.forEach_testFdimFloat3Float3Float3(inA, out);
- verifyResultsFdimFloat3Float3Float3(inA, inB, out, false);
+ script.forEach_testNativeHypotFloat3Float3Float3(inA, out);
+ verifyResultsNativeHypotFloat3Float3Float3(inA, inB, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat3Float3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.forEach_testFdimFloat3Float3Float3(inA, out);
- verifyResultsFdimFloat3Float3Float3(inA, inB, out, true);
+ scriptRelaxed.forEach_testNativeHypotFloat3Float3Float3(inA, out);
+ verifyResultsNativeHypotFloat3Float3Float3(inA, inB, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat3Float3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsFdimFloat3Float3Float3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ private void verifyResultsNativeHypotFloat3Float3Float3(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
float[] arrayInA = new float[INPUTSIZE * 4];
inA.copyTo(arrayInA);
float[] arrayInB = new float[INPUTSIZE * 4];
@@ -214,7 +214,7 @@
args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeFdim(args, target);
+ CoreMathVerifier.computeNativeHypot(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -240,35 +240,35 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkFdimFloat3Float3Float3" +
+ assertTrue("Incorrect output for checkNativeHypotFloat3Float3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkFdimFloat4Float4Float4() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x7334530172d2828el, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x7334530172d2828fl, false);
+ private void checkNativeHypotFloat4Float4Float4() {
+ Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3b71c2876461118fl, false);
+ Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3b71c28764611190l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
script.set_gAllocInB(inB);
- script.forEach_testFdimFloat4Float4Float4(inA, out);
- verifyResultsFdimFloat4Float4Float4(inA, inB, out, false);
+ script.forEach_testNativeHypotFloat4Float4Float4(inA, out);
+ verifyResultsNativeHypotFloat4Float4Float4(inA, inB, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat4Float4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.forEach_testFdimFloat4Float4Float4(inA, out);
- verifyResultsFdimFloat4Float4Float4(inA, inB, out, true);
+ scriptRelaxed.forEach_testNativeHypotFloat4Float4Float4(inA, out);
+ verifyResultsNativeHypotFloat4Float4Float4(inA, inB, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFdimFloat4Float4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsFdimFloat4Float4Float4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
+ private void verifyResultsNativeHypotFloat4Float4Float4(Allocation inA, Allocation inB, Allocation out, boolean relaxed) {
float[] arrayInA = new float[INPUTSIZE * 4];
inA.copyTo(arrayInA);
float[] arrayInB = new float[INPUTSIZE * 4];
@@ -283,7 +283,7 @@
args.inB = arrayInB[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeFdim(args, target);
+ CoreMathVerifier.computeNativeHypot(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -309,17 +309,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkFdimFloat4Float4Float4" +
+ assertTrue("Incorrect output for checkNativeHypotFloat4Float4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testFdim() {
- checkFdimFloatFloatFloat();
- checkFdimFloat2Float2Float2();
- checkFdimFloat3Float3Float3();
- checkFdimFloat4Float4Float4();
+ public void testNativeHypot() {
+ checkNativeHypotFloatFloatFloat();
+ checkNativeHypotFloat2Float2Float2();
+ checkNativeHypotFloat3Float3Float3();
+ checkNativeHypotFloat4Float4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeHypot.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeHypot.rs
similarity index 67%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeHypot.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeHypot.rs
index b4e8a7c..70fb23d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeHypot.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeHypot.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInY;
+rs_allocation gAllocInB;
-float __attribute__((kernel)) testNativeHypotFloatFloatFloat(float inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return native_hypot(inX, inY);
+float __attribute__((kernel)) testNativeHypotFloatFloatFloat(float inA, unsigned int x) {
+ float inB = rsGetElementAt_float(gAllocInB, x);
+ return native_hypot(inA, inB);
}
-float2 __attribute__((kernel)) testNativeHypotFloat2Float2Float2(float2 inX, unsigned int x) {
- float2 inY = rsGetElementAt_float2(gAllocInY, x);
- return native_hypot(inX, inY);
+float2 __attribute__((kernel)) testNativeHypotFloat2Float2Float2(float2 inA, unsigned int x) {
+ float2 inB = rsGetElementAt_float2(gAllocInB, x);
+ return native_hypot(inA, inB);
}
-float3 __attribute__((kernel)) testNativeHypotFloat3Float3Float3(float3 inX, unsigned int x) {
- float3 inY = rsGetElementAt_float3(gAllocInY, x);
- return native_hypot(inX, inY);
+float3 __attribute__((kernel)) testNativeHypotFloat3Float3Float3(float3 inA, unsigned int x) {
+ float3 inB = rsGetElementAt_float3(gAllocInB, x);
+ return native_hypot(inA, inB);
}
-float4 __attribute__((kernel)) testNativeHypotFloat4Float4Float4(float4 inX, unsigned int x) {
- float4 inY = rsGetElementAt_float4(gAllocInY, x);
- return native_hypot(inX, inY);
+float4 __attribute__((kernel)) testNativeHypotFloat4Float4Float4(float4 inA, unsigned int x) {
+ float4 inB = rsGetElementAt_float4(gAllocInB, x);
+ return native_hypot(inA, inB);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeHypotRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeHypotRelaxed.rs
index 66f3fef..5a97da6 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeHypotRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeHypot.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLength.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLength.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeLength.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLength.java
index b3a5df6..77faec5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLength.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLength.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeLength extends RSBaseCompute {
+public class GeneratedTestNativeLength extends RSBaseCompute {
- private ScriptC_TestNativeLength script;
- private ScriptC_TestNativeLengthRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeLength script;
+ private ScriptC_GeneratedTestNativeLengthRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeLength(mRS);
- scriptRelaxed = new ScriptC_TestNativeLengthRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeLength(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeLengthRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLength.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLength.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeLength.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLength.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLengthRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLengthRelaxed.rs
index 66f3fef..5cdca08 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLengthRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeLength.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog.java
index 4116cba..323d174 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeLog extends RSBaseCompute {
+public class GeneratedTestNativeLog extends RSBaseCompute {
- private ScriptC_TestNativeLog script;
- private ScriptC_TestNativeLogRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeLog script;
+ private ScriptC_GeneratedTestNativeLogRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeLog(mRS);
- scriptRelaxed = new ScriptC_TestNativeLogRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeLog(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeLogRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog10.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog10.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog10.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog10.java
index 9a64239..3220259 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog10.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog10.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeLog10 extends RSBaseCompute {
+public class GeneratedTestNativeLog10 extends RSBaseCompute {
- private ScriptC_TestNativeLog10 script;
- private ScriptC_TestNativeLog10Relaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeLog10 script;
+ private ScriptC_GeneratedTestNativeLog10Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeLog10(mRS);
- scriptRelaxed = new ScriptC_TestNativeLog10Relaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeLog10(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeLog10Relaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog10.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog10.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog10.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog10.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog10Relaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog10Relaxed.rs
index 66f3fef..42408f9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog10Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeLog10.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog1p.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog1p.java
similarity index 79%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog1p.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog1p.java
index 0d88a75..b2c2bea 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog1p.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog1p.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeLog1p extends RSBaseCompute {
+public class GeneratedTestNativeLog1p extends RSBaseCompute {
- private ScriptC_TestNativeLog1p script;
- private ScriptC_TestNativeLog1pRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeLog1p script;
+ private ScriptC_GeneratedTestNativeLog1pRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeLog1p(mRS);
- scriptRelaxed = new ScriptC_TestNativeLog1pRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeLog1p(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeLog1pRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeLog1pFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x444585911437d95l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb77ad6f5e656185dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeLog1pFloatFloat(in, out);
- verifyResultsNativeLog1pFloatFloat(in, out, false);
+ script.forEach_testNativeLog1pFloatFloat(inV, out);
+ verifyResultsNativeLog1pFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeLog1pFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeLog1pFloatFloat(in, out);
- verifyResultsNativeLog1pFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeLog1pFloatFloat(inV, out);
+ verifyResultsNativeLog1pFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeLog1pFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeLog1pFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeLog1pFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeLog1p(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeLog1pFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xd1a13d4961ae8449l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x36154b5368503899l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeLog1pFloat2Float2(in, out);
- verifyResultsNativeLog1pFloat2Float2(in, out, false);
+ script.forEach_testNativeLog1pFloat2Float2(inV, out);
+ verifyResultsNativeLog1pFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeLog1pFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeLog1pFloat2Float2(in, out);
- verifyResultsNativeLog1pFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeLog1pFloat2Float2(inV, out);
+ verifyResultsNativeLog1pFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeLog1pFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeLog1pFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeLog1pFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeLog1p(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeLog1pFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd1a147eac0b519e3l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x3617146e5e6b5977l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeLog1pFloat3Float3(in, out);
- verifyResultsNativeLog1pFloat3Float3(in, out, false);
+ script.forEach_testNativeLog1pFloat3Float3(inV, out);
+ verifyResultsNativeLog1pFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeLog1pFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeLog1pFloat3Float3(in, out);
- verifyResultsNativeLog1pFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeLog1pFloat3Float3(inV, out);
+ verifyResultsNativeLog1pFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeLog1pFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeLog1pFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeLog1pFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeLog1p(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeLog1pFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd1a1528c1fbbaf7dl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3618dd8954867a55l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeLog1pFloat4Float4(in, out);
- verifyResultsNativeLog1pFloat4Float4(in, out, false);
+ script.forEach_testNativeLog1pFloat4Float4(inV, out);
+ verifyResultsNativeLog1pFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeLog1pFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeLog1pFloat4Float4(in, out);
- verifyResultsNativeLog1pFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeLog1pFloat4Float4(inV, out);
+ verifyResultsNativeLog1pFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeLog1pFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeLog1pFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeLog1pFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeLog1p(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog1p.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog1p.rs
similarity index 87%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog1p.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog1p.rs
index 8d9cdd2..4fdcd2f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog1p.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog1p.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeLog1pFloatFloat(float in) {
- return native_log1p(in);
+float __attribute__((kernel)) testNativeLog1pFloatFloat(float inV) {
+ return native_log1p(inV);
}
-float2 __attribute__((kernel)) testNativeLog1pFloat2Float2(float2 in) {
- return native_log1p(in);
+float2 __attribute__((kernel)) testNativeLog1pFloat2Float2(float2 inV) {
+ return native_log1p(inV);
}
-float3 __attribute__((kernel)) testNativeLog1pFloat3Float3(float3 in) {
- return native_log1p(in);
+float3 __attribute__((kernel)) testNativeLog1pFloat3Float3(float3 inV) {
+ return native_log1p(inV);
}
-float4 __attribute__((kernel)) testNativeLog1pFloat4Float4(float4 in) {
- return native_log1p(in);
+float4 __attribute__((kernel)) testNativeLog1pFloat4Float4(float4 inV) {
+ return native_log1p(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog1pRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog1pRelaxed.rs
index 66f3fef..96ba4e0 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog1pRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeLog1p.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog2.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog2.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog2.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog2.java
index 674abb7..2da8087 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog2.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog2.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeLog2 extends RSBaseCompute {
+public class GeneratedTestNativeLog2 extends RSBaseCompute {
- private ScriptC_TestNativeLog2 script;
- private ScriptC_TestNativeLog2Relaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeLog2 script;
+ private ScriptC_GeneratedTestNativeLog2Relaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeLog2(mRS);
- scriptRelaxed = new ScriptC_TestNativeLog2Relaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeLog2(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeLog2Relaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog2.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog2.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog2.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog2.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog2Relaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog2Relaxed.rs
index 66f3fef..c51cf21 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLog2Relaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeLog2.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLogRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLogRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeLogRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLogRelaxed.rs
index 70d5e2f..8e631be 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLogRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeLogRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeLog.rs"
+#include "GeneratedTestNativeLog.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeNormalize.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeNormalize.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeNormalize.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeNormalize.java
index 42f4553..ef9ebf9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeNormalize.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeNormalize.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeNormalize extends RSBaseCompute {
+public class GeneratedTestNativeNormalize extends RSBaseCompute {
- private ScriptC_TestNativeNormalize script;
- private ScriptC_TestNativeNormalizeRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeNormalize script;
+ private ScriptC_GeneratedTestNativeNormalizeRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeNormalize(mRS);
- scriptRelaxed = new ScriptC_TestNativeNormalizeRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeNormalize(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeNormalizeRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeNormalize.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeNormalize.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeNormalize.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeNormalize.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeNormalizeRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeNormalizeRelaxed.rs
index 66f3fef..6036573 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeNormalizeRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeNormalize.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativePowr.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativePowr.java
similarity index 67%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativePowr.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativePowr.java
index f19d80c..f4443e4 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativePowr.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativePowr.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativePowr extends RSBaseCompute {
+public class GeneratedTestNativePowr extends RSBaseCompute {
- private ScriptC_TestNativePowr script;
- private ScriptC_TestNativePowrRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativePowr script;
+ private ScriptC_GeneratedTestNativePowrRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativePowr(mRS);
- scriptRelaxed = new ScriptC_TestNativePowrRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativePowr(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativePowrRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inV;
- public float inY;
+ public float inBase;
+ public float inExponent;
public Target.Floaty out;
}
private void checkNativePowrFloatFloatFloat() {
- Allocation inV = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3c3550bdff7a10c2l, 0, 256);
- Allocation inY = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3c3550bdff7a10c5l, -15, 15);
+ Allocation inBase = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x22637077834d1839l, 0, 256);
+ Allocation inExponent = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xef7b0ab4f9181f0fl, -15, 15);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNativePowrFloatFloatFloat(inV, out);
- verifyResultsNativePowrFloatFloatFloat(inV, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testNativePowrFloatFloatFloat(inBase, out);
+ verifyResultsNativePowrFloatFloatFloat(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativePowrFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNativePowrFloatFloatFloat(inV, out);
- verifyResultsNativePowrFloatFloatFloat(inV, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testNativePowrFloatFloatFloat(inBase, out);
+ verifyResultsNativePowrFloatFloatFloat(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativePowrFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativePowrFloatFloatFloat(Allocation inV, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInV = new float[INPUTSIZE * 1];
- inV.copyTo(arrayInV);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsNativePowrFloatFloatFloat(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 1];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 1];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inV = arrayInV[i];
- args.inY = arrayInY[i];
+ args.inBase = arrayInBase[i];
+ args.inExponent = arrayInExponent[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativePowr(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inV, Float.floatToRawIntBits(args.inV), args.inV));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkNativePowrFloat2Float2Float2() {
- Allocation inV = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xdbc56fbe7733c926l, 0, 256);
- Allocation inY = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xdbc56fbe7733c929l, -15, 15);
+ Allocation inBase = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x47afceb7283b11a5l, 0, 256);
+ Allocation inExponent = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x65ac261bb67d4abbl, -15, 15);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNativePowrFloat2Float2Float2(inV, out);
- verifyResultsNativePowrFloat2Float2Float2(inV, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testNativePowrFloat2Float2Float2(inBase, out);
+ verifyResultsNativePowrFloat2Float2Float2(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativePowrFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNativePowrFloat2Float2Float2(inV, out);
- verifyResultsNativePowrFloat2Float2Float2(inV, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testNativePowrFloat2Float2Float2(inBase, out);
+ verifyResultsNativePowrFloat2Float2Float2(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativePowrFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsNativePowrFloat2Float2Float2(Allocation inV, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInV = new float[INPUTSIZE * 2];
- inV.copyTo(arrayInV);
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
+ private void verifyResultsNativePowrFloat2Float2Float2(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 2];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 2];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inV = arrayInV[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
+ args.inBase = arrayInBase[i * 2 + j];
+ args.inExponent = arrayInExponent[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativePowr(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inV, Float.floatToRawIntBits(args.inV), args.inV));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkNativePowrFloat3Float3Float3() {
- Allocation inV = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x302a4dde7911cac7l, 0, 256);
- Allocation inY = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x302a4dde7911cacal, -15, 15);
+ Allocation inBase = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xe2961d5b10aef718l, 0, 256);
+ Allocation inExponent = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x411aa11d0d9fcd3el, -15, 15);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNativePowrFloat3Float3Float3(inV, out);
- verifyResultsNativePowrFloat3Float3Float3(inV, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testNativePowrFloat3Float3Float3(inBase, out);
+ verifyResultsNativePowrFloat3Float3Float3(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativePowrFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNativePowrFloat3Float3Float3(inV, out);
- verifyResultsNativePowrFloat3Float3Float3(inV, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testNativePowrFloat3Float3Float3(inBase, out);
+ verifyResultsNativePowrFloat3Float3Float3(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativePowrFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsNativePowrFloat3Float3Float3(Allocation inV, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInV = new float[INPUTSIZE * 4];
- inV.copyTo(arrayInV);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsNativePowrFloat3Float3Float3(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 4];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 4];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inV = arrayInV[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inBase = arrayInBase[i * 4 + j];
+ args.inExponent = arrayInExponent[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativePowr(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inV, Float.floatToRawIntBits(args.inV), args.inV));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkNativePowrFloat4Float4Float4() {
- Allocation inV = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x848f2bfe7aefcc68l, 0, 256);
- Allocation inY = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x848f2bfe7aefcc6bl, -15, 15);
+ Allocation inBase = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x7d7c6bfef922dc8bl, 0, 256);
+ Allocation inExponent = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x1c891c1e64c24fc1l, -15, 15);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNativePowrFloat4Float4Float4(inV, out);
- verifyResultsNativePowrFloat4Float4Float4(inV, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testNativePowrFloat4Float4Float4(inBase, out);
+ verifyResultsNativePowrFloat4Float4Float4(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativePowrFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNativePowrFloat4Float4Float4(inV, out);
- verifyResultsNativePowrFloat4Float4Float4(inV, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testNativePowrFloat4Float4Float4(inBase, out);
+ verifyResultsNativePowrFloat4Float4Float4(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativePowrFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsNativePowrFloat4Float4Float4(Allocation inV, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInV = new float[INPUTSIZE * 4];
- inV.copyTo(arrayInV);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsNativePowrFloat4Float4Float4(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 4];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 4];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inV = arrayInV[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inBase = arrayInBase[i * 4 + j];
+ args.inExponent = arrayInExponent[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativePowr(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inV: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inV, Float.floatToRawIntBits(args.inV), args.inV));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativePowr.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativePowr.rs
similarity index 63%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativePowr.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativePowr.rs
index 06de2f9..8adc2d2 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativePowr.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativePowr.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInY;
+rs_allocation gAllocInExponent;
-float __attribute__((kernel)) testNativePowrFloatFloatFloat(float inV, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return native_powr(inV, inY);
+float __attribute__((kernel)) testNativePowrFloatFloatFloat(float inBase, unsigned int x) {
+ float inExponent = rsGetElementAt_float(gAllocInExponent, x);
+ return native_powr(inBase, inExponent);
}
-float2 __attribute__((kernel)) testNativePowrFloat2Float2Float2(float2 inV, unsigned int x) {
- float2 inY = rsGetElementAt_float2(gAllocInY, x);
- return native_powr(inV, inY);
+float2 __attribute__((kernel)) testNativePowrFloat2Float2Float2(float2 inBase, unsigned int x) {
+ float2 inExponent = rsGetElementAt_float2(gAllocInExponent, x);
+ return native_powr(inBase, inExponent);
}
-float3 __attribute__((kernel)) testNativePowrFloat3Float3Float3(float3 inV, unsigned int x) {
- float3 inY = rsGetElementAt_float3(gAllocInY, x);
- return native_powr(inV, inY);
+float3 __attribute__((kernel)) testNativePowrFloat3Float3Float3(float3 inBase, unsigned int x) {
+ float3 inExponent = rsGetElementAt_float3(gAllocInExponent, x);
+ return native_powr(inBase, inExponent);
}
-float4 __attribute__((kernel)) testNativePowrFloat4Float4Float4(float4 inV, unsigned int x) {
- float4 inY = rsGetElementAt_float4(gAllocInY, x);
- return native_powr(inV, inY);
+float4 __attribute__((kernel)) testNativePowrFloat4Float4Float4(float4 inBase, unsigned int x) {
+ float4 inExponent = rsGetElementAt_float4(gAllocInExponent, x);
+ return native_powr(inBase, inExponent);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativePowrRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativePowrRelaxed.rs
index 66f3fef..216df7c 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativePowrRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativePowr.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRecip.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRecip.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeRecip.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRecip.java
index 976526b..88d9f82 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRecip.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRecip.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeRecip extends RSBaseCompute {
+public class GeneratedTestNativeRecip extends RSBaseCompute {
- private ScriptC_TestNativeRecip script;
- private ScriptC_TestNativeRecipRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeRecip script;
+ private ScriptC_GeneratedTestNativeRecipRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeRecip(mRS);
- scriptRelaxed = new ScriptC_TestNativeRecipRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeRecip(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeRecipRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRecip.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRecip.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeRecip.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRecip.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRecipRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRecipRelaxed.rs
index 66f3fef..3dac525 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRecipRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeRecip.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRootn.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRootn.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeRootn.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRootn.java
index d125e3b..9d42f44 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRootn.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRootn.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeRootn extends RSBaseCompute {
+public class GeneratedTestNativeRootn extends RSBaseCompute {
- private ScriptC_TestNativeRootn script;
- private ScriptC_TestNativeRootnRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeRootn script;
+ private ScriptC_GeneratedTestNativeRootnRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeRootn(mRS);
- scriptRelaxed = new ScriptC_TestNativeRootnRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeRootn(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeRootnRelaxed(mRS);
}
public class ArgumentsFloatIntFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRootn.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRootn.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeRootn.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRootn.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRootnRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRootnRelaxed.rs
index 66f3fef..74c32dc 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRootnRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeRootn.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRsqrt.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRsqrt.java
similarity index 79%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeRsqrt.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRsqrt.java
index fc2549d..88b821a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRsqrt.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRsqrt.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeRsqrt extends RSBaseCompute {
+public class GeneratedTestNativeRsqrt extends RSBaseCompute {
- private ScriptC_TestNativeRsqrt script;
- private ScriptC_TestNativeRsqrtRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeRsqrt script;
+ private ScriptC_GeneratedTestNativeRsqrtRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeRsqrt(mRS);
- scriptRelaxed = new ScriptC_TestNativeRsqrtRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeRsqrt(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeRsqrtRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeRsqrtFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf3cf23b51aa29de0l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf3caff6b795084f6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeRsqrtFloatFloat(in, out);
- verifyResultsNativeRsqrtFloatFloat(in, out, false);
+ script.forEach_testNativeRsqrtFloatFloat(inV, out);
+ verifyResultsNativeRsqrtFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeRsqrtFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeRsqrtFloatFloat(in, out);
- verifyResultsNativeRsqrtFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeRsqrtFloatFloat(inV, out);
+ verifyResultsNativeRsqrtFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeRsqrtFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeRsqrtFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeRsqrtFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeRsqrt(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeRsqrtFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xf318090911bec1fcl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xd5098485fb0a95aal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeRsqrtFloat2Float2(in, out);
- verifyResultsNativeRsqrtFloat2Float2(in, out, false);
+ script.forEach_testNativeRsqrtFloat2Float2(inV, out);
+ verifyResultsNativeRsqrtFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeRsqrtFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeRsqrtFloat2Float2(in, out);
- verifyResultsNativeRsqrtFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeRsqrtFloat2Float2(inV, out);
+ verifyResultsNativeRsqrtFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeRsqrtFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeRsqrtFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeRsqrtFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeRsqrt(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeRsqrtFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xf31813aa70c55796l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd50b4da0f125b688l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeRsqrtFloat3Float3(in, out);
- verifyResultsNativeRsqrtFloat3Float3(in, out, false);
+ script.forEach_testNativeRsqrtFloat3Float3(inV, out);
+ verifyResultsNativeRsqrtFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeRsqrtFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeRsqrtFloat3Float3(in, out);
- verifyResultsNativeRsqrtFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeRsqrtFloat3Float3(inV, out);
+ verifyResultsNativeRsqrtFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeRsqrtFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeRsqrtFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeRsqrtFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeRsqrt(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeRsqrtFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf3181e4bcfcbed30l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd50d16bbe740d766l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeRsqrtFloat4Float4(in, out);
- verifyResultsNativeRsqrtFloat4Float4(in, out, false);
+ script.forEach_testNativeRsqrtFloat4Float4(inV, out);
+ verifyResultsNativeRsqrtFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeRsqrtFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeRsqrtFloat4Float4(in, out);
- verifyResultsNativeRsqrtFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeRsqrtFloat4Float4(inV, out);
+ verifyResultsNativeRsqrtFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeRsqrtFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeRsqrtFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeRsqrtFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeRsqrt(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRsqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRsqrt.rs
similarity index 87%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeRsqrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRsqrt.rs
index af291cb..b7c3173 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRsqrt.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRsqrt.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeRsqrtFloatFloat(float in) {
- return native_rsqrt(in);
+float __attribute__((kernel)) testNativeRsqrtFloatFloat(float inV) {
+ return native_rsqrt(inV);
}
-float2 __attribute__((kernel)) testNativeRsqrtFloat2Float2(float2 in) {
- return native_rsqrt(in);
+float2 __attribute__((kernel)) testNativeRsqrtFloat2Float2(float2 inV) {
+ return native_rsqrt(inV);
}
-float3 __attribute__((kernel)) testNativeRsqrtFloat3Float3(float3 in) {
- return native_rsqrt(in);
+float3 __attribute__((kernel)) testNativeRsqrtFloat3Float3(float3 inV) {
+ return native_rsqrt(inV);
}
-float4 __attribute__((kernel)) testNativeRsqrtFloat4Float4(float4 in) {
- return native_rsqrt(in);
+float4 __attribute__((kernel)) testNativeRsqrtFloat4Float4(float4 inV) {
+ return native_rsqrt(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRsqrtRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRsqrtRelaxed.rs
index 66f3fef..9c61597 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeRsqrtRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeRsqrt.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSin.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSin.java
similarity index 77%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeSin.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSin.java
index 1637326..29cc178 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSin.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSin.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeSin extends RSBaseCompute {
+public class GeneratedTestNativeSin extends RSBaseCompute {
- private ScriptC_TestNativeSin script;
- private ScriptC_TestNativeSinRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeSin script;
+ private ScriptC_GeneratedTestNativeSinRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeSin(mRS);
- scriptRelaxed = new ScriptC_TestNativeSinRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeSin(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeSinRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeSinFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x33ee19763354cc56l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb8fe46da9f3e52c8l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeSinFloatFloat(in, out);
- verifyResultsNativeSinFloatFloat(in, out, false);
+ script.forEach_testNativeSinFloatFloat(inV, out);
+ verifyResultsNativeSinFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinFloatFloat(in, out);
- verifyResultsNativeSinFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeSinFloatFloat(inV, out);
+ verifyResultsNativeSinFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeSinFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSin(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeSinFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x12b508b470b05442l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2468764eed9e276cl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeSinFloat2Float2(in, out);
- verifyResultsNativeSinFloat2Float2(in, out, false);
+ script.forEach_testNativeSinFloat2Float2(inV, out);
+ verifyResultsNativeSinFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinFloat2Float2(in, out);
- verifyResultsNativeSinFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeSinFloat2Float2(inV, out);
+ verifyResultsNativeSinFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeSinFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSin(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeSinFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x12b51355cfb6e9dcl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x246a3f69e3b9484al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeSinFloat3Float3(in, out);
- verifyResultsNativeSinFloat3Float3(in, out, false);
+ script.forEach_testNativeSinFloat3Float3(inV, out);
+ verifyResultsNativeSinFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinFloat3Float3(in, out);
- verifyResultsNativeSinFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeSinFloat3Float3(inV, out);
+ verifyResultsNativeSinFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeSinFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSin(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeSinFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x12b51df72ebd7f76l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x246c0884d9d46928l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeSinFloat4Float4(in, out);
- verifyResultsNativeSinFloat4Float4(in, out, false);
+ script.forEach_testNativeSinFloat4Float4(inV, out);
+ verifyResultsNativeSinFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinFloat4Float4(in, out);
- verifyResultsNativeSinFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeSinFloat4Float4(inV, out);
+ verifyResultsNativeSinFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeSinFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSin(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSin.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSin.rs
similarity index 83%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeSin.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSin.rs
index 1af8929..dacc15e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSin.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSin.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeSinFloatFloat(float in) {
- return native_sin(in);
+float __attribute__((kernel)) testNativeSinFloatFloat(float inV) {
+ return native_sin(inV);
}
-float2 __attribute__((kernel)) testNativeSinFloat2Float2(float2 in) {
- return native_sin(in);
+float2 __attribute__((kernel)) testNativeSinFloat2Float2(float2 inV) {
+ return native_sin(inV);
}
-float3 __attribute__((kernel)) testNativeSinFloat3Float3(float3 in) {
- return native_sin(in);
+float3 __attribute__((kernel)) testNativeSinFloat3Float3(float3 inV) {
+ return native_sin(inV);
}
-float4 __attribute__((kernel)) testNativeSinFloat4Float4(float4 in) {
- return native_sin(in);
+float4 __attribute__((kernel)) testNativeSinFloat4Float4(float4 inV) {
+ return native_sin(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinRelaxed.rs
index e3dbf27..3db631d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeSin.rs"
+#include "GeneratedTestNativeSin.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSincos.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSincos.java
similarity index 76%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeSincos.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSincos.java
index 380f2b4..8812b4d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSincos.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSincos.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeSincos extends RSBaseCompute {
+public class GeneratedTestNativeSincos extends RSBaseCompute {
- private ScriptC_TestNativeSincos script;
- private ScriptC_TestNativeSincosRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeSincos script;
+ private ScriptC_GeneratedTestNativeSincosRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeSincos(mRS);
- scriptRelaxed = new ScriptC_TestNativeSincosRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeSincos(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeSincosRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
public float inV;
- public Target.Floaty outCosptr;
+ public Target.Floaty outCos;
public Target.Floaty out;
}
private void checkNativeSincosFloatFloatFloat() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe15df2366436cc13l, false);
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocOutCosptr(outCosptr);
+ script.set_gAllocOutCos(outCos);
script.forEach_testNativeSincosFloatFloatFloat(inV, out);
- verifyResultsNativeSincosFloatFloatFloat(inV, outCosptr, out, false);
+ verifyResultsNativeSincosFloatFloatFloat(inV, outCos, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSincosFloatFloatFloat: " + e.toString());
}
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocOutCosptr(outCosptr);
+ scriptRelaxed.set_gAllocOutCos(outCos);
scriptRelaxed.forEach_testNativeSincosFloatFloatFloat(inV, out);
- verifyResultsNativeSincosFloatFloatFloat(inV, outCosptr, out, true);
+ verifyResultsNativeSincosFloatFloatFloat(inV, outCos, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSincosFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeSincosFloatFloatFloat(Allocation inV, Allocation outCosptr, Allocation out, boolean relaxed) {
+ private void verifyResultsNativeSincosFloatFloatFloat(Allocation inV, Allocation outCos, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
- float[] arrayOutCosptr = new float[INPUTSIZE * 1];
- outCosptr.copyTo(arrayOutCosptr);
+ float[] arrayOutCos = new float[INPUTSIZE * 1];
+ outCos.copyTo(arrayOutCos);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -79,7 +79,7 @@
CoreMathVerifier.computeNativeSincos(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 1 + j], 0.0005)) {
+ if (!args.outCos.couldBe(arrayOutCos[i * 1 + j], 0.0005)) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 1 + j], 0.0005)) {
@@ -91,13 +91,13 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outCosptr: ");
- message.append(args.outCosptr.toString());
+ message.append("Expected output outCos: ");
+ message.append(args.outCos.toString());
message.append("\n");
- message.append("Actual output outCosptr: ");
+ message.append("Actual output outCos: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutCosptr[i * 1 + j], Float.floatToRawIntBits(arrayOutCosptr[i * 1 + j]), arrayOutCosptr[i * 1 + j]));
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 1 + j], 0.0005)) {
+ arrayOutCos[i * 1 + j], Float.floatToRawIntBits(arrayOutCos[i * 1 + j]), arrayOutCos[i * 1 + j]));
+ if (!args.outCos.couldBe(arrayOutCos[i * 1 + j], 0.0005)) {
message.append(" FAIL");
}
message.append("\n");
@@ -121,30 +121,30 @@
private void checkNativeSincosFloat2Float2Float2() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xe5a1f1dcda676ea9l, false);
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocOutCosptr(outCosptr);
+ script.set_gAllocOutCos(outCos);
script.forEach_testNativeSincosFloat2Float2Float2(inV, out);
- verifyResultsNativeSincosFloat2Float2Float2(inV, outCosptr, out, false);
+ verifyResultsNativeSincosFloat2Float2Float2(inV, outCos, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSincosFloat2Float2Float2: " + e.toString());
}
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocOutCosptr(outCosptr);
+ scriptRelaxed.set_gAllocOutCos(outCos);
scriptRelaxed.forEach_testNativeSincosFloat2Float2Float2(inV, out);
- verifyResultsNativeSincosFloat2Float2Float2(inV, outCosptr, out, true);
+ verifyResultsNativeSincosFloat2Float2Float2(inV, outCos, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSincosFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsNativeSincosFloat2Float2Float2(Allocation inV, Allocation outCosptr, Allocation out, boolean relaxed) {
+ private void verifyResultsNativeSincosFloat2Float2Float2(Allocation inV, Allocation outCos, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
- float[] arrayOutCosptr = new float[INPUTSIZE * 2];
- outCosptr.copyTo(arrayOutCosptr);
+ float[] arrayOutCos = new float[INPUTSIZE * 2];
+ outCos.copyTo(arrayOutCos);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -157,7 +157,7 @@
CoreMathVerifier.computeNativeSincos(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 2 + j], 0.0005)) {
+ if (!args.outCos.couldBe(arrayOutCos[i * 2 + j], 0.0005)) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 2 + j], 0.0005)) {
@@ -169,13 +169,13 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outCosptr: ");
- message.append(args.outCosptr.toString());
+ message.append("Expected output outCos: ");
+ message.append(args.outCos.toString());
message.append("\n");
- message.append("Actual output outCosptr: ");
+ message.append("Actual output outCos: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutCosptr[i * 2 + j], Float.floatToRawIntBits(arrayOutCosptr[i * 2 + j]), arrayOutCosptr[i * 2 + j]));
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 2 + j], 0.0005)) {
+ arrayOutCos[i * 2 + j], Float.floatToRawIntBits(arrayOutCos[i * 2 + j]), arrayOutCos[i * 2 + j]));
+ if (!args.outCos.couldBe(arrayOutCos[i * 2 + j], 0.0005)) {
message.append(" FAIL");
}
message.append("\n");
@@ -199,30 +199,30 @@
private void checkNativeSincosFloat3Float3Float3() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x3a06cffcdc45704al, false);
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocOutCosptr(outCosptr);
+ script.set_gAllocOutCos(outCos);
script.forEach_testNativeSincosFloat3Float3Float3(inV, out);
- verifyResultsNativeSincosFloat3Float3Float3(inV, outCosptr, out, false);
+ verifyResultsNativeSincosFloat3Float3Float3(inV, outCos, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSincosFloat3Float3Float3: " + e.toString());
}
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocOutCosptr(outCosptr);
+ scriptRelaxed.set_gAllocOutCos(outCos);
scriptRelaxed.forEach_testNativeSincosFloat3Float3Float3(inV, out);
- verifyResultsNativeSincosFloat3Float3Float3(inV, outCosptr, out, true);
+ verifyResultsNativeSincosFloat3Float3Float3(inV, outCos, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSincosFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsNativeSincosFloat3Float3Float3(Allocation inV, Allocation outCosptr, Allocation out, boolean relaxed) {
+ private void verifyResultsNativeSincosFloat3Float3Float3(Allocation inV, Allocation outCos, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
- float[] arrayOutCosptr = new float[INPUTSIZE * 4];
- outCosptr.copyTo(arrayOutCosptr);
+ float[] arrayOutCos = new float[INPUTSIZE * 4];
+ outCos.copyTo(arrayOutCos);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -235,7 +235,7 @@
CoreMathVerifier.computeNativeSincos(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 4 + j], 0.0005)) {
+ if (!args.outCos.couldBe(arrayOutCos[i * 4 + j], 0.0005)) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 4 + j], 0.0005)) {
@@ -247,13 +247,13 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outCosptr: ");
- message.append(args.outCosptr.toString());
+ message.append("Expected output outCos: ");
+ message.append(args.outCos.toString());
message.append("\n");
- message.append("Actual output outCosptr: ");
+ message.append("Actual output outCos: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutCosptr[i * 4 + j], Float.floatToRawIntBits(arrayOutCosptr[i * 4 + j]), arrayOutCosptr[i * 4 + j]));
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 4 + j], 0.0005)) {
+ arrayOutCos[i * 4 + j], Float.floatToRawIntBits(arrayOutCos[i * 4 + j]), arrayOutCos[i * 4 + j]));
+ if (!args.outCos.couldBe(arrayOutCos[i * 4 + j], 0.0005)) {
message.append(" FAIL");
}
message.append("\n");
@@ -277,30 +277,30 @@
private void checkNativeSincosFloat4Float4Float4() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x8e6bae1cde2371ebl, false);
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocOutCosptr(outCosptr);
+ script.set_gAllocOutCos(outCos);
script.forEach_testNativeSincosFloat4Float4Float4(inV, out);
- verifyResultsNativeSincosFloat4Float4Float4(inV, outCosptr, out, false);
+ verifyResultsNativeSincosFloat4Float4Float4(inV, outCos, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSincosFloat4Float4Float4: " + e.toString());
}
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocOutCosptr(outCosptr);
+ scriptRelaxed.set_gAllocOutCos(outCos);
scriptRelaxed.forEach_testNativeSincosFloat4Float4Float4(inV, out);
- verifyResultsNativeSincosFloat4Float4Float4(inV, outCosptr, out, true);
+ verifyResultsNativeSincosFloat4Float4Float4(inV, outCos, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSincosFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsNativeSincosFloat4Float4Float4(Allocation inV, Allocation outCosptr, Allocation out, boolean relaxed) {
+ private void verifyResultsNativeSincosFloat4Float4Float4(Allocation inV, Allocation outCos, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
- float[] arrayOutCosptr = new float[INPUTSIZE * 4];
- outCosptr.copyTo(arrayOutCosptr);
+ float[] arrayOutCos = new float[INPUTSIZE * 4];
+ outCos.copyTo(arrayOutCos);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -313,7 +313,7 @@
CoreMathVerifier.computeNativeSincos(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 4 + j], 0.0005)) {
+ if (!args.outCos.couldBe(arrayOutCos[i * 4 + j], 0.0005)) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 4 + j], 0.0005)) {
@@ -325,13 +325,13 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outCosptr: ");
- message.append(args.outCosptr.toString());
+ message.append("Expected output outCos: ");
+ message.append(args.outCos.toString());
message.append("\n");
- message.append("Actual output outCosptr: ");
+ message.append("Actual output outCos: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutCosptr[i * 4 + j], Float.floatToRawIntBits(arrayOutCosptr[i * 4 + j]), arrayOutCosptr[i * 4 + j]));
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 4 + j], 0.0005)) {
+ arrayOutCos[i * 4 + j], Float.floatToRawIntBits(arrayOutCos[i * 4 + j]), arrayOutCos[i * 4 + j]));
+ if (!args.outCos.couldBe(arrayOutCos[i * 4 + j], 0.0005)) {
message.append(" FAIL");
}
message.append("\n");
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSincos.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSincos.rs
similarity index 68%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeSincos.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSincos.rs
index 8148c67..741a49b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSincos.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSincos.rs
@@ -19,32 +19,32 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocOutCosptr;
+rs_allocation gAllocOutCos;
float __attribute__((kernel)) testNativeSincosFloatFloatFloat(float inV, unsigned int x) {
- float outCosptr = 0;
- float out = native_sincos(inV, &outCosptr);
- rsSetElementAt_float(gAllocOutCosptr, outCosptr, x);
+ float outCos = 0;
+ float out = native_sincos(inV, &outCos);
+ rsSetElementAt_float(gAllocOutCos, outCos, x);
return out;
}
float2 __attribute__((kernel)) testNativeSincosFloat2Float2Float2(float2 inV, unsigned int x) {
- float2 outCosptr = 0;
- float2 out = native_sincos(inV, &outCosptr);
- rsSetElementAt_float2(gAllocOutCosptr, outCosptr, x);
+ float2 outCos = 0;
+ float2 out = native_sincos(inV, &outCos);
+ rsSetElementAt_float2(gAllocOutCos, outCos, x);
return out;
}
float3 __attribute__((kernel)) testNativeSincosFloat3Float3Float3(float3 inV, unsigned int x) {
- float3 outCosptr = 0;
- float3 out = native_sincos(inV, &outCosptr);
- rsSetElementAt_float3(gAllocOutCosptr, outCosptr, x);
+ float3 outCos = 0;
+ float3 out = native_sincos(inV, &outCos);
+ rsSetElementAt_float3(gAllocOutCos, outCos, x);
return out;
}
float4 __attribute__((kernel)) testNativeSincosFloat4Float4Float4(float4 inV, unsigned int x) {
- float4 outCosptr = 0;
- float4 out = native_sincos(inV, &outCosptr);
- rsSetElementAt_float4(gAllocOutCosptr, outCosptr, x);
+ float4 outCos = 0;
+ float4 out = native_sincos(inV, &outCos);
+ rsSetElementAt_float4(gAllocOutCos, outCos, x);
return out;
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSincosRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSincosRelaxed.rs
index 66f3fef..023df70 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSincosRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeSincos.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinh.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinh.java
similarity index 77%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinh.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinh.java
index 9c2edc7..cb7b90e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinh.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinh.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeSinh extends RSBaseCompute {
+public class GeneratedTestNativeSinh extends RSBaseCompute {
- private ScriptC_TestNativeSinh script;
- private ScriptC_TestNativeSinhRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeSinh script;
+ private ScriptC_GeneratedTestNativeSinhRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeSinh(mRS);
- scriptRelaxed = new ScriptC_TestNativeSinhRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeSinh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeSinhRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeSinhFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x74dcf3e9c65b6590l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xa11cf844515a0f86l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeSinhFloatFloat(in, out);
- verifyResultsNativeSinhFloatFloat(in, out, false);
+ script.forEach_testNativeSinhFloatFloat(inV, out);
+ verifyResultsNativeSinhFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinhFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinhFloatFloat(in, out);
- verifyResultsNativeSinhFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeSinhFloatFloat(inV, out);
+ verifyResultsNativeSinhFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinhFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeSinhFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinhFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSinh(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeSinhFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xfdcd5755b59082cl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xaa17dab657f45fbal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeSinhFloat2Float2(in, out);
- verifyResultsNativeSinhFloat2Float2(in, out, false);
+ script.forEach_testNativeSinhFloat2Float2(inV, out);
+ verifyResultsNativeSinhFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinhFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinhFloat2Float2(in, out);
- verifyResultsNativeSinhFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeSinhFloat2Float2(inV, out);
+ verifyResultsNativeSinhFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinhFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeSinhFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinhFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSinh(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeSinhFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xfdce016ba5f9dc6l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xaa19a3d14e0f8098l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeSinhFloat3Float3(in, out);
- verifyResultsNativeSinhFloat3Float3(in, out, false);
+ script.forEach_testNativeSinhFloat3Float3(inV, out);
+ verifyResultsNativeSinhFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinhFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinhFloat3Float3(in, out);
- verifyResultsNativeSinhFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeSinhFloat3Float3(inV, out);
+ verifyResultsNativeSinhFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinhFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeSinhFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinhFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSinh(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeSinhFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xfdceab819663360l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xaa1b6cec442aa176l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeSinhFloat4Float4(in, out);
- verifyResultsNativeSinhFloat4Float4(in, out, false);
+ script.forEach_testNativeSinhFloat4Float4(inV, out);
+ verifyResultsNativeSinhFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinhFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinhFloat4Float4(in, out);
- verifyResultsNativeSinhFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeSinhFloat4Float4(inV, out);
+ verifyResultsNativeSinhFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinhFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeSinhFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinhFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSinh(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinh.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinh.rs
similarity index 82%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinh.rs
index 20728d5..8eecf7c 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinh.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinh.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeSinhFloatFloat(float in) {
- return native_sinh(in);
+float __attribute__((kernel)) testNativeSinhFloatFloat(float inV) {
+ return native_sinh(inV);
}
-float2 __attribute__((kernel)) testNativeSinhFloat2Float2(float2 in) {
- return native_sinh(in);
+float2 __attribute__((kernel)) testNativeSinhFloat2Float2(float2 inV) {
+ return native_sinh(inV);
}
-float3 __attribute__((kernel)) testNativeSinhFloat3Float3(float3 in) {
- return native_sinh(in);
+float3 __attribute__((kernel)) testNativeSinhFloat3Float3(float3 inV) {
+ return native_sinh(inV);
}
-float4 __attribute__((kernel)) testNativeSinhFloat4Float4(float4 in) {
- return native_sinh(in);
+float4 __attribute__((kernel)) testNativeSinhFloat4Float4(float4 inV) {
+ return native_sinh(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinhRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinhRelaxed.rs
index 66f3fef..2ae33f7 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinhRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeSinh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinpi.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinpi.java
similarity index 79%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinpi.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinpi.java
index 2f67e8e..a887d0e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinpi.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinpi.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeSinpi extends RSBaseCompute {
+public class GeneratedTestNativeSinpi extends RSBaseCompute {
- private ScriptC_TestNativeSinpi script;
- private ScriptC_TestNativeSinpiRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeSinpi script;
+ private ScriptC_GeneratedTestNativeSinpiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeSinpi(mRS);
- scriptRelaxed = new ScriptC_TestNativeSinpiRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeSinpi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeSinpiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeSinpiFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb52c701227c9dc37l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x6e76d30caee7fd93l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeSinpiFloatFloat(in, out);
- verifyResultsNativeSinpiFloatFloat(in, out, false);
+ script.forEach_testNativeSinpiFloatFloat(inV, out);
+ verifyResultsNativeSinpiFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinpiFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinpiFloatFloat(in, out);
- verifyResultsNativeSinpiFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeSinpiFloatFloat(inV, out);
+ verifyResultsNativeSinpiFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinpiFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeSinpiFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinpiFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSinpi(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeSinpiFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x8df4951d1230045bl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xd8150be20e10bb9fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeSinpiFloat2Float2(in, out);
- verifyResultsNativeSinpiFloat2Float2(in, out, false);
+ script.forEach_testNativeSinpiFloat2Float2(inV, out);
+ verifyResultsNativeSinpiFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinpiFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinpiFloat2Float2(in, out);
- verifyResultsNativeSinpiFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeSinpiFloat2Float2(inV, out);
+ verifyResultsNativeSinpiFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinpiFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeSinpiFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinpiFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSinpi(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeSinpiFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x8df49fbe713699f5l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd816d4fd042bdc7dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeSinpiFloat3Float3(in, out);
- verifyResultsNativeSinpiFloat3Float3(in, out, false);
+ script.forEach_testNativeSinpiFloat3Float3(inV, out);
+ verifyResultsNativeSinpiFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinpiFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinpiFloat3Float3(in, out);
- verifyResultsNativeSinpiFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeSinpiFloat3Float3(inV, out);
+ verifyResultsNativeSinpiFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinpiFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeSinpiFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinpiFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSinpi(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeSinpiFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x8df4aa5fd03d2f8fl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd8189e17fa46fd5bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeSinpiFloat4Float4(in, out);
- verifyResultsNativeSinpiFloat4Float4(in, out, false);
+ script.forEach_testNativeSinpiFloat4Float4(inV, out);
+ verifyResultsNativeSinpiFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinpiFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSinpiFloat4Float4(in, out);
- verifyResultsNativeSinpiFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeSinpiFloat4Float4(inV, out);
+ verifyResultsNativeSinpiFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSinpiFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeSinpiFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSinpiFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSinpi(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinpi.rs
similarity index 87%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinpi.rs
index 1b17471..7d88eb6 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinpi.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinpi.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeSinpiFloatFloat(float in) {
- return native_sinpi(in);
+float __attribute__((kernel)) testNativeSinpiFloatFloat(float inV) {
+ return native_sinpi(inV);
}
-float2 __attribute__((kernel)) testNativeSinpiFloat2Float2(float2 in) {
- return native_sinpi(in);
+float2 __attribute__((kernel)) testNativeSinpiFloat2Float2(float2 inV) {
+ return native_sinpi(inV);
}
-float3 __attribute__((kernel)) testNativeSinpiFloat3Float3(float3 in) {
- return native_sinpi(in);
+float3 __attribute__((kernel)) testNativeSinpiFloat3Float3(float3 inV) {
+ return native_sinpi(inV);
}
-float4 __attribute__((kernel)) testNativeSinpiFloat4Float4(float4 in) {
- return native_sinpi(in);
+float4 __attribute__((kernel)) testNativeSinpiFloat4Float4(float4 inV) {
+ return native_sinpi(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinpiRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinpiRelaxed.rs
index 66f3fef..dd92483 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSinpiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeSinpi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSqrt.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSqrt.java
similarity index 77%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeSqrt.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSqrt.java
index edb07bc..a64fff3 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSqrt.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSqrt.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeSqrt extends RSBaseCompute {
+public class GeneratedTestNativeSqrt extends RSBaseCompute {
- private ScriptC_TestNativeSqrt script;
- private ScriptC_TestNativeSqrtRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeSqrt script;
+ private ScriptC_GeneratedTestNativeSqrtRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeSqrt(mRS);
- scriptRelaxed = new ScriptC_TestNativeSqrtRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeSqrt(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeSqrtRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeSqrtFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb4c9e7b9972ac810l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x5de9ec2c642f9b06l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeSqrtFloatFloat(in, out);
- verifyResultsNativeSqrtFloatFloat(in, out, false);
+ script.forEach_testNativeSqrtFloatFloat(inV, out);
+ verifyResultsNativeSqrtFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSqrtFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSqrtFloatFloat(in, out);
- verifyResultsNativeSqrtFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeSqrtFloatFloat(inV, out);
+ verifyResultsNativeSqrtFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSqrtFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeSqrtFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSqrtFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSqrt(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeSqrtFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc649cd70853776acl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x4e6581e66050ef3al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeSqrtFloat2Float2(in, out);
- verifyResultsNativeSqrtFloat2Float2(in, out, false);
+ script.forEach_testNativeSqrtFloat2Float2(inV, out);
+ verifyResultsNativeSqrtFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSqrtFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSqrtFloat2Float2(in, out);
- verifyResultsNativeSqrtFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeSqrtFloat2Float2(inV, out);
+ verifyResultsNativeSqrtFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSqrtFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeSqrtFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSqrtFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSqrt(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeSqrtFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xc649d811e43e0c46l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x4e674b01566c1018l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeSqrtFloat3Float3(in, out);
- verifyResultsNativeSqrtFloat3Float3(in, out, false);
+ script.forEach_testNativeSqrtFloat3Float3(inV, out);
+ verifyResultsNativeSqrtFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSqrtFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSqrtFloat3Float3(in, out);
- verifyResultsNativeSqrtFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeSqrtFloat3Float3(inV, out);
+ verifyResultsNativeSqrtFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSqrtFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeSqrtFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSqrtFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSqrt(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeSqrtFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc649e2b34344a1e0l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x4e69141c4c8730f6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeSqrtFloat4Float4(in, out);
- verifyResultsNativeSqrtFloat4Float4(in, out, false);
+ script.forEach_testNativeSqrtFloat4Float4(inV, out);
+ verifyResultsNativeSqrtFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSqrtFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeSqrtFloat4Float4(in, out);
- verifyResultsNativeSqrtFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeSqrtFloat4Float4(inV, out);
+ verifyResultsNativeSqrtFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeSqrtFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeSqrtFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeSqrtFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeSqrt(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSqrt.rs
similarity index 82%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeSqrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSqrt.rs
index 2ed1cc8..c312e6a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSqrt.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSqrt.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeSqrtFloatFloat(float in) {
- return native_sqrt(in);
+float __attribute__((kernel)) testNativeSqrtFloatFloat(float inV) {
+ return native_sqrt(inV);
}
-float2 __attribute__((kernel)) testNativeSqrtFloat2Float2(float2 in) {
- return native_sqrt(in);
+float2 __attribute__((kernel)) testNativeSqrtFloat2Float2(float2 inV) {
+ return native_sqrt(inV);
}
-float3 __attribute__((kernel)) testNativeSqrtFloat3Float3(float3 in) {
- return native_sqrt(in);
+float3 __attribute__((kernel)) testNativeSqrtFloat3Float3(float3 inV) {
+ return native_sqrt(inV);
}
-float4 __attribute__((kernel)) testNativeSqrtFloat4Float4(float4 in) {
- return native_sqrt(in);
+float4 __attribute__((kernel)) testNativeSqrtFloat4Float4(float4 inV) {
+ return native_sqrt(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSqrtRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSqrtRelaxed.rs
index 66f3fef..4797071 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeSqrtRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeSqrt.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTan.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTan.java
similarity index 77%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeTan.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTan.java
index cd51a53..8dc9836 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTan.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTan.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeTan extends RSBaseCompute {
+public class GeneratedTestNativeTan extends RSBaseCompute {
- private ScriptC_TestNativeTan script;
- private ScriptC_TestNativeTanRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeTan script;
+ private ScriptC_GeneratedTestNativeTanRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeTan(mRS);
- scriptRelaxed = new ScriptC_TestNativeTanRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeTan(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeTanRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeTanFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x5b9a224e25042b47l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x62e3c32037b34543l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeTanFloatFloat(in, out);
- verifyResultsNativeTanFloatFloat(in, out, false);
+ script.forEach_testNativeTanFloatFloat(inV, out);
+ verifyResultsNativeTanFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanFloatFloat(in, out);
- verifyResultsNativeTanFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeTanFloatFloat(inV, out);
+ verifyResultsNativeTanFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeTanFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTan(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeTanFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x9c40e8650c550eebl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3ee708f9124981cfl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeTanFloat2Float2(in, out);
- verifyResultsNativeTanFloat2Float2(in, out, false);
+ script.forEach_testNativeTanFloat2Float2(inV, out);
+ verifyResultsNativeTanFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanFloat2Float2(in, out);
- verifyResultsNativeTanFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeTanFloat2Float2(inV, out);
+ verifyResultsNativeTanFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeTanFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTan(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeTanFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x9c40f3066b5ba485l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x3ee8d2140864a2adl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeTanFloat3Float3(in, out);
- verifyResultsNativeTanFloat3Float3(in, out, false);
+ script.forEach_testNativeTanFloat3Float3(inV, out);
+ verifyResultsNativeTanFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanFloat3Float3(in, out);
- verifyResultsNativeTanFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeTanFloat3Float3(inV, out);
+ verifyResultsNativeTanFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeTanFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTan(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeTanFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x9c40fda7ca623a1fl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3eea9b2efe7fc38bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeTanFloat4Float4(in, out);
- verifyResultsNativeTanFloat4Float4(in, out, false);
+ script.forEach_testNativeTanFloat4Float4(inV, out);
+ verifyResultsNativeTanFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanFloat4Float4(in, out);
- verifyResultsNativeTanFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeTanFloat4Float4(inV, out);
+ verifyResultsNativeTanFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeTanFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTan(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTan.rs
similarity index 83%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeTan.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTan.rs
index 000bc74..004ffc5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTan.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeTanFloatFloat(float in) {
- return native_tan(in);
+float __attribute__((kernel)) testNativeTanFloatFloat(float inV) {
+ return native_tan(inV);
}
-float2 __attribute__((kernel)) testNativeTanFloat2Float2(float2 in) {
- return native_tan(in);
+float2 __attribute__((kernel)) testNativeTanFloat2Float2(float2 inV) {
+ return native_tan(inV);
}
-float3 __attribute__((kernel)) testNativeTanFloat3Float3(float3 in) {
- return native_tan(in);
+float3 __attribute__((kernel)) testNativeTanFloat3Float3(float3 inV) {
+ return native_tan(inV);
}
-float4 __attribute__((kernel)) testNativeTanFloat4Float4(float4 in) {
- return native_tan(in);
+float4 __attribute__((kernel)) testNativeTanFloat4Float4(float4 inV) {
+ return native_tan(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanRelaxed.rs
index 9ec6688..a8533b4 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeTan.rs"
+#include "GeneratedTestNativeTan.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanh.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanh.java
similarity index 77%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanh.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanh.java
index 0b69e5f..e2674bf 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanh.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanh.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeTanh extends RSBaseCompute {
+public class GeneratedTestNativeTanh extends RSBaseCompute {
- private ScriptC_TestNativeTanh script;
- private ScriptC_TestNativeTanhRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeTanh script;
+ private ScriptC_GeneratedTestNativeTanhRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeTanh(mRS);
- scriptRelaxed = new ScriptC_TestNativeTanhRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeTanh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeTanhRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeTanhFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x1ec2702f5ed0580bl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x2aa8d7f4ecfeca2fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeTanhFloatFloat(in, out);
- verifyResultsNativeTanhFloatFloat(in, out, false);
+ script.forEach_testNativeTanhFloatFloat(inV, out);
+ verifyResultsNativeTanhFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanhFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanhFloatFloat(in, out);
- verifyResultsNativeTanhFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeTanhFloatFloat(inV, out);
+ verifyResultsNativeTanhFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanhFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeTanhFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanhFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTanh(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeTanhFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2a5b681f8004628fl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x1d5a7d4a80bc8e5bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeTanhFloat2Float2(in, out);
- verifyResultsNativeTanhFloat2Float2(in, out, false);
+ script.forEach_testNativeTanhFloat2Float2(inV, out);
+ verifyResultsNativeTanhFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanhFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanhFloat2Float2(in, out);
- verifyResultsNativeTanhFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeTanhFloat2Float2(inV, out);
+ verifyResultsNativeTanhFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanhFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeTanhFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanhFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTanh(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeTanhFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2a5b72c0df0af829l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1d5c466576d7af39l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeTanhFloat3Float3(in, out);
- verifyResultsNativeTanhFloat3Float3(in, out, false);
+ script.forEach_testNativeTanhFloat3Float3(inV, out);
+ verifyResultsNativeTanhFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanhFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanhFloat3Float3(in, out);
- verifyResultsNativeTanhFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeTanhFloat3Float3(inV, out);
+ verifyResultsNativeTanhFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanhFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeTanhFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanhFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTanh(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeTanhFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2a5b7d623e118dc3l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x1d5e0f806cf2d017l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeTanhFloat4Float4(in, out);
- verifyResultsNativeTanhFloat4Float4(in, out, false);
+ script.forEach_testNativeTanhFloat4Float4(inV, out);
+ verifyResultsNativeTanhFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanhFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanhFloat4Float4(in, out);
- verifyResultsNativeTanhFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeTanhFloat4Float4(inV, out);
+ verifyResultsNativeTanhFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanhFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeTanhFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanhFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTanh(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanh.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanh.rs
similarity index 82%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanh.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanh.rs
index a7bfcfd..03fed50 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanh.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanh.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeTanhFloatFloat(float in) {
- return native_tanh(in);
+float __attribute__((kernel)) testNativeTanhFloatFloat(float inV) {
+ return native_tanh(inV);
}
-float2 __attribute__((kernel)) testNativeTanhFloat2Float2(float2 in) {
- return native_tanh(in);
+float2 __attribute__((kernel)) testNativeTanhFloat2Float2(float2 inV) {
+ return native_tanh(inV);
}
-float3 __attribute__((kernel)) testNativeTanhFloat3Float3(float3 in) {
- return native_tanh(in);
+float3 __attribute__((kernel)) testNativeTanhFloat3Float3(float3 inV) {
+ return native_tanh(inV);
}
-float4 __attribute__((kernel)) testNativeTanhFloat4Float4(float4 in) {
- return native_tanh(in);
+float4 __attribute__((kernel)) testNativeTanhFloat4Float4(float4 inV) {
+ return native_tanh(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanhRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanhRelaxed.rs
index 66f3fef..cde0396 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanhRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeTanh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanpi.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanpi.java
similarity index 79%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanpi.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanpi.java
index 1d9b538..f046f1e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanpi.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanpi.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNativeTanpi extends RSBaseCompute {
+public class GeneratedTestNativeTanpi extends RSBaseCompute {
- private ScriptC_TestNativeTanpi script;
- private ScriptC_TestNativeTanpiRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNativeTanpi script;
+ private ScriptC_GeneratedTestNativeTanpiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNativeTanpi(mRS);
- scriptRelaxed = new ScriptC_TestNativeTanpiRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNativeTanpi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNativeTanpiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float in;
+ public float inV;
public Target.Floaty out;
}
private void checkNativeTanpiFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3eb84fc2c36e96e0l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x88f565b6d39357f6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testNativeTanpiFloatFloat(in, out);
- verifyResultsNativeTanpiFloatFloat(in, out, false);
+ script.forEach_testNativeTanpiFloatFloat(inV, out);
+ verifyResultsNativeTanpiFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanpiFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanpiFloatFloat(in, out);
- verifyResultsNativeTanpiFloatFloat(in, out, true);
+ scriptRelaxed.forEach_testNativeTanpiFloatFloat(inV, out);
+ verifyResultsNativeTanpiFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanpiFloatFloat: " + e.toString());
}
}
- private void verifyResultsNativeTanpiFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanpiFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTanpi(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkNativeTanpiFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x13737b13af832fcl, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x34465ac4e7b090aal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testNativeTanpiFloat2Float2(in, out);
- verifyResultsNativeTanpiFloat2Float2(in, out, false);
+ script.forEach_testNativeTanpiFloat2Float2(inV, out);
+ verifyResultsNativeTanpiFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanpiFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanpiFloat2Float2(in, out);
- verifyResultsNativeTanpiFloat2Float2(in, out, true);
+ scriptRelaxed.forEach_testNativeTanpiFloat2Float2(inV, out);
+ verifyResultsNativeTanpiFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanpiFloat2Float2: " + e.toString());
}
}
- private void verifyResultsNativeTanpiFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanpiFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTanpi(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkNativeTanpiFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x137425299fec896l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x344823dfddcbb188l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testNativeTanpiFloat3Float3(in, out);
- verifyResultsNativeTanpiFloat3Float3(in, out, false);
+ script.forEach_testNativeTanpiFloat3Float3(inV, out);
+ verifyResultsNativeTanpiFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanpiFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanpiFloat3Float3(in, out);
- verifyResultsNativeTanpiFloat3Float3(in, out, true);
+ scriptRelaxed.forEach_testNativeTanpiFloat3Float3(inV, out);
+ verifyResultsNativeTanpiFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanpiFloat3Float3: " + e.toString());
}
}
- private void verifyResultsNativeTanpiFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanpiFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTanpi(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkNativeTanpiFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x1374cf3f9055e30l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3449ecfad3e6d266l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testNativeTanpiFloat4Float4(in, out);
- verifyResultsNativeTanpiFloat4Float4(in, out, false);
+ script.forEach_testNativeTanpiFloat4Float4(inV, out);
+ verifyResultsNativeTanpiFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanpiFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testNativeTanpiFloat4Float4(in, out);
- verifyResultsNativeTanpiFloat4Float4(in, out, true);
+ scriptRelaxed.forEach_testNativeTanpiFloat4Float4(inV, out);
+ verifyResultsNativeTanpiFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeTanpiFloat4Float4: " + e.toString());
}
}
- private void verifyResultsNativeTanpiFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
+ private void verifyResultsNativeTanpiFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNativeTanpi(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input in: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanpi.rs
similarity index 87%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanpi.rs
index ae1f633..c553315 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanpi.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanpi.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testNativeTanpiFloatFloat(float in) {
- return native_tanpi(in);
+float __attribute__((kernel)) testNativeTanpiFloatFloat(float inV) {
+ return native_tanpi(inV);
}
-float2 __attribute__((kernel)) testNativeTanpiFloat2Float2(float2 in) {
- return native_tanpi(in);
+float2 __attribute__((kernel)) testNativeTanpiFloat2Float2(float2 inV) {
+ return native_tanpi(inV);
}
-float3 __attribute__((kernel)) testNativeTanpiFloat3Float3(float3 in) {
- return native_tanpi(in);
+float3 __attribute__((kernel)) testNativeTanpiFloat3Float3(float3 inV) {
+ return native_tanpi(inV);
}
-float4 __attribute__((kernel)) testNativeTanpiFloat4Float4(float4 in) {
- return native_tanpi(in);
+float4 __attribute__((kernel)) testNativeTanpiFloat4Float4(float4 inV) {
+ return native_tanpi(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanpiRelaxed.rs
similarity index 94%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanpiRelaxed.rs
index 66f3fef..095f4b5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNativeTanpiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestNativeTanpi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNextafter.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNextafter.java
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNextafter.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNextafter.java
index df69e42..2d9567f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNextafter.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNextafter.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNextafter extends RSBaseCompute {
+public class GeneratedTestNextafter extends RSBaseCompute {
- private ScriptC_TestNextafter script;
- private ScriptC_TestNextafterRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNextafter script;
+ private ScriptC_GeneratedTestNextafterRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNextafter(mRS);
- scriptRelaxed = new ScriptC_TestNextafterRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNextafter(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNextafterRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inX;
- public float inY;
+ public float inV;
+ public float inTarget;
public Target.Floaty out;
}
private void checkNextafterFloatFloatFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xa3b02393ad412958l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xa3b02393ad412959l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xa3b02393ad412956l, false);
+ Allocation inTarget = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xde8acce6afd7c03dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNextafterFloatFloatFloat(inX, out);
- verifyResultsNextafterFloatFloatFloat(inX, inY, out, false);
+ script.set_gAllocInTarget(inTarget);
+ script.forEach_testNextafterFloatFloatFloat(inV, out);
+ verifyResultsNextafterFloatFloatFloat(inV, inTarget, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNextafterFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNextafterFloatFloatFloat(inX, out);
- verifyResultsNextafterFloatFloatFloat(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInTarget(inTarget);
+ scriptRelaxed.forEach_testNextafterFloatFloatFloat(inV, out);
+ verifyResultsNextafterFloatFloatFloat(inV, inTarget, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNextafterFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsNextafterFloatFloatFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsNextafterFloatFloatFloat(Allocation inV, Allocation inTarget, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
+ float[] arrayInTarget = new float[INPUTSIZE * 1];
+ inTarget.copyTo(arrayInTarget);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
+ args.inV = arrayInV[i];
+ args.inTarget = arrayInTarget[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNextafter(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inTarget: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inTarget, Float.floatToRawIntBits(args.inTarget), args.inTarget));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkNextafterFloat2Float2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x29b40e0584a1e24l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x29b40e0584a1e25l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x29b40e0584a1e22l, false);
+ Allocation inTarget = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x68f3a41af7e4d541l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNextafterFloat2Float2Float2(inX, out);
- verifyResultsNextafterFloat2Float2Float2(inX, inY, out, false);
+ script.set_gAllocInTarget(inTarget);
+ script.forEach_testNextafterFloat2Float2Float2(inV, out);
+ verifyResultsNextafterFloat2Float2Float2(inV, inTarget, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNextafterFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNextafterFloat2Float2Float2(inX, out);
- verifyResultsNextafterFloat2Float2Float2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInTarget(inTarget);
+ scriptRelaxed.forEach_testNextafterFloat2Float2Float2(inV, out);
+ verifyResultsNextafterFloat2Float2Float2(inV, inTarget, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNextafterFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsNextafterFloat2Float2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
+ private void verifyResultsNextafterFloat2Float2Float2(Allocation inV, Allocation inTarget, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
+ float[] arrayInTarget = new float[INPUTSIZE * 2];
+ inTarget.copyTo(arrayInTarget);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
+ args.inTarget = arrayInTarget[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNextafter(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inTarget: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inTarget, Float.floatToRawIntBits(args.inTarget), args.inTarget));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkNextafterFloat3Float3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x57001f005a281fc5l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x57001f005a281fc6l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x57001f005a281fc3l, false);
+ Allocation inTarget = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x3261a1f4e4f910dcl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNextafterFloat3Float3Float3(inX, out);
- verifyResultsNextafterFloat3Float3Float3(inX, inY, out, false);
+ script.set_gAllocInTarget(inTarget);
+ script.forEach_testNextafterFloat3Float3Float3(inV, out);
+ verifyResultsNextafterFloat3Float3Float3(inV, inTarget, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNextafterFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNextafterFloat3Float3Float3(inX, out);
- verifyResultsNextafterFloat3Float3Float3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInTarget(inTarget);
+ scriptRelaxed.forEach_testNextafterFloat3Float3Float3(inV, out);
+ verifyResultsNextafterFloat3Float3Float3(inV, inTarget, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNextafterFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsNextafterFloat3Float3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsNextafterFloat3Float3Float3(Allocation inV, Allocation inTarget, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
+ float[] arrayInTarget = new float[INPUTSIZE * 4];
+ inTarget.copyTo(arrayInTarget);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
+ args.inTarget = arrayInTarget[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNextafter(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inTarget: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inTarget, Float.floatToRawIntBits(args.inTarget), args.inTarget));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkNextafterFloat4Float4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xab64fd205c062166l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xab64fd205c062167l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xab64fd205c062164l, false);
+ Allocation inTarget = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xfbcf9fced20d4c77l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNextafterFloat4Float4Float4(inX, out);
- verifyResultsNextafterFloat4Float4Float4(inX, inY, out, false);
+ script.set_gAllocInTarget(inTarget);
+ script.forEach_testNextafterFloat4Float4Float4(inV, out);
+ verifyResultsNextafterFloat4Float4Float4(inV, inTarget, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNextafterFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNextafterFloat4Float4Float4(inX, out);
- verifyResultsNextafterFloat4Float4Float4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInTarget(inTarget);
+ scriptRelaxed.forEach_testNextafterFloat4Float4Float4(inV, out);
+ verifyResultsNextafterFloat4Float4Float4(inV, inTarget, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNextafterFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsNextafterFloat4Float4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsNextafterFloat4Float4Float4(Allocation inV, Allocation inTarget, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
+ float[] arrayInTarget = new float[INPUTSIZE * 4];
+ inTarget.copyTo(arrayInTarget);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
+ args.inTarget = arrayInTarget[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeNextafter(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inTarget: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inTarget, Float.floatToRawIntBits(args.inTarget), args.inTarget));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNextafter.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNextafter.rs
similarity index 65%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNextafter.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNextafter.rs
index a7ae02d..b7c57f6 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNextafter.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNextafter.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInY;
+rs_allocation gAllocInTarget;
-float __attribute__((kernel)) testNextafterFloatFloatFloat(float inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return nextafter(inX, inY);
+float __attribute__((kernel)) testNextafterFloatFloatFloat(float inV, unsigned int x) {
+ float inTarget = rsGetElementAt_float(gAllocInTarget, x);
+ return nextafter(inV, inTarget);
}
-float2 __attribute__((kernel)) testNextafterFloat2Float2Float2(float2 inX, unsigned int x) {
- float2 inY = rsGetElementAt_float2(gAllocInY, x);
- return nextafter(inX, inY);
+float2 __attribute__((kernel)) testNextafterFloat2Float2Float2(float2 inV, unsigned int x) {
+ float2 inTarget = rsGetElementAt_float2(gAllocInTarget, x);
+ return nextafter(inV, inTarget);
}
-float3 __attribute__((kernel)) testNextafterFloat3Float3Float3(float3 inX, unsigned int x) {
- float3 inY = rsGetElementAt_float3(gAllocInY, x);
- return nextafter(inX, inY);
+float3 __attribute__((kernel)) testNextafterFloat3Float3Float3(float3 inV, unsigned int x) {
+ float3 inTarget = rsGetElementAt_float3(gAllocInTarget, x);
+ return nextafter(inV, inTarget);
}
-float4 __attribute__((kernel)) testNextafterFloat4Float4Float4(float4 inX, unsigned int x) {
- float4 inY = rsGetElementAt_float4(gAllocInY, x);
- return nextafter(inX, inY);
+float4 __attribute__((kernel)) testNextafterFloat4Float4Float4(float4 inV, unsigned int x) {
+ float4 inTarget = rsGetElementAt_float4(gAllocInTarget, x);
+ return nextafter(inV, inTarget);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNextafterRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNextafterRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNextafterRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNextafterRelaxed.rs
index 2111f17..12f07f5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNextafterRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNextafterRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNextafter.rs"
+#include "GeneratedTestNextafter.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNormalize.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNormalize.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNormalize.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNormalize.java
index 0d71ec5..34d2cb0 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNormalize.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNormalize.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestNormalize extends RSBaseCompute {
+public class GeneratedTestNormalize extends RSBaseCompute {
- private ScriptC_TestNormalize script;
- private ScriptC_TestNormalizeRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestNormalize script;
+ private ScriptC_GeneratedTestNormalizeRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestNormalize(mRS);
- scriptRelaxed = new ScriptC_TestNormalizeRelaxed(mRS);
+ script = new ScriptC_GeneratedTestNormalize(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestNormalizeRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNormalize.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNormalize.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNormalize.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNormalize.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNormalizeRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNormalizeRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestNormalizeRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNormalizeRelaxed.rs
index 148bec3..283fdb5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNormalizeRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestNormalizeRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNormalize.rs"
+#include "GeneratedTestNormalize.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestPow.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPow.java
similarity index 66%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestPow.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPow.java
index 39369c4..fcdd097 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestPow.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPow.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestPow extends RSBaseCompute {
+public class GeneratedTestPow extends RSBaseCompute {
- private ScriptC_TestPow script;
- private ScriptC_TestPowRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestPow script;
+ private ScriptC_GeneratedTestPowRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestPow(mRS);
- scriptRelaxed = new ScriptC_TestPowRelaxed(mRS);
+ script = new ScriptC_GeneratedTestPow(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestPowRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inX;
- public float inY;
+ public float inBase;
+ public float inExponent;
public Target.Floaty out;
}
private void checkPowFloatFloatFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x470aeab18312445bl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x470aeab18312445cl, false);
+ Allocation inBase = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x377b8a6622b91eel, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x8bdde8de49a5f734l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPowFloatFloatFloat(inX, out);
- verifyResultsPowFloatFloatFloat(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPowFloatFloatFloat(inBase, out);
+ verifyResultsPowFloatFloatFloat(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPowFloatFloatFloat(inX, out);
- verifyResultsPowFloatFloatFloat(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPowFloatFloatFloat(inBase, out);
+ verifyResultsPowFloatFloatFloat(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsPowFloatFloatFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsPowFloatFloatFloat(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 1];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 1];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
+ args.inBase = arrayInBase[i];
+ args.inExponent = arrayInExponent[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePow(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkPowFloat2Float2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xbcd9b7ed561242ddl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xbcd9b7ed561242del, false);
+ Allocation inBase = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x15be0382895c2294l, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xeb77bf60bbad35fal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPowFloat2Float2Float2(inX, out);
- verifyResultsPowFloat2Float2Float2(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPowFloat2Float2Float2(inBase, out);
+ verifyResultsPowFloat2Float2Float2(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPowFloat2Float2Float2(inX, out);
- verifyResultsPowFloat2Float2Float2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPowFloat2Float2Float2(inBase, out);
+ verifyResultsPowFloat2Float2Float2(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsPowFloat2Float2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
+ private void verifyResultsPowFloat2Float2Float2(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 2];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 2];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
+ args.inBase = arrayInBase[i * 2 + j];
+ args.inExponent = arrayInExponent[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePow(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkPowFloat3Float3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x113e960d57f0447el, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x113e960d57f0447fl, false);
+ Allocation inBase = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xb0a4522671d00807l, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xc6e63a6212cfb87dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPowFloat3Float3Float3(inX, out);
- verifyResultsPowFloat3Float3Float3(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPowFloat3Float3Float3(inBase, out);
+ verifyResultsPowFloat3Float3Float3(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPowFloat3Float3Float3(inX, out);
- verifyResultsPowFloat3Float3Float3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPowFloat3Float3Float3(inBase, out);
+ verifyResultsPowFloat3Float3Float3(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsPowFloat3Float3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsPowFloat3Float3Float3(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 4];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 4];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inBase = arrayInBase[i * 4 + j];
+ args.inExponent = arrayInExponent[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePow(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkPowFloat4Float4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x65a3742d59ce461fl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x65a3742d59ce4620l, false);
+ Allocation inBase = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x4b8aa0ca5a43ed7al, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xa254b56369f23b00l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPowFloat4Float4Float4(inX, out);
- verifyResultsPowFloat4Float4Float4(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPowFloat4Float4Float4(inBase, out);
+ verifyResultsPowFloat4Float4Float4(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPowFloat4Float4Float4(inX, out);
- verifyResultsPowFloat4Float4Float4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPowFloat4Float4Float4(inBase, out);
+ verifyResultsPowFloat4Float4Float4(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsPowFloat4Float4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsPowFloat4Float4Float4(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 4];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 4];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inBase = arrayInBase[i * 4 + j];
+ args.inExponent = arrayInExponent[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePow(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestPow.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPow.rs
similarity index 61%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestPow.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPow.rs
index 855419a..1033d0e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestPow.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPow.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInY;
+rs_allocation gAllocInExponent;
-float __attribute__((kernel)) testPowFloatFloatFloat(float inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return pow(inX, inY);
+float __attribute__((kernel)) testPowFloatFloatFloat(float inBase, unsigned int x) {
+ float inExponent = rsGetElementAt_float(gAllocInExponent, x);
+ return pow(inBase, inExponent);
}
-float2 __attribute__((kernel)) testPowFloat2Float2Float2(float2 inX, unsigned int x) {
- float2 inY = rsGetElementAt_float2(gAllocInY, x);
- return pow(inX, inY);
+float2 __attribute__((kernel)) testPowFloat2Float2Float2(float2 inBase, unsigned int x) {
+ float2 inExponent = rsGetElementAt_float2(gAllocInExponent, x);
+ return pow(inBase, inExponent);
}
-float3 __attribute__((kernel)) testPowFloat3Float3Float3(float3 inX, unsigned int x) {
- float3 inY = rsGetElementAt_float3(gAllocInY, x);
- return pow(inX, inY);
+float3 __attribute__((kernel)) testPowFloat3Float3Float3(float3 inBase, unsigned int x) {
+ float3 inExponent = rsGetElementAt_float3(gAllocInExponent, x);
+ return pow(inBase, inExponent);
}
-float4 __attribute__((kernel)) testPowFloat4Float4Float4(float4 inX, unsigned int x) {
- float4 inY = rsGetElementAt_float4(gAllocInY, x);
- return pow(inX, inY);
+float4 __attribute__((kernel)) testPowFloat4Float4Float4(float4 inBase, unsigned int x) {
+ float4 inExponent = rsGetElementAt_float4(gAllocInExponent, x);
+ return pow(inBase, inExponent);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowRelaxed.rs
index 66f3fef..e95f00d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestPow.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestPown.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPown.java
similarity index 66%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestPown.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPown.java
index 14a09e1..f412854 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestPown.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPown.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestPown extends RSBaseCompute {
+public class GeneratedTestPown extends RSBaseCompute {
- private ScriptC_TestPown script;
- private ScriptC_TestPownRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestPown script;
+ private ScriptC_GeneratedTestPownRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestPown(mRS);
- scriptRelaxed = new ScriptC_TestPownRelaxed(mRS);
+ script = new ScriptC_GeneratedTestPown(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestPownRelaxed(mRS);
}
public class ArgumentsFloatIntFloat {
- public float inX;
- public int inY;
+ public float inBase;
+ public int inExponent;
public Target.Floaty out;
}
private void checkPownFloatIntFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xde633e0d2c462948l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0xde633e0d2c462949l, false);
+ Allocation inBase = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe020952d622f0405l, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 1, 0x9c3888e9096b9f1bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPownFloatIntFloat(inX, out);
- verifyResultsPownFloatIntFloat(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPownFloatIntFloat(inBase, out);
+ verifyResultsPownFloatIntFloat(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPownFloatIntFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPownFloatIntFloat(inX, out);
- verifyResultsPownFloatIntFloat(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPownFloatIntFloat(inBase, out);
+ verifyResultsPownFloatIntFloat(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPownFloatIntFloat: " + e.toString());
}
}
- private void verifyResultsPownFloatIntFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- int[] arrayInY = new int[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsPownFloatIntFloat(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 1];
+ inBase.copyTo(arrayInBase);
+ int[] arrayInExponent = new int[INPUTSIZE * 1];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
+ args.inBase = arrayInBase[i];
+ args.inExponent = arrayInExponent[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePown(args, target);
@@ -84,12 +84,12 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%d", args.inY));
+ message.append("Input inExponent: ");
+ message.append(String.format("%d", args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -109,39 +109,39 @@
}
private void checkPownFloat2Int2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x1685dc0ea821329el, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0x1685dc0ea821329fl, false);
+ Allocation inBase = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x7571c02be438467l, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 2, 0xe6177b3249076ddl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPownFloat2Int2Float2(inX, out);
- verifyResultsPownFloat2Int2Float2(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPownFloat2Int2Float2(inBase, out);
+ verifyResultsPownFloat2Int2Float2(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPownFloat2Int2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPownFloat2Int2Float2(inX, out);
- verifyResultsPownFloat2Int2Float2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPownFloat2Int2Float2(inBase, out);
+ verifyResultsPownFloat2Int2Float2(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPownFloat2Int2Float2: " + e.toString());
}
}
- private void verifyResultsPownFloat2Int2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- int[] arrayInY = new int[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
+ private void verifyResultsPownFloat2Int2Float2(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 2];
+ inBase.copyTo(arrayInBase);
+ int[] arrayInExponent = new int[INPUTSIZE * 2];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
+ args.inBase = arrayInBase[i * 2 + j];
+ args.inExponent = arrayInExponent[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePown(args, target);
@@ -152,12 +152,12 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%d", args.inY));
+ message.append("Input inExponent: ");
+ message.append(String.format("%d", args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -177,39 +177,39 @@
}
private void checkPownFloat3Int3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x3c3c1a719dd39f57l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0x3c3c1a719dd39f58l, false);
+ Allocation inBase = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x5e88c45be35ff8a2l, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 3, 0xaf710734144a81a8l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPownFloat3Int3Float3(inX, out);
- verifyResultsPownFloat3Int3Float3(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPownFloat3Int3Float3(inBase, out);
+ verifyResultsPownFloat3Int3Float3(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPownFloat3Int3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPownFloat3Int3Float3(inX, out);
- verifyResultsPownFloat3Int3Float3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPownFloat3Int3Float3(inBase, out);
+ verifyResultsPownFloat3Int3Float3(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPownFloat3Int3Float3: " + e.toString());
}
}
- private void verifyResultsPownFloat3Int3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- int[] arrayInY = new int[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsPownFloat3Int3Float3(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 4];
+ inBase.copyTo(arrayInBase);
+ int[] arrayInExponent = new int[INPUTSIZE * 4];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inBase = arrayInBase[i * 4 + j];
+ args.inExponent = arrayInExponent[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePown(args, target);
@@ -220,12 +220,12 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%d", args.inY));
+ message.append("Input inExponent: ");
+ message.append(String.format("%d", args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -245,39 +245,39 @@
}
private void checkPownFloat4Int4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x61f258d493860c10l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0x61f258d493860c11l, false);
+ Allocation inBase = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xb5ba6cb5087c6cddl, false);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.SIGNED_32, 4, 0x508096b504048c73l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPownFloat4Int4Float4(inX, out);
- verifyResultsPownFloat4Int4Float4(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPownFloat4Int4Float4(inBase, out);
+ verifyResultsPownFloat4Int4Float4(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPownFloat4Int4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPownFloat4Int4Float4(inX, out);
- verifyResultsPownFloat4Int4Float4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPownFloat4Int4Float4(inBase, out);
+ verifyResultsPownFloat4Int4Float4(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPownFloat4Int4Float4: " + e.toString());
}
}
- private void verifyResultsPownFloat4Int4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- int[] arrayInY = new int[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsPownFloat4Int4Float4(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 4];
+ inBase.copyTo(arrayInBase);
+ int[] arrayInExponent = new int[INPUTSIZE * 4];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatIntFloat args = new ArgumentsFloatIntFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inBase = arrayInBase[i * 4 + j];
+ args.inExponent = arrayInExponent[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePown(args, target);
@@ -288,12 +288,12 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%d", args.inY));
+ message.append("Input inExponent: ");
+ message.append(String.format("%d", args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestPown.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPown.rs
similarity index 62%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestPown.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPown.rs
index 3ee4fc0..f4fa3d8 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestPown.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPown.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInY;
+rs_allocation gAllocInExponent;
-float __attribute__((kernel)) testPownFloatIntFloat(float inX, unsigned int x) {
- int inY = rsGetElementAt_int(gAllocInY, x);
- return pown(inX, inY);
+float __attribute__((kernel)) testPownFloatIntFloat(float inBase, unsigned int x) {
+ int inExponent = rsGetElementAt_int(gAllocInExponent, x);
+ return pown(inBase, inExponent);
}
-float2 __attribute__((kernel)) testPownFloat2Int2Float2(float2 inX, unsigned int x) {
- int2 inY = rsGetElementAt_int2(gAllocInY, x);
- return pown(inX, inY);
+float2 __attribute__((kernel)) testPownFloat2Int2Float2(float2 inBase, unsigned int x) {
+ int2 inExponent = rsGetElementAt_int2(gAllocInExponent, x);
+ return pown(inBase, inExponent);
}
-float3 __attribute__((kernel)) testPownFloat3Int3Float3(float3 inX, unsigned int x) {
- int3 inY = rsGetElementAt_int3(gAllocInY, x);
- return pown(inX, inY);
+float3 __attribute__((kernel)) testPownFloat3Int3Float3(float3 inBase, unsigned int x) {
+ int3 inExponent = rsGetElementAt_int3(gAllocInExponent, x);
+ return pown(inBase, inExponent);
}
-float4 __attribute__((kernel)) testPownFloat4Int4Float4(float4 inX, unsigned int x) {
- int4 inY = rsGetElementAt_int4(gAllocInY, x);
- return pown(inX, inY);
+float4 __attribute__((kernel)) testPownFloat4Int4Float4(float4 inBase, unsigned int x) {
+ int4 inExponent = rsGetElementAt_int4(gAllocInExponent, x);
+ return pown(inBase, inExponent);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPownRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPownRelaxed.rs
index 66f3fef..fd8255f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPownRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestPown.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestPowr.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowr.java
similarity index 66%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestPowr.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowr.java
index b1f281b..740500d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestPowr.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowr.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestPowr extends RSBaseCompute {
+public class GeneratedTestPowr extends RSBaseCompute {
- private ScriptC_TestPowr script;
- private ScriptC_TestPowrRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestPowr script;
+ private ScriptC_GeneratedTestPowrRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestPowr(mRS);
- scriptRelaxed = new ScriptC_TestPowrRelaxed(mRS);
+ script = new ScriptC_GeneratedTestPowr(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestPowrRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inX;
- public float inY;
+ public float inBase;
+ public float inExponent;
public Target.Floaty out;
}
private void checkPowrFloatFloatFloat() {
- Allocation inX = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x616e17ec158f6a8dl, 0, 3000);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x616e17ec158f6a8el, false);
+ Allocation inBase = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x432f9eac0c490ca4l, 0, 3000);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x7ee76eaeab21ab0al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPowrFloatFloatFloat(inX, out);
- verifyResultsPowrFloatFloatFloat(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPowrFloatFloatFloat(inBase, out);
+ verifyResultsPowrFloatFloatFloat(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowrFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPowrFloatFloatFloat(inX, out);
- verifyResultsPowrFloatFloatFloat(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPowrFloatFloatFloat(inBase, out);
+ verifyResultsPowrFloatFloatFloat(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowrFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsPowrFloatFloatFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsPowrFloatFloatFloat(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 1];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 1];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
+ args.inBase = arrayInBase[i];
+ args.inExponent = arrayInExponent[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePowr(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkPowrFloat2Float2Float2() {
- Allocation inX = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xfc919df3002fbd93l, 0, 3000);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xfc919df3002fbd94l, false);
+ Allocation inBase = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x5ce1f4c2eae1fd16l, 0, 3000);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x1f9ec14817a9ddcl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPowrFloat2Float2Float2(inX, out);
- verifyResultsPowrFloat2Float2Float2(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPowrFloat2Float2Float2(inBase, out);
+ verifyResultsPowrFloat2Float2Float2(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowrFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPowrFloat2Float2Float2(inX, out);
- verifyResultsPowrFloat2Float2Float2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPowrFloat2Float2Float2(inBase, out);
+ verifyResultsPowrFloat2Float2Float2(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowrFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsPowrFloat2Float2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
+ private void verifyResultsPowrFloat2Float2Float2(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 2];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 2];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
+ args.inBase = arrayInBase[i * 2 + j];
+ args.inExponent = arrayInExponent[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePowr(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkPowrFloat3Float3Float3() {
- Allocation inX = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x50f67c13020dbf34l, 0, 3000);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x50f67c13020dbf35l, false);
+ Allocation inBase = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xf7c84366d355e289l, 0, 3000);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xdd686715d89d205fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPowrFloat3Float3Float3(inX, out);
- verifyResultsPowrFloat3Float3Float3(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPowrFloat3Float3Float3(inBase, out);
+ verifyResultsPowrFloat3Float3Float3(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowrFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPowrFloat3Float3Float3(inX, out);
- verifyResultsPowrFloat3Float3Float3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPowrFloat3Float3Float3(inBase, out);
+ verifyResultsPowrFloat3Float3Float3(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowrFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsPowrFloat3Float3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsPowrFloat3Float3Float3(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 4];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 4];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inBase = arrayInBase[i * 4 + j];
+ args.inExponent = arrayInExponent[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePowr(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkPowrFloat4Float4Float4() {
- Allocation inX = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xa55b5a3303ebc0d5l, 0, 3000);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xa55b5a3303ebc0d6l, false);
+ Allocation inBase = createRandomFloatAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x92ae920abbc9c7fcl, 0, 3000);
+ Allocation inExponent = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xb8d6e2172fbfa2e2l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testPowrFloat4Float4Float4(inX, out);
- verifyResultsPowrFloat4Float4Float4(inX, inY, out, false);
+ script.set_gAllocInExponent(inExponent);
+ script.forEach_testPowrFloat4Float4Float4(inBase, out);
+ verifyResultsPowrFloat4Float4Float4(inBase, inExponent, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowrFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testPowrFloat4Float4Float4(inX, out);
- verifyResultsPowrFloat4Float4Float4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInExponent(inExponent);
+ scriptRelaxed.forEach_testPowrFloat4Float4Float4(inBase, out);
+ verifyResultsPowrFloat4Float4Float4(inBase, inExponent, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testPowrFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsPowrFloat4Float4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsPowrFloat4Float4Float4(Allocation inBase, Allocation inExponent, Allocation out, boolean relaxed) {
+ float[] arrayInBase = new float[INPUTSIZE * 4];
+ inBase.copyTo(arrayInBase);
+ float[] arrayInExponent = new float[INPUTSIZE * 4];
+ inExponent.copyTo(arrayInExponent);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inBase = arrayInBase[i * 4 + j];
+ args.inExponent = arrayInExponent[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computePowr(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inBase: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inBase, Float.floatToRawIntBits(args.inBase), args.inBase));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inExponent: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inExponent, Float.floatToRawIntBits(args.inExponent), args.inExponent));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestPowr.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowr.rs
similarity index 61%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestPowr.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowr.rs
index 0fd603e..9cd9da0 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestPowr.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowr.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInY;
+rs_allocation gAllocInExponent;
-float __attribute__((kernel)) testPowrFloatFloatFloat(float inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return powr(inX, inY);
+float __attribute__((kernel)) testPowrFloatFloatFloat(float inBase, unsigned int x) {
+ float inExponent = rsGetElementAt_float(gAllocInExponent, x);
+ return powr(inBase, inExponent);
}
-float2 __attribute__((kernel)) testPowrFloat2Float2Float2(float2 inX, unsigned int x) {
- float2 inY = rsGetElementAt_float2(gAllocInY, x);
- return powr(inX, inY);
+float2 __attribute__((kernel)) testPowrFloat2Float2Float2(float2 inBase, unsigned int x) {
+ float2 inExponent = rsGetElementAt_float2(gAllocInExponent, x);
+ return powr(inBase, inExponent);
}
-float3 __attribute__((kernel)) testPowrFloat3Float3Float3(float3 inX, unsigned int x) {
- float3 inY = rsGetElementAt_float3(gAllocInY, x);
- return powr(inX, inY);
+float3 __attribute__((kernel)) testPowrFloat3Float3Float3(float3 inBase, unsigned int x) {
+ float3 inExponent = rsGetElementAt_float3(gAllocInExponent, x);
+ return powr(inBase, inExponent);
}
-float4 __attribute__((kernel)) testPowrFloat4Float4Float4(float4 inX, unsigned int x) {
- float4 inY = rsGetElementAt_float4(gAllocInY, x);
- return powr(inX, inY);
+float4 __attribute__((kernel)) testPowrFloat4Float4Float4(float4 inBase, unsigned int x) {
+ float4 inExponent = rsGetElementAt_float4(gAllocInExponent, x);
+ return powr(inBase, inExponent);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowrRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowrRelaxed.rs
index 66f3fef..8c2d3ac 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestPowrRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestPowr.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRadians.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRadians.java
similarity index 76%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestRadians.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRadians.java
index 2707ac2..61bf9b2 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRadians.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRadians.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestRadians extends RSBaseCompute {
+public class GeneratedTestRadians extends RSBaseCompute {
- private ScriptC_TestRadians script;
- private ScriptC_TestRadiansRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestRadians script;
+ private ScriptC_GeneratedTestRadiansRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestRadians(mRS);
- scriptRelaxed = new ScriptC_TestRadiansRelaxed(mRS);
+ script = new ScriptC_GeneratedTestRadians(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestRadiansRelaxed(mRS);
}
public class ArgumentsFloatFloat {
- public float inValue;
+ public float inV;
public Target.Floaty out;
}
private void checkRadiansFloatFloat() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xaa72f227598b8106l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x6e5054c0042adfabl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testRadiansFloatFloat(inValue, out);
- verifyResultsRadiansFloatFloat(inValue, out, false);
+ script.forEach_testRadiansFloatFloat(inV, out);
+ verifyResultsRadiansFloatFloat(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRadiansFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testRadiansFloatFloat(inValue, out);
- verifyResultsRadiansFloatFloat(inValue, out, true);
+ scriptRelaxed.forEach_testRadiansFloatFloat(inV, out);
+ verifyResultsRadiansFloatFloat(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRadiansFloatFloat: " + e.toString());
}
}
- private void verifyResultsRadiansFloatFloat(Allocation inValue, Allocation out, boolean relaxed) {
- float[] arrayInValue = new float[INPUTSIZE * 1];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsRadiansFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 1];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inValue = arrayInValue[i];
+ args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeRadians(args, target);
@@ -77,9 +77,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inValue, Float.floatToRawIntBits(args.inValue), args.inValue));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -99,33 +99,33 @@
}
private void checkRadiansFloat2Float2() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xb28bd9316e059892l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc20ed424de23baf7l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testRadiansFloat2Float2(inValue, out);
- verifyResultsRadiansFloat2Float2(inValue, out, false);
+ script.forEach_testRadiansFloat2Float2(inV, out);
+ verifyResultsRadiansFloat2Float2(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRadiansFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testRadiansFloat2Float2(inValue, out);
- verifyResultsRadiansFloat2Float2(inValue, out, true);
+ scriptRelaxed.forEach_testRadiansFloat2Float2(inV, out);
+ verifyResultsRadiansFloat2Float2(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRadiansFloat2Float2: " + e.toString());
}
}
- private void verifyResultsRadiansFloat2Float2(Allocation inValue, Allocation out, boolean relaxed) {
- float[] arrayInValue = new float[INPUTSIZE * 2];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsRadiansFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 2];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inValue = arrayInValue[i * 2 + j];
+ args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeRadians(args, target);
@@ -136,9 +136,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inValue, Float.floatToRawIntBits(args.inValue), args.inValue));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -158,33 +158,33 @@
}
private void checkRadiansFloat3Float3() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd8404eb8b743be10l, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xc2109d3fd43edbd5l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testRadiansFloat3Float3(inValue, out);
- verifyResultsRadiansFloat3Float3(inValue, out, false);
+ script.forEach_testRadiansFloat3Float3(inV, out);
+ verifyResultsRadiansFloat3Float3(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRadiansFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testRadiansFloat3Float3(inValue, out);
- verifyResultsRadiansFloat3Float3(inValue, out, true);
+ scriptRelaxed.forEach_testRadiansFloat3Float3(inV, out);
+ verifyResultsRadiansFloat3Float3(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRadiansFloat3Float3: " + e.toString());
}
}
- private void verifyResultsRadiansFloat3Float3(Allocation inValue, Allocation out, boolean relaxed) {
- float[] arrayInValue = new float[INPUTSIZE * 4];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsRadiansFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inValue = arrayInValue[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeRadians(args, target);
@@ -195,9 +195,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inValue, Float.floatToRawIntBits(args.inValue), args.inValue));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -217,33 +217,33 @@
}
private void checkRadiansFloat4Float4() {
- Allocation inValue = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xfdf4c4400081e38el, false);
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc212665aca59fcb3l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testRadiansFloat4Float4(inValue, out);
- verifyResultsRadiansFloat4Float4(inValue, out, false);
+ script.forEach_testRadiansFloat4Float4(inV, out);
+ verifyResultsRadiansFloat4Float4(inV, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRadiansFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testRadiansFloat4Float4(inValue, out);
- verifyResultsRadiansFloat4Float4(inValue, out, true);
+ scriptRelaxed.forEach_testRadiansFloat4Float4(inV, out);
+ verifyResultsRadiansFloat4Float4(inV, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRadiansFloat4Float4: " + e.toString());
}
}
- private void verifyResultsRadiansFloat4Float4(Allocation inValue, Allocation out, boolean relaxed) {
- float[] arrayInValue = new float[INPUTSIZE * 4];
- inValue.copyTo(arrayInValue);
+ private void verifyResultsRadiansFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ float[] arrayInV = new float[INPUTSIZE * 4];
+ inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.inValue = arrayInValue[i * 4 + j];
+ args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeRadians(args, target);
@@ -254,9 +254,9 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inValue: ");
+ message.append("Input inV: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inValue, Float.floatToRawIntBits(args.inValue), args.inValue));
+ args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRadians.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRadians.rs
similarity index 82%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestRadians.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRadians.rs
index 09aa9a0..035a936 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRadians.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRadians.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testRadiansFloatFloat(float inValue) {
- return radians(inValue);
+float __attribute__((kernel)) testRadiansFloatFloat(float inV) {
+ return radians(inV);
}
-float2 __attribute__((kernel)) testRadiansFloat2Float2(float2 inValue) {
- return radians(inValue);
+float2 __attribute__((kernel)) testRadiansFloat2Float2(float2 inV) {
+ return radians(inV);
}
-float3 __attribute__((kernel)) testRadiansFloat3Float3(float3 inValue) {
- return radians(inValue);
+float3 __attribute__((kernel)) testRadiansFloat3Float3(float3 inV) {
+ return radians(inV);
}
-float4 __attribute__((kernel)) testRadiansFloat4Float4(float4 inValue) {
- return radians(inValue);
+float4 __attribute__((kernel)) testRadiansFloat4Float4(float4 inV) {
+ return radians(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRadiansRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRadiansRelaxed.rs
index 66f3fef..8ed4122 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRadiansRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestRadians.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRemainder.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemainder.java
similarity index 65%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestRemainder.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemainder.java
index 8208d23..9bb5c65 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRemainder.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemainder.java
@@ -22,58 +22,58 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestRemainder extends RSBaseCompute {
+public class GeneratedTestRemainder extends RSBaseCompute {
- private ScriptC_TestRemainder script;
- private ScriptC_TestRemainderRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestRemainder script;
+ private ScriptC_GeneratedTestRemainderRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestRemainder(mRS);
- scriptRelaxed = new ScriptC_TestRemainderRelaxed(mRS);
+ script = new ScriptC_GeneratedTestRemainder(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestRemainderRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
- public float inX;
- public float inY;
+ public float inNumerator;
+ public float inDenominator;
public Target.Floaty out;
}
private void checkRemainderFloatFloatFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x27d6330966022888l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x27d6330966022889l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xd47c3f07317ea229l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb246eb0ee2ebe35al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testRemainderFloatFloatFloat(inX, out);
- verifyResultsRemainderFloatFloatFloat(inX, inY, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testRemainderFloatFloatFloat(inNumerator, out);
+ verifyResultsRemainderFloatFloatFloat(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemainderFloatFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testRemainderFloatFloatFloat(inX, out);
- verifyResultsRemainderFloatFloatFloat(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testRemainderFloatFloatFloat(inNumerator, out);
+ verifyResultsRemainderFloatFloatFloat(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemainderFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsRemainderFloatFloatFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
+ private void verifyResultsRemainderFloatFloatFloat(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 1];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 1];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 1 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
+ args.inNumerator = arrayInNumerator[i];
+ args.inDenominator = arrayInDenominator[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeRemainder(args, target);
@@ -84,13 +84,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -110,39 +110,39 @@
}
private void checkRemainderFloat2Float2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xfb2eaf332420c6b4l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xfb2eaf332420c6b5l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x27d975633fdcf8d5l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xce8489f2aa4be3a6l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testRemainderFloat2Float2Float2(inX, out);
- verifyResultsRemainderFloat2Float2Float2(inX, inY, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testRemainderFloat2Float2Float2(inNumerator, out);
+ verifyResultsRemainderFloat2Float2Float2(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemainderFloat2Float2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testRemainderFloat2Float2Float2(inX, out);
- verifyResultsRemainderFloat2Float2Float2(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testRemainderFloat2Float2Float2(inNumerator, out);
+ verifyResultsRemainderFloat2Float2Float2(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemainderFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsRemainderFloat2Float2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
+ private void verifyResultsRemainderFloat2Float2Float2(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 2];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 2];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 2 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
+ args.inNumerator = arrayInNumerator[i * 2 + j];
+ args.inDenominator = arrayInDenominator[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeRemainder(args, target);
@@ -153,13 +153,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -179,39 +179,39 @@
}
private void checkRemainderFloat3Float3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x4f938d5325fec855l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x4f938d5325fec856l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x3681e9ce2a8e4d6l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x97e8cb3b7d2776dfl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testRemainderFloat3Float3Float3(inX, out);
- verifyResultsRemainderFloat3Float3Float3(inX, inY, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testRemainderFloat3Float3Float3(inNumerator, out);
+ verifyResultsRemainderFloat3Float3Float3(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemainderFloat3Float3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testRemainderFloat3Float3Float3(inX, out);
- verifyResultsRemainderFloat3Float3Float3(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testRemainderFloat3Float3Float3(inNumerator, out);
+ verifyResultsRemainderFloat3Float3Float3(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemainderFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsRemainderFloat3Float3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsRemainderFloat3Float3Float3(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 3 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeRemainder(args, target);
@@ -222,13 +222,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
@@ -248,39 +248,39 @@
}
private void checkRemainderFloat4Float4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xa3f86b7327dcc9f6l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xa3f86b7327dcc9f7l, false);
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xdef6c7d68574d0d7l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x614d0c8450030a18l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testRemainderFloat4Float4Float4(inX, out);
- verifyResultsRemainderFloat4Float4Float4(inX, inY, out, false);
+ script.set_gAllocInDenominator(inDenominator);
+ script.forEach_testRemainderFloat4Float4Float4(inNumerator, out);
+ verifyResultsRemainderFloat4Float4Float4(inNumerator, inDenominator, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemainderFloat4Float4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testRemainderFloat4Float4Float4(inX, out);
- verifyResultsRemainderFloat4Float4Float4(inX, inY, out, true);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.forEach_testRemainderFloat4Float4Float4(inNumerator, out);
+ verifyResultsRemainderFloat4Float4Float4(inNumerator, inDenominator, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemainderFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsRemainderFloat4Float4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
+ private void verifyResultsRemainderFloat4Float4Float4(Allocation inNumerator, Allocation inDenominator, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
for (int j = 0; j < 4 ; j++) {
// Extract the inputs.
ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
CoreMathVerifier.computeRemainder(args, target);
@@ -291,13 +291,13 @@
}
if (!valid) {
StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
+ message.append("Input inNumerator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
message.append("\n");
- message.append("Input inY: ");
+ message.append("Input inDenominator: ");
message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
message.append("\n");
message.append("Expected output out: ");
message.append(args.out.toString());
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRemainder.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemainder.rs
similarity index 61%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestRemainder.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemainder.rs
index 86f2030..a0aa809 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRemainder.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemainder.rs
@@ -19,24 +19,24 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocInY;
+rs_allocation gAllocInDenominator;
-float __attribute__((kernel)) testRemainderFloatFloatFloat(float inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return remainder(inX, inY);
+float __attribute__((kernel)) testRemainderFloatFloatFloat(float inNumerator, unsigned int x) {
+ float inDenominator = rsGetElementAt_float(gAllocInDenominator, x);
+ return remainder(inNumerator, inDenominator);
}
-float2 __attribute__((kernel)) testRemainderFloat2Float2Float2(float2 inX, unsigned int x) {
- float2 inY = rsGetElementAt_float2(gAllocInY, x);
- return remainder(inX, inY);
+float2 __attribute__((kernel)) testRemainderFloat2Float2Float2(float2 inNumerator, unsigned int x) {
+ float2 inDenominator = rsGetElementAt_float2(gAllocInDenominator, x);
+ return remainder(inNumerator, inDenominator);
}
-float3 __attribute__((kernel)) testRemainderFloat3Float3Float3(float3 inX, unsigned int x) {
- float3 inY = rsGetElementAt_float3(gAllocInY, x);
- return remainder(inX, inY);
+float3 __attribute__((kernel)) testRemainderFloat3Float3Float3(float3 inNumerator, unsigned int x) {
+ float3 inDenominator = rsGetElementAt_float3(gAllocInDenominator, x);
+ return remainder(inNumerator, inDenominator);
}
-float4 __attribute__((kernel)) testRemainderFloat4Float4Float4(float4 inX, unsigned int x) {
- float4 inY = rsGetElementAt_float4(gAllocInY, x);
- return remainder(inX, inY);
+float4 __attribute__((kernel)) testRemainderFloat4Float4Float4(float4 inNumerator, unsigned int x) {
+ float4 inDenominator = rsGetElementAt_float4(gAllocInDenominator, x);
+ return remainder(inNumerator, inDenominator);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRemainderRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemainderRelaxed.rs
similarity index 95%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestRemainderRelaxed.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemainderRelaxed.rs
index 7c45964..33c5ca2 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRemainderRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemainderRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestRemainder.rs"
+#include "GeneratedTestRemainder.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemquo.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemquo.java
new file mode 100644
index 0000000..7298e5f
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemquo.java
@@ -0,0 +1,334 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+package android.renderscript.cts;
+
+import android.renderscript.Allocation;
+import android.renderscript.RSRuntimeException;
+import android.renderscript.Element;
+
+public class GeneratedTestRemquo extends RSBaseCompute {
+
+ private ScriptC_GeneratedTestRemquo script;
+ private ScriptC_GeneratedTestRemquoRelaxed scriptRelaxed;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ script = new ScriptC_GeneratedTestRemquo(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestRemquoRelaxed(mRS);
+ }
+
+ public class ArgumentsFloatFloatIntFloat {
+ public float inNumerator;
+ public float inDenominator;
+ public int outQuotient;
+ public float out;
+ }
+
+ private void checkRemquoFloatFloatIntFloat() {
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xcd5efc69edd4ff2al, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x4ff0c9312eb19f93l, false);
+ try {
+ Allocation outQuotient = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ script.set_gAllocInDenominator(inDenominator);
+ script.set_gAllocOutQuotient(outQuotient);
+ script.forEach_testRemquoFloatFloatIntFloat(inNumerator, out);
+ verifyResultsRemquoFloatFloatIntFloat(inNumerator, inDenominator, outQuotient, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloatFloatIntFloat: " + e.toString());
+ }
+ try {
+ Allocation outQuotient = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.set_gAllocOutQuotient(outQuotient);
+ scriptRelaxed.forEach_testRemquoFloatFloatIntFloat(inNumerator, out);
+ verifyResultsRemquoFloatFloatIntFloat(inNumerator, inDenominator, outQuotient, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloatFloatIntFloat: " + e.toString());
+ }
+ }
+
+ private void verifyResultsRemquoFloatFloatIntFloat(Allocation inNumerator, Allocation inDenominator, Allocation outQuotient, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 1];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 1];
+ inDenominator.copyTo(arrayInDenominator);
+ int[] arrayOutQuotient = new int[INPUTSIZE * 1];
+ outQuotient.copyTo(arrayOutQuotient);
+ float[] arrayOut = new float[INPUTSIZE * 1];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 1 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatIntFloat args = new ArgumentsFloatFloatIntFloat();
+ args.inNumerator = arrayInNumerator[i];
+ args.inDenominator = arrayInDenominator[i];
+ // Extract the outputs.
+ args.outQuotient = arrayOutQuotient[i * 1 + j];
+ args.out = arrayOut[i * 1 + j];
+ // Ask the CoreMathVerifier to validate.
+ Target target = new Target(relaxed);
+ String errorMessage = CoreMathVerifier.verifyRemquo(args, target);
+ boolean valid = errorMessage == null;
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inNumerator: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
+ message.append("\n");
+ message.append("Input inDenominator: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
+ message.append("\n");
+ message.append("Output outQuotient: ");
+ message.append(String.format("%d", args.outQuotient));
+ message.append("\n");
+ message.append("Output out: ");
+ message.append(Float.toString(args.out));
+ message.append("\n");
+ message.append(errorMessage);
+ assertTrue("Incorrect output for checkRemquoFloatFloatIntFloat" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ private void checkRemquoFloat2Float2Int2Float2() {
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x28c14abc3a27171al, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x58f8799a6ba08403l, false);
+ try {
+ Allocation outQuotient = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ script.set_gAllocInDenominator(inDenominator);
+ script.set_gAllocOutQuotient(outQuotient);
+ script.forEach_testRemquoFloat2Float2Int2Float2(inNumerator, out);
+ verifyResultsRemquoFloat2Float2Int2Float2(inNumerator, inDenominator, outQuotient, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat2Float2Int2Float2: " + e.toString());
+ }
+ try {
+ Allocation outQuotient = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.set_gAllocOutQuotient(outQuotient);
+ scriptRelaxed.forEach_testRemquoFloat2Float2Int2Float2(inNumerator, out);
+ verifyResultsRemquoFloat2Float2Int2Float2(inNumerator, inDenominator, outQuotient, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat2Float2Int2Float2: " + e.toString());
+ }
+ }
+
+ private void verifyResultsRemquoFloat2Float2Int2Float2(Allocation inNumerator, Allocation inDenominator, Allocation outQuotient, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 2];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 2];
+ inDenominator.copyTo(arrayInDenominator);
+ int[] arrayOutQuotient = new int[INPUTSIZE * 2];
+ outQuotient.copyTo(arrayOutQuotient);
+ float[] arrayOut = new float[INPUTSIZE * 2];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 2 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatIntFloat args = new ArgumentsFloatFloatIntFloat();
+ args.inNumerator = arrayInNumerator[i * 2 + j];
+ args.inDenominator = arrayInDenominator[i * 2 + j];
+ // Extract the outputs.
+ args.outQuotient = arrayOutQuotient[i * 2 + j];
+ args.out = arrayOut[i * 2 + j];
+ // Ask the CoreMathVerifier to validate.
+ Target target = new Target(relaxed);
+ String errorMessage = CoreMathVerifier.verifyRemquo(args, target);
+ boolean valid = errorMessage == null;
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inNumerator: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
+ message.append("\n");
+ message.append("Input inDenominator: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
+ message.append("\n");
+ message.append("Output outQuotient: ");
+ message.append(String.format("%d", args.outQuotient));
+ message.append("\n");
+ message.append("Output out: ");
+ message.append(Float.toString(args.out));
+ message.append("\n");
+ message.append(errorMessage);
+ assertTrue("Incorrect output for checkRemquoFloat2Float2Int2Float2" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ private void checkRemquoFloat3Float3Int3Float3() {
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xf60211df96052526l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd1d6c7fcf273f8afl, false);
+ try {
+ Allocation outQuotient = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ script.set_gAllocInDenominator(inDenominator);
+ script.set_gAllocOutQuotient(outQuotient);
+ script.forEach_testRemquoFloat3Float3Int3Float3(inNumerator, out);
+ verifyResultsRemquoFloat3Float3Int3Float3(inNumerator, inDenominator, outQuotient, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat3Float3Int3Float3: " + e.toString());
+ }
+ try {
+ Allocation outQuotient = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.set_gAllocOutQuotient(outQuotient);
+ scriptRelaxed.forEach_testRemquoFloat3Float3Int3Float3(inNumerator, out);
+ verifyResultsRemquoFloat3Float3Int3Float3(inNumerator, inDenominator, outQuotient, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat3Float3Int3Float3: " + e.toString());
+ }
+ }
+
+ private void verifyResultsRemquoFloat3Float3Int3Float3(Allocation inNumerator, Allocation inDenominator, Allocation outQuotient, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
+ int[] arrayOutQuotient = new int[INPUTSIZE * 4];
+ outQuotient.copyTo(arrayOutQuotient);
+ float[] arrayOut = new float[INPUTSIZE * 4];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 3 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatIntFloat args = new ArgumentsFloatFloatIntFloat();
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
+ // Extract the outputs.
+ args.outQuotient = arrayOutQuotient[i * 4 + j];
+ args.out = arrayOut[i * 4 + j];
+ // Ask the CoreMathVerifier to validate.
+ Target target = new Target(relaxed);
+ String errorMessage = CoreMathVerifier.verifyRemquo(args, target);
+ boolean valid = errorMessage == null;
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inNumerator: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
+ message.append("\n");
+ message.append("Input inDenominator: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
+ message.append("\n");
+ message.append("Output outQuotient: ");
+ message.append(String.format("%d", args.outQuotient));
+ message.append("\n");
+ message.append("Output out: ");
+ message.append(Float.toString(args.out));
+ message.append("\n");
+ message.append(errorMessage);
+ assertTrue("Incorrect output for checkRemquoFloat3Float3Int3Float3" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ private void checkRemquoFloat4Float4Int4Float4() {
+ Allocation inNumerator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc342d902f1e33332l, false);
+ Allocation inDenominator = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x4ab5165f79476d5bl, false);
+ try {
+ Allocation outQuotient = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ script.set_gAllocInDenominator(inDenominator);
+ script.set_gAllocOutQuotient(outQuotient);
+ script.forEach_testRemquoFloat4Float4Int4Float4(inNumerator, out);
+ verifyResultsRemquoFloat4Float4Int4Float4(inNumerator, inDenominator, outQuotient, out, false);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat4Float4Int4Float4: " + e.toString());
+ }
+ try {
+ Allocation outQuotient = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
+ Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ scriptRelaxed.set_gAllocInDenominator(inDenominator);
+ scriptRelaxed.set_gAllocOutQuotient(outQuotient);
+ scriptRelaxed.forEach_testRemquoFloat4Float4Int4Float4(inNumerator, out);
+ verifyResultsRemquoFloat4Float4Int4Float4(inNumerator, inDenominator, outQuotient, out, true);
+ } catch (Exception e) {
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat4Float4Int4Float4: " + e.toString());
+ }
+ }
+
+ private void verifyResultsRemquoFloat4Float4Int4Float4(Allocation inNumerator, Allocation inDenominator, Allocation outQuotient, Allocation out, boolean relaxed) {
+ float[] arrayInNumerator = new float[INPUTSIZE * 4];
+ inNumerator.copyTo(arrayInNumerator);
+ float[] arrayInDenominator = new float[INPUTSIZE * 4];
+ inDenominator.copyTo(arrayInDenominator);
+ int[] arrayOutQuotient = new int[INPUTSIZE * 4];
+ outQuotient.copyTo(arrayOutQuotient);
+ float[] arrayOut = new float[INPUTSIZE * 4];
+ out.copyTo(arrayOut);
+ for (int i = 0; i < INPUTSIZE; i++) {
+ for (int j = 0; j < 4 ; j++) {
+ // Extract the inputs.
+ ArgumentsFloatFloatIntFloat args = new ArgumentsFloatFloatIntFloat();
+ args.inNumerator = arrayInNumerator[i * 4 + j];
+ args.inDenominator = arrayInDenominator[i * 4 + j];
+ // Extract the outputs.
+ args.outQuotient = arrayOutQuotient[i * 4 + j];
+ args.out = arrayOut[i * 4 + j];
+ // Ask the CoreMathVerifier to validate.
+ Target target = new Target(relaxed);
+ String errorMessage = CoreMathVerifier.verifyRemquo(args, target);
+ boolean valid = errorMessage == null;
+ if (!valid) {
+ StringBuilder message = new StringBuilder();
+ message.append("Input inNumerator: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inNumerator, Float.floatToRawIntBits(args.inNumerator), args.inNumerator));
+ message.append("\n");
+ message.append("Input inDenominator: ");
+ message.append(String.format("%14.8g {%8x} %15a",
+ args.inDenominator, Float.floatToRawIntBits(args.inDenominator), args.inDenominator));
+ message.append("\n");
+ message.append("Output outQuotient: ");
+ message.append(String.format("%d", args.outQuotient));
+ message.append("\n");
+ message.append("Output out: ");
+ message.append(Float.toString(args.out));
+ message.append("\n");
+ message.append(errorMessage);
+ assertTrue("Incorrect output for checkRemquoFloat4Float4Int4Float4" +
+ (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
+ }
+ }
+ }
+ }
+
+ public void testRemquo() {
+ checkRemquoFloatFloatIntFloat();
+ checkRemquoFloat2Float2Int2Float2();
+ checkRemquoFloat3Float3Int3Float3();
+ checkRemquoFloat4Float4Int4Float4();
+ }
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemquo.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemquo.rs
new file mode 100644
index 0000000..fada6c1
--- /dev/null
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemquo.rs
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma version(1)
+#pragma rs java_package_name(android.renderscript.cts)
+
+// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
+
+rs_allocation gAllocInDenominator;
+rs_allocation gAllocOutQuotient;
+
+float __attribute__((kernel)) testRemquoFloatFloatIntFloat(float inNumerator, unsigned int x) {
+ float inDenominator = rsGetElementAt_float(gAllocInDenominator, x);
+ int outQuotient = 0;
+ float out = remquo(inNumerator, inDenominator, &outQuotient);
+ rsSetElementAt_int(gAllocOutQuotient, outQuotient, x);
+ return out;
+}
+
+float2 __attribute__((kernel)) testRemquoFloat2Float2Int2Float2(float2 inNumerator, unsigned int x) {
+ float2 inDenominator = rsGetElementAt_float2(gAllocInDenominator, x);
+ int2 outQuotient = 0;
+ float2 out = remquo(inNumerator, inDenominator, &outQuotient);
+ rsSetElementAt_int2(gAllocOutQuotient, outQuotient, x);
+ return out;
+}
+
+float3 __attribute__((kernel)) testRemquoFloat3Float3Int3Float3(float3 inNumerator, unsigned int x) {
+ float3 inDenominator = rsGetElementAt_float3(gAllocInDenominator, x);
+ int3 outQuotient = 0;
+ float3 out = remquo(inNumerator, inDenominator, &outQuotient);
+ rsSetElementAt_int3(gAllocOutQuotient, outQuotient, x);
+ return out;
+}
+
+float4 __attribute__((kernel)) testRemquoFloat4Float4Int4Float4(float4 inNumerator, unsigned int x) {
+ float4 inDenominator = rsGetElementAt_float4(gAllocInDenominator, x);
+ int4 outQuotient = 0;
+ float4 out = remquo(inNumerator, inDenominator, &outQuotient);
+ rsSetElementAt_int4(gAllocOutQuotient, outQuotient, x);
+ return out;
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemquoRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemquoRelaxed.rs
index 66f3fef..85fc974 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRemquoRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestRemquo.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRint.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRint.java
index 77c467c..5c296e9 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRint.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestRint extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestRint script;
+ private ScriptC_GeneratedTestRintRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestRint(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestRintRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkRintFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb88cd9adbf02db54l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testRintFloatFloat(inV, out);
+ verifyResultsRintFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testRintFloatFloat(inV, out);
+ verifyResultsRintFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRintFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRint(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkRintFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkRintFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xf12aed2f601c6298l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testRintFloat2Float2(inV, out);
+ verifyResultsRintFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testRintFloat2Float2(inV, out);
+ verifyResultsRintFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRintFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRint(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkRintFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkRintFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xf12cb64a56378376l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testRintFloat3Float3(inV, out);
+ verifyResultsRintFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testRintFloat3Float3(inV, out);
+ verifyResultsRintFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRintFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRint(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkRintFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkRintFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf12e7f654c52a454l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testRintFloat4Float4(inV, out);
+ verifyResultsRintFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testRintFloat4Float4(inV, out);
+ verifyResultsRintFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRintFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRint(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkRintFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testRint() {
+ checkRintFloatFloat();
+ checkRintFloat2Float2();
+ checkRintFloat3Float3();
+ checkRintFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRint.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRint.rs
index 1024943..937d1a4 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRint.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testRintFloatFloat(float inV) {
+ return rint(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testRintFloat2Float2(float2 inV) {
+ return rint(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testRintFloat3Float3(float3 inV) {
+ return rint(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testRintFloat4Float4(float4 inV) {
+ return rint(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRintRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRintRelaxed.rs
index 66f3fef..d9e2f89 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRintRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestRint.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRootn.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRootn.java
similarity index 98%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestRootn.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRootn.java
index b9562e4..06842b6 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRootn.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRootn.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestRootn extends RSBaseCompute {
+public class GeneratedTestRootn extends RSBaseCompute {
- private ScriptC_TestRootn script;
- private ScriptC_TestRootnRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestRootn script;
+ private ScriptC_GeneratedTestRootnRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestRootn(mRS);
- scriptRelaxed = new ScriptC_TestRootnRelaxed(mRS);
+ script = new ScriptC_GeneratedTestRootn(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestRootnRelaxed(mRS);
}
public class ArgumentsFloatIntFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRootn.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRootn.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestRootn.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRootn.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRootnRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRootnRelaxed.rs
index 66f3fef..50c77e4 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRootnRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestRootn.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRound.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRound.java
index 77c467c..9278a80 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRound.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestRound extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestRound script;
+ private ScriptC_GeneratedTestRoundRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestRound(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestRoundRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkRoundFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x51f05c443f4006c3l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testRoundFloatFloat(inV, out);
+ verifyResultsRoundFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testRoundFloatFloat(inV, out);
+ verifyResultsRoundFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRoundFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRound(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkRoundFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkRoundFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xd0e51e3399eb174fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testRoundFloat2Float2(inV, out);
+ verifyResultsRoundFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testRoundFloat2Float2(inV, out);
+ verifyResultsRoundFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRoundFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRound(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkRoundFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkRoundFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xd0e6e74e9006382dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testRoundFloat3Float3(inV, out);
+ verifyResultsRoundFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testRoundFloat3Float3(inV, out);
+ verifyResultsRoundFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRoundFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRound(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkRoundFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkRoundFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xd0e8b0698621590bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testRoundFloat4Float4(inV, out);
+ verifyResultsRoundFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testRoundFloat4Float4(inV, out);
+ verifyResultsRoundFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRoundFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRound(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkRoundFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testRound() {
+ checkRoundFloatFloat();
+ checkRoundFloat2Float2();
+ checkRoundFloat3Float3();
+ checkRoundFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRound.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRound.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestRound.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRound.rs
index 0442849..df77461 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRound.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRound.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testRoundFloatFloat(float in) {
- return round(in);
+float __attribute__((kernel)) testRoundFloatFloat(float inV) {
+ return round(inV);
}
-float2 __attribute__((kernel)) testRoundFloat2Float2(float2 in) {
- return round(in);
+float2 __attribute__((kernel)) testRoundFloat2Float2(float2 inV) {
+ return round(inV);
}
-float3 __attribute__((kernel)) testRoundFloat3Float3(float3 in) {
- return round(in);
+float3 __attribute__((kernel)) testRoundFloat3Float3(float3 inV) {
+ return round(inV);
}
-float4 __attribute__((kernel)) testRoundFloat4Float4(float4 in) {
- return round(in);
+float4 __attribute__((kernel)) testRoundFloat4Float4(float4 inV) {
+ return round(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRoundRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRoundRelaxed.rs
index 66f3fef..e15d81a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRoundRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestRound.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRsqrt.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRsqrt.java
index 77c467c..aec55d2 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRsqrt.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestRsqrt extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestRsqrt script;
+ private ScriptC_GeneratedTestRsqrtRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestRsqrt(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestRsqrtRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkRsqrtFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x637c4873aa3f3b8fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testRsqrtFloatFloat(inV, out);
+ verifyResultsRsqrtFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testRsqrtFloatFloat(inV, out);
+ verifyResultsRsqrtFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRsqrtFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRsqrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkRsqrtFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkRsqrtFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x8c8200af672f6cbbl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testRsqrtFloat2Float2(inV, out);
+ verifyResultsRsqrtFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testRsqrtFloat2Float2(inV, out);
+ verifyResultsRsqrtFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRsqrtFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRsqrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkRsqrtFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkRsqrtFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x8c83c9ca5d4a8d99l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testRsqrtFloat3Float3(inV, out);
+ verifyResultsRsqrtFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testRsqrtFloat3Float3(inV, out);
+ verifyResultsRsqrtFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRsqrtFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRsqrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkRsqrtFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkRsqrtFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x8c8592e55365ae77l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testRsqrtFloat4Float4(inV, out);
+ verifyResultsRsqrtFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testRsqrtFloat4Float4(inV, out);
+ verifyResultsRsqrtFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsRsqrtFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeRsqrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkRsqrtFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testRsqrt() {
+ checkRsqrtFloatFloat();
+ checkRsqrtFloat2Float2();
+ checkRsqrtFloat3Float3();
+ checkRsqrtFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRsqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRsqrt.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestRsqrt.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRsqrt.rs
index 5978899..72c65cc 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRsqrt.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRsqrt.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testRsqrtFloatFloat(float in) {
- return rsqrt(in);
+float __attribute__((kernel)) testRsqrtFloatFloat(float inV) {
+ return rsqrt(inV);
}
-float2 __attribute__((kernel)) testRsqrtFloat2Float2(float2 in) {
- return rsqrt(in);
+float2 __attribute__((kernel)) testRsqrtFloat2Float2(float2 inV) {
+ return rsqrt(inV);
}
-float3 __attribute__((kernel)) testRsqrtFloat3Float3(float3 in) {
- return rsqrt(in);
+float3 __attribute__((kernel)) testRsqrtFloat3Float3(float3 inV) {
+ return rsqrt(inV);
}
-float4 __attribute__((kernel)) testRsqrtFloat4Float4(float4 in) {
- return rsqrt(in);
+float4 __attribute__((kernel)) testRsqrtFloat4Float4(float4 inV) {
+ return rsqrt(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRsqrtRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRsqrtRelaxed.rs
index 66f3fef..a709839 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestRsqrtRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestRsqrt.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSign.java
similarity index 97%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSign.java
index 77c467c..b9de39f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSign.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestSign extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestSign script;
+ private ScriptC_GeneratedTestSignRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestSign(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestSignRelaxed(mRS);
}
public class ArgumentsFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSign.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestSign.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSign.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSignRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSignRelaxed.rs
index 66f3fef..96293d2 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSignRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestSign.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSin.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSin.java
index 77c467c..e167669 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSin.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestSin extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestSin script;
+ private ScriptC_GeneratedTestSinRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestSin(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestSinRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkSinFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x983d81dfe3401d29l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testSinFloatFloat(inV, out);
+ verifyResultsSinFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testSinFloatFloat(inV, out);
+ verifyResultsSinFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSin(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkSinFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkSinFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x9419bf571e8cde05l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testSinFloat2Float2(inV, out);
+ verifyResultsSinFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testSinFloat2Float2(inV, out);
+ verifyResultsSinFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSin(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkSinFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkSinFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x941b887214a7fee3l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testSinFloat3Float3(inV, out);
+ verifyResultsSinFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testSinFloat3Float3(inV, out);
+ verifyResultsSinFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSin(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkSinFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkSinFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x941d518d0ac31fc1l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testSinFloat4Float4(inV, out);
+ verifyResultsSinFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testSinFloat4Float4(inV, out);
+ verifyResultsSinFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSin(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkSinFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testSin() {
+ checkSinFloatFloat();
+ checkSinFloat2Float2();
+ checkSinFloat3Float3();
+ checkSinFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSin.rs
similarity index 70%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSin.rs
index 80c8708..d68243a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSin.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testCeilFloatFloat(float in) {
- return ceil(in);
+float __attribute__((kernel)) testSinFloatFloat(float inV) {
+ return sin(inV);
}
-float2 __attribute__((kernel)) testCeilFloat2Float2(float2 in) {
- return ceil(in);
+float2 __attribute__((kernel)) testSinFloat2Float2(float2 inV) {
+ return sin(inV);
}
-float3 __attribute__((kernel)) testCeilFloat3Float3(float3 in) {
- return ceil(in);
+float3 __attribute__((kernel)) testSinFloat3Float3(float3 inV) {
+ return sin(inV);
}
-float4 __attribute__((kernel)) testCeilFloat4Float4(float4 in) {
- return ceil(in);
+float4 __attribute__((kernel)) testSinFloat4Float4(float4 inV) {
+ return sin(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinRelaxed.rs
index 66f3fef..ef09f8c 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestSin.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSincos.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSincos.java
similarity index 74%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestSincos.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSincos.java
index 60c6ef0..4c58cd6 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSincos.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSincos.java
@@ -22,51 +22,51 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSincos extends RSBaseCompute {
+public class GeneratedTestSincos extends RSBaseCompute {
- private ScriptC_TestSincos script;
- private ScriptC_TestSincosRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestSincos script;
+ private ScriptC_GeneratedTestSincosRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSincos(mRS);
- scriptRelaxed = new ScriptC_TestSincosRelaxed(mRS);
+ script = new ScriptC_GeneratedTestSincos(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestSincosRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
public float inV;
- public Target.Floaty outCosptr;
+ public Target.Floaty outCos;
public Target.Floaty out;
}
private void checkSincosFloatFloatFloat() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb8748e13e46c48d4l, false);
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocOutCosptr(outCosptr);
+ script.set_gAllocOutCos(outCos);
script.forEach_testSincosFloatFloatFloat(inV, out);
- verifyResultsSincosFloatFloatFloat(inV, outCosptr, out, false);
+ verifyResultsSincosFloatFloatFloat(inV, outCos, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSincosFloatFloatFloat: " + e.toString());
}
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocOutCosptr(outCosptr);
+ scriptRelaxed.set_gAllocOutCos(outCos);
scriptRelaxed.forEach_testSincosFloatFloatFloat(inV, out);
- verifyResultsSincosFloatFloatFloat(inV, outCosptr, out, true);
+ verifyResultsSincosFloatFloatFloat(inV, outCos, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSincosFloatFloatFloat: " + e.toString());
}
}
- private void verifyResultsSincosFloatFloatFloat(Allocation inV, Allocation outCosptr, Allocation out, boolean relaxed) {
+ private void verifyResultsSincosFloatFloatFloat(Allocation inV, Allocation outCos, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
- float[] arrayOutCosptr = new float[INPUTSIZE * 1];
- outCosptr.copyTo(arrayOutCosptr);
+ float[] arrayOutCos = new float[INPUTSIZE * 1];
+ outCos.copyTo(arrayOutCos);
float[] arrayOut = new float[INPUTSIZE * 1];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -79,7 +79,7 @@
CoreMathVerifier.computeSincos(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 1 + j])) {
+ if (!args.outCos.couldBe(arrayOutCos[i * 1 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,13 +91,13 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outCosptr: ");
- message.append(args.outCosptr.toString());
+ message.append("Expected output outCos: ");
+ message.append(args.outCos.toString());
message.append("\n");
- message.append("Actual output outCosptr: ");
+ message.append("Actual output outCos: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutCosptr[i * 1 + j], Float.floatToRawIntBits(arrayOutCosptr[i * 1 + j]), arrayOutCosptr[i * 1 + j]));
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 1 + j])) {
+ arrayOutCos[i * 1 + j], Float.floatToRawIntBits(arrayOutCos[i * 1 + j]), arrayOutCos[i * 1 + j]));
+ if (!args.outCos.couldBe(arrayOutCos[i * 1 + j])) {
message.append(" FAIL");
}
message.append("\n");
@@ -121,30 +121,30 @@
private void checkSincosFloat2Float2Float2() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc85bab4e3e2fc77cl, false);
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocOutCosptr(outCosptr);
+ script.set_gAllocOutCos(outCos);
script.forEach_testSincosFloat2Float2Float2(inV, out);
- verifyResultsSincosFloat2Float2Float2(inV, outCosptr, out, false);
+ verifyResultsSincosFloat2Float2Float2(inV, outCos, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSincosFloat2Float2Float2: " + e.toString());
}
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocOutCosptr(outCosptr);
+ scriptRelaxed.set_gAllocOutCos(outCos);
scriptRelaxed.forEach_testSincosFloat2Float2Float2(inV, out);
- verifyResultsSincosFloat2Float2Float2(inV, outCosptr, out, true);
+ verifyResultsSincosFloat2Float2Float2(inV, outCos, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSincosFloat2Float2Float2: " + e.toString());
}
}
- private void verifyResultsSincosFloat2Float2Float2(Allocation inV, Allocation outCosptr, Allocation out, boolean relaxed) {
+ private void verifyResultsSincosFloat2Float2Float2(Allocation inV, Allocation outCos, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
- float[] arrayOutCosptr = new float[INPUTSIZE * 2];
- outCosptr.copyTo(arrayOutCosptr);
+ float[] arrayOutCos = new float[INPUTSIZE * 2];
+ outCos.copyTo(arrayOutCos);
float[] arrayOut = new float[INPUTSIZE * 2];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -157,7 +157,7 @@
CoreMathVerifier.computeSincos(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 2 + j])) {
+ if (!args.outCos.couldBe(arrayOutCos[i * 2 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -169,13 +169,13 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outCosptr: ");
- message.append(args.outCosptr.toString());
+ message.append("Expected output outCos: ");
+ message.append(args.outCos.toString());
message.append("\n");
- message.append("Actual output outCosptr: ");
+ message.append("Actual output outCos: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutCosptr[i * 2 + j], Float.floatToRawIntBits(arrayOutCosptr[i * 2 + j]), arrayOutCosptr[i * 2 + j]));
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 2 + j])) {
+ arrayOutCos[i * 2 + j], Float.floatToRawIntBits(arrayOutCos[i * 2 + j]), arrayOutCos[i * 2 + j]));
+ if (!args.outCos.couldBe(arrayOutCos[i * 2 + j])) {
message.append(" FAIL");
}
message.append("\n");
@@ -199,30 +199,30 @@
private void checkSincosFloat3Float3Float3() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1cc0896e400dc91dl, false);
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocOutCosptr(outCosptr);
+ script.set_gAllocOutCos(outCos);
script.forEach_testSincosFloat3Float3Float3(inV, out);
- verifyResultsSincosFloat3Float3Float3(inV, outCosptr, out, false);
+ verifyResultsSincosFloat3Float3Float3(inV, outCos, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSincosFloat3Float3Float3: " + e.toString());
}
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocOutCosptr(outCosptr);
+ scriptRelaxed.set_gAllocOutCos(outCos);
scriptRelaxed.forEach_testSincosFloat3Float3Float3(inV, out);
- verifyResultsSincosFloat3Float3Float3(inV, outCosptr, out, true);
+ verifyResultsSincosFloat3Float3Float3(inV, outCos, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSincosFloat3Float3Float3: " + e.toString());
}
}
- private void verifyResultsSincosFloat3Float3Float3(Allocation inV, Allocation outCosptr, Allocation out, boolean relaxed) {
+ private void verifyResultsSincosFloat3Float3Float3(Allocation inV, Allocation outCos, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
- float[] arrayOutCosptr = new float[INPUTSIZE * 4];
- outCosptr.copyTo(arrayOutCosptr);
+ float[] arrayOutCos = new float[INPUTSIZE * 4];
+ outCos.copyTo(arrayOutCos);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -235,7 +235,7 @@
CoreMathVerifier.computeSincos(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 4 + j])) {
+ if (!args.outCos.couldBe(arrayOutCos[i * 4 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -247,13 +247,13 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outCosptr: ");
- message.append(args.outCosptr.toString());
+ message.append("Expected output outCos: ");
+ message.append(args.outCos.toString());
message.append("\n");
- message.append("Actual output outCosptr: ");
+ message.append("Actual output outCos: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutCosptr[i * 4 + j], Float.floatToRawIntBits(arrayOutCosptr[i * 4 + j]), arrayOutCosptr[i * 4 + j]));
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 4 + j])) {
+ arrayOutCos[i * 4 + j], Float.floatToRawIntBits(arrayOutCos[i * 4 + j]), arrayOutCos[i * 4 + j]));
+ if (!args.outCos.couldBe(arrayOutCos[i * 4 + j])) {
message.append(" FAIL");
}
message.append("\n");
@@ -277,30 +277,30 @@
private void checkSincosFloat4Float4Float4() {
Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x7125678e41ebcabel, false);
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocOutCosptr(outCosptr);
+ script.set_gAllocOutCos(outCos);
script.forEach_testSincosFloat4Float4Float4(inV, out);
- verifyResultsSincosFloat4Float4Float4(inV, outCosptr, out, false);
+ verifyResultsSincosFloat4Float4Float4(inV, outCos, out, false);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSincosFloat4Float4Float4: " + e.toString());
}
try {
- Allocation outCosptr = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
+ Allocation outCos = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocOutCosptr(outCosptr);
+ scriptRelaxed.set_gAllocOutCos(outCos);
scriptRelaxed.forEach_testSincosFloat4Float4Float4(inV, out);
- verifyResultsSincosFloat4Float4Float4(inV, outCosptr, out, true);
+ verifyResultsSincosFloat4Float4Float4(inV, outCos, out, true);
} catch (Exception e) {
throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSincosFloat4Float4Float4: " + e.toString());
}
}
- private void verifyResultsSincosFloat4Float4Float4(Allocation inV, Allocation outCosptr, Allocation out, boolean relaxed) {
+ private void verifyResultsSincosFloat4Float4Float4(Allocation inV, Allocation outCos, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
- float[] arrayOutCosptr = new float[INPUTSIZE * 4];
- outCosptr.copyTo(arrayOutCosptr);
+ float[] arrayOutCos = new float[INPUTSIZE * 4];
+ outCos.copyTo(arrayOutCos);
float[] arrayOut = new float[INPUTSIZE * 4];
out.copyTo(arrayOut);
for (int i = 0; i < INPUTSIZE; i++) {
@@ -313,7 +313,7 @@
CoreMathVerifier.computeSincos(args, target);
// Validate the outputs.
boolean valid = true;
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 4 + j])) {
+ if (!args.outCos.couldBe(arrayOutCos[i * 4 + j])) {
valid = false;
}
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -325,13 +325,13 @@
message.append(String.format("%14.8g {%8x} %15a",
args.inV, Float.floatToRawIntBits(args.inV), args.inV));
message.append("\n");
- message.append("Expected output outCosptr: ");
- message.append(args.outCosptr.toString());
+ message.append("Expected output outCos: ");
+ message.append(args.outCos.toString());
message.append("\n");
- message.append("Actual output outCosptr: ");
+ message.append("Actual output outCos: ");
message.append(String.format("%14.8g {%8x} %15a",
- arrayOutCosptr[i * 4 + j], Float.floatToRawIntBits(arrayOutCosptr[i * 4 + j]), arrayOutCosptr[i * 4 + j]));
- if (!args.outCosptr.couldBe(arrayOutCosptr[i * 4 + j])) {
+ arrayOutCos[i * 4 + j], Float.floatToRawIntBits(arrayOutCos[i * 4 + j]), arrayOutCos[i * 4 + j]));
+ if (!args.outCos.couldBe(arrayOutCos[i * 4 + j])) {
message.append(" FAIL");
}
message.append("\n");
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSincos.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSincos.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestSincos.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSincos.rs
index 82ff9cd..8bad9df 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSincos.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSincos.rs
@@ -19,32 +19,32 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-rs_allocation gAllocOutCosptr;
+rs_allocation gAllocOutCos;
float __attribute__((kernel)) testSincosFloatFloatFloat(float inV, unsigned int x) {
- float outCosptr = 0;
- float out = sincos(inV, &outCosptr);
- rsSetElementAt_float(gAllocOutCosptr, outCosptr, x);
+ float outCos = 0;
+ float out = sincos(inV, &outCos);
+ rsSetElementAt_float(gAllocOutCos, outCos, x);
return out;
}
float2 __attribute__((kernel)) testSincosFloat2Float2Float2(float2 inV, unsigned int x) {
- float2 outCosptr = 0;
- float2 out = sincos(inV, &outCosptr);
- rsSetElementAt_float2(gAllocOutCosptr, outCosptr, x);
+ float2 outCos = 0;
+ float2 out = sincos(inV, &outCos);
+ rsSetElementAt_float2(gAllocOutCos, outCos, x);
return out;
}
float3 __attribute__((kernel)) testSincosFloat3Float3Float3(float3 inV, unsigned int x) {
- float3 outCosptr = 0;
- float3 out = sincos(inV, &outCosptr);
- rsSetElementAt_float3(gAllocOutCosptr, outCosptr, x);
+ float3 outCos = 0;
+ float3 out = sincos(inV, &outCos);
+ rsSetElementAt_float3(gAllocOutCos, outCos, x);
return out;
}
float4 __attribute__((kernel)) testSincosFloat4Float4Float4(float4 inV, unsigned int x) {
- float4 outCosptr = 0;
- float4 out = sincos(inV, &outCosptr);
- rsSetElementAt_float4(gAllocOutCosptr, outCosptr, x);
+ float4 outCos = 0;
+ float4 out = sincos(inV, &outCos);
+ rsSetElementAt_float4(gAllocOutCos, outCos, x);
return out;
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSincosRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSincosRelaxed.rs
index 66f3fef..ab3359b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSincosRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestSincos.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinh.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinh.java
index 77c467c..459da75 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinh.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestSinh extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestSinh script;
+ private ScriptC_GeneratedTestSinhRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestSinh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestSinhRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkSinhFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x20bbe226bda70dd1l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testSinhFloatFloat(inV, out);
+ verifyResultsSinhFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testSinhFloatFloat(inV, out);
+ verifyResultsSinhFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinhFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSinh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkSinhFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkSinhFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x6cdf1f16900d0b6dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testSinhFloat2Float2(inV, out);
+ verifyResultsSinhFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testSinhFloat2Float2(inV, out);
+ verifyResultsSinhFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinhFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSinh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkSinhFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkSinhFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6ce0e83186282c4bl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testSinhFloat3Float3(inV, out);
+ verifyResultsSinhFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testSinhFloat3Float3(inV, out);
+ verifyResultsSinhFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinhFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSinh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkSinhFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkSinhFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6ce2b14c7c434d29l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testSinhFloat4Float4(inV, out);
+ verifyResultsSinhFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testSinhFloat4Float4(inV, out);
+ verifyResultsSinhFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinhFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSinh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkSinhFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testSinh() {
+ checkSinhFloatFloat();
+ checkSinhFloat2Float2();
+ checkSinhFloat3Float3();
+ checkSinhFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinh.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinh.rs
index 1024943..1624bd2 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinh.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testSinhFloatFloat(float inV) {
+ return sinh(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testSinhFloat2Float2(float2 inV) {
+ return sinh(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testSinhFloat3Float3(float3 inV) {
+ return sinh(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testSinhFloat4Float4(float4 inV) {
+ return sinh(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinhRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinhRelaxed.rs
index 66f3fef..31ca12b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinhRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestSinh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinpi.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinpi.java
index 77c467c..12a4c12 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinpi.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestSinpi extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestSinpi script;
+ private ScriptC_GeneratedTestSinpiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestSinpi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestSinpiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkSinpiFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xde281c14dfd6b42cl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testSinpiFloatFloat(inV, out);
+ verifyResultsSinpiFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testSinpiFloatFloat(inV, out);
+ verifyResultsSinpiFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinpiFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSinpi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkSinpiFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkSinpiFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x8f8d880b7a3592b0l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testSinpiFloat2Float2(inV, out);
+ verifyResultsSinpiFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testSinpiFloat2Float2(inV, out);
+ verifyResultsSinpiFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinpiFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSinpi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkSinpiFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkSinpiFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x8f8f51267050b38el, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testSinpiFloat3Float3(inV, out);
+ verifyResultsSinpiFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testSinpiFloat3Float3(inV, out);
+ verifyResultsSinpiFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinpiFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSinpi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkSinpiFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkSinpiFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x8f911a41666bd46cl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testSinpiFloat4Float4(inV, out);
+ verifyResultsSinpiFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testSinpiFloat4Float4(inV, out);
+ verifyResultsSinpiFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSinpiFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSinpi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkSinpiFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testSinpi() {
+ checkSinpiFloatFloat();
+ checkSinpiFloat2Float2();
+ checkSinpiFloat3Float3();
+ checkSinpiFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSinpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinpi.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestSinpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinpi.rs
index 367040e..9ebbb05 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSinpi.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinpi.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testSinpiFloatFloat(float in) {
- return sinpi(in);
+float __attribute__((kernel)) testSinpiFloatFloat(float inV) {
+ return sinpi(inV);
}
-float2 __attribute__((kernel)) testSinpiFloat2Float2(float2 in) {
- return sinpi(in);
+float2 __attribute__((kernel)) testSinpiFloat2Float2(float2 inV) {
+ return sinpi(inV);
}
-float3 __attribute__((kernel)) testSinpiFloat3Float3(float3 in) {
- return sinpi(in);
+float3 __attribute__((kernel)) testSinpiFloat3Float3(float3 inV) {
+ return sinpi(inV);
}
-float4 __attribute__((kernel)) testSinpiFloat4Float4(float4 in) {
- return sinpi(in);
+float4 __attribute__((kernel)) testSinpiFloat4Float4(float4 inV) {
+ return sinpi(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinpiRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinpiRelaxed.rs
index 66f3fef..9745638 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSinpiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestSinpi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSqrt.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSqrt.java
index 77c467c..cbe47fe 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSqrt.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestSqrt extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestSqrt script;
+ private ScriptC_GeneratedTestSqrtRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestSqrt(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestSqrtRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkSqrtFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xdd88d60ed07c9951l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testSqrtFloatFloat(inV, out);
+ verifyResultsSqrtFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testSqrtFloatFloat(inV, out);
+ verifyResultsSqrtFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSqrtFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSqrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkSqrtFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkSqrtFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x112cc64698699aedl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testSqrtFloat2Float2(inV, out);
+ verifyResultsSqrtFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testSqrtFloat2Float2(inV, out);
+ verifyResultsSqrtFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSqrtFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSqrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkSqrtFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkSqrtFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x112e8f618e84bbcbl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testSqrtFloat3Float3(inV, out);
+ verifyResultsSqrtFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testSqrtFloat3Float3(inV, out);
+ verifyResultsSqrtFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSqrtFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSqrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkSqrtFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkSqrtFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x1130587c849fdca9l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testSqrtFloat4Float4(inV, out);
+ verifyResultsSqrtFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testSqrtFloat4Float4(inV, out);
+ verifyResultsSqrtFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsSqrtFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeSqrt(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkSqrtFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testSqrt() {
+ checkSqrtFloatFloat();
+ checkSqrtFloat2Float2();
+ checkSqrtFloat3Float3();
+ checkSqrtFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSqrt.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSqrt.rs
index 1024943..dfae82a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSqrt.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testSqrtFloatFloat(float inV) {
+ return sqrt(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testSqrtFloat2Float2(float2 inV) {
+ return sqrt(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testSqrtFloat3Float3(float3 inV) {
+ return sqrt(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testSqrtFloat4Float4(float4 inV) {
+ return sqrt(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSqrtRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSqrtRelaxed.rs
index 66f3fef..9bb61e5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestSqrtRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestSqrt.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestStep.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestStep.java
similarity index 99%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestStep.java
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestStep.java
index dabfd45..3873a2b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestStep.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestStep.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestStep extends RSBaseCompute {
+public class GeneratedTestStep extends RSBaseCompute {
- private ScriptC_TestStep script;
- private ScriptC_TestStepRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestStep script;
+ private ScriptC_GeneratedTestStepRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestStep(mRS);
- scriptRelaxed = new ScriptC_TestStepRelaxed(mRS);
+ script = new ScriptC_GeneratedTestStep(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestStepRelaxed(mRS);
}
public class ArgumentsFloatFloatFloat {
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestStep.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestStep.rs
similarity index 100%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestStep.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestStep.rs
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestStepRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestStepRelaxed.rs
index 66f3fef..20c4adb 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestStepRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestStep.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTan.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTan.java
index 77c467c..a90819d 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTan.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestTan extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestTan script;
+ private ScriptC_GeneratedTestTanRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestTan(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestTanRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkTanFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x4222fe257bb50fa4l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testTanFloatFloat(inV, out);
+ verifyResultsTanFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testTanFloatFloat(inV, out);
+ verifyResultsTanFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTan(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkTanFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkTanFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xae98520143383868l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testTanFloat2Float2(inV, out);
+ verifyResultsTanFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testTanFloat2Float2(inV, out);
+ verifyResultsTanFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTan(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkTanFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkTanFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xae9a1b1c39535946l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testTanFloat3Float3(inV, out);
+ verifyResultsTanFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testTanFloat3Float3(inV, out);
+ verifyResultsTanFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTan(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkTanFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkTanFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xae9be4372f6e7a24l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testTanFloat4Float4(inV, out);
+ verifyResultsTanFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testTanFloat4Float4(inV, out);
+ verifyResultsTanFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTan(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkTanFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testTan() {
+ checkTanFloatFloat();
+ checkTanFloat2Float2();
+ checkTanFloat3Float3();
+ checkTanFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTan.rs
similarity index 70%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTan.rs
index 80c8708..4190d54 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTan.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testCeilFloatFloat(float in) {
- return ceil(in);
+float __attribute__((kernel)) testTanFloatFloat(float inV) {
+ return tan(inV);
}
-float2 __attribute__((kernel)) testCeilFloat2Float2(float2 in) {
- return ceil(in);
+float2 __attribute__((kernel)) testTanFloat2Float2(float2 inV) {
+ return tan(inV);
}
-float3 __attribute__((kernel)) testCeilFloat3Float3(float3 in) {
- return ceil(in);
+float3 __attribute__((kernel)) testTanFloat3Float3(float3 inV) {
+ return tan(inV);
}
-float4 __attribute__((kernel)) testCeilFloat4Float4(float4 in) {
- return ceil(in);
+float4 __attribute__((kernel)) testTanFloat4Float4(float4 inV) {
+ return tan(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanRelaxed.rs
index 66f3fef..00374ce 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestTan.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanh.java
similarity index 78%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanh.java
index 77c467c..bdfe88a 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanh.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestTanh extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestTanh script;
+ private ScriptC_GeneratedTestTanhRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestTanh(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestTanhRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkTanhFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xaa47c1d7594bc87al, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testTanhFloatFloat(inV, out);
+ verifyResultsTanhFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testTanhFloatFloat(inV, out);
+ verifyResultsTanhFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanhFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTanh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkTanhFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkTanhFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xe021c1aab8d53a0el, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testTanhFloat2Float2(inV, out);
+ verifyResultsTanhFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testTanhFloat2Float2(inV, out);
+ verifyResultsTanhFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanhFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTanh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkTanhFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkTanhFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xe0238ac5aef05aecl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testTanhFloat3Float3(inV, out);
+ verifyResultsTanhFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testTanhFloat3Float3(inV, out);
+ verifyResultsTanhFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanhFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTanh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkTanhFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkTanhFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xe02553e0a50b7bcal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testTanhFloat4Float4(inV, out);
+ verifyResultsTanhFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testTanhFloat4Float4(inV, out);
+ verifyResultsTanhFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanhFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTanh(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkTanhFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testTanh() {
+ checkTanhFloatFloat();
+ checkTanhFloat2Float2();
+ checkTanhFloat3Float3();
+ checkTanhFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanh.rs
similarity index 69%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanh.rs
index 1024943..5855222 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanh.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testTanhFloatFloat(float inV) {
+ return tanh(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testTanhFloat2Float2(float2 inV) {
+ return tanh(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testTanhFloat3Float3(float3 inV) {
+ return tanh(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testTanhFloat4Float4(float4 inV) {
+ return tanh(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanhRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanhRelaxed.rs
index 66f3fef..37bd435 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanhRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestTanh.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanpi.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanpi.java
index 77c467c..f05b2c1 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanpi.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestTanpi extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestTanpi script;
+ private ScriptC_GeneratedTestTanpiRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestTanpi(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestTanpiRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkTanpiFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf8a6aebf04820e8fl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testTanpiFloatFloat(inV, out);
+ verifyResultsTanpiFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testTanpiFloatFloat(inV, out);
+ verifyResultsTanpiFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanpiFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTanpi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkTanpiFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkTanpiFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xebbed6ee53d567bbl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testTanpiFloat2Float2(inV, out);
+ verifyResultsTanpiFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testTanpiFloat2Float2(inV, out);
+ verifyResultsTanpiFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanpiFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTanpi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkTanpiFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkTanpiFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xebc0a00949f08899l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testTanpiFloat3Float3(inV, out);
+ verifyResultsTanpiFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testTanpiFloat3Float3(inV, out);
+ verifyResultsTanpiFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanpiFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTanpi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkTanpiFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkTanpiFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xebc26924400ba977l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testTanpiFloat4Float4(inV, out);
+ verifyResultsTanpiFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testTanpiFloat4Float4(inV, out);
+ verifyResultsTanpiFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTanpiFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTanpi(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkTanpiFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testTanpi() {
+ checkTanpiFloatFloat();
+ checkTanpiFloat2Float2();
+ checkTanpiFloat3Float3();
+ checkTanpiFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTanpi.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanpi.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestTanpi.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanpi.rs
index 883a571..2fa56e2 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTanpi.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanpi.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanpiFloatFloat(float in) {
- return tanpi(in);
+float __attribute__((kernel)) testTanpiFloatFloat(float inV) {
+ return tanpi(inV);
}
-float2 __attribute__((kernel)) testTanpiFloat2Float2(float2 in) {
- return tanpi(in);
+float2 __attribute__((kernel)) testTanpiFloat2Float2(float2 inV) {
+ return tanpi(inV);
}
-float3 __attribute__((kernel)) testTanpiFloat3Float3(float3 in) {
- return tanpi(in);
+float3 __attribute__((kernel)) testTanpiFloat3Float3(float3 inV) {
+ return tanpi(inV);
}
-float4 __attribute__((kernel)) testTanpiFloat4Float4(float4 in) {
- return tanpi(in);
+float4 __attribute__((kernel)) testTanpiFloat4Float4(float4 inV) {
+ return tanpi(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanpiRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanpiRelaxed.rs
index 66f3fef..a7e3df5 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTanpiRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestTanpi.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTgamma.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTgamma.java
index 77c467c..feba850 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTgamma.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestTgamma extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestTgamma script;
+ private ScriptC_GeneratedTestTgammaRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestTgamma(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestTgammaRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkTgammaFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x5c02c6a0eda55486l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testTgammaFloatFloat(inV, out);
+ verifyResultsTgammaFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testTgammaFloatFloat(inV, out);
+ verifyResultsTgammaFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTgammaFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTgamma(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkTgammaFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkTgammaFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x8fe7559b3399bcbal, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testTgammaFloat2Float2(inV, out);
+ verifyResultsTgammaFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testTgammaFloat2Float2(inV, out);
+ verifyResultsTgammaFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTgammaFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTgamma(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkTgammaFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkTgammaFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x8fe91eb629b4dd98l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testTgammaFloat3Float3(inV, out);
+ verifyResultsTgammaFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testTgammaFloat3Float3(inV, out);
+ verifyResultsTgammaFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTgammaFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTgamma(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkTgammaFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkTgammaFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x8feae7d11fcffe76l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testTgammaFloat4Float4(inV, out);
+ verifyResultsTgammaFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testTgammaFloat4Float4(inV, out);
+ verifyResultsTgammaFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTgammaFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTgamma(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkTgammaFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testTgamma() {
+ checkTgammaFloatFloat();
+ checkTgammaFloat2Float2();
+ checkTgammaFloat3Float3();
+ checkTgammaFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTgamma.rs
similarity index 68%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTgamma.rs
index 1024943..b27b7d4 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTgamma.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTanFloatFloat(float in) {
- return tan(in);
+float __attribute__((kernel)) testTgammaFloatFloat(float inV) {
+ return tgamma(inV);
}
-float2 __attribute__((kernel)) testTanFloat2Float2(float2 in) {
- return tan(in);
+float2 __attribute__((kernel)) testTgammaFloat2Float2(float2 inV) {
+ return tgamma(inV);
}
-float3 __attribute__((kernel)) testTanFloat3Float3(float3 in) {
- return tan(in);
+float3 __attribute__((kernel)) testTgammaFloat3Float3(float3 inV) {
+ return tgamma(inV);
}
-float4 __attribute__((kernel)) testTanFloat4Float4(float4 in) {
- return tan(in);
+float4 __attribute__((kernel)) testTgammaFloat4Float4(float4 inV) {
+ return tgamma(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTgammaRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTgammaRelaxed.rs
index 66f3fef..8f5d63b 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTgammaRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestTgamma.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTrunc.java
similarity index 76%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTrunc.java
index 77c467c..0f80d61 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSign.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTrunc.java
@@ -22,16 +22,16 @@
import android.renderscript.RSRuntimeException;
import android.renderscript.Element;
-public class TestSign extends RSBaseCompute {
+public class GeneratedTestTrunc extends RSBaseCompute {
- private ScriptC_TestSign script;
- private ScriptC_TestSignRelaxed scriptRelaxed;
+ private ScriptC_GeneratedTestTrunc script;
+ private ScriptC_GeneratedTestTruncRelaxed scriptRelaxed;
@Override
protected void setUp() throws Exception {
super.setUp();
- script = new ScriptC_TestSign(mRS);
- scriptRelaxed = new ScriptC_TestSignRelaxed(mRS);
+ script = new ScriptC_GeneratedTestTrunc(mRS);
+ scriptRelaxed = new ScriptC_GeneratedTestTruncRelaxed(mRS);
}
public class ArgumentsFloatFloat {
@@ -39,25 +39,25 @@
public Target.Floaty out;
}
- private void checkSignFloatFloat() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xadc8bc2f364ea474l, false);
+ private void checkTruncFloatFloat() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb16f216b11eebe01l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, false);
+ script.forEach_testTruncFloatFloat(inV, out);
+ verifyResultsTruncFloatFloat(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloatFloat: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloatFloat(inV, out);
- verifyResultsSignFloatFloat(inV, out, true);
+ scriptRelaxed.forEach_testTruncFloatFloat(inV, out);
+ verifyResultsTruncFloatFloat(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloatFloat: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloatFloat: " + e.toString());
}
}
- private void verifyResultsSignFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTruncFloatFloat(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 1];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 1];
@@ -69,7 +69,7 @@
args.inV = arrayInV[i];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTrunc(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 1 + j])) {
@@ -91,32 +91,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloatFloat" +
+ assertTrue("Incorrect output for checkTruncFloatFloat" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat2Float2() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2eb1e646027c0ab8l, false);
+ private void checkTruncFloat2Float2() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x8b83139b49d4961dl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, false);
+ script.forEach_testTruncFloat2Float2(inV, out);
+ verifyResultsTruncFloat2Float2(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat2Float2: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat2Float2(inV, out);
- verifyResultsSignFloat2Float2(inV, out, true);
+ scriptRelaxed.forEach_testTruncFloat2Float2(inV, out);
+ verifyResultsTruncFloat2Float2(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat2Float2: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat2Float2: " + e.toString());
}
}
- private void verifyResultsSignFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTruncFloat2Float2(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 2];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 2];
@@ -128,7 +128,7 @@
args.inV = arrayInV[i * 2 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTrunc(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 2 + j])) {
@@ -150,32 +150,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat2Float2" +
+ assertTrue("Incorrect output for checkTruncFloat2Float2" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat3Float3() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x2eb3af60f8972b96l, false);
+ private void checkTruncFloat3Float3() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x8b84dcb63fefb6fbl, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, false);
+ script.forEach_testTruncFloat3Float3(inV, out);
+ verifyResultsTruncFloat3Float3(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat3Float3: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat3Float3(inV, out);
- verifyResultsSignFloat3Float3(inV, out, true);
+ scriptRelaxed.forEach_testTruncFloat3Float3(inV, out);
+ verifyResultsTruncFloat3Float3(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat3Float3: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat3Float3: " + e.toString());
}
}
- private void verifyResultsSignFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTruncFloat3Float3(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -187,7 +187,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTrunc(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -209,32 +209,32 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat3Float3" +
+ assertTrue("Incorrect output for checkTruncFloat3Float3" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- private void checkSignFloat4Float4() {
- Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x2eb5787beeb24c74l, false);
+ private void checkTruncFloat4Float4() {
+ Allocation inV = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x8b86a5d1360ad7d9l, false);
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, false);
+ script.forEach_testTruncFloat4Float4(inV, out);
+ verifyResultsTruncFloat4Float4(inV, out, false);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat4Float4: " + e.toString());
}
try {
Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSignFloat4Float4(inV, out);
- verifyResultsSignFloat4Float4(inV, out, true);
+ scriptRelaxed.forEach_testTruncFloat4Float4(inV, out);
+ verifyResultsTruncFloat4Float4(inV, out, true);
} catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSignFloat4Float4: " + e.toString());
+ throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat4Float4: " + e.toString());
}
}
- private void verifyResultsSignFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
+ private void verifyResultsTruncFloat4Float4(Allocation inV, Allocation out, boolean relaxed) {
float[] arrayInV = new float[INPUTSIZE * 4];
inV.copyTo(arrayInV);
float[] arrayOut = new float[INPUTSIZE * 4];
@@ -246,7 +246,7 @@
args.inV = arrayInV[i * 4 + j];
// Figure out what the outputs should have been.
Target target = new Target(relaxed);
- CoreMathVerifier.computeSign(args, target);
+ CoreMathVerifier.computeTrunc(args, target);
// Validate the outputs.
boolean valid = true;
if (!args.out.couldBe(arrayOut[i * 4 + j])) {
@@ -268,17 +268,17 @@
message.append(" FAIL");
}
message.append("\n");
- assertTrue("Incorrect output for checkSignFloat4Float4" +
+ assertTrue("Incorrect output for checkTruncFloat4Float4" +
(relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
}
}
}
}
- public void testSign() {
- checkSignFloatFloat();
- checkSignFloat2Float2();
- checkSignFloat3Float3();
- checkSignFloat4Float4();
+ public void testTrunc() {
+ checkTruncFloatFloat();
+ checkTruncFloat2Float2();
+ checkTruncFloat3Float3();
+ checkTruncFloat4Float4();
}
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTrunc.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTrunc.rs
similarity index 69%
rename from tests/tests/renderscript/src/android/renderscript/cts/TestTrunc.rs
rename to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTrunc.rs
index 2422ae4..89d959e 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTrunc.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTrunc.rs
@@ -20,18 +20,18 @@
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-float __attribute__((kernel)) testTruncFloatFloat(float in) {
- return trunc(in);
+float __attribute__((kernel)) testTruncFloatFloat(float inV) {
+ return trunc(inV);
}
-float2 __attribute__((kernel)) testTruncFloat2Float2(float2 in) {
- return trunc(in);
+float2 __attribute__((kernel)) testTruncFloat2Float2(float2 inV) {
+ return trunc(inV);
}
-float3 __attribute__((kernel)) testTruncFloat3Float3(float3 in) {
- return trunc(in);
+float3 __attribute__((kernel)) testTruncFloat3Float3(float3 inV) {
+ return trunc(inV);
}
-float4 __attribute__((kernel)) testTruncFloat4Float4(float4 in) {
- return trunc(in);
+float4 __attribute__((kernel)) testTruncFloat4Float4(float4 inV) {
+ return trunc(inV);
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTruncRelaxed.rs
similarity index 95%
copy from tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
copy to tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTruncRelaxed.rs
index 66f3fef..eb18613 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCosRelaxed.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/GeneratedTestTruncRelaxed.rs
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "TestNativeCos.rs"
+#include "GeneratedTestTrunc.rs"
#pragma rs_fp_relaxed
// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/IntrinsicResize.java b/tests/tests/renderscript/src/android/renderscript/cts/IntrinsicResize.java
index d593bff..9028c37 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/IntrinsicResize.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/IntrinsicResize.java
@@ -67,8 +67,24 @@
sr.forEach_bicubic_U1(mAllocDst);
break;
}
+ } else {
+ switch(vecSize) {
+ case 4:
+ sr.forEach_bicubic_F4(mAllocDst);
+ break;
+ case 3:
+ sr.forEach_bicubic_F3(mAllocDst);
+ break;
+ case 2:
+ sr.forEach_bicubic_F2(mAllocDst);
+ break;
+ case 1:
+ sr.forEach_bicubic_F1(mAllocDst);
+ break;
+ }
}
+
mVerify.invoke_verify(mAllocRef, mAllocDst, mAllocSrc);
if (outW == w && outH == h) {
//when scale = 1, check with the original.
@@ -248,4 +264,176 @@
testReszie(inX, inY, Element.DataType.UNSIGNED_8, 1, 0.5f, 0.5f);
checkError();
}
+
+
+ public void test_F32_4_SCALE10_10_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 4, 1.f, 1.f);
+ checkError();
+ }
+ public void test_F32_3_SCALE10_10_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 3, 1.f, 1.f);
+ checkError();
+ }
+ public void test_F32_2_SCALE10_10_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 2, 1.f, 1.f);
+ checkError();
+ }
+ public void test_F32_1_SCALE10_10_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 1, 1.f, 1.f);
+ checkError();
+ }
+
+ public void test_F32_4_SCALE20_20_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 4, 2.f, 2.f);
+ checkError();
+ }
+ public void test_F32_3_SCALE20_20_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 3, 2.f, 2.f);
+ checkError();
+ }
+ public void test_F32_2_SCALE20_20_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 2, 2.f, 2.f);
+ checkError();
+ }
+ public void test_F32_1_SCALE20_20_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 1, 2.f, 2.f);
+ checkError();
+ }
+
+ public void test_F32_4_SCALE05_20_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 4, 0.5f, 2.f);
+ checkError();
+ }
+ public void test_F32_3_SCALE05_20_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 3, 0.5f, 2.f);
+ checkError();
+ }
+ public void test_F32_2_SCALE05_20_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 2, 0.5f, 2.f);
+ checkError();
+ }
+ public void test_F32_1_SCALE05_20_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 1, 0.5f, 2.f);
+ checkError();
+ }
+
+ public void test_F32_4_SCALE20_05_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 4, 2.f, 0.5f);
+ checkError();
+ }
+ public void test_F32_3_SCALE20_05_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 3, 2.f, 0.5f);
+ checkError();
+ }
+ public void test_F32_2_SCALE20_05_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 2, 2.f, 0.5f);
+ checkError();
+ }
+ public void test_F32_1_SCALE20_05_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 1, 2.f, 0.5f);
+ checkError();
+ }
+
+ public void test_F32_4_SCALE05_05_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 4, 0.5f, 0.5f);
+ checkError();
+ }
+ public void test_F32_3_SCALE05_05_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 3, 0.5f, 0.5f);
+ checkError();
+ }
+ public void test_F32_2_SCALE05_05_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 2, 0.5f, 0.5f);
+ checkError();
+ }
+ public void test_F32_1_SCALE05_05_inSqure() {
+ testReszie(inX, inX, Element.DataType.FLOAT_32, 1, 0.5f, 0.5f);
+ checkError();
+ }
+
+ public void test_F32_4_SCALE10_10_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 4, 1.f, 1.f);
+ checkError();
+ }
+ public void test_F32_3_SCALE10_10_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 3, 1.f, 1.f);
+ checkError();
+ }
+ public void test_F32_2_SCALE10_10_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 2, 1.f, 1.f);
+ checkError();
+ }
+ public void test_F32_1_SCALE10_10_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 1, 1.f, 1.f);
+ checkError();
+ }
+
+ public void test_F32_4_SCALE20_20_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 4, 2.f, 2.f);
+ checkError();
+ }
+ public void test_F32_3_SCALE20_20_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 3, 2.f, 2.f);
+ checkError();
+ }
+ public void test_F32_2_SCALE20_20_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 2, 2.f, 2.f);
+ checkError();
+ }
+ public void test_F32_1_SCALE20_20_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 1, 2.f, 2.f);
+ checkError();
+ }
+
+ public void test_F32_4_SCALE05_20_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 4, 0.5f, 2.f);
+ checkError();
+ }
+ public void test_F32_3_SCALE05_20_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 3, 0.5f, 2.f);
+ checkError();
+ }
+ public void test_F32_2_SCALE05_20_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 2, 0.5f, 2.f);
+ checkError();
+ }
+ public void test_F32_1_SCALE05_20_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 1, 0.5f, 2.f);
+ checkError();
+ }
+
+ public void test_F32_4_SCALE20_05_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 4, 2.f, 0.5f);
+ checkError();
+ }
+ public void test_F32_3_SCALE20_05_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 3, 2.f, 0.5f);
+ checkError();
+ }
+ public void test_F32_2_SCALE20_05_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 2, 2.f, 0.5f);
+ checkError();
+ }
+ public void test_F32_1_SCALE20_05_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 1, 2.f, 0.5f);
+ checkError();
+ }
+
+ public void test_F32_4_SCALE05_05_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 4, 0.5f, 0.5f);
+ checkError();
+ }
+ public void test_F32_3_SCALE05_05_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 3, 0.5f, 0.5f);
+ checkError();
+ }
+ public void test_F32_2_SCALE05_05_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 2, 0.5f, 0.5f);
+ checkError();
+ }
+ public void test_F32_1_SCALE05_05_inRectangle() {
+ testReszie(inX, inY, Element.DataType.FLOAT_32, 1, 0.5f, 0.5f);
+ checkError();
+ }
+
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/MatrixTest.rs b/tests/tests/renderscript/src/android/renderscript/cts/MatrixTest.rs
index f1dbc64..a71deef 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/MatrixTest.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/MatrixTest.rs
@@ -268,11 +268,13 @@
const float2 f2r = rsMatrixMultiply(&m2, f2);
const float3 f3r = rsMatrixMultiply(&m3, f3);
const float4 f4r = rsMatrixMultiply(&m4, f4);
+ const float4 f3m4r = rsMatrixMultiply(&m4, f3);
// rsMatrixMultiply returns (matrix * vector)
const float2 f2rExpectedValues = { 14.f, 24.f };
const float3 f3rExpectedValues = { 21.f, 31.f, 41.f };
const float4 f4rExpectedValues = {168.f, 298.f, 428.f, 558.f};
+ const float4 f3m4rExpectedValues = {35.0, 55.0, 75.0, 95.0};
for (int row = 0; row < 2; row++) {
EXPECT(row, 0, f2r[row], f2rExpectedValues[row]);
@@ -286,6 +288,10 @@
EXPECT(row, 0, f4r[row], f4rExpectedValues[row]);
}
+ for (int row = 0; row < 4; row++) {
+ EXPECT(row, 0, f3m4r[row], f3m4rExpectedValues[row]);
+ }
+
return failed;
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAbs.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAbs.rs
deleted file mode 100644
index 8f1747e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAbs.rs
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-uchar __attribute__((kernel)) testAbsCharUchar(char inValue) {
- return abs(inValue);
-}
-
-uchar2 __attribute__((kernel)) testAbsChar2Uchar2(char2 inValue) {
- return abs(inValue);
-}
-
-uchar3 __attribute__((kernel)) testAbsChar3Uchar3(char3 inValue) {
- return abs(inValue);
-}
-
-uchar4 __attribute__((kernel)) testAbsChar4Uchar4(char4 inValue) {
- return abs(inValue);
-}
-
-ushort __attribute__((kernel)) testAbsShortUshort(short inValue) {
- return abs(inValue);
-}
-
-ushort2 __attribute__((kernel)) testAbsShort2Ushort2(short2 inValue) {
- return abs(inValue);
-}
-
-ushort3 __attribute__((kernel)) testAbsShort3Ushort3(short3 inValue) {
- return abs(inValue);
-}
-
-ushort4 __attribute__((kernel)) testAbsShort4Ushort4(short4 inValue) {
- return abs(inValue);
-}
-
-uint __attribute__((kernel)) testAbsIntUint(int inValue) {
- return abs(inValue);
-}
-
-uint2 __attribute__((kernel)) testAbsInt2Uint2(int2 inValue) {
- return abs(inValue);
-}
-
-uint3 __attribute__((kernel)) testAbsInt3Uint3(int3 inValue) {
- return abs(inValue);
-}
-
-uint4 __attribute__((kernel)) testAbsInt4Uint4(int4 inValue) {
- return abs(inValue);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAbsRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAbsRelaxed.rs
deleted file mode 100644
index 437a467..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAbsRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAbs.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAcosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAcosRelaxed.rs
deleted file mode 100644
index 92fd9e8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAcosRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAcos.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAcosh.java b/tests/tests/renderscript/src/android/renderscript/cts/TestAcosh.java
deleted file mode 100644
index 1412c2e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAcosh.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestAcosh extends RSBaseCompute {
-
- private ScriptC_TestAcosh script;
- private ScriptC_TestAcoshRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestAcosh(mRS);
- scriptRelaxed = new ScriptC_TestAcoshRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkAcoshFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb2c74105f8e94ea7l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testAcoshFloatFloat(in, out);
- verifyResultsAcoshFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testAcoshFloatFloat(in, out);
- verifyResultsAcoshFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsAcoshFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeAcosh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkAcoshFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkAcoshFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x4123c61e7e518f4bl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testAcoshFloat2Float2(in, out);
- verifyResultsAcoshFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testAcoshFloat2Float2(in, out);
- verifyResultsAcoshFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsAcoshFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeAcosh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkAcoshFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkAcoshFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x4123d0bfdd5824e5l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testAcoshFloat3Float3(in, out);
- verifyResultsAcoshFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testAcoshFloat3Float3(in, out);
- verifyResultsAcoshFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsAcoshFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeAcosh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkAcoshFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkAcoshFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x4123db613c5eba7fl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testAcoshFloat4Float4(in, out);
- verifyResultsAcoshFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testAcoshFloat4Float4(in, out);
- verifyResultsAcoshFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAcoshFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsAcoshFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeAcosh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkAcoshFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testAcosh() {
- checkAcoshFloatFloat();
- checkAcoshFloat2Float2();
- checkAcoshFloat3Float3();
- checkAcoshFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAcosh.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAcosh.rs
deleted file mode 100644
index 9be2fa2..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAcosh.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testAcoshFloatFloat(float in) {
- return acosh(in);
-}
-
-float2 __attribute__((kernel)) testAcoshFloat2Float2(float2 in) {
- return acosh(in);
-}
-
-float3 __attribute__((kernel)) testAcoshFloat3Float3(float3 in) {
- return acosh(in);
-}
-
-float4 __attribute__((kernel)) testAcoshFloat4Float4(float4 in) {
- return acosh(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAcoshRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAcoshRelaxed.rs
deleted file mode 100644
index 269cec5..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAcoshRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAcosh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAcospiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAcospiRelaxed.rs
deleted file mode 100644
index 203fe7e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAcospiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAcospi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAsinRelaxed.rs
deleted file mode 100644
index f972148..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAsin.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinh.java b/tests/tests/renderscript/src/android/renderscript/cts/TestAsinh.java
deleted file mode 100644
index 90c26a0..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinh.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestAsinh extends RSBaseCompute {
-
- private ScriptC_TestAsinh script;
- private ScriptC_TestAsinhRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestAsinh(mRS);
- scriptRelaxed = new ScriptC_TestAsinhRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkAsinhFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3c94145f20a86cdal, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testAsinhFloatFloat(in, out);
- verifyResultsAsinhFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testAsinhFloatFloat(in, out);
- verifyResultsAsinhFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsAsinhFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeAsinh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkAsinhFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkAsinhFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x8986450e91b2ada6l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testAsinhFloat2Float2(in, out);
- verifyResultsAsinhFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testAsinhFloat2Float2(in, out);
- verifyResultsAsinhFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsAsinhFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeAsinh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkAsinhFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkAsinhFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x89864faff0b94340l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testAsinhFloat3Float3(in, out);
- verifyResultsAsinhFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testAsinhFloat3Float3(in, out);
- verifyResultsAsinhFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsAsinhFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeAsinh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkAsinhFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkAsinhFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x89865a514fbfd8dal, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testAsinhFloat4Float4(in, out);
- verifyResultsAsinhFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testAsinhFloat4Float4(in, out);
- verifyResultsAsinhFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testAsinhFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsAsinhFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeAsinh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkAsinhFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testAsinh() {
- checkAsinhFloatFloat();
- checkAsinhFloat2Float2();
- checkAsinhFloat3Float3();
- checkAsinhFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAsinhRelaxed.rs
deleted file mode 100644
index 7540ea8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAsinh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAsinpiRelaxed.rs
deleted file mode 100644
index aad672b..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAsinpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAsinpi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2.rs
deleted file mode 100644
index 877402d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocInX;
-
-float __attribute__((kernel)) testAtan2FloatFloatFloat(float inY, unsigned int x) {
- float inX = rsGetElementAt_float(gAllocInX, x);
- return atan2(inY, inX);
-}
-
-float2 __attribute__((kernel)) testAtan2Float2Float2Float2(float2 inY, unsigned int x) {
- float2 inX = rsGetElementAt_float2(gAllocInX, x);
- return atan2(inY, inX);
-}
-
-float3 __attribute__((kernel)) testAtan2Float3Float3Float3(float3 inY, unsigned int x) {
- float3 inX = rsGetElementAt_float3(gAllocInX, x);
- return atan2(inY, inX);
-}
-
-float4 __attribute__((kernel)) testAtan2Float4Float4Float4(float4 inY, unsigned int x) {
- float4 inX = rsGetElementAt_float4(gAllocInX, x);
- return atan2(inY, inX);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2Relaxed.rs
deleted file mode 100644
index d5d90a1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAtan2.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2piRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2piRelaxed.rs
deleted file mode 100644
index 9f87fff..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtan2piRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAtan2pi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAtanRelaxed.rs
deleted file mode 100644
index cab9300..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAtan.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAtanhRelaxed.rs
deleted file mode 100644
index 88dfc75..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAtanh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestAtanpiRelaxed.rs
deleted file mode 100644
index 6183636..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestAtanpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestAtanpi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCbrt.java b/tests/tests/renderscript/src/android/renderscript/cts/TestCbrt.java
deleted file mode 100644
index c6e6bd3..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCbrt.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestCbrt extends RSBaseCompute {
-
- private ScriptC_TestCbrt script;
- private ScriptC_TestCbrtRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestCbrt(mRS);
- scriptRelaxed = new ScriptC_TestCbrtRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkCbrtFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x4e2c540726cc677al, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testCbrtFloatFloat(in, out);
- verifyResultsCbrtFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testCbrtFloatFloat(in, out);
- verifyResultsCbrtFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsCbrtFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCbrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCbrtFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCbrtFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x9e2a09a2eb8fdb46l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testCbrtFloat2Float2(in, out);
- verifyResultsCbrtFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testCbrtFloat2Float2(in, out);
- verifyResultsCbrtFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsCbrtFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCbrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCbrtFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCbrtFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x9e2a14444a9670e0l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testCbrtFloat3Float3(in, out);
- verifyResultsCbrtFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testCbrtFloat3Float3(in, out);
- verifyResultsCbrtFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsCbrtFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCbrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCbrtFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCbrtFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x9e2a1ee5a99d067al, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testCbrtFloat4Float4(in, out);
- verifyResultsCbrtFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testCbrtFloat4Float4(in, out);
- verifyResultsCbrtFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCbrtFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsCbrtFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCbrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCbrtFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testCbrt() {
- checkCbrtFloatFloat();
- checkCbrtFloat2Float2();
- checkCbrtFloat3Float3();
- checkCbrtFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCbrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestCbrt.rs
deleted file mode 100644
index d14f508..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCbrt.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testCbrtFloatFloat(float in) {
- return cbrt(in);
-}
-
-float2 __attribute__((kernel)) testCbrtFloat2Float2(float2 in) {
- return cbrt(in);
-}
-
-float3 __attribute__((kernel)) testCbrtFloat3Float3(float3 in) {
- return cbrt(in);
-}
-
-float4 __attribute__((kernel)) testCbrtFloat4Float4(float4 in) {
- return cbrt(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCbrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestCbrtRelaxed.rs
deleted file mode 100644
index ad970fe..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCbrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestCbrt.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.java b/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.java
deleted file mode 100644
index 80121a8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCeil.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestCeil extends RSBaseCompute {
-
- private ScriptC_TestCeil script;
- private ScriptC_TestCeilRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestCeil(mRS);
- scriptRelaxed = new ScriptC_TestCeilRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkCeilFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xa65a49d160f51d9al, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testCeilFloatFloat(in, out);
- verifyResultsCeilFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testCeilFloatFloat(in, out);
- verifyResultsCeilFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsCeilFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCeil(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCeilFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCeilFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x821e4b40fb9b4866l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testCeilFloat2Float2(in, out);
- verifyResultsCeilFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testCeilFloat2Float2(in, out);
- verifyResultsCeilFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsCeilFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCeil(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCeilFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCeilFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x821e55e25aa1de00l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testCeilFloat3Float3(in, out);
- verifyResultsCeilFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testCeilFloat3Float3(in, out);
- verifyResultsCeilFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsCeilFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCeil(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCeilFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCeilFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x821e6083b9a8739al, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testCeilFloat4Float4(in, out);
- verifyResultsCeilFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testCeilFloat4Float4(in, out);
- verifyResultsCeilFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCeilFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsCeilFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCeil(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCeilFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testCeil() {
- checkCeilFloatFloat();
- checkCeilFloat2Float2();
- checkCeilFloat3Float3();
- checkCeilFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCeilRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestCeilRelaxed.rs
deleted file mode 100644
index bbafb0d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCeilRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestCeil.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestClampRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestClampRelaxed.rs
deleted file mode 100644
index 15fd58c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestClampRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestClamp.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestClzRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestClzRelaxed.rs
deleted file mode 100644
index c463c94..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestClzRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestClz.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestConvertRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestConvertRelaxed.rs
deleted file mode 100644
index d13c634..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestConvertRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestConvert.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCos.java b/tests/tests/renderscript/src/android/renderscript/cts/TestCos.java
deleted file mode 100644
index c3aaf28..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCos.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestCos extends RSBaseCompute {
-
- private ScriptC_TestCos script;
- private ScriptC_TestCosRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestCos(mRS);
- scriptRelaxed = new ScriptC_TestCosRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkCosFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x35eace7a33fd0be0l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testCosFloatFloat(in, out);
- verifyResultsCosFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testCosFloatFloat(in, out);
- verifyResultsCosFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsCosFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCos(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCosFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCosFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x6cec729d2fe33ffcl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testCosFloat2Float2(in, out);
- verifyResultsCosFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testCosFloat2Float2(in, out);
- verifyResultsCosFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsCosFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCos(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCosFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCosFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6cec7d3e8ee9d596l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testCosFloat3Float3(in, out);
- verifyResultsCosFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testCosFloat3Float3(in, out);
- verifyResultsCosFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsCosFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCos(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCosFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCosFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6cec87dfedf06b30l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testCosFloat4Float4(in, out);
- verifyResultsCosFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testCosFloat4Float4(in, out);
- verifyResultsCosFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCosFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsCosFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCos(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCosFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testCos() {
- checkCosFloatFloat();
- checkCosFloat2Float2();
- checkCosFloat3Float3();
- checkCosFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCos.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestCos.rs
deleted file mode 100644
index 5605139..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCos.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testCosFloatFloat(float in) {
- return cos(in);
-}
-
-float2 __attribute__((kernel)) testCosFloat2Float2(float2 in) {
- return cos(in);
-}
-
-float3 __attribute__((kernel)) testCosFloat3Float3(float3 in) {
- return cos(in);
-}
-
-float4 __attribute__((kernel)) testCosFloat4Float4(float4 in) {
- return cos(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestCosRelaxed.rs
deleted file mode 100644
index 1871a69..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCosRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestCos.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCosh.java b/tests/tests/renderscript/src/android/renderscript/cts/TestCosh.java
deleted file mode 100644
index c1f6bf3..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCosh.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestCosh extends RSBaseCompute {
-
- private ScriptC_TestCosh script;
- private ScriptC_TestCoshRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestCosh(mRS);
- scriptRelaxed = new ScriptC_TestCoshRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkCoshFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xca4f5b95e29e11bel, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testCoshFloatFloat(in, out);
- verifyResultsCoshFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testCoshFloatFloat(in, out);
- verifyResultsCoshFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsCoshFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCosh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCoshFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCoshFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x372b9f8d78e6a06al, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testCoshFloat2Float2(in, out);
- verifyResultsCoshFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testCoshFloat2Float2(in, out);
- verifyResultsCoshFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsCoshFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCosh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCoshFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCoshFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x372baa2ed7ed3604l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testCoshFloat3Float3(in, out);
- verifyResultsCoshFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testCoshFloat3Float3(in, out);
- verifyResultsCoshFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsCoshFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCosh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCoshFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCoshFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x372bb4d036f3cb9el, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testCoshFloat4Float4(in, out);
- verifyResultsCoshFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testCoshFloat4Float4(in, out);
- verifyResultsCoshFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCoshFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsCoshFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCosh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCoshFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testCosh() {
- checkCoshFloatFloat();
- checkCoshFloat2Float2();
- checkCoshFloat3Float3();
- checkCoshFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCosh.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestCosh.rs
deleted file mode 100644
index b2d89b9..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCosh.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testCoshFloatFloat(float in) {
- return cosh(in);
-}
-
-float2 __attribute__((kernel)) testCoshFloat2Float2(float2 in) {
- return cosh(in);
-}
-
-float3 __attribute__((kernel)) testCoshFloat3Float3(float3 in) {
- return cosh(in);
-}
-
-float4 __attribute__((kernel)) testCoshFloat4Float4(float4 in) {
- return cosh(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCoshRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestCoshRelaxed.rs
deleted file mode 100644
index cf28629..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCoshRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestCosh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCospi.java b/tests/tests/renderscript/src/android/renderscript/cts/TestCospi.java
deleted file mode 100644
index 2d18af9..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCospi.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestCospi extends RSBaseCompute {
-
- private ScriptC_TestCospi script;
- private ScriptC_TestCospiRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestCospi(mRS);
- scriptRelaxed = new ScriptC_TestCospiRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkCospiFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xf63d9fae6fcc7f1l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testCospiFloatFloat(in, out);
- verifyResultsCospiFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testCospiFloatFloat(in, out);
- verifyResultsCospiFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsCospiFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCospi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCospiFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCospiFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x2830872a08f896c5l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testCospiFloat2Float2(in, out);
- verifyResultsCospiFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testCospiFloat2Float2(in, out);
- verifyResultsCospiFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsCospiFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCospi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCospiFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCospiFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x283091cb67ff2c5fl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testCospiFloat3Float3(in, out);
- verifyResultsCospiFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testCospiFloat3Float3(in, out);
- verifyResultsCospiFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsCospiFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCospi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCospiFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkCospiFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x28309c6cc705c1f9l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testCospiFloat4Float4(in, out);
- verifyResultsCospiFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testCospiFloat4Float4(in, out);
- verifyResultsCospiFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testCospiFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsCospiFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeCospi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkCospiFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testCospi() {
- checkCospiFloatFloat();
- checkCospiFloat2Float2();
- checkCospiFloat3Float3();
- checkCospiFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCospiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestCospiRelaxed.rs
deleted file mode 100644
index aac7b90..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCospiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestCospi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestCrossRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestCrossRelaxed.rs
deleted file mode 100644
index 59fa62d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestCrossRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestCross.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestDegreesRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestDegreesRelaxed.rs
deleted file mode 100644
index 7a443bf..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestDegreesRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestDegrees.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestDistanceRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestDistanceRelaxed.rs
deleted file mode 100644
index ba4c096..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestDistanceRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestDistance.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestDot.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestDot.rs
deleted file mode 100644
index 27aa8aa..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestDot.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocInRhs;
-
-float __attribute__((kernel)) testDotFloatFloatFloat(float inLhs, unsigned int x) {
- float inRhs = rsGetElementAt_float(gAllocInRhs, x);
- return dot(inLhs, inRhs);
-}
-
-float __attribute__((kernel)) testDotFloat2Float2Float(float2 inLhs, unsigned int x) {
- float2 inRhs = rsGetElementAt_float2(gAllocInRhs, x);
- return dot(inLhs, inRhs);
-}
-
-float __attribute__((kernel)) testDotFloat3Float3Float(float3 inLhs, unsigned int x) {
- float3 inRhs = rsGetElementAt_float3(gAllocInRhs, x);
- return dot(inLhs, inRhs);
-}
-
-float __attribute__((kernel)) testDotFloat4Float4Float(float4 inLhs, unsigned int x) {
- float4 inRhs = rsGetElementAt_float4(gAllocInRhs, x);
- return dot(inLhs, inRhs);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestDotRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestDotRelaxed.rs
deleted file mode 100644
index 53e7080..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestDotRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestDot.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestErf.java b/tests/tests/renderscript/src/android/renderscript/cts/TestErf.java
deleted file mode 100644
index 6c73bf1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestErf.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestErf extends RSBaseCompute {
-
- private ScriptC_TestErf script;
- private ScriptC_TestErfRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestErf(mRS);
- scriptRelaxed = new ScriptC_TestErfRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkErfFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x287cee12fdd9cb26l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testErfFloatFloat(in, out);
- verifyResultsErfFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testErfFloatFloat(in, out);
- verifyResultsErfFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsErfFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeErf(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkErfFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkErfFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x6e52a9272b44c092l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testErfFloat2Float2(in, out);
- verifyResultsErfFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testErfFloat2Float2(in, out);
- verifyResultsErfFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsErfFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeErf(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkErfFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkErfFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6e52b3c88a4b562cl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testErfFloat3Float3(in, out);
- verifyResultsErfFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testErfFloat3Float3(in, out);
- verifyResultsErfFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsErfFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeErf(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkErfFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkErfFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x6e52be69e951ebc6l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testErfFloat4Float4(in, out);
- verifyResultsErfFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testErfFloat4Float4(in, out);
- verifyResultsErfFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsErfFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeErf(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkErfFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testErf() {
- checkErfFloatFloat();
- checkErfFloat2Float2();
- checkErfFloat3Float3();
- checkErfFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestErf.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestErf.rs
deleted file mode 100644
index 5d26ed6..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestErf.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testErfFloatFloat(float in) {
- return erf(in);
-}
-
-float2 __attribute__((kernel)) testErfFloat2Float2(float2 in) {
- return erf(in);
-}
-
-float3 __attribute__((kernel)) testErfFloat3Float3(float3 in) {
- return erf(in);
-}
-
-float4 __attribute__((kernel)) testErfFloat4Float4(float4 in) {
- return erf(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestErfRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestErfRelaxed.rs
deleted file mode 100644
index 1551db8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestErfRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestErf.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestErfc.java b/tests/tests/renderscript/src/android/renderscript/cts/TestErfc.java
deleted file mode 100644
index 86c2aa1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestErfc.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestErfc extends RSBaseCompute {
-
- private ScriptC_TestErfc script;
- private ScriptC_TestErfcRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestErfc(mRS);
- scriptRelaxed = new ScriptC_TestErfcRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkErfcFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb41907c64db86b2bl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testErfcFloatFloat(in, out);
- verifyResultsErfcFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testErfcFloatFloat(in, out);
- verifyResultsErfcFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsErfcFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeErfc(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkErfcFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkErfcFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc8c849430a3684afl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testErfcFloat2Float2(in, out);
- verifyResultsErfcFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testErfcFloat2Float2(in, out);
- verifyResultsErfcFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsErfcFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeErfc(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkErfcFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkErfcFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xc8c853e4693d1a49l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testErfcFloat3Float3(in, out);
- verifyResultsErfcFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testErfcFloat3Float3(in, out);
- verifyResultsErfcFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsErfcFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeErfc(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkErfcFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkErfcFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc8c85e85c843afe3l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testErfcFloat4Float4(in, out);
- verifyResultsErfcFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testErfcFloat4Float4(in, out);
- verifyResultsErfcFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testErfcFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsErfcFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeErfc(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkErfcFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testErfc() {
- checkErfcFloatFloat();
- checkErfcFloat2Float2();
- checkErfcFloat3Float3();
- checkErfcFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestErfc.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestErfc.rs
deleted file mode 100644
index d12ea25..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestErfc.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testErfcFloatFloat(float in) {
- return erfc(in);
-}
-
-float2 __attribute__((kernel)) testErfcFloat2Float2(float2 in) {
- return erfc(in);
-}
-
-float3 __attribute__((kernel)) testErfcFloat3Float3(float3 in) {
- return erfc(in);
-}
-
-float4 __attribute__((kernel)) testErfcFloat4Float4(float4 in) {
- return erfc(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestErfcRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestErfcRelaxed.rs
deleted file mode 100644
index f6117c8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestErfcRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestErfc.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExp.java b/tests/tests/renderscript/src/android/renderscript/cts/TestExp.java
deleted file mode 100644
index 224a64c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExp.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestExp extends RSBaseCompute {
-
- private ScriptC_TestExp script;
- private ScriptC_TestExpRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestExp(mRS);
- scriptRelaxed = new ScriptC_TestExpRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkExpFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb43af2b5f55920f2l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testExpFloatFloat(in, out);
- verifyResultsExpFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testExpFloatFloat(in, out);
- verifyResultsExpFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsExpFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExpFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExpFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xbdc22634c1f76efel, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testExpFloat2Float2(in, out);
- verifyResultsExpFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testExpFloat2Float2(in, out);
- verifyResultsExpFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsExpFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExpFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExpFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xbdc230d620fe0498l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testExpFloat3Float3(in, out);
- verifyResultsExpFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testExpFloat3Float3(in, out);
- verifyResultsExpFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsExpFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExpFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExpFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbdc23b7780049a32l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testExpFloat4Float4(in, out);
- verifyResultsExpFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testExpFloat4Float4(in, out);
- verifyResultsExpFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsExpFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExpFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testExp() {
- checkExpFloatFloat();
- checkExpFloat2Float2();
- checkExpFloat3Float3();
- checkExpFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExp.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestExp.rs
deleted file mode 100644
index 90879d9..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExp.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testExpFloatFloat(float in) {
- return exp(in);
-}
-
-float2 __attribute__((kernel)) testExpFloat2Float2(float2 in) {
- return exp(in);
-}
-
-float3 __attribute__((kernel)) testExpFloat3Float3(float3 in) {
- return exp(in);
-}
-
-float4 __attribute__((kernel)) testExpFloat4Float4(float4 in) {
- return exp(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExp10.java b/tests/tests/renderscript/src/android/renderscript/cts/TestExp10.java
deleted file mode 100644
index 874d17b..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExp10.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestExp10 extends RSBaseCompute {
-
- private ScriptC_TestExp10 script;
- private ScriptC_TestExp10Relaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestExp10(mRS);
- scriptRelaxed = new ScriptC_TestExp10Relaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkExp10FloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x9f6474a4cee90545l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testExp10FloatFloat(in, out);
- verifyResultsExp10FloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10FloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testExp10FloatFloat(in, out);
- verifyResultsExp10FloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10FloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsExp10FloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp10(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExp10FloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExp10Float2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x3c8d9c56223f8a79l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testExp10Float2Float2(in, out);
- verifyResultsExp10Float2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testExp10Float2Float2(in, out);
- verifyResultsExp10Float2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsExp10Float2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp10(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExp10Float2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExp10Float3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x3c8da6f781462013l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testExp10Float3Float3(in, out);
- verifyResultsExp10Float3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testExp10Float3Float3(in, out);
- verifyResultsExp10Float3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsExp10Float3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp10(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExp10Float3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExp10Float4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3c8db198e04cb5adl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testExp10Float4Float4(in, out);
- verifyResultsExp10Float4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testExp10Float4Float4(in, out);
- verifyResultsExp10Float4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp10Float4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsExp10Float4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp10(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExp10Float4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testExp10() {
- checkExp10FloatFloat();
- checkExp10Float2Float2();
- checkExp10Float3Float3();
- checkExp10Float4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExp10Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestExp10Relaxed.rs
deleted file mode 100644
index 9b07598..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExp10Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestExp10.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExp2.java b/tests/tests/renderscript/src/android/renderscript/cts/TestExp2.java
deleted file mode 100644
index bbb9c68..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExp2.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestExp2 extends RSBaseCompute {
-
- private ScriptC_TestExp2 script;
- private ScriptC_TestExp2Relaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestExp2(mRS);
- scriptRelaxed = new ScriptC_TestExp2Relaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkExp2FloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x80096e5b0f2662el, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testExp2FloatFloat(in, out);
- verifyResultsExp2FloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2FloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testExp2FloatFloat(in, out);
- verifyResultsExp2FloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2FloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsExp2FloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp2(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExp2FloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExp2Float2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xcc4102f6b7fc7d5al, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testExp2Float2Float2(in, out);
- verifyResultsExp2Float2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testExp2Float2Float2(in, out);
- verifyResultsExp2Float2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsExp2Float2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp2(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExp2Float2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExp2Float3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xcc410d98170312f4l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testExp2Float3Float3(in, out);
- verifyResultsExp2Float3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testExp2Float3Float3(in, out);
- verifyResultsExp2Float3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsExp2Float3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp2(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExp2Float3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExp2Float4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xcc4118397609a88el, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testExp2Float4Float4(in, out);
- verifyResultsExp2Float4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testExp2Float4Float4(in, out);
- verifyResultsExp2Float4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExp2Float4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsExp2Float4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExp2(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExp2Float4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testExp2() {
- checkExp2FloatFloat();
- checkExp2Float2Float2();
- checkExp2Float3Float3();
- checkExp2Float4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExp2.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestExp2.rs
deleted file mode 100644
index 61ff900..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExp2.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testExp2FloatFloat(float in) {
- return exp2(in);
-}
-
-float2 __attribute__((kernel)) testExp2Float2Float2(float2 in) {
- return exp2(in);
-}
-
-float3 __attribute__((kernel)) testExp2Float3Float3(float3 in) {
- return exp2(in);
-}
-
-float4 __attribute__((kernel)) testExp2Float4Float4(float4 in) {
- return exp2(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExp2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestExp2Relaxed.rs
deleted file mode 100644
index 06810b3..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExp2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestExp2.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExpRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestExpRelaxed.rs
deleted file mode 100644
index f98bf80..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExpRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestExp.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExpm1.java b/tests/tests/renderscript/src/android/renderscript/cts/TestExpm1.java
deleted file mode 100644
index c922e49..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExpm1.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestExpm1 extends RSBaseCompute {
-
- private ScriptC_TestExpm1 script;
- private ScriptC_TestExpm1Relaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestExpm1(mRS);
- scriptRelaxed = new ScriptC_TestExpm1Relaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkExpm1FloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xa03d120368f727aal, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testExpm1FloatFloat(in, out);
- verifyResultsExpm1FloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1FloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testExpm1FloatFloat(in, out);
- verifyResultsExpm1FloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1FloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsExpm1FloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExpm1(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExpm1FloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExpm1Float2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x59163c9cd255f5f6l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testExpm1Float2Float2(in, out);
- verifyResultsExpm1Float2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testExpm1Float2Float2(in, out);
- verifyResultsExpm1Float2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsExpm1Float2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExpm1(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExpm1Float2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExpm1Float3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x5916473e315c8b90l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testExpm1Float3Float3(in, out);
- verifyResultsExpm1Float3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testExpm1Float3Float3(in, out);
- verifyResultsExpm1Float3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsExpm1Float3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExpm1(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExpm1Float3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkExpm1Float4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x591651df9063212al, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testExpm1Float4Float4(in, out);
- verifyResultsExpm1Float4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testExpm1Float4Float4(in, out);
- verifyResultsExpm1Float4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testExpm1Float4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsExpm1Float4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeExpm1(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkExpm1Float4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testExpm1() {
- checkExpm1FloatFloat();
- checkExpm1Float2Float2();
- checkExpm1Float3Float3();
- checkExpm1Float4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestExpm1Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestExpm1Relaxed.rs
deleted file mode 100644
index bd73f9d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestExpm1Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestExpm1.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFabs.java b/tests/tests/renderscript/src/android/renderscript/cts/TestFabs.java
deleted file mode 100644
index 29cdd86..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFabs.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestFabs extends RSBaseCompute {
-
- private ScriptC_TestFabs script;
- private ScriptC_TestFabsRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestFabs(mRS);
- scriptRelaxed = new ScriptC_TestFabsRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkFabsFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x70316affaf9e3339l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testFabsFloatFloat(in, out);
- verifyResultsFabsFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testFabsFloatFloat(in, out);
- verifyResultsFabsFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsFabsFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFabs(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFabsFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkFabsFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x54ecf2b71ed871cdl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testFabsFloat2Float2(in, out);
- verifyResultsFabsFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testFabsFloat2Float2(in, out);
- verifyResultsFabsFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsFabsFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFabs(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFabsFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkFabsFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x54ecfd587ddf0767l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testFabsFloat3Float3(in, out);
- verifyResultsFabsFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testFabsFloat3Float3(in, out);
- verifyResultsFabsFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsFabsFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFabs(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFabsFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkFabsFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x54ed07f9dce59d01l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testFabsFloat4Float4(in, out);
- verifyResultsFabsFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testFabsFloat4Float4(in, out);
- verifyResultsFabsFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFabsFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsFabsFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFabs(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFabsFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testFabs() {
- checkFabsFloatFloat();
- checkFabsFloat2Float2();
- checkFabsFloat3Float3();
- checkFabsFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFabs.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFabs.rs
deleted file mode 100644
index aed0318..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFabs.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testFabsFloatFloat(float in) {
- return fabs(in);
-}
-
-float2 __attribute__((kernel)) testFabsFloat2Float2(float2 in) {
- return fabs(in);
-}
-
-float3 __attribute__((kernel)) testFabsFloat3Float3(float3 in) {
- return fabs(in);
-}
-
-float4 __attribute__((kernel)) testFabsFloat4Float4(float4 in) {
- return fabs(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFabsRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFabsRelaxed.rs
deleted file mode 100644
index 4d2214a..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFabsRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestFabs.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFastLengthRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFastLengthRelaxed.rs
deleted file mode 100644
index 680c3e1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFastLengthRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestFastLength.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFastNormalizeRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFastNormalizeRelaxed.rs
deleted file mode 100644
index e195f60..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFastNormalizeRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestFastNormalize.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFdimRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFdimRelaxed.rs
deleted file mode 100644
index 473a588..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFdimRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestFdim.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFloor.java b/tests/tests/renderscript/src/android/renderscript/cts/TestFloor.java
deleted file mode 100644
index 39ec8bd..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFloor.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestFloor extends RSBaseCompute {
-
- private ScriptC_TestFloor script;
- private ScriptC_TestFloorRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestFloor(mRS);
- scriptRelaxed = new ScriptC_TestFloorRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkFloorFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x9c2b15433f045885l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testFloorFloatFloat(in, out);
- verifyResultsFloorFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testFloorFloatFloat(in, out);
- verifyResultsFloorFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsFloorFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFloor(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFloorFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkFloorFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xf32bb4add79bd3b9l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testFloorFloat2Float2(in, out);
- verifyResultsFloorFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testFloorFloat2Float2(in, out);
- verifyResultsFloorFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsFloorFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFloor(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFloorFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkFloorFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xf32bbf4f36a26953l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testFloorFloat3Float3(in, out);
- verifyResultsFloorFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testFloorFloat3Float3(in, out);
- verifyResultsFloorFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsFloorFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFloor(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFloorFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkFloorFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf32bc9f095a8feedl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testFloorFloat4Float4(in, out);
- verifyResultsFloorFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testFloorFloat4Float4(in, out);
- verifyResultsFloorFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFloorFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsFloorFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFloor(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFloorFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testFloor() {
- checkFloorFloatFloat();
- checkFloorFloat2Float2();
- checkFloorFloat3Float3();
- checkFloorFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFloor.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFloor.rs
deleted file mode 100644
index f74fc2b..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFloor.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testFloorFloatFloat(float in) {
- return floor(in);
-}
-
-float2 __attribute__((kernel)) testFloorFloat2Float2(float2 in) {
- return floor(in);
-}
-
-float3 __attribute__((kernel)) testFloorFloat3Float3(float3 in) {
- return floor(in);
-}
-
-float4 __attribute__((kernel)) testFloorFloat4Float4(float4 in) {
- return floor(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFloorRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFloorRelaxed.rs
deleted file mode 100644
index 4caf0de..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFloorRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestFloor.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFma.java b/tests/tests/renderscript/src/android/renderscript/cts/TestFma.java
deleted file mode 100644
index fcb7c5f..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFma.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestFma extends RSBaseCompute {
-
- private ScriptC_TestFma script;
- private ScriptC_TestFmaRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestFma(mRS);
- scriptRelaxed = new ScriptC_TestFmaRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloatFloatFloat {
- public float inA;
- public float inB;
- public float inC;
- public Target.Floaty out;
- }
-
- private void checkFmaFloatFloatFloatFloat() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x5f6b3ee0c3466c2l, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x5f6b3ee0c3466c3l, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x5f6b3ee0c3466c4l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInB(inB);
- script.set_gAllocInC(inC);
- script.forEach_testFmaFloatFloatFloatFloat(inA, out);
- verifyResultsFmaFloatFloatFloatFloat(inA, inB, inC, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloatFloatFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.forEach_testFmaFloatFloatFloatFloat(inA, out);
- verifyResultsFmaFloatFloatFloatFloat(inA, inB, inC, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloatFloatFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsFmaFloatFloatFloatFloat(Allocation inA, Allocation inB, Allocation inC, Allocation out, boolean relaxed) {
- float[] arrayInA = new float[INPUTSIZE * 1];
- inA.copyTo(arrayInA);
- float[] arrayInB = new float[INPUTSIZE * 1];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 1];
- inC.copyTo(arrayInC);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
- args.inA = arrayInA[i];
- args.inB = arrayInB[i];
- args.inC = arrayInC[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFma(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inA: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inA, Float.floatToRawIntBits(args.inA), args.inA));
- message.append("\n");
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFmaFloatFloatFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkFmaFloat2Float2Float2Float2() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x47b62b8849bc43dal, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x47b62b8849bc43dbl, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x47b62b8849bc43dcl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInB(inB);
- script.set_gAllocInC(inC);
- script.forEach_testFmaFloat2Float2Float2Float2(inA, out);
- verifyResultsFmaFloat2Float2Float2Float2(inA, inB, inC, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat2Float2Float2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.forEach_testFmaFloat2Float2Float2Float2(inA, out);
- verifyResultsFmaFloat2Float2Float2Float2(inA, inB, inC, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat2Float2Float2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsFmaFloat2Float2Float2Float2(Allocation inA, Allocation inB, Allocation inC, Allocation out, boolean relaxed) {
- float[] arrayInA = new float[INPUTSIZE * 2];
- inA.copyTo(arrayInA);
- float[] arrayInB = new float[INPUTSIZE * 2];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 2];
- inC.copyTo(arrayInC);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
- args.inA = arrayInA[i * 2 + j];
- args.inB = arrayInB[i * 2 + j];
- args.inC = arrayInC[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFma(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inA: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inA, Float.floatToRawIntBits(args.inA), args.inA));
- message.append("\n");
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFmaFloat2Float2Float2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkFmaFloat3Float3Float3Float3() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1d2fcf231c237d76l, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1d2fcf231c237d77l, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1d2fcf231c237d78l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInB(inB);
- script.set_gAllocInC(inC);
- script.forEach_testFmaFloat3Float3Float3Float3(inA, out);
- verifyResultsFmaFloat3Float3Float3Float3(inA, inB, inC, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat3Float3Float3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.forEach_testFmaFloat3Float3Float3Float3(inA, out);
- verifyResultsFmaFloat3Float3Float3Float3(inA, inB, inC, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat3Float3Float3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsFmaFloat3Float3Float3Float3(Allocation inA, Allocation inB, Allocation inC, Allocation out, boolean relaxed) {
- float[] arrayInA = new float[INPUTSIZE * 4];
- inA.copyTo(arrayInA);
- float[] arrayInB = new float[INPUTSIZE * 4];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 4];
- inC.copyTo(arrayInC);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
- args.inA = arrayInA[i * 4 + j];
- args.inB = arrayInB[i * 4 + j];
- args.inC = arrayInC[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFma(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inA: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inA, Float.floatToRawIntBits(args.inA), args.inA));
- message.append("\n");
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFmaFloat3Float3Float3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkFmaFloat4Float4Float4Float4() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf2a972bdee8ab712l, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf2a972bdee8ab713l, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xf2a972bdee8ab714l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInB(inB);
- script.set_gAllocInC(inC);
- script.forEach_testFmaFloat4Float4Float4Float4(inA, out);
- verifyResultsFmaFloat4Float4Float4Float4(inA, inB, inC, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat4Float4Float4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.forEach_testFmaFloat4Float4Float4Float4(inA, out);
- verifyResultsFmaFloat4Float4Float4Float4(inA, inB, inC, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testFmaFloat4Float4Float4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsFmaFloat4Float4Float4Float4(Allocation inA, Allocation inB, Allocation inC, Allocation out, boolean relaxed) {
- float[] arrayInA = new float[INPUTSIZE * 4];
- inA.copyTo(arrayInA);
- float[] arrayInB = new float[INPUTSIZE * 4];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 4];
- inC.copyTo(arrayInC);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
- args.inA = arrayInA[i * 4 + j];
- args.inB = arrayInB[i * 4 + j];
- args.inC = arrayInC[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeFma(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inA: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inA, Float.floatToRawIntBits(args.inA), args.inA));
- message.append("\n");
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkFmaFloat4Float4Float4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testFma() {
- checkFmaFloatFloatFloatFloat();
- checkFmaFloat2Float2Float2Float2();
- checkFmaFloat3Float3Float3Float3();
- checkFmaFloat4Float4Float4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFma.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFma.rs
deleted file mode 100644
index b0cb2dd..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFma.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocInB;
-rs_allocation gAllocInC;
-
-float __attribute__((kernel)) testFmaFloatFloatFloatFloat(float inA, unsigned int x) {
- float inB = rsGetElementAt_float(gAllocInB, x);
- float inC = rsGetElementAt_float(gAllocInC, x);
- return fma(inA, inB, inC);
-}
-
-float2 __attribute__((kernel)) testFmaFloat2Float2Float2Float2(float2 inA, unsigned int x) {
- float2 inB = rsGetElementAt_float2(gAllocInB, x);
- float2 inC = rsGetElementAt_float2(gAllocInC, x);
- return fma(inA, inB, inC);
-}
-
-float3 __attribute__((kernel)) testFmaFloat3Float3Float3Float3(float3 inA, unsigned int x) {
- float3 inB = rsGetElementAt_float3(gAllocInB, x);
- float3 inC = rsGetElementAt_float3(gAllocInC, x);
- return fma(inA, inB, inC);
-}
-
-float4 __attribute__((kernel)) testFmaFloat4Float4Float4Float4(float4 inA, unsigned int x) {
- float4 inB = rsGetElementAt_float4(gAllocInB, x);
- float4 inC = rsGetElementAt_float4(gAllocInC, x);
- return fma(inA, inB, inC);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFmaRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFmaRelaxed.rs
deleted file mode 100644
index cc80e06..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFmaRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestFma.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFmaxRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFmaxRelaxed.rs
deleted file mode 100644
index 74c8b3d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFmaxRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestFmax.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFminRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFminRelaxed.rs
deleted file mode 100644
index 571f64a..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFminRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestFmin.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFmod.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFmod.rs
deleted file mode 100644
index c1c2bff..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFmod.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocInY;
-
-float __attribute__((kernel)) testFmodFloatFloatFloat(float inX, unsigned int x) {
- float inY = rsGetElementAt_float(gAllocInY, x);
- return fmod(inX, inY);
-}
-
-float2 __attribute__((kernel)) testFmodFloat2Float2Float2(float2 inX, unsigned int x) {
- float2 inY = rsGetElementAt_float2(gAllocInY, x);
- return fmod(inX, inY);
-}
-
-float3 __attribute__((kernel)) testFmodFloat3Float3Float3(float3 inX, unsigned int x) {
- float3 inY = rsGetElementAt_float3(gAllocInY, x);
- return fmod(inX, inY);
-}
-
-float4 __attribute__((kernel)) testFmodFloat4Float4Float4(float4 inX, unsigned int x) {
- float4 inY = rsGetElementAt_float4(gAllocInY, x);
- return fmod(inX, inY);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFmodRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFmodRelaxed.rs
deleted file mode 100644
index 02888a1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFmodRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestFmod.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFractRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFractRelaxed.rs
deleted file mode 100644
index c9a98df..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFractRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestFract.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestFrexpRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestFrexpRelaxed.rs
deleted file mode 100644
index 8dc4c4d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestFrexpRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestFrexp.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfSqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestHalfSqrtRelaxed.rs
deleted file mode 100644
index 46b979d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestHalfSqrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestHalfSqrt.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHypot.java b/tests/tests/renderscript/src/android/renderscript/cts/TestHypot.java
deleted file mode 100644
index 8aecdcd..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestHypot.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestHypot extends RSBaseCompute {
-
- private ScriptC_TestHypot script;
- private ScriptC_TestHypotRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestHypot(mRS);
- scriptRelaxed = new ScriptC_TestHypotRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloatFloat {
- public float inX;
- public float inY;
- public Target.Floaty out;
- }
-
- private void checkHypotFloatFloatFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x7deb65e7738c74dbl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x7deb65e7738c74dcl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testHypotFloatFloatFloat(inX, out);
- verifyResultsHypotFloatFloatFloat(inX, inY, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloatFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testHypotFloatFloatFloat(inX, out);
- verifyResultsHypotFloatFloatFloat(inX, inY, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloatFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsHypotFloatFloatFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeHypot(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
- message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkHypotFloatFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkHypotFloat2Float2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x14f3c91a62f71c5dl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x14f3c91a62f71c5el, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testHypotFloat2Float2Float2(inX, out);
- verifyResultsHypotFloat2Float2Float2(inX, inY, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat2Float2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testHypotFloat2Float2Float2(inX, out);
- verifyResultsHypotFloat2Float2Float2(inX, inY, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat2Float2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsHypotFloat2Float2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeHypot(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
- message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkHypotFloat2Float2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkHypotFloat3Float3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6958a73a64d51dfel, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x6958a73a64d51dffl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testHypotFloat3Float3Float3(inX, out);
- verifyResultsHypotFloat3Float3Float3(inX, inY, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat3Float3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testHypotFloat3Float3Float3(inX, out);
- verifyResultsHypotFloat3Float3Float3(inX, inY, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat3Float3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsHypotFloat3Float3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeHypot(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
- message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkHypotFloat3Float3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkHypotFloat4Float4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbdbd855a66b31f9fl, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbdbd855a66b31fa0l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testHypotFloat4Float4Float4(inX, out);
- verifyResultsHypotFloat4Float4Float4(inX, inY, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat4Float4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testHypotFloat4Float4Float4(inX, out);
- verifyResultsHypotFloat4Float4Float4(inX, inY, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testHypotFloat4Float4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsHypotFloat4Float4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeHypot(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
- message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkHypotFloat4Float4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testHypot() {
- checkHypotFloatFloatFloat();
- checkHypotFloat2Float2Float2();
- checkHypotFloat3Float3Float3();
- checkHypotFloat4Float4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestHypotRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestHypotRelaxed.rs
deleted file mode 100644
index 15d02f3..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestHypotRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestHypot.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestIlogb.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestIlogb.rs
deleted file mode 100644
index d9d62ed..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestIlogb.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-int __attribute__((kernel)) testIlogbFloatInt(float in) {
- return ilogb(in);
-}
-
-int2 __attribute__((kernel)) testIlogbFloat2Int2(float2 in) {
- return ilogb(in);
-}
-
-int3 __attribute__((kernel)) testIlogbFloat3Int3(float3 in) {
- return ilogb(in);
-}
-
-int4 __attribute__((kernel)) testIlogbFloat4Int4(float4 in) {
- return ilogb(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestIlogbRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestIlogbRelaxed.rs
deleted file mode 100644
index 6a60e53..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestIlogbRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestIlogb.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLdexp.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLdexp.rs
deleted file mode 100644
index e8b05f2..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLdexp.rs
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocInY;
-
-float __attribute__((kernel)) testLdexpFloatIntFloat(float inX, unsigned int x) {
- int inY = rsGetElementAt_int(gAllocInY, x);
- return ldexp(inX, inY);
-}
-
-float2 __attribute__((kernel)) testLdexpFloat2Int2Float2(float2 inX, unsigned int x) {
- int2 inY = rsGetElementAt_int2(gAllocInY, x);
- return ldexp(inX, inY);
-}
-
-float3 __attribute__((kernel)) testLdexpFloat3Int3Float3(float3 inX, unsigned int x) {
- int3 inY = rsGetElementAt_int3(gAllocInY, x);
- return ldexp(inX, inY);
-}
-
-float4 __attribute__((kernel)) testLdexpFloat4Int4Float4(float4 inX, unsigned int x) {
- int4 inY = rsGetElementAt_int4(gAllocInY, x);
- return ldexp(inX, inY);
-}
-
-float2 __attribute__((kernel)) testLdexpFloat2IntFloat2(float2 inX, unsigned int x) {
- int inY = rsGetElementAt_int(gAllocInY, x);
- return ldexp(inX, inY);
-}
-
-float3 __attribute__((kernel)) testLdexpFloat3IntFloat3(float3 inX, unsigned int x) {
- int inY = rsGetElementAt_int(gAllocInY, x);
- return ldexp(inX, inY);
-}
-
-float4 __attribute__((kernel)) testLdexpFloat4IntFloat4(float4 inX, unsigned int x) {
- int inY = rsGetElementAt_int(gAllocInY, x);
- return ldexp(inX, inY);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLdexpRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLdexpRelaxed.rs
deleted file mode 100644
index ee9f5cf..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLdexpRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestLdexp.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLengthRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLengthRelaxed.rs
deleted file mode 100644
index 12eba8b..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLengthRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestLength.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLgamma.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLgamma.rs
deleted file mode 100644
index b39e592..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLgamma.rs
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testLgammaFloatFloat(float in) {
- return lgamma(in);
-}
-
-float2 __attribute__((kernel)) testLgammaFloat2Float2(float2 in) {
- return lgamma(in);
-}
-
-float3 __attribute__((kernel)) testLgammaFloat3Float3(float3 in) {
- return lgamma(in);
-}
-
-float4 __attribute__((kernel)) testLgammaFloat4Float4(float4 in) {
- return lgamma(in);
-}
-rs_allocation gAllocOutY;
-
-float __attribute__((kernel)) testLgammaFloatIntFloat(float inX, unsigned int x) {
- int outY = 0;
- float out = lgamma(inX, &outY);
- rsSetElementAt_int(gAllocOutY, outY, x);
- return out;
-}
-
-float2 __attribute__((kernel)) testLgammaFloat2Int2Float2(float2 inX, unsigned int x) {
- int2 outY = 0;
- float2 out = lgamma(inX, &outY);
- rsSetElementAt_int2(gAllocOutY, outY, x);
- return out;
-}
-
-float3 __attribute__((kernel)) testLgammaFloat3Int3Float3(float3 inX, unsigned int x) {
- int3 outY = 0;
- float3 out = lgamma(inX, &outY);
- rsSetElementAt_int3(gAllocOutY, outY, x);
- return out;
-}
-
-float4 __attribute__((kernel)) testLgammaFloat4Int4Float4(float4 inX, unsigned int x) {
- int4 outY = 0;
- float4 out = lgamma(inX, &outY);
- rsSetElementAt_int4(gAllocOutY, outY, x);
- return out;
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLgammaRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLgammaRelaxed.rs
deleted file mode 100644
index a259576..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLgammaRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestLgamma.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLog.java b/tests/tests/renderscript/src/android/renderscript/cts/TestLog.java
deleted file mode 100644
index 8b4717c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLog.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestLog extends RSBaseCompute {
-
- private ScriptC_TestLog script;
- private ScriptC_TestLogRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestLog(mRS);
- scriptRelaxed = new ScriptC_TestLogRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkLogFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x371a946136907325l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testLogFloatFloat(in, out);
- verifyResultsLogFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testLogFloatFloat(in, out);
- verifyResultsLogFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsLogFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLogFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLogFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xfef8d41eca882159l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testLogFloat2Float2(in, out);
- verifyResultsLogFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testLogFloat2Float2(in, out);
- verifyResultsLogFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsLogFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLogFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLogFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xfef8dec0298eb6f3l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testLogFloat3Float3(in, out);
- verifyResultsLogFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testLogFloat3Float3(in, out);
- verifyResultsLogFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsLogFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLogFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLogFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xfef8e96188954c8dl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testLogFloat4Float4(in, out);
- verifyResultsLogFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testLogFloat4Float4(in, out);
- verifyResultsLogFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsLogFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLogFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testLog() {
- checkLogFloatFloat();
- checkLogFloat2Float2();
- checkLogFloat3Float3();
- checkLogFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLog.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLog.rs
deleted file mode 100644
index 4261b61..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLog.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testLogFloatFloat(float in) {
- return log(in);
-}
-
-float2 __attribute__((kernel)) testLogFloat2Float2(float2 in) {
- return log(in);
-}
-
-float3 __attribute__((kernel)) testLogFloat3Float3(float3 in) {
- return log(in);
-}
-
-float4 __attribute__((kernel)) testLogFloat4Float4(float4 in) {
- return log(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLog10.java b/tests/tests/renderscript/src/android/renderscript/cts/TestLog10.java
deleted file mode 100644
index 5928090..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLog10.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestLog10 extends RSBaseCompute {
-
- private ScriptC_TestLog10 script;
- private ScriptC_TestLog10Relaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestLog10(mRS);
- scriptRelaxed = new ScriptC_TestLog10Relaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkLog10FloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe09b228ed779b7a0l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testLog10FloatFloat(in, out);
- verifyResultsLog10FloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10FloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testLog10FloatFloat(in, out);
- verifyResultsLog10FloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10FloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsLog10FloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog10(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog10FloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLog10Float2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x407bbbadff57bdbcl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testLog10Float2Float2(in, out);
- verifyResultsLog10Float2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testLog10Float2Float2(in, out);
- verifyResultsLog10Float2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsLog10Float2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog10(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog10Float2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLog10Float3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x407bc64f5e5e5356l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testLog10Float3Float3(in, out);
- verifyResultsLog10Float3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testLog10Float3Float3(in, out);
- verifyResultsLog10Float3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsLog10Float3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog10(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog10Float3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLog10Float4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x407bd0f0bd64e8f0l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testLog10Float4Float4(in, out);
- verifyResultsLog10Float4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testLog10Float4Float4(in, out);
- verifyResultsLog10Float4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog10Float4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsLog10Float4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog10(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog10Float4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testLog10() {
- checkLog10FloatFloat();
- checkLog10Float2Float2();
- checkLog10Float3Float3();
- checkLog10Float4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLog10Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLog10Relaxed.rs
deleted file mode 100644
index c0c47f3..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLog10Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestLog10.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLog1p.java b/tests/tests/renderscript/src/android/renderscript/cts/TestLog1p.java
deleted file mode 100644
index 019cffb..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLog1p.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestLog1p extends RSBaseCompute {
-
- private ScriptC_TestLog1p script;
- private ScriptC_TestLog1pRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestLog1p(mRS);
- scriptRelaxed = new ScriptC_TestLog1pRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkLog1pFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x83e3423b7d907be0l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testLog1pFloatFloat(in, out);
- verifyResultsLog1pFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testLog1pFloatFloat(in, out);
- verifyResultsLog1pFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsLog1pFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog1p(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog1pFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLog1pFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x946881a999c72ffcl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testLog1pFloat2Float2(in, out);
- verifyResultsLog1pFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testLog1pFloat2Float2(in, out);
- verifyResultsLog1pFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsLog1pFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog1p(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog1pFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLog1pFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x94688c4af8cdc596l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testLog1pFloat3Float3(in, out);
- verifyResultsLog1pFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testLog1pFloat3Float3(in, out);
- verifyResultsLog1pFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsLog1pFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog1p(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog1pFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLog1pFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x946896ec57d45b30l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testLog1pFloat4Float4(in, out);
- verifyResultsLog1pFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testLog1pFloat4Float4(in, out);
- verifyResultsLog1pFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog1pFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsLog1pFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog1p(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog1pFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testLog1p() {
- checkLog1pFloatFloat();
- checkLog1pFloat2Float2();
- checkLog1pFloat3Float3();
- checkLog1pFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLog1p.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLog1p.rs
deleted file mode 100644
index bc5577e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLog1p.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testLog1pFloatFloat(float in) {
- return log1p(in);
-}
-
-float2 __attribute__((kernel)) testLog1pFloat2Float2(float2 in) {
- return log1p(in);
-}
-
-float3 __attribute__((kernel)) testLog1pFloat3Float3(float3 in) {
- return log1p(in);
-}
-
-float4 __attribute__((kernel)) testLog1pFloat4Float4(float4 in) {
- return log1p(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLog1pRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLog1pRelaxed.rs
deleted file mode 100644
index 3136d9e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLog1pRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestLog1p.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLog2.java b/tests/tests/renderscript/src/android/renderscript/cts/TestLog2.java
deleted file mode 100644
index 92a4985..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLog2.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestLog2 extends RSBaseCompute {
-
- private ScriptC_TestLog2 script;
- private ScriptC_TestLog2Relaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestLog2(mRS);
- scriptRelaxed = new ScriptC_TestLog2Relaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkLog2FloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x390bea9a53d34bfl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testLog2FloatFloat(in, out);
- verifyResultsLog2FloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2FloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testLog2FloatFloat(in, out);
- verifyResultsLog2FloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2FloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsLog2FloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog2(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog2FloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLog2Float2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc0703946284a72a3l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testLog2Float2Float2(in, out);
- verifyResultsLog2Float2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testLog2Float2Float2(in, out);
- verifyResultsLog2Float2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsLog2Float2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog2(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog2Float2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLog2Float3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xc07043e78751083dl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testLog2Float3Float3(in, out);
- verifyResultsLog2Float3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testLog2Float3Float3(in, out);
- verifyResultsLog2Float3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsLog2Float3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog2(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog2Float3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLog2Float4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc0704e88e6579dd7l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testLog2Float4Float4(in, out);
- verifyResultsLog2Float4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testLog2Float4Float4(in, out);
- verifyResultsLog2Float4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLog2Float4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsLog2Float4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLog2(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLog2Float4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testLog2() {
- checkLog2FloatFloat();
- checkLog2Float2Float2();
- checkLog2Float3Float3();
- checkLog2Float4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLog2.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLog2.rs
deleted file mode 100644
index 4cf8ef2..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLog2.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testLog2FloatFloat(float in) {
- return log2(in);
-}
-
-float2 __attribute__((kernel)) testLog2Float2Float2(float2 in) {
- return log2(in);
-}
-
-float3 __attribute__((kernel)) testLog2Float3Float3(float3 in) {
- return log2(in);
-}
-
-float4 __attribute__((kernel)) testLog2Float4Float4(float4 in) {
- return log2(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLog2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLog2Relaxed.rs
deleted file mode 100644
index e79f105..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLog2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestLog2.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLogRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLogRelaxed.rs
deleted file mode 100644
index 3fed787..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLogRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestLog.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLogb.java b/tests/tests/renderscript/src/android/renderscript/cts/TestLogb.java
deleted file mode 100644
index 8679aa0..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLogb.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestLogb extends RSBaseCompute {
-
- private ScriptC_TestLogb script;
- private ScriptC_TestLogbRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestLogb(mRS);
- scriptRelaxed = new ScriptC_TestLogbRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkLogbFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xfe06d66b21ce47efl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testLogbFloatFloat(in, out);
- verifyResultsLogbFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testLogbFloatFloat(in, out);
- verifyResultsLogbFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsLogbFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLogb(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLogbFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLogbFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xbf61cdc2dc1e0853l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testLogbFloat2Float2(in, out);
- verifyResultsLogbFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testLogbFloat2Float2(in, out);
- verifyResultsLogbFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsLogbFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLogb(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLogbFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLogbFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xbf61d8643b249dedl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testLogbFloat3Float3(in, out);
- verifyResultsLogbFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testLogbFloat3Float3(in, out);
- verifyResultsLogbFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsLogbFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLogb(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLogbFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkLogbFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xbf61e3059a2b3387l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testLogbFloat4Float4(in, out);
- verifyResultsLogbFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testLogbFloat4Float4(in, out);
- verifyResultsLogbFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testLogbFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsLogbFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeLogb(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkLogbFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testLogb() {
- checkLogbFloatFloat();
- checkLogbFloat2Float2();
- checkLogbFloat3Float3();
- checkLogbFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLogb.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLogb.rs
deleted file mode 100644
index 8317a22..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLogb.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testLogbFloatFloat(float in) {
- return logb(in);
-}
-
-float2 __attribute__((kernel)) testLogbFloat2Float2(float2 in) {
- return logb(in);
-}
-
-float3 __attribute__((kernel)) testLogbFloat3Float3(float3 in) {
- return logb(in);
-}
-
-float4 __attribute__((kernel)) testLogbFloat4Float4(float4 in) {
- return logb(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestLogbRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestLogbRelaxed.rs
deleted file mode 100644
index bcf84b7..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestLogbRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestLogb.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMad.java b/tests/tests/renderscript/src/android/renderscript/cts/TestMad.java
deleted file mode 100644
index 0ac029c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMad.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestMad extends RSBaseCompute {
-
- private ScriptC_TestMad script;
- private ScriptC_TestMadRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestMad(mRS);
- scriptRelaxed = new ScriptC_TestMadRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloatFloatFloat {
- public float inA;
- public float inB;
- public float inC;
- public Target.Floaty out;
- }
-
- private void checkMadFloatFloatFloatFloat() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb3b9b8429c37eacl, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb3b9b8429c37eadl, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xb3b9b8429c37eael, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInB(inB);
- script.set_gAllocInC(inC);
- script.forEach_testMadFloatFloatFloatFloat(inA, out);
- verifyResultsMadFloatFloatFloatFloat(inA, inB, inC, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloatFloatFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.forEach_testMadFloatFloatFloatFloat(inA, out);
- verifyResultsMadFloatFloatFloatFloat(inA, inB, inC, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloatFloatFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsMadFloatFloatFloatFloat(Allocation inA, Allocation inB, Allocation inC, Allocation out, boolean relaxed) {
- float[] arrayInA = new float[INPUTSIZE * 1];
- inA.copyTo(arrayInA);
- float[] arrayInB = new float[INPUTSIZE * 1];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 1];
- inC.copyTo(arrayInC);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
- args.inA = arrayInA[i];
- args.inB = arrayInB[i];
- args.inC = arrayInC[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeMad(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inA: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inA, Float.floatToRawIntBits(args.inA), args.inA));
- message.append("\n");
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkMadFloatFloatFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkMadFloat2Float2Float2Float2() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x44d6ec3d0f2030a4l, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x44d6ec3d0f2030a5l, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x44d6ec3d0f2030a6l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInB(inB);
- script.set_gAllocInC(inC);
- script.forEach_testMadFloat2Float2Float2Float2(inA, out);
- verifyResultsMadFloat2Float2Float2Float2(inA, inB, inC, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat2Float2Float2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.forEach_testMadFloat2Float2Float2Float2(inA, out);
- verifyResultsMadFloat2Float2Float2Float2(inA, inB, inC, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat2Float2Float2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsMadFloat2Float2Float2Float2(Allocation inA, Allocation inB, Allocation inC, Allocation out, boolean relaxed) {
- float[] arrayInA = new float[INPUTSIZE * 2];
- inA.copyTo(arrayInA);
- float[] arrayInB = new float[INPUTSIZE * 2];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 2];
- inC.copyTo(arrayInC);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
- args.inA = arrayInA[i * 2 + j];
- args.inB = arrayInB[i * 2 + j];
- args.inC = arrayInC[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeMad(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inA: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inA, Float.floatToRawIntBits(args.inA), args.inA));
- message.append("\n");
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkMadFloat2Float2Float2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkMadFloat3Float3Float3Float3() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1a508fd7e1876a40l, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1a508fd7e1876a41l, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1a508fd7e1876a42l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInB(inB);
- script.set_gAllocInC(inC);
- script.forEach_testMadFloat3Float3Float3Float3(inA, out);
- verifyResultsMadFloat3Float3Float3Float3(inA, inB, inC, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat3Float3Float3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.forEach_testMadFloat3Float3Float3Float3(inA, out);
- verifyResultsMadFloat3Float3Float3Float3(inA, inB, inC, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat3Float3Float3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsMadFloat3Float3Float3Float3(Allocation inA, Allocation inB, Allocation inC, Allocation out, boolean relaxed) {
- float[] arrayInA = new float[INPUTSIZE * 4];
- inA.copyTo(arrayInA);
- float[] arrayInB = new float[INPUTSIZE * 4];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 4];
- inC.copyTo(arrayInC);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
- args.inA = arrayInA[i * 4 + j];
- args.inB = arrayInB[i * 4 + j];
- args.inC = arrayInC[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeMad(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inA: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inA, Float.floatToRawIntBits(args.inA), args.inA));
- message.append("\n");
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkMadFloat3Float3Float3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkMadFloat4Float4Float4Float4() {
- Allocation inA = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xefca3372b3eea3dcl, false);
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xefca3372b3eea3ddl, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xefca3372b3eea3del, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInB(inB);
- script.set_gAllocInC(inC);
- script.forEach_testMadFloat4Float4Float4Float4(inA, out);
- verifyResultsMadFloat4Float4Float4Float4(inA, inB, inC, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat4Float4Float4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInB(inB);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.forEach_testMadFloat4Float4Float4Float4(inA, out);
- verifyResultsMadFloat4Float4Float4Float4(inA, inB, inC, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testMadFloat4Float4Float4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsMadFloat4Float4Float4Float4(Allocation inA, Allocation inB, Allocation inC, Allocation out, boolean relaxed) {
- float[] arrayInA = new float[INPUTSIZE * 4];
- inA.copyTo(arrayInA);
- float[] arrayInB = new float[INPUTSIZE * 4];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 4];
- inC.copyTo(arrayInC);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloatFloat args = new ArgumentsFloatFloatFloatFloat();
- args.inA = arrayInA[i * 4 + j];
- args.inB = arrayInB[i * 4 + j];
- args.inC = arrayInC[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeMad(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inA: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inA, Float.floatToRawIntBits(args.inA), args.inA));
- message.append("\n");
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkMadFloat4Float4Float4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testMad() {
- checkMadFloatFloatFloatFloat();
- checkMadFloat2Float2Float2Float2();
- checkMadFloat3Float3Float3Float3();
- checkMadFloat4Float4Float4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMad.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestMad.rs
deleted file mode 100644
index bcf908b..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMad.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocInB;
-rs_allocation gAllocInC;
-
-float __attribute__((kernel)) testMadFloatFloatFloatFloat(float inA, unsigned int x) {
- float inB = rsGetElementAt_float(gAllocInB, x);
- float inC = rsGetElementAt_float(gAllocInC, x);
- return mad(inA, inB, inC);
-}
-
-float2 __attribute__((kernel)) testMadFloat2Float2Float2Float2(float2 inA, unsigned int x) {
- float2 inB = rsGetElementAt_float2(gAllocInB, x);
- float2 inC = rsGetElementAt_float2(gAllocInC, x);
- return mad(inA, inB, inC);
-}
-
-float3 __attribute__((kernel)) testMadFloat3Float3Float3Float3(float3 inA, unsigned int x) {
- float3 inB = rsGetElementAt_float3(gAllocInB, x);
- float3 inC = rsGetElementAt_float3(gAllocInC, x);
- return mad(inA, inB, inC);
-}
-
-float4 __attribute__((kernel)) testMadFloat4Float4Float4Float4(float4 inA, unsigned int x) {
- float4 inB = rsGetElementAt_float4(gAllocInB, x);
- float4 inC = rsGetElementAt_float4(gAllocInC, x);
- return mad(inA, inB, inC);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMadRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestMadRelaxed.rs
deleted file mode 100644
index acec458..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMadRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestMad.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMax.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestMax.rs
deleted file mode 100644
index dff7927..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMax.rs
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocIn1;
-
-float __attribute__((kernel)) testMaxFloatFloatFloat(float in, unsigned int x) {
- float in1 = rsGetElementAt_float(gAllocIn1, x);
- return max(in, in1);
-}
-
-float2 __attribute__((kernel)) testMaxFloat2Float2Float2(float2 in, unsigned int x) {
- float2 in1 = rsGetElementAt_float2(gAllocIn1, x);
- return max(in, in1);
-}
-
-float3 __attribute__((kernel)) testMaxFloat3Float3Float3(float3 in, unsigned int x) {
- float3 in1 = rsGetElementAt_float3(gAllocIn1, x);
- return max(in, in1);
-}
-
-float4 __attribute__((kernel)) testMaxFloat4Float4Float4(float4 in, unsigned int x) {
- float4 in1 = rsGetElementAt_float4(gAllocIn1, x);
- return max(in, in1);
-}
-rs_allocation gAllocInV2;
-
-char __attribute__((kernel)) testMaxCharCharChar(char inV1, unsigned int x) {
- char inV2 = rsGetElementAt_char(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-char2 __attribute__((kernel)) testMaxChar2Char2Char2(char2 inV1, unsigned int x) {
- char2 inV2 = rsGetElementAt_char2(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-char3 __attribute__((kernel)) testMaxChar3Char3Char3(char3 inV1, unsigned int x) {
- char3 inV2 = rsGetElementAt_char3(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-char4 __attribute__((kernel)) testMaxChar4Char4Char4(char4 inV1, unsigned int x) {
- char4 inV2 = rsGetElementAt_char4(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-uchar __attribute__((kernel)) testMaxUcharUcharUchar(uchar inV1, unsigned int x) {
- uchar inV2 = rsGetElementAt_uchar(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-uchar2 __attribute__((kernel)) testMaxUchar2Uchar2Uchar2(uchar2 inV1, unsigned int x) {
- uchar2 inV2 = rsGetElementAt_uchar2(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-uchar3 __attribute__((kernel)) testMaxUchar3Uchar3Uchar3(uchar3 inV1, unsigned int x) {
- uchar3 inV2 = rsGetElementAt_uchar3(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-uchar4 __attribute__((kernel)) testMaxUchar4Uchar4Uchar4(uchar4 inV1, unsigned int x) {
- uchar4 inV2 = rsGetElementAt_uchar4(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-short __attribute__((kernel)) testMaxShortShortShort(short inV1, unsigned int x) {
- short inV2 = rsGetElementAt_short(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-short2 __attribute__((kernel)) testMaxShort2Short2Short2(short2 inV1, unsigned int x) {
- short2 inV2 = rsGetElementAt_short2(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-short3 __attribute__((kernel)) testMaxShort3Short3Short3(short3 inV1, unsigned int x) {
- short3 inV2 = rsGetElementAt_short3(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-short4 __attribute__((kernel)) testMaxShort4Short4Short4(short4 inV1, unsigned int x) {
- short4 inV2 = rsGetElementAt_short4(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-ushort __attribute__((kernel)) testMaxUshortUshortUshort(ushort inV1, unsigned int x) {
- ushort inV2 = rsGetElementAt_ushort(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-ushort2 __attribute__((kernel)) testMaxUshort2Ushort2Ushort2(ushort2 inV1, unsigned int x) {
- ushort2 inV2 = rsGetElementAt_ushort2(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-ushort3 __attribute__((kernel)) testMaxUshort3Ushort3Ushort3(ushort3 inV1, unsigned int x) {
- ushort3 inV2 = rsGetElementAt_ushort3(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-ushort4 __attribute__((kernel)) testMaxUshort4Ushort4Ushort4(ushort4 inV1, unsigned int x) {
- ushort4 inV2 = rsGetElementAt_ushort4(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-int __attribute__((kernel)) testMaxIntIntInt(int inV1, unsigned int x) {
- int inV2 = rsGetElementAt_int(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-int2 __attribute__((kernel)) testMaxInt2Int2Int2(int2 inV1, unsigned int x) {
- int2 inV2 = rsGetElementAt_int2(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-int3 __attribute__((kernel)) testMaxInt3Int3Int3(int3 inV1, unsigned int x) {
- int3 inV2 = rsGetElementAt_int3(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-int4 __attribute__((kernel)) testMaxInt4Int4Int4(int4 inV1, unsigned int x) {
- int4 inV2 = rsGetElementAt_int4(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-uint __attribute__((kernel)) testMaxUintUintUint(uint inV1, unsigned int x) {
- uint inV2 = rsGetElementAt_uint(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-uint2 __attribute__((kernel)) testMaxUint2Uint2Uint2(uint2 inV1, unsigned int x) {
- uint2 inV2 = rsGetElementAt_uint2(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-uint3 __attribute__((kernel)) testMaxUint3Uint3Uint3(uint3 inV1, unsigned int x) {
- uint3 inV2 = rsGetElementAt_uint3(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-uint4 __attribute__((kernel)) testMaxUint4Uint4Uint4(uint4 inV1, unsigned int x) {
- uint4 inV2 = rsGetElementAt_uint4(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-long __attribute__((kernel)) testMaxLongLongLong(long inV1, unsigned int x) {
- long inV2 = rsGetElementAt_long(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-long2 __attribute__((kernel)) testMaxLong2Long2Long2(long2 inV1, unsigned int x) {
- long2 inV2 = rsGetElementAt_long2(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-long3 __attribute__((kernel)) testMaxLong3Long3Long3(long3 inV1, unsigned int x) {
- long3 inV2 = rsGetElementAt_long3(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-long4 __attribute__((kernel)) testMaxLong4Long4Long4(long4 inV1, unsigned int x) {
- long4 inV2 = rsGetElementAt_long4(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-ulong __attribute__((kernel)) testMaxUlongUlongUlong(ulong inV1, unsigned int x) {
- ulong inV2 = rsGetElementAt_ulong(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-ulong2 __attribute__((kernel)) testMaxUlong2Ulong2Ulong2(ulong2 inV1, unsigned int x) {
- ulong2 inV2 = rsGetElementAt_ulong2(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-ulong3 __attribute__((kernel)) testMaxUlong3Ulong3Ulong3(ulong3 inV1, unsigned int x) {
- ulong3 inV2 = rsGetElementAt_ulong3(gAllocInV2, x);
- return max(inV1, inV2);
-}
-
-ulong4 __attribute__((kernel)) testMaxUlong4Ulong4Ulong4(ulong4 inV1, unsigned int x) {
- ulong4 inV2 = rsGetElementAt_ulong4(gAllocInV2, x);
- return max(inV1, inV2);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMaxRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestMaxRelaxed.rs
deleted file mode 100644
index fb0319b..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMaxRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestMax.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMin.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestMin.rs
deleted file mode 100644
index 29a9aeb..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMin.rs
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocIn1;
-
-float __attribute__((kernel)) testMinFloatFloatFloat(float in, unsigned int x) {
- float in1 = rsGetElementAt_float(gAllocIn1, x);
- return min(in, in1);
-}
-
-float2 __attribute__((kernel)) testMinFloat2Float2Float2(float2 in, unsigned int x) {
- float2 in1 = rsGetElementAt_float2(gAllocIn1, x);
- return min(in, in1);
-}
-
-float3 __attribute__((kernel)) testMinFloat3Float3Float3(float3 in, unsigned int x) {
- float3 in1 = rsGetElementAt_float3(gAllocIn1, x);
- return min(in, in1);
-}
-
-float4 __attribute__((kernel)) testMinFloat4Float4Float4(float4 in, unsigned int x) {
- float4 in1 = rsGetElementAt_float4(gAllocIn1, x);
- return min(in, in1);
-}
-rs_allocation gAllocInV2;
-
-char __attribute__((kernel)) testMinCharCharChar(char inV1, unsigned int x) {
- char inV2 = rsGetElementAt_char(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-char2 __attribute__((kernel)) testMinChar2Char2Char2(char2 inV1, unsigned int x) {
- char2 inV2 = rsGetElementAt_char2(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-char3 __attribute__((kernel)) testMinChar3Char3Char3(char3 inV1, unsigned int x) {
- char3 inV2 = rsGetElementAt_char3(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-char4 __attribute__((kernel)) testMinChar4Char4Char4(char4 inV1, unsigned int x) {
- char4 inV2 = rsGetElementAt_char4(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-uchar __attribute__((kernel)) testMinUcharUcharUchar(uchar inV1, unsigned int x) {
- uchar inV2 = rsGetElementAt_uchar(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-uchar2 __attribute__((kernel)) testMinUchar2Uchar2Uchar2(uchar2 inV1, unsigned int x) {
- uchar2 inV2 = rsGetElementAt_uchar2(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-uchar3 __attribute__((kernel)) testMinUchar3Uchar3Uchar3(uchar3 inV1, unsigned int x) {
- uchar3 inV2 = rsGetElementAt_uchar3(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-uchar4 __attribute__((kernel)) testMinUchar4Uchar4Uchar4(uchar4 inV1, unsigned int x) {
- uchar4 inV2 = rsGetElementAt_uchar4(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-short __attribute__((kernel)) testMinShortShortShort(short inV1, unsigned int x) {
- short inV2 = rsGetElementAt_short(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-short2 __attribute__((kernel)) testMinShort2Short2Short2(short2 inV1, unsigned int x) {
- short2 inV2 = rsGetElementAt_short2(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-short3 __attribute__((kernel)) testMinShort3Short3Short3(short3 inV1, unsigned int x) {
- short3 inV2 = rsGetElementAt_short3(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-short4 __attribute__((kernel)) testMinShort4Short4Short4(short4 inV1, unsigned int x) {
- short4 inV2 = rsGetElementAt_short4(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-ushort __attribute__((kernel)) testMinUshortUshortUshort(ushort inV1, unsigned int x) {
- ushort inV2 = rsGetElementAt_ushort(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-ushort2 __attribute__((kernel)) testMinUshort2Ushort2Ushort2(ushort2 inV1, unsigned int x) {
- ushort2 inV2 = rsGetElementAt_ushort2(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-ushort3 __attribute__((kernel)) testMinUshort3Ushort3Ushort3(ushort3 inV1, unsigned int x) {
- ushort3 inV2 = rsGetElementAt_ushort3(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-ushort4 __attribute__((kernel)) testMinUshort4Ushort4Ushort4(ushort4 inV1, unsigned int x) {
- ushort4 inV2 = rsGetElementAt_ushort4(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-int __attribute__((kernel)) testMinIntIntInt(int inV1, unsigned int x) {
- int inV2 = rsGetElementAt_int(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-int2 __attribute__((kernel)) testMinInt2Int2Int2(int2 inV1, unsigned int x) {
- int2 inV2 = rsGetElementAt_int2(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-int3 __attribute__((kernel)) testMinInt3Int3Int3(int3 inV1, unsigned int x) {
- int3 inV2 = rsGetElementAt_int3(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-int4 __attribute__((kernel)) testMinInt4Int4Int4(int4 inV1, unsigned int x) {
- int4 inV2 = rsGetElementAt_int4(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-uint __attribute__((kernel)) testMinUintUintUint(uint inV1, unsigned int x) {
- uint inV2 = rsGetElementAt_uint(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-uint2 __attribute__((kernel)) testMinUint2Uint2Uint2(uint2 inV1, unsigned int x) {
- uint2 inV2 = rsGetElementAt_uint2(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-uint3 __attribute__((kernel)) testMinUint3Uint3Uint3(uint3 inV1, unsigned int x) {
- uint3 inV2 = rsGetElementAt_uint3(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-uint4 __attribute__((kernel)) testMinUint4Uint4Uint4(uint4 inV1, unsigned int x) {
- uint4 inV2 = rsGetElementAt_uint4(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-long __attribute__((kernel)) testMinLongLongLong(long inV1, unsigned int x) {
- long inV2 = rsGetElementAt_long(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-long2 __attribute__((kernel)) testMinLong2Long2Long2(long2 inV1, unsigned int x) {
- long2 inV2 = rsGetElementAt_long2(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-long3 __attribute__((kernel)) testMinLong3Long3Long3(long3 inV1, unsigned int x) {
- long3 inV2 = rsGetElementAt_long3(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-long4 __attribute__((kernel)) testMinLong4Long4Long4(long4 inV1, unsigned int x) {
- long4 inV2 = rsGetElementAt_long4(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-ulong __attribute__((kernel)) testMinUlongUlongUlong(ulong inV1, unsigned int x) {
- ulong inV2 = rsGetElementAt_ulong(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-ulong2 __attribute__((kernel)) testMinUlong2Ulong2Ulong2(ulong2 inV1, unsigned int x) {
- ulong2 inV2 = rsGetElementAt_ulong2(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-ulong3 __attribute__((kernel)) testMinUlong3Ulong3Ulong3(ulong3 inV1, unsigned int x) {
- ulong3 inV2 = rsGetElementAt_ulong3(gAllocInV2, x);
- return min(inV1, inV2);
-}
-
-ulong4 __attribute__((kernel)) testMinUlong4Ulong4Ulong4(ulong4 inV1, unsigned int x) {
- ulong4 inV2 = rsGetElementAt_ulong4(gAllocInV2, x);
- return min(inV1, inV2);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMinRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestMinRelaxed.rs
deleted file mode 100644
index 29a4d89..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMinRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestMin.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestMixRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestMixRelaxed.rs
deleted file mode 100644
index 6b59e70..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestMixRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestMix.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestModf.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestModf.rs
deleted file mode 100644
index be10983..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestModf.rs
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocOutIret;
-
-float __attribute__((kernel)) testModfFloatFloatFloat(float inX, unsigned int x) {
- float outIret = 0;
- float out = modf(inX, &outIret);
- rsSetElementAt_float(gAllocOutIret, outIret, x);
- return out;
-}
-
-float2 __attribute__((kernel)) testModfFloat2Float2Float2(float2 inX, unsigned int x) {
- float2 outIret = 0;
- float2 out = modf(inX, &outIret);
- rsSetElementAt_float2(gAllocOutIret, outIret, x);
- return out;
-}
-
-float3 __attribute__((kernel)) testModfFloat3Float3Float3(float3 inX, unsigned int x) {
- float3 outIret = 0;
- float3 out = modf(inX, &outIret);
- rsSetElementAt_float3(gAllocOutIret, outIret, x);
- return out;
-}
-
-float4 __attribute__((kernel)) testModfFloat4Float4Float4(float4 inX, unsigned int x) {
- float4 outIret = 0;
- float4 out = modf(inX, &outIret);
- rsSetElementAt_float4(gAllocOutIret, outIret, x);
- return out;
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestModfRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestModfRelaxed.rs
deleted file mode 100644
index 4c9cd9a..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestModfRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestModf.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNanRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNanRelaxed.rs
deleted file mode 100644
index fc7b9eb..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNanRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNan.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcosRelaxed.rs
deleted file mode 100644
index 01a9de2..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcosRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeAcos.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcoshRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcoshRelaxed.rs
deleted file mode 100644
index 9ea7b88..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcoshRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeAcosh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcospiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcospiRelaxed.rs
deleted file mode 100644
index ff6025e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAcospiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeAcospi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinRelaxed.rs
deleted file mode 100644
index 9d04b24..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeAsin.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinhRelaxed.rs
deleted file mode 100644
index 1155084..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeAsinh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinpiRelaxed.rs
deleted file mode 100644
index 83a97d3..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAsinpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeAsinpi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2Relaxed.rs
deleted file mode 100644
index 40e8b3e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeAtan2.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2pi.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2pi.rs
deleted file mode 100644
index ea3e3f9..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2pi.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocInX;
-
-float __attribute__((kernel)) testNativeAtan2piFloatFloatFloat(float inY, unsigned int x) {
- float inX = rsGetElementAt_float(gAllocInX, x);
- return native_atan2pi(inY, inX);
-}
-
-float2 __attribute__((kernel)) testNativeAtan2piFloat2Float2Float2(float2 inY, unsigned int x) {
- float2 inX = rsGetElementAt_float2(gAllocInX, x);
- return native_atan2pi(inY, inX);
-}
-
-float3 __attribute__((kernel)) testNativeAtan2piFloat3Float3Float3(float3 inY, unsigned int x) {
- float3 inX = rsGetElementAt_float3(gAllocInX, x);
- return native_atan2pi(inY, inX);
-}
-
-float4 __attribute__((kernel)) testNativeAtan2piFloat4Float4Float4(float4 inY, unsigned int x) {
- float4 inX = rsGetElementAt_float4(gAllocInX, x);
- return native_atan2pi(inY, inX);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2piRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2piRelaxed.rs
deleted file mode 100644
index e301936..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtan2piRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeAtan2pi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanRelaxed.rs
deleted file mode 100644
index 083f168..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeAtan.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanhRelaxed.rs
deleted file mode 100644
index 40442c7..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeAtanh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanpiRelaxed.rs
deleted file mode 100644
index 7758862..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeAtanpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeAtanpi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCbrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCbrtRelaxed.rs
deleted file mode 100644
index 2a49b9e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCbrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeCbrt.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCoshRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCoshRelaxed.rs
deleted file mode 100644
index 138b5c2..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCoshRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeCosh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCospiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCospiRelaxed.rs
deleted file mode 100644
index f72429e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeCospiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeCospi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDistance.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDistance.rs
deleted file mode 100644
index d9c215c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDistance.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocInRhs;
-
-float __attribute__((kernel)) testNativeDistanceFloatFloatFloat(float inLhs, unsigned int x) {
- float inRhs = rsGetElementAt_float(gAllocInRhs, x);
- return native_distance(inLhs, inRhs);
-}
-
-float __attribute__((kernel)) testNativeDistanceFloat2Float2Float(float2 inLhs, unsigned int x) {
- float2 inRhs = rsGetElementAt_float2(gAllocInRhs, x);
- return native_distance(inLhs, inRhs);
-}
-
-float __attribute__((kernel)) testNativeDistanceFloat3Float3Float(float3 inLhs, unsigned int x) {
- float3 inRhs = rsGetElementAt_float3(gAllocInRhs, x);
- return native_distance(inLhs, inRhs);
-}
-
-float __attribute__((kernel)) testNativeDistanceFloat4Float4Float(float4 inLhs, unsigned int x) {
- float4 inRhs = rsGetElementAt_float4(gAllocInRhs, x);
- return native_distance(inLhs, inRhs);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDistanceRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDistanceRelaxed.rs
deleted file mode 100644
index 167b79a..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDistanceRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeDistance.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDivide.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDivide.rs
deleted file mode 100644
index ee36b50..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDivide.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocInRhs;
-
-float __attribute__((kernel)) testNativeDivideFloatFloatFloat(float inLhs, unsigned int x) {
- float inRhs = rsGetElementAt_float(gAllocInRhs, x);
- return native_divide(inLhs, inRhs);
-}
-
-float2 __attribute__((kernel)) testNativeDivideFloat2Float2Float2(float2 inLhs, unsigned int x) {
- float2 inRhs = rsGetElementAt_float2(gAllocInRhs, x);
- return native_divide(inLhs, inRhs);
-}
-
-float3 __attribute__((kernel)) testNativeDivideFloat3Float3Float3(float3 inLhs, unsigned int x) {
- float3 inRhs = rsGetElementAt_float3(gAllocInRhs, x);
- return native_divide(inLhs, inRhs);
-}
-
-float4 __attribute__((kernel)) testNativeDivideFloat4Float4Float4(float4 inLhs, unsigned int x) {
- float4 inRhs = rsGetElementAt_float4(gAllocInRhs, x);
- return native_divide(inLhs, inRhs);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDivideRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDivideRelaxed.rs
deleted file mode 100644
index b6d5004..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeDivideRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeDivide.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp10Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp10Relaxed.rs
deleted file mode 100644
index 4f12665..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp10Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeExp10.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp2Relaxed.rs
deleted file mode 100644
index 8b99710..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExp2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeExp2.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpm1Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpm1Relaxed.rs
deleted file mode 100644
index a74a0d1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeExpm1Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeExpm1.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeHypot.java b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeHypot.java
deleted file mode 100644
index 0a50675..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeHypot.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestNativeHypot extends RSBaseCompute {
-
- private ScriptC_TestNativeHypot script;
- private ScriptC_TestNativeHypotRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestNativeHypot(mRS);
- scriptRelaxed = new ScriptC_TestNativeHypotRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloatFloat {
- public float inX;
- public float inY;
- public Target.Floaty out;
- }
-
- private void checkNativeHypotFloatFloatFloat() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3d61f129bdf66018l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x3d61f129bdf66019l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNativeHypotFloatFloatFloat(inX, out);
- verifyResultsNativeHypotFloatFloatFloat(inX, inY, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloatFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNativeHypotFloatFloatFloat(inX, out);
- verifyResultsNativeHypotFloatFloatFloat(inX, inY, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloatFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsNativeHypotFloatFloatFloat(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 1];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 1];
- inY.copyTo(arrayInY);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i];
- args.inY = arrayInY[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeNativeHypot(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
- message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkNativeHypotFloatFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkNativeHypotFloat2Float2Float2() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x92a8064760a50e64l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x92a8064760a50e65l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNativeHypotFloat2Float2Float2(inX, out);
- verifyResultsNativeHypotFloat2Float2Float2(inX, inY, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat2Float2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNativeHypotFloat2Float2Float2(inX, out);
- verifyResultsNativeHypotFloat2Float2Float2(inX, inY, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat2Float2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsNativeHypotFloat2Float2Float2(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 2];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 2];
- inY.copyTo(arrayInY);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 2 + j];
- args.inY = arrayInY[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeNativeHypot(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
- message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkNativeHypotFloat2Float2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkNativeHypotFloat3Float3Float3() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xe70ce46762831005l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xe70ce46762831006l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNativeHypotFloat3Float3Float3(inX, out);
- verifyResultsNativeHypotFloat3Float3Float3(inX, inY, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat3Float3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNativeHypotFloat3Float3Float3(inX, out);
- verifyResultsNativeHypotFloat3Float3Float3(inX, inY, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat3Float3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsNativeHypotFloat3Float3Float3(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeNativeHypot(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
- message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkNativeHypotFloat3Float3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkNativeHypotFloat4Float4Float4() {
- Allocation inX = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3b71c287646111a6l, false);
- Allocation inY = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x3b71c287646111a7l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInY(inY);
- script.forEach_testNativeHypotFloat4Float4Float4(inX, out);
- verifyResultsNativeHypotFloat4Float4Float4(inX, inY, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat4Float4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInY(inY);
- scriptRelaxed.forEach_testNativeHypotFloat4Float4Float4(inX, out);
- verifyResultsNativeHypotFloat4Float4Float4(inX, inY, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testNativeHypotFloat4Float4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsNativeHypotFloat4Float4Float4(Allocation inX, Allocation inY, Allocation out, boolean relaxed) {
- float[] arrayInX = new float[INPUTSIZE * 4];
- inX.copyTo(arrayInX);
- float[] arrayInY = new float[INPUTSIZE * 4];
- inY.copyTo(arrayInY);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatFloat args = new ArgumentsFloatFloatFloat();
- args.inX = arrayInX[i * 4 + j];
- args.inY = arrayInY[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeNativeHypot(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inX: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inX, Float.floatToRawIntBits(args.inX), args.inX));
- message.append("\n");
- message.append("Input inY: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inY, Float.floatToRawIntBits(args.inY), args.inY));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkNativeHypotFloat4Float4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testNativeHypot() {
- checkNativeHypotFloatFloatFloat();
- checkNativeHypotFloat2Float2Float2();
- checkNativeHypotFloat3Float3Float3();
- checkNativeHypotFloat4Float4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeHypotRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeHypotRelaxed.rs
deleted file mode 100644
index 79aa107..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeHypotRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeHypot.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLengthRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLengthRelaxed.rs
deleted file mode 100644
index cb03c1e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLengthRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeLength.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog10Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog10Relaxed.rs
deleted file mode 100644
index a00ed08..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog10Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeLog10.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog1pRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog1pRelaxed.rs
deleted file mode 100644
index 3411c6e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog1pRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeLog1p.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog2Relaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog2Relaxed.rs
deleted file mode 100644
index 71c2580..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeLog2Relaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeLog2.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeNormalizeRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeNormalizeRelaxed.rs
deleted file mode 100644
index 9050ff3..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeNormalizeRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeNormalize.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativePowrRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativePowrRelaxed.rs
deleted file mode 100644
index 069e40e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativePowrRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativePowr.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRecipRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRecipRelaxed.rs
deleted file mode 100644
index f2cbc83..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRecipRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeRecip.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRootnRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRootnRelaxed.rs
deleted file mode 100644
index 3b05992..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRootnRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeRootn.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRsqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRsqrtRelaxed.rs
deleted file mode 100644
index c18cc22..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeRsqrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeRsqrt.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSincosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSincosRelaxed.rs
deleted file mode 100644
index 175e265..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSincosRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeSincos.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinhRelaxed.rs
deleted file mode 100644
index 7ba4ce8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeSinh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinpiRelaxed.rs
deleted file mode 100644
index 2bc871f..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSinpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeSinpi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSqrtRelaxed.rs
deleted file mode 100644
index aa39435..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeSqrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeSqrt.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanhRelaxed.rs
deleted file mode 100644
index 27c9275..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeTanh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanpiRelaxed.rs
deleted file mode 100644
index 921fa3c..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestNativeTanpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestNativeTanpi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestPowRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestPowRelaxed.rs
deleted file mode 100644
index eae1207..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestPowRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestPow.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestPownRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestPownRelaxed.rs
deleted file mode 100644
index d35cd0b..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestPownRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestPown.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestPowrRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestPowrRelaxed.rs
deleted file mode 100644
index 95e6f84..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestPowrRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestPowr.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRadiansRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestRadiansRelaxed.rs
deleted file mode 100644
index fa9209f..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRadiansRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestRadians.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRemquo.java b/tests/tests/renderscript/src/android/renderscript/cts/TestRemquo.java
deleted file mode 100644
index 7052dd1..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRemquo.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestRemquo extends RSBaseCompute {
-
- private ScriptC_TestRemquo script;
- private ScriptC_TestRemquoRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestRemquo(mRS);
- scriptRelaxed = new ScriptC_TestRemquoRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloatIntFloat {
- public float inB;
- public float inC;
- public int outD;
- public float out;
- }
-
- private void checkRemquoFloatFloatIntFloat() {
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x118af9b82db63b13l, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x118af9b82db63b14l, false);
- try {
- Allocation outD = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.set_gAllocInC(inC);
- script.set_gAllocOutD(outD);
- script.forEach_testRemquoFloatFloatIntFloat(inB, out);
- verifyResultsRemquoFloatFloatIntFloat(inB, inC, outD, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloatFloatIntFloat: " + e.toString());
- }
- try {
- Allocation outD = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 1), INPUTSIZE);
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.set_gAllocOutD(outD);
- scriptRelaxed.forEach_testRemquoFloatFloatIntFloat(inB, out);
- verifyResultsRemquoFloatFloatIntFloat(inB, inC, outD, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloatFloatIntFloat: " + e.toString());
- }
- }
-
- private void verifyResultsRemquoFloatFloatIntFloat(Allocation inB, Allocation inC, Allocation outD, Allocation out, boolean relaxed) {
- float[] arrayInB = new float[INPUTSIZE * 1];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 1];
- inC.copyTo(arrayInC);
- int[] arrayOutD = new int[INPUTSIZE * 1];
- outD.copyTo(arrayOutD);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatIntFloat args = new ArgumentsFloatFloatIntFloat();
- args.inB = arrayInB[i];
- args.inC = arrayInC[i];
- // Extract the outputs.
- args.outD = arrayOutD[i * 1 + j];
- args.out = arrayOut[i * 1 + j];
- // Ask the CoreMathVerifier to validate.
- Target target = new Target(relaxed);
- String errorMessage = CoreMathVerifier.verifyRemquo(args, target);
- boolean valid = errorMessage == null;
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Output outD: ");
- message.append(String.format("%d", args.outD));
- message.append("\n");
- message.append("Output out: ");
- message.append(Float.toString(args.out));
- message.append("\n");
- message.append(errorMessage);
- assertTrue("Incorrect output for checkRemquoFloatFloatIntFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRemquoFloat2Float2Int2Float2() {
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x9b98a1a6b125f903l, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x9b98a1a6b125f904l, false);
- try {
- Allocation outD = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.set_gAllocInC(inC);
- script.set_gAllocOutD(outD);
- script.forEach_testRemquoFloat2Float2Int2Float2(inB, out);
- verifyResultsRemquoFloat2Float2Int2Float2(inB, inC, outD, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat2Float2Int2Float2: " + e.toString());
- }
- try {
- Allocation outD = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 2), INPUTSIZE);
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.set_gAllocOutD(outD);
- scriptRelaxed.forEach_testRemquoFloat2Float2Int2Float2(inB, out);
- verifyResultsRemquoFloat2Float2Int2Float2(inB, inC, outD, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat2Float2Int2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsRemquoFloat2Float2Int2Float2(Allocation inB, Allocation inC, Allocation outD, Allocation out, boolean relaxed) {
- float[] arrayInB = new float[INPUTSIZE * 2];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 2];
- inC.copyTo(arrayInC);
- int[] arrayOutD = new int[INPUTSIZE * 2];
- outD.copyTo(arrayOutD);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatIntFloat args = new ArgumentsFloatFloatIntFloat();
- args.inB = arrayInB[i * 2 + j];
- args.inC = arrayInC[i * 2 + j];
- // Extract the outputs.
- args.outD = arrayOutD[i * 2 + j];
- args.out = arrayOut[i * 2 + j];
- // Ask the CoreMathVerifier to validate.
- Target target = new Target(relaxed);
- String errorMessage = CoreMathVerifier.verifyRemquo(args, target);
- boolean valid = errorMessage == null;
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Output outD: ");
- message.append(String.format("%d", args.outD));
- message.append("\n");
- message.append("Output out: ");
- message.append(Float.toString(args.out));
- message.append("\n");
- message.append(errorMessage);
- assertTrue("Incorrect output for checkRemquoFloat2Float2Int2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRemquoFloat3Float3Int3Float3() {
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xa049a00a6911ca8fl, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xa049a00a6911ca90l, false);
- try {
- Allocation outD = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.set_gAllocInC(inC);
- script.set_gAllocOutD(outD);
- script.forEach_testRemquoFloat3Float3Int3Float3(inB, out);
- verifyResultsRemquoFloat3Float3Int3Float3(inB, inC, outD, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat3Float3Int3Float3: " + e.toString());
- }
- try {
- Allocation outD = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 3), INPUTSIZE);
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.set_gAllocOutD(outD);
- scriptRelaxed.forEach_testRemquoFloat3Float3Int3Float3(inB, out);
- verifyResultsRemquoFloat3Float3Int3Float3(inB, inC, outD, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat3Float3Int3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsRemquoFloat3Float3Int3Float3(Allocation inB, Allocation inC, Allocation outD, Allocation out, boolean relaxed) {
- float[] arrayInB = new float[INPUTSIZE * 4];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 4];
- inC.copyTo(arrayInC);
- int[] arrayOutD = new int[INPUTSIZE * 4];
- outD.copyTo(arrayOutD);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatIntFloat args = new ArgumentsFloatFloatIntFloat();
- args.inB = arrayInB[i * 4 + j];
- args.inC = arrayInC[i * 4 + j];
- // Extract the outputs.
- args.outD = arrayOutD[i * 4 + j];
- args.out = arrayOut[i * 4 + j];
- // Ask the CoreMathVerifier to validate.
- Target target = new Target(relaxed);
- String errorMessage = CoreMathVerifier.verifyRemquo(args, target);
- boolean valid = errorMessage == null;
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Output outD: ");
- message.append(String.format("%d", args.outD));
- message.append("\n");
- message.append("Output out: ");
- message.append(Float.toString(args.out));
- message.append("\n");
- message.append(errorMessage);
- assertTrue("Incorrect output for checkRemquoFloat3Float3Int3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRemquoFloat4Float4Int4Float4() {
- Allocation inB = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xa4fa9e6e20fd9c1bl, false);
- Allocation inC = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xa4fa9e6e20fd9c1cl, false);
- try {
- Allocation outD = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.set_gAllocInC(inC);
- script.set_gAllocOutD(outD);
- script.forEach_testRemquoFloat4Float4Int4Float4(inB, out);
- verifyResultsRemquoFloat4Float4Int4Float4(inB, inC, outD, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat4Float4Int4Float4: " + e.toString());
- }
- try {
- Allocation outD = Allocation.createSized(mRS, getElement(mRS, Element.DataType.SIGNED_32, 4), INPUTSIZE);
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.set_gAllocInC(inC);
- scriptRelaxed.set_gAllocOutD(outD);
- scriptRelaxed.forEach_testRemquoFloat4Float4Int4Float4(inB, out);
- verifyResultsRemquoFloat4Float4Int4Float4(inB, inC, outD, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRemquoFloat4Float4Int4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsRemquoFloat4Float4Int4Float4(Allocation inB, Allocation inC, Allocation outD, Allocation out, boolean relaxed) {
- float[] arrayInB = new float[INPUTSIZE * 4];
- inB.copyTo(arrayInB);
- float[] arrayInC = new float[INPUTSIZE * 4];
- inC.copyTo(arrayInC);
- int[] arrayOutD = new int[INPUTSIZE * 4];
- outD.copyTo(arrayOutD);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloatIntFloat args = new ArgumentsFloatFloatIntFloat();
- args.inB = arrayInB[i * 4 + j];
- args.inC = arrayInC[i * 4 + j];
- // Extract the outputs.
- args.outD = arrayOutD[i * 4 + j];
- args.out = arrayOut[i * 4 + j];
- // Ask the CoreMathVerifier to validate.
- Target target = new Target(relaxed);
- String errorMessage = CoreMathVerifier.verifyRemquo(args, target);
- boolean valid = errorMessage == null;
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input inB: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inB, Float.floatToRawIntBits(args.inB), args.inB));
- message.append("\n");
- message.append("Input inC: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.inC, Float.floatToRawIntBits(args.inC), args.inC));
- message.append("\n");
- message.append("Output outD: ");
- message.append(String.format("%d", args.outD));
- message.append("\n");
- message.append("Output out: ");
- message.append(Float.toString(args.out));
- message.append("\n");
- message.append(errorMessage);
- assertTrue("Incorrect output for checkRemquoFloat4Float4Int4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testRemquo() {
- checkRemquoFloatFloatIntFloat();
- checkRemquoFloat2Float2Int2Float2();
- checkRemquoFloat3Float3Int3Float3();
- checkRemquoFloat4Float4Int4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRemquo.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestRemquo.rs
deleted file mode 100644
index 032e6c0..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRemquo.rs
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-rs_allocation gAllocInC;
-rs_allocation gAllocOutD;
-
-float __attribute__((kernel)) testRemquoFloatFloatIntFloat(float inB, unsigned int x) {
- float inC = rsGetElementAt_float(gAllocInC, x);
- int outD = 0;
- float out = remquo(inB, inC, &outD);
- rsSetElementAt_int(gAllocOutD, outD, x);
- return out;
-}
-
-float2 __attribute__((kernel)) testRemquoFloat2Float2Int2Float2(float2 inB, unsigned int x) {
- float2 inC = rsGetElementAt_float2(gAllocInC, x);
- int2 outD = 0;
- float2 out = remquo(inB, inC, &outD);
- rsSetElementAt_int2(gAllocOutD, outD, x);
- return out;
-}
-
-float3 __attribute__((kernel)) testRemquoFloat3Float3Int3Float3(float3 inB, unsigned int x) {
- float3 inC = rsGetElementAt_float3(gAllocInC, x);
- int3 outD = 0;
- float3 out = remquo(inB, inC, &outD);
- rsSetElementAt_int3(gAllocOutD, outD, x);
- return out;
-}
-
-float4 __attribute__((kernel)) testRemquoFloat4Float4Int4Float4(float4 inB, unsigned int x) {
- float4 inC = rsGetElementAt_float4(gAllocInC, x);
- int4 outD = 0;
- float4 out = remquo(inB, inC, &outD);
- rsSetElementAt_int4(gAllocOutD, outD, x);
- return out;
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRemquoRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestRemquoRelaxed.rs
deleted file mode 100644
index 3962532..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRemquoRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestRemquo.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRint.java b/tests/tests/renderscript/src/android/renderscript/cts/TestRint.java
deleted file mode 100644
index 6d42aeb..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRint.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestRint extends RSBaseCompute {
-
- private ScriptC_TestRint script;
- private ScriptC_TestRintRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestRint(mRS);
- scriptRelaxed = new ScriptC_TestRintRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkRintFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xfe569fda5dbe93fal, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testRintFloatFloat(in, out);
- verifyResultsRintFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testRintFloatFloat(in, out);
- verifyResultsRintFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsRintFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRint(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRintFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRintFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xffa7b22ac6b343c6l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testRintFloat2Float2(in, out);
- verifyResultsRintFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testRintFloat2Float2(in, out);
- verifyResultsRintFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsRintFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRint(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRintFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRintFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xffa7bccc25b9d960l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testRintFloat3Float3(in, out);
- verifyResultsRintFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testRintFloat3Float3(in, out);
- verifyResultsRintFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsRintFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRint(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRintFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRintFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xffa7c76d84c06efal, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testRintFloat4Float4(in, out);
- verifyResultsRintFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testRintFloat4Float4(in, out);
- verifyResultsRintFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRintFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsRintFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRint(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRintFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testRint() {
- checkRintFloatFloat();
- checkRintFloat2Float2();
- checkRintFloat3Float3();
- checkRintFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRint.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestRint.rs
deleted file mode 100644
index a551d68..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRint.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testRintFloatFloat(float in) {
- return rint(in);
-}
-
-float2 __attribute__((kernel)) testRintFloat2Float2(float2 in) {
- return rint(in);
-}
-
-float3 __attribute__((kernel)) testRintFloat3Float3(float3 in) {
- return rint(in);
-}
-
-float4 __attribute__((kernel)) testRintFloat4Float4(float4 in) {
- return rint(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRintRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestRintRelaxed.rs
deleted file mode 100644
index 9fb4636..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRintRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestRint.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRootnRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestRootnRelaxed.rs
deleted file mode 100644
index e42d664..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRootnRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestRootn.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRound.java b/tests/tests/renderscript/src/android/renderscript/cts/TestRound.java
deleted file mode 100644
index f9c9a9d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRound.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestRound extends RSBaseCompute {
-
- private ScriptC_TestRound script;
- private ScriptC_TestRoundRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestRound(mRS);
- scriptRelaxed = new ScriptC_TestRoundRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkRoundFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x377ca8d7e9a82fc7l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testRoundFloatFloat(in, out);
- verifyResultsRoundFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testRoundFloatFloat(in, out);
- verifyResultsRoundFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsRoundFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRound(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRoundFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRoundFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc35ea17250f98f6bl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testRoundFloat2Float2(in, out);
- verifyResultsRoundFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testRoundFloat2Float2(in, out);
- verifyResultsRoundFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsRoundFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRound(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRoundFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRoundFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xc35eac13b0002505l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testRoundFloat3Float3(in, out);
- verifyResultsRoundFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testRoundFloat3Float3(in, out);
- verifyResultsRoundFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsRoundFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRound(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRoundFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRoundFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc35eb6b50f06ba9fl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testRoundFloat4Float4(in, out);
- verifyResultsRoundFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testRoundFloat4Float4(in, out);
- verifyResultsRoundFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRoundFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsRoundFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRound(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRoundFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testRound() {
- checkRoundFloatFloat();
- checkRoundFloat2Float2();
- checkRoundFloat3Float3();
- checkRoundFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRoundRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestRoundRelaxed.rs
deleted file mode 100644
index ebbdccf..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRoundRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestRound.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRsqrt.java b/tests/tests/renderscript/src/android/renderscript/cts/TestRsqrt.java
deleted file mode 100644
index 7b57621..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRsqrt.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestRsqrt extends RSBaseCompute {
-
- private ScriptC_TestRsqrt script;
- private ScriptC_TestRsqrtRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestRsqrt(mRS);
- scriptRelaxed = new ScriptC_TestRsqrtRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkRsqrtFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x736e0d9786ef9c2bl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testRsqrtFloatFloat(in, out);
- verifyResultsRsqrtFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testRsqrtFloatFloat(in, out);
- verifyResultsRsqrtFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsRsqrtFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRsqrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRsqrtFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRsqrtFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xb5df4d6949d76dafl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testRsqrtFloat2Float2(in, out);
- verifyResultsRsqrtFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testRsqrtFloat2Float2(in, out);
- verifyResultsRsqrtFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsRsqrtFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRsqrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRsqrtFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRsqrtFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xb5df580aa8de0349l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testRsqrtFloat3Float3(in, out);
- verifyResultsRsqrtFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testRsqrtFloat3Float3(in, out);
- verifyResultsRsqrtFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsRsqrtFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRsqrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRsqrtFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkRsqrtFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xb5df62ac07e498e3l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testRsqrtFloat4Float4(in, out);
- verifyResultsRsqrtFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testRsqrtFloat4Float4(in, out);
- verifyResultsRsqrtFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testRsqrtFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsRsqrtFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeRsqrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkRsqrtFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testRsqrt() {
- checkRsqrtFloatFloat();
- checkRsqrtFloat2Float2();
- checkRsqrtFloat3Float3();
- checkRsqrtFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestRsqrtRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestRsqrtRelaxed.rs
deleted file mode 100644
index 262761e..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestRsqrtRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestRsqrt.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSignRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestSignRelaxed.rs
deleted file mode 100644
index 1bc69fb..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSignRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestSign.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSin.java b/tests/tests/renderscript/src/android/renderscript/cts/TestSin.java
deleted file mode 100644
index ae039e2..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSin.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestSin extends RSBaseCompute {
-
- private ScriptC_TestSin script;
- private ScriptC_TestSinRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestSin(mRS);
- scriptRelaxed = new ScriptC_TestSinRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkSinFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xd3e99dcfa01359f9l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSinFloatFloat(in, out);
- verifyResultsSinFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSinFloatFloat(in, out);
- verifyResultsSinFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsSinFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSin(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSinFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x9253f296dcfd528dl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSinFloat2Float2(in, out);
- verifyResultsSinFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSinFloat2Float2(in, out);
- verifyResultsSinFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsSinFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSin(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSinFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x9253fd383c03e827l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSinFloat3Float3(in, out);
- verifyResultsSinFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSinFloat3Float3(in, out);
- verifyResultsSinFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsSinFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSin(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSinFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x925407d99b0a7dc1l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSinFloat4Float4(in, out);
- verifyResultsSinFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSinFloat4Float4(in, out);
- verifyResultsSinFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsSinFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSin(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testSin() {
- checkSinFloatFloat();
- checkSinFloat2Float2();
- checkSinFloat3Float3();
- checkSinFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSin.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestSin.rs
deleted file mode 100644
index 15e78ba..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSin.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testSinFloatFloat(float in) {
- return sin(in);
-}
-
-float2 __attribute__((kernel)) testSinFloat2Float2(float2 in) {
- return sin(in);
-}
-
-float3 __attribute__((kernel)) testSinFloat3Float3(float3 in) {
- return sin(in);
-}
-
-float4 __attribute__((kernel)) testSinFloat4Float4(float4 in) {
- return sin(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSinRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestSinRelaxed.rs
deleted file mode 100644
index e9e4912..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSinRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestSin.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSincosRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestSincosRelaxed.rs
deleted file mode 100644
index 56cb9fc..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSincosRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestSincos.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSinh.java b/tests/tests/renderscript/src/android/renderscript/cts/TestSinh.java
deleted file mode 100644
index 1ebcba2..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSinh.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestSinh extends RSBaseCompute {
-
- private ScriptC_TestSinh script;
- private ScriptC_TestSinhRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestSinh(mRS);
- scriptRelaxed = new ScriptC_TestSinhRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkSinhFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x541c2eef0a5d2ff1l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSinhFloatFloat(in, out);
- verifyResultsSinhFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSinhFloatFloat(in, out);
- verifyResultsSinhFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsSinhFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSinh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinhFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSinhFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x7f8e1e7d8c47bec5l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSinhFloat2Float2(in, out);
- verifyResultsSinhFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSinhFloat2Float2(in, out);
- verifyResultsSinhFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsSinhFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSinh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinhFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSinhFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x7f8e291eeb4e545fl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSinhFloat3Float3(in, out);
- verifyResultsSinhFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSinhFloat3Float3(in, out);
- verifyResultsSinhFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsSinhFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSinh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinhFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSinhFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x7f8e33c04a54e9f9l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSinhFloat4Float4(in, out);
- verifyResultsSinhFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSinhFloat4Float4(in, out);
- verifyResultsSinhFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinhFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsSinhFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSinh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinhFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testSinh() {
- checkSinhFloatFloat();
- checkSinhFloat2Float2();
- checkSinhFloat3Float3();
- checkSinhFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSinh.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestSinh.rs
deleted file mode 100644
index bd94f0d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSinh.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testSinhFloatFloat(float in) {
- return sinh(in);
-}
-
-float2 __attribute__((kernel)) testSinhFloat2Float2(float2 in) {
- return sinh(in);
-}
-
-float3 __attribute__((kernel)) testSinhFloat3Float3(float3 in) {
- return sinh(in);
-}
-
-float4 __attribute__((kernel)) testSinhFloat4Float4(float4 in) {
- return sinh(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSinhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestSinhRelaxed.rs
deleted file mode 100644
index 8ca3390..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSinhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestSinh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSinpi.java b/tests/tests/renderscript/src/android/renderscript/cts/TestSinpi.java
deleted file mode 100644
index 2df09b8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSinpi.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestSinpi extends RSBaseCompute {
-
- private ScriptC_TestSinpi script;
- private ScriptC_TestSinpiRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestSinpi(mRS);
- scriptRelaxed = new ScriptC_TestSinpiRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkSinpiFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x34cb59f49416da82l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSinpiFloatFloat(in, out);
- verifyResultsSinpiFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSinpiFloatFloat(in, out);
- verifyResultsSinpiFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsSinpiFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSinpi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinpiFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSinpiFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x50bbd97d4a48b00el, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSinpiFloat2Float2(in, out);
- verifyResultsSinpiFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSinpiFloat2Float2(in, out);
- verifyResultsSinpiFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsSinpiFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSinpi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinpiFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSinpiFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x50bbe41ea94f45a8l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSinpiFloat3Float3(in, out);
- verifyResultsSinpiFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSinpiFloat3Float3(in, out);
- verifyResultsSinpiFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsSinpiFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSinpi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinpiFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSinpiFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x50bbeec00855db42l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSinpiFloat4Float4(in, out);
- verifyResultsSinpiFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSinpiFloat4Float4(in, out);
- verifyResultsSinpiFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSinpiFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsSinpiFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSinpi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSinpiFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testSinpi() {
- checkSinpiFloatFloat();
- checkSinpiFloat2Float2();
- checkSinpiFloat3Float3();
- checkSinpiFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSinpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestSinpiRelaxed.rs
deleted file mode 100644
index dd611a7..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSinpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestSinpi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSqrt.java b/tests/tests/renderscript/src/android/renderscript/cts/TestSqrt.java
deleted file mode 100644
index 4537c3d..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSqrt.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestSqrt extends RSBaseCompute {
-
- private ScriptC_TestSqrt script;
- private ScriptC_TestSqrtRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestSqrt(mRS);
- scriptRelaxed = new ScriptC_TestSqrtRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkSqrtFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x940922bedb2c9271l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testSqrtFloatFloat(in, out);
- verifyResultsSqrtFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testSqrtFloatFloat(in, out);
- verifyResultsSqrtFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsSqrtFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSqrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSqrtFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSqrtFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x35fb1678b6262d45l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testSqrtFloat2Float2(in, out);
- verifyResultsSqrtFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testSqrtFloat2Float2(in, out);
- verifyResultsSqrtFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsSqrtFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSqrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSqrtFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSqrtFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x35fb211a152cc2dfl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testSqrtFloat3Float3(in, out);
- verifyResultsSqrtFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testSqrtFloat3Float3(in, out);
- verifyResultsSqrtFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsSqrtFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSqrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSqrtFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkSqrtFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x35fb2bbb74335879l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testSqrtFloat4Float4(in, out);
- verifyResultsSqrtFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testSqrtFloat4Float4(in, out);
- verifyResultsSqrtFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testSqrtFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsSqrtFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeSqrt(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkSqrtFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testSqrt() {
- checkSqrtFloatFloat();
- checkSqrtFloat2Float2();
- checkSqrtFloat3Float3();
- checkSqrtFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestSqrt.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestSqrt.rs
deleted file mode 100644
index f1c163b..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestSqrt.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testSqrtFloatFloat(float in) {
- return sqrt(in);
-}
-
-float2 __attribute__((kernel)) testSqrtFloat2Float2(float2 in) {
- return sqrt(in);
-}
-
-float3 __attribute__((kernel)) testSqrtFloat3Float3(float3 in) {
- return sqrt(in);
-}
-
-float4 __attribute__((kernel)) testSqrtFloat4Float4(float4 in) {
- return sqrt(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestStepRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestStepRelaxed.rs
deleted file mode 100644
index b2bad68..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestStepRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestStep.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.java b/tests/tests/renderscript/src/android/renderscript/cts/TestTan.java
deleted file mode 100644
index 29dae6f..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTan.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestTan extends RSBaseCompute {
-
- private ScriptC_TestTan script;
- private ScriptC_TestTanRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestTan(mRS);
- scriptRelaxed = new ScriptC_TestTanRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkTanFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xfb95a6a791c2b8eal, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testTanFloatFloat(in, out);
- verifyResultsTanFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testTanFloatFloat(in, out);
- verifyResultsTanFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsTanFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTan(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTanFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x1bdfd24778a20d36l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testTanFloat2Float2(in, out);
- verifyResultsTanFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testTanFloat2Float2(in, out);
- verifyResultsTanFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsTanFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTan(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTanFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x1bdfdce8d7a8a2d0l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testTanFloat3Float3(in, out);
- verifyResultsTanFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testTanFloat3Float3(in, out);
- verifyResultsTanFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsTanFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTan(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTanFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x1bdfe78a36af386al, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testTanFloat4Float4(in, out);
- verifyResultsTanFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testTanFloat4Float4(in, out);
- verifyResultsTanFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsTanFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTan(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testTan() {
- checkTanFloatFloat();
- checkTanFloat2Float2();
- checkTanFloat3Float3();
- checkTanFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTanRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestTanRelaxed.rs
deleted file mode 100644
index 9297033..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTanRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestTan.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTanh.java b/tests/tests/renderscript/src/android/renderscript/cts/TestTanh.java
deleted file mode 100644
index e554ad8..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTanh.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestTanh extends RSBaseCompute {
-
- private ScriptC_TestTanh script;
- private ScriptC_TestTanhRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestTanh(mRS);
- scriptRelaxed = new ScriptC_TestTanhRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkTanhFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xfe01ab34a2d2226cl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testTanhFloatFloat(in, out);
- verifyResultsTanhFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testTanhFloatFloat(in, out);
- verifyResultsTanhFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsTanhFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTanh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanhFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTanhFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x9a0cb127b0f31928l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testTanhFloat2Float2(in, out);
- verifyResultsTanhFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testTanhFloat2Float2(in, out);
- verifyResultsTanhFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsTanhFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTanh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanhFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTanhFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x9a0cbbc90ff9aec2l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testTanhFloat3Float3(in, out);
- verifyResultsTanhFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testTanhFloat3Float3(in, out);
- verifyResultsTanhFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsTanhFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTanh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanhFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTanhFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x9a0cc66a6f00445cl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testTanhFloat4Float4(in, out);
- verifyResultsTanhFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testTanhFloat4Float4(in, out);
- verifyResultsTanhFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanhFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsTanhFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTanh(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanhFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testTanh() {
- checkTanhFloatFloat();
- checkTanhFloat2Float2();
- checkTanhFloat3Float3();
- checkTanhFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTanh.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestTanh.rs
deleted file mode 100644
index a017c2b..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTanh.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-
-float __attribute__((kernel)) testTanhFloatFloat(float in) {
- return tanh(in);
-}
-
-float2 __attribute__((kernel)) testTanhFloat2Float2(float2 in) {
- return tanh(in);
-}
-
-float3 __attribute__((kernel)) testTanhFloat3Float3(float3 in) {
- return tanh(in);
-}
-
-float4 __attribute__((kernel)) testTanhFloat4Float4(float4 in) {
- return tanh(in);
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTanhRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestTanhRelaxed.rs
deleted file mode 100644
index f99420a..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTanhRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestTanh.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTanpi.java b/tests/tests/renderscript/src/android/renderscript/cts/TestTanpi.java
deleted file mode 100644
index 5e45440..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTanpi.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestTanpi extends RSBaseCompute {
-
- private ScriptC_TestTanpi script;
- private ScriptC_TestTanpiRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestTanpi(mRS);
- scriptRelaxed = new ScriptC_TestTanpiRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkTanpiFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xbe5739a52fbb952bl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testTanpiFloatFloat(in, out);
- verifyResultsTanpiFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testTanpiFloatFloat(in, out);
- verifyResultsTanpiFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsTanpiFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTanpi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanpiFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTanpiFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xc3fe7c117310deafl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testTanpiFloat2Float2(in, out);
- verifyResultsTanpiFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testTanpiFloat2Float2(in, out);
- verifyResultsTanpiFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsTanpiFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTanpi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanpiFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTanpiFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xc3fe86b2d2177449l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testTanpiFloat3Float3(in, out);
- verifyResultsTanpiFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testTanpiFloat3Float3(in, out);
- verifyResultsTanpiFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsTanpiFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTanpi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanpiFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTanpiFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xc3fe9154311e09e3l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testTanpiFloat4Float4(in, out);
- verifyResultsTanpiFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testTanpiFloat4Float4(in, out);
- verifyResultsTanpiFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTanpiFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsTanpiFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTanpi(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTanpiFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testTanpi() {
- checkTanpiFloatFloat();
- checkTanpiFloat2Float2();
- checkTanpiFloat3Float3();
- checkTanpiFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTanpiRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestTanpiRelaxed.rs
deleted file mode 100644
index 3fc9d28..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTanpiRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestTanpi.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.java b/tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.java
deleted file mode 100644
index c7bb7b5..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTgamma.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestTgamma extends RSBaseCompute {
-
- private ScriptC_TestTgamma script;
- private ScriptC_TestTgammaRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestTgamma(mRS);
- scriptRelaxed = new ScriptC_TestTgammaRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkTgammaFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0xe45f5203be15b490l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testTgammaFloatFloat(in, out);
- verifyResultsTgammaFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testTgammaFloatFloat(in, out);
- verifyResultsTgammaFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsTgammaFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTgamma(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTgammaFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTgammaFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0x74767f039bfd9f2cl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testTgammaFloat2Float2(in, out);
- verifyResultsTgammaFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testTgammaFloat2Float2(in, out);
- verifyResultsTgammaFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsTgammaFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTgamma(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTgammaFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTgammaFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0x747689a4fb0434c6l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testTgammaFloat3Float3(in, out);
- verifyResultsTgammaFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testTgammaFloat3Float3(in, out);
- verifyResultsTgammaFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsTgammaFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTgamma(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTgammaFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTgammaFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0x747694465a0aca60l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testTgammaFloat4Float4(in, out);
- verifyResultsTgammaFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testTgammaFloat4Float4(in, out);
- verifyResultsTgammaFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTgammaFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsTgammaFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTgamma(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTgammaFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testTgamma() {
- checkTgammaFloatFloat();
- checkTgammaFloat2Float2();
- checkTgammaFloat3Float3();
- checkTgammaFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTgammaRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestTgammaRelaxed.rs
deleted file mode 100644
index 7d57ba0..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTgammaRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestTgamma.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTrunc.java b/tests/tests/renderscript/src/android/renderscript/cts/TestTrunc.java
deleted file mode 100644
index 0657844..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTrunc.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
-package android.renderscript.cts;
-
-import android.renderscript.Allocation;
-import android.renderscript.RSRuntimeException;
-import android.renderscript.Element;
-
-public class TestTrunc extends RSBaseCompute {
-
- private ScriptC_TestTrunc script;
- private ScriptC_TestTruncRelaxed scriptRelaxed;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- script = new ScriptC_TestTrunc(mRS);
- scriptRelaxed = new ScriptC_TestTruncRelaxed(mRS);
- }
-
- public class ArgumentsFloatFloat {
- public float in;
- public Target.Floaty out;
- }
-
- private void checkTruncFloatFloat() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 1, 0x6361d71a4dcff881l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- script.forEach_testTruncFloatFloat(in, out);
- verifyResultsTruncFloatFloat(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloatFloat: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 1), INPUTSIZE);
- scriptRelaxed.forEach_testTruncFloatFloat(in, out);
- verifyResultsTruncFloatFloat(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloatFloat: " + e.toString());
- }
- }
-
- private void verifyResultsTruncFloatFloat(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 1];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 1];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 1 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTrunc(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 1 + j], Float.floatToRawIntBits(arrayOut[i * 1 + j]), arrayOut[i * 1 + j]));
- if (!args.out.couldBe(arrayOut[i * 1 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTruncFloatFloat" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTruncFloat2Float2() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 2, 0xcda9bef7b45256d5l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- script.forEach_testTruncFloat2Float2(in, out);
- verifyResultsTruncFloat2Float2(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat2Float2: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 2), INPUTSIZE);
- scriptRelaxed.forEach_testTruncFloat2Float2(in, out);
- verifyResultsTruncFloat2Float2(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat2Float2: " + e.toString());
- }
- }
-
- private void verifyResultsTruncFloat2Float2(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 2];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 2];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 2 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 2 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTrunc(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 2 + j], Float.floatToRawIntBits(arrayOut[i * 2 + j]), arrayOut[i * 2 + j]));
- if (!args.out.couldBe(arrayOut[i * 2 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTruncFloat2Float2" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTruncFloat3Float3() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 3, 0xcda9c9991358ec6fl, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- script.forEach_testTruncFloat3Float3(in, out);
- verifyResultsTruncFloat3Float3(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat3Float3: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 3), INPUTSIZE);
- scriptRelaxed.forEach_testTruncFloat3Float3(in, out);
- verifyResultsTruncFloat3Float3(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat3Float3: " + e.toString());
- }
- }
-
- private void verifyResultsTruncFloat3Float3(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 3 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTrunc(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTruncFloat3Float3" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- private void checkTruncFloat4Float4() {
- Allocation in = createRandomAllocation(mRS, Element.DataType.FLOAT_32, 4, 0xcda9d43a725f8209l, false);
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- script.forEach_testTruncFloat4Float4(in, out);
- verifyResultsTruncFloat4Float4(in, out, false);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat4Float4: " + e.toString());
- }
- try {
- Allocation out = Allocation.createSized(mRS, getElement(mRS, Element.DataType.FLOAT_32, 4), INPUTSIZE);
- scriptRelaxed.forEach_testTruncFloat4Float4(in, out);
- verifyResultsTruncFloat4Float4(in, out, true);
- } catch (Exception e) {
- throw new RSRuntimeException("RenderScript. Can't invoke forEach_testTruncFloat4Float4: " + e.toString());
- }
- }
-
- private void verifyResultsTruncFloat4Float4(Allocation in, Allocation out, boolean relaxed) {
- float[] arrayIn = new float[INPUTSIZE * 4];
- in.copyTo(arrayIn);
- float[] arrayOut = new float[INPUTSIZE * 4];
- out.copyTo(arrayOut);
- for (int i = 0; i < INPUTSIZE; i++) {
- for (int j = 0; j < 4 ; j++) {
- // Extract the inputs.
- ArgumentsFloatFloat args = new ArgumentsFloatFloat();
- args.in = arrayIn[i * 4 + j];
- // Figure out what the outputs should have been.
- Target target = new Target(relaxed);
- CoreMathVerifier.computeTrunc(args, target);
- // Validate the outputs.
- boolean valid = true;
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- valid = false;
- }
- if (!valid) {
- StringBuilder message = new StringBuilder();
- message.append("Input in: ");
- message.append(String.format("%14.8g {%8x} %15a",
- args.in, Float.floatToRawIntBits(args.in), args.in));
- message.append("\n");
- message.append("Expected output out: ");
- message.append(args.out.toString());
- message.append("\n");
- message.append("Actual output out: ");
- message.append(String.format("%14.8g {%8x} %15a",
- arrayOut[i * 4 + j], Float.floatToRawIntBits(arrayOut[i * 4 + j]), arrayOut[i * 4 + j]));
- if (!args.out.couldBe(arrayOut[i * 4 + j])) {
- message.append(" FAIL");
- }
- message.append("\n");
- assertTrue("Incorrect output for checkTruncFloat4Float4" +
- (relaxed ? "_relaxed" : "") + ":\n" + message.toString(), valid);
- }
- }
- }
- }
-
- public void testTrunc() {
- checkTruncFloatFloat();
- checkTruncFloat2Float2();
- checkTruncFloat3Float3();
- checkTruncFloat4Float4();
- }
-}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/TestTruncRelaxed.rs b/tests/tests/renderscript/src/android/renderscript/cts/TestTruncRelaxed.rs
deleted file mode 100644
index b365243..0000000
--- a/tests/tests/renderscript/src/android/renderscript/cts/TestTruncRelaxed.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "TestTrunc.rs"
-#pragma rs_fp_relaxed
-// Don't edit this file! It is auto-generated by frameworks/rs/api/gen_runtime.
-
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/YuvTest.java b/tests/tests/renderscript/src/android/renderscript/cts/YuvTest.java
index 21f4417..5cdfe95 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/YuvTest.java
+++ b/tests/tests/renderscript/src/android/renderscript/cts/YuvTest.java
@@ -72,6 +72,9 @@
return Allocation.createTyped(mRS, Type.createXY(mRS, Element.RGBA_8888(mRS), width, height));
}
+ public Allocation makeOutput_f4() {
+ return Allocation.createTyped(mRS, Type.createXY(mRS, Element.F32_4(mRS), width, height));
+ }
// Test for the API 17 conversion path
// This used a uchar buffer assuming nv21
public void testV17() {
@@ -198,4 +201,81 @@
checkForErrors();
}
+ // Test for the API conversion to float4 RGBA using rsYuvToRGBA, YV12.
+ public void test_YV12_Float4() {
+ mVerify = new ScriptC_verify(mRS);
+ ScriptC_yuv script = new ScriptC_yuv(mRS);
+
+ makeYuvBuffer(512, 512);
+ Allocation aout = makeOutput_f4();
+ Allocation aref = makeOutput_f4();
+
+
+ Type.Builder tb = new Type.Builder(mRS, Element.YUV(mRS));
+ tb.setX(width);
+ tb.setY(height);
+ tb.setYuvFormat(android.graphics.ImageFormat.YV12);
+ Allocation ta = Allocation.createTyped(mRS, tb.create(), Allocation.USAGE_SCRIPT);
+
+ byte tmp[] = new byte[(width * height) + (getCWidth() * getCHeight() * 2)];
+ int i = 0;
+ for (int j = 0; j < (width * height); j++) {
+ tmp[i++] = by[j];
+ }
+ for (int j = 0; j < (getCWidth() * getCHeight()); j++) {
+ tmp[i++] = bu[j];
+ }
+ for (int j = 0; j < (getCWidth() * getCHeight()); j++) {
+ tmp[i++] = bv[j];
+ }
+ ta.copyFrom(tmp);
+ script.invoke_makeRef_f4(ay, au, av, aref);
+
+ script.set_mInput(ta);
+ script.forEach_cvt_f4(aout);
+ mVerify.invoke_verify(aref, aout, ay);
+
+ mRS.finish();
+ mVerify.invoke_checkError();
+ waitForMessage();
+ checkForErrors();
+ }
+
+ // Test for the API conversion to float4 RGBA using rsYuvToRGBA, NV21.
+ public void test_NV21_Float4() {
+ mVerify = new ScriptC_verify(mRS);
+ ScriptC_yuv script = new ScriptC_yuv(mRS);
+
+ makeYuvBuffer(512, 512);
+ Allocation aout = makeOutput_f4();
+ Allocation aref = makeOutput_f4();
+
+
+ Type.Builder tb = new Type.Builder(mRS, Element.YUV(mRS));
+ tb.setX(width);
+ tb.setY(height);
+ tb.setYuvFormat(android.graphics.ImageFormat.NV21);
+ Allocation ta = Allocation.createTyped(mRS, tb.create(), Allocation.USAGE_SCRIPT);
+
+ byte tmp[] = new byte[(width * height) + (getCWidth() * getCHeight() * 2)];
+ int i = 0;
+ for (int j = 0; j < (width * height); j++) {
+ tmp[i++] = by[j];
+ }
+ for (int j = 0; j < (getCWidth() * getCHeight()); j++) {
+ tmp[i++] = bv[j];
+ tmp[i++] = bu[j];
+ }
+ ta.copyFrom(tmp);
+ script.invoke_makeRef_f4(ay, au, av, aref);
+
+ script.set_mInput(ta);
+ script.forEach_cvt_f4(aout);
+ mVerify.invoke_verify(aref, aout, ay);
+
+ mRS.finish();
+ mVerify.invoke_checkError();
+ waitForMessage();
+ checkForErrors();
+ }
}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_resize.rs b/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_resize.rs
index fa8c8dd..ccdf42f 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_resize.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/intrinsic_resize.rs
@@ -242,3 +242,203 @@
return (uchar)p;
}
+float4 __attribute__((kernel)) bicubic_F4(uint32_t x, uint32_t y) {
+ float xf = (x + 0.5f) * scaleX - 0.5f;
+ float yf = (y + 0.5f) * scaleY - 0.5f;
+
+ int startx = (int) floor(xf - 1);
+ int starty = (int) floor(yf - 1);
+ xf = xf - floor(xf);
+ yf = yf - floor(yf);
+ int maxx = gWidthIn - 1;
+ int maxy = gHeightIn - 1;
+
+ uint32_t xs0 = (uint32_t) max(0, startx + 0);
+ uint32_t xs1 = (uint32_t) max(0, startx + 1);
+ uint32_t xs2 = (uint32_t) min(maxx, startx + 2);
+ uint32_t xs3 = (uint32_t) min(maxx, startx + 3);
+
+ uint32_t ys0 = (uint32_t) max(0, starty + 0);
+ uint32_t ys1 = (uint32_t) max(0, starty + 1);
+ uint32_t ys2 = (uint32_t) min(maxy, starty + 2);
+ uint32_t ys3 = (uint32_t) min(maxy, starty + 3);
+
+ float4 p00 = rsGetElementAt_float4(gIn, xs0, ys0);
+ float4 p01 = rsGetElementAt_float4(gIn, xs1, ys0);
+ float4 p02 = rsGetElementAt_float4(gIn, xs2, ys0);
+ float4 p03 = rsGetElementAt_float4(gIn, xs3, ys0);
+ float4 p0 = cubicInterpolate_F4(p00, p01, p02, p03, xf);
+
+ float4 p10 = rsGetElementAt_float4(gIn, xs0, ys1);
+ float4 p11 = rsGetElementAt_float4(gIn, xs1, ys1);
+ float4 p12 = rsGetElementAt_float4(gIn, xs2, ys1);
+ float4 p13 = rsGetElementAt_float4(gIn, xs3, ys1);
+ float4 p1 = cubicInterpolate_F4(p10, p11, p12, p13, xf);
+
+ float4 p20 = rsGetElementAt_float4(gIn, xs0, ys2);
+ float4 p21 = rsGetElementAt_float4(gIn, xs1, ys2);
+ float4 p22 = rsGetElementAt_float4(gIn, xs2, ys2);
+ float4 p23 = rsGetElementAt_float4(gIn, xs3, ys2);
+ float4 p2 = cubicInterpolate_F4(p20, p21, p22, p23, xf);
+
+ float4 p30 = rsGetElementAt_float4(gIn, xs0, ys3);
+ float4 p31 = rsGetElementAt_float4(gIn, xs1, ys3);
+ float4 p32 = rsGetElementAt_float4(gIn, xs2, ys3);
+ float4 p33 = rsGetElementAt_float4(gIn, xs3, ys3);
+ float4 p3 = cubicInterpolate_F4(p30, p31, p32, p33, xf);
+
+ float4 p = cubicInterpolate_F4(p0, p1, p2, p3, yf);
+
+ return p;
+}
+
+float3 __attribute__((kernel)) bicubic_F3(uint32_t x, uint32_t y) {
+ float xf = (x + 0.5f) * scaleX - 0.5f;
+ float yf = (y + 0.5f) * scaleY - 0.5f;
+
+ int startx = (int) floor(xf - 1);
+ int starty = (int) floor(yf - 1);
+ xf = xf - floor(xf);
+ yf = yf - floor(yf);
+ int maxx = gWidthIn - 1;
+ int maxy = gHeightIn - 1;
+
+ uint32_t xs0 = (uint32_t) max(0, startx + 0);
+ uint32_t xs1 = (uint32_t) max(0, startx + 1);
+ uint32_t xs2 = (uint32_t) min(maxx, startx + 2);
+ uint32_t xs3 = (uint32_t) min(maxx, startx + 3);
+
+ uint32_t ys0 = (uint32_t) max(0, starty + 0);
+ uint32_t ys1 = (uint32_t) max(0, starty + 1);
+ uint32_t ys2 = (uint32_t) min(maxy, starty + 2);
+ uint32_t ys3 = (uint32_t) min(maxy, starty + 3);
+
+ float3 p00 = rsGetElementAt_float3(gIn, xs0, ys0);
+ float3 p01 = rsGetElementAt_float3(gIn, xs1, ys0);
+ float3 p02 = rsGetElementAt_float3(gIn, xs2, ys0);
+ float3 p03 = rsGetElementAt_float3(gIn, xs3, ys0);
+ float3 p0 = cubicInterpolate_F3(p00, p01, p02, p03, xf);
+
+ float3 p10 = rsGetElementAt_float3(gIn, xs0, ys1);
+ float3 p11 = rsGetElementAt_float3(gIn, xs1, ys1);
+ float3 p12 = rsGetElementAt_float3(gIn, xs2, ys1);
+ float3 p13 = rsGetElementAt_float3(gIn, xs3, ys1);
+ float3 p1 = cubicInterpolate_F3(p10, p11, p12, p13, xf);
+
+ float3 p20 = rsGetElementAt_float3(gIn, xs0, ys2);
+ float3 p21 = rsGetElementAt_float3(gIn, xs1, ys2);
+ float3 p22 = rsGetElementAt_float3(gIn, xs2, ys2);
+ float3 p23 = rsGetElementAt_float3(gIn, xs3, ys2);
+ float3 p2 = cubicInterpolate_F3(p20, p21, p22, p23, xf);
+
+ float3 p30 = rsGetElementAt_float3(gIn, xs0, ys3);
+ float3 p31 = rsGetElementAt_float3(gIn, xs1, ys3);
+ float3 p32 = rsGetElementAt_float3(gIn, xs2, ys3);
+ float3 p33 = rsGetElementAt_float3(gIn, xs3, ys3);
+ float3 p3 = cubicInterpolate_F3(p30, p31, p32, p33, xf);
+
+ float3 p = cubicInterpolate_F3(p0, p1, p2, p3, yf);
+
+ return p;
+}
+
+float2 __attribute__((kernel)) bicubic_F2(uint32_t x, uint32_t y) {
+ float xf = (x + 0.5f) * scaleX - 0.5f;
+ float yf = (y + 0.5f) * scaleY - 0.5f;
+
+ int startx = (int) floor(xf - 1);
+ int starty = (int) floor(yf - 1);
+ xf = xf - floor(xf);
+ yf = yf - floor(yf);
+ int maxx = gWidthIn - 1;
+ int maxy = gHeightIn - 1;
+
+ uint32_t xs0 = (uint32_t) max(0, startx + 0);
+ uint32_t xs1 = (uint32_t) max(0, startx + 1);
+ uint32_t xs2 = (uint32_t) min(maxx, startx + 2);
+ uint32_t xs3 = (uint32_t) min(maxx, startx + 3);
+
+ uint32_t ys0 = (uint32_t) max(0, starty + 0);
+ uint32_t ys1 = (uint32_t) max(0, starty + 1);
+ uint32_t ys2 = (uint32_t) min(maxy, starty + 2);
+ uint32_t ys3 = (uint32_t) min(maxy, starty + 3);
+
+ float2 p00 = rsGetElementAt_float2(gIn, xs0, ys0);
+ float2 p01 = rsGetElementAt_float2(gIn, xs1, ys0);
+ float2 p02 = rsGetElementAt_float2(gIn, xs2, ys0);
+ float2 p03 = rsGetElementAt_float2(gIn, xs3, ys0);
+ float2 p0 = cubicInterpolate_F2(p00, p01, p02, p03, xf);
+
+ float2 p10 = rsGetElementAt_float2(gIn, xs0, ys1);
+ float2 p11 = rsGetElementAt_float2(gIn, xs1, ys1);
+ float2 p12 = rsGetElementAt_float2(gIn, xs2, ys1);
+ float2 p13 = rsGetElementAt_float2(gIn, xs3, ys1);
+ float2 p1 = cubicInterpolate_F2(p10, p11, p12, p13, xf);
+
+ float2 p20 = rsGetElementAt_float2(gIn, xs0, ys2);
+ float2 p21 = rsGetElementAt_float2(gIn, xs1, ys2);
+ float2 p22 = rsGetElementAt_float2(gIn, xs2, ys2);
+ float2 p23 = rsGetElementAt_float2(gIn, xs3, ys2);
+ float2 p2 = cubicInterpolate_F2(p20, p21, p22, p23, xf);
+
+ float2 p30 = rsGetElementAt_float2(gIn, xs0, ys3);
+ float2 p31 = rsGetElementAt_float2(gIn, xs1, ys3);
+ float2 p32 = rsGetElementAt_float2(gIn, xs2, ys3);
+ float2 p33 = rsGetElementAt_float2(gIn, xs3, ys3);
+ float2 p3 = cubicInterpolate_F2(p30, p31, p32, p33, xf);
+
+ float2 p = cubicInterpolate_F2(p0, p1, p2, p3, yf);
+
+ return p;
+}
+
+float __attribute__((kernel)) bicubic_F1(uint32_t x, uint32_t y) {
+ float xf = (x + 0.5f) * scaleX - 0.5f;
+ float yf = (y + 0.5f) * scaleY - 0.5f;
+
+ int startx = (int) floor(xf - 1);
+ int starty = (int) floor(yf - 1);
+ xf = xf - floor(xf);
+ yf = yf - floor(yf);
+ int maxx = gWidthIn - 1;
+ int maxy = gHeightIn - 1;
+
+ uint32_t xs0 = (uint32_t) max(0, startx + 0);
+ uint32_t xs1 = (uint32_t) max(0, startx + 1);
+ uint32_t xs2 = (uint32_t) min(maxx, startx + 2);
+ uint32_t xs3 = (uint32_t) min(maxx, startx + 3);
+
+ uint32_t ys0 = (uint32_t) max(0, starty + 0);
+ uint32_t ys1 = (uint32_t) max(0, starty + 1);
+ uint32_t ys2 = (uint32_t) min(maxy, starty + 2);
+ uint32_t ys3 = (uint32_t) min(maxy, starty + 3);
+
+ float p00 = rsGetElementAt_float(gIn, xs0, ys0);
+ float p01 = rsGetElementAt_float(gIn, xs1, ys0);
+ float p02 = rsGetElementAt_float(gIn, xs2, ys0);
+ float p03 = rsGetElementAt_float(gIn, xs3, ys0);
+ float p0 = cubicInterpolate_F1(p00, p01, p02, p03, xf);
+
+ float p10 = rsGetElementAt_float(gIn, xs0, ys1);
+ float p11 = rsGetElementAt_float(gIn, xs1, ys1);
+ float p12 = rsGetElementAt_float(gIn, xs2, ys1);
+ float p13 = rsGetElementAt_float(gIn, xs3, ys1);
+ float p1 = cubicInterpolate_F1(p10, p11, p12, p13, xf);
+
+ float p20 = rsGetElementAt_float(gIn, xs0, ys2);
+ float p21 = rsGetElementAt_float(gIn, xs1, ys2);
+ float p22 = rsGetElementAt_float(gIn, xs2, ys2);
+ float p23 = rsGetElementAt_float(gIn, xs3, ys2);
+ float p2 = cubicInterpolate_F1(p20, p21, p22, p23, xf);
+
+ float p30 = rsGetElementAt_float(gIn, xs0, ys3);
+ float p31 = rsGetElementAt_float(gIn, xs1, ys3);
+ float p32 = rsGetElementAt_float(gIn, xs2, ys3);
+ float p33 = rsGetElementAt_float(gIn, xs3, ys3);
+ float p3 = cubicInterpolate_F1(p30, p31, p32, p33, xf);
+
+ float p = cubicInterpolate_F1(p0, p1, p2, p3, yf);
+
+ return p;
+}
+
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/oob.rs b/tests/tests/renderscript/src/android/renderscript/cts/oob.rs
index b191c69..11b7cef 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/oob.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/oob.rs
@@ -1,5 +1,4 @@
-#pragma version(1)
-#pragma rs java_package_name(android.renderscript.cts)
+#include "shared.rsh"
rs_allocation aInt;
@@ -10,3 +9,7 @@
void __attribute__((kernel)) write_k(int unused) {
rsSetElementAt_int(aInt, 1, 1);
}
+
+void send_msg() {
+ rsSendToClientBlocking(RS_MSG_TEST_PASSED);
+}
diff --git a/tests/tests/renderscript/src/android/renderscript/cts/yuv.rs b/tests/tests/renderscript/src/android/renderscript/cts/yuv.rs
index 6d45331..4aa1564 100644
--- a/tests/tests/renderscript/src/android/renderscript/cts/yuv.rs
+++ b/tests/tests/renderscript/src/android/renderscript/cts/yuv.rs
@@ -56,6 +56,20 @@
return (uchar4){p.x, p.y, p.z, p.w};
}
+static float4 yuvToRGBA_f4(uchar y, uchar u, uchar v) {
+ float4 yuv_U_values = {0.f, -0.392f * 0.003921569f, +2.02 * 0.003921569f, 0.f};
+ float4 yuv_V_values = {1.603f * 0.003921569f, -0.815f * 0.003921569f, 0.f, 0.f};
+
+ float4 color = (float)y * 0.003921569f;
+ float4 fU = ((float)u) - 128.f;
+ float4 fV = ((float)v) - 128.f;
+
+ color += fU * yuv_U_values;
+ color += fV * yuv_V_values;
+ color = clamp(color, 0.f, 1.f);
+ return color;
+}
+
void makeRef(rs_allocation ay, rs_allocation au, rs_allocation av, rs_allocation aout) {
uint32_t w = rsAllocationGetDimX(ay);
uint32_t h = rsAllocationGetDimY(ay);
@@ -80,6 +94,29 @@
}
}
+void makeRef_f4(rs_allocation ay, rs_allocation au, rs_allocation av, rs_allocation aout) {
+ uint32_t w = rsAllocationGetDimX(ay);
+ uint32_t h = rsAllocationGetDimY(ay);
+
+ for (int y = 0; y < h; y++) {
+ //rsDebug("y", y);
+ for (int x = 0; x < w; x++) {
+
+ uchar py = rsGetElementAt_uchar(ay, x, y);
+ uchar pu = rsGetElementAt_uchar(au, x >> 1, y >> 1);
+ uchar pv = rsGetElementAt_uchar(av, x >> 1, y >> 1);
+
+ //rsDebug("py", py);
+ //rsDebug(" u", pu);
+ //rsDebug(" v", pv);
+
+ float4 rgb = yuvToRGBA_f4(py, pu, pv);
+ //rsDebug(" ", rgb);
+
+ rsSetElementAt_float4(aout, rgb, x, y);
+ }
+ }
+}
uchar4 __attribute__((kernel)) cvt(uint32_t x, uint32_t y) {
@@ -94,4 +131,16 @@
return yuvToRGBA4(py, pu, pv);
}
+float4 __attribute__((kernel)) cvt_f4(uint32_t x, uint32_t y) {
+
+ uchar py = rsGetElementAtYuv_uchar_Y(mInput, x, y);
+ uchar pu = rsGetElementAtYuv_uchar_U(mInput, x, y);
+ uchar pv = rsGetElementAtYuv_uchar_V(mInput, x, y);
+
+ //rsDebug("py2", py);
+ //rsDebug(" u2", pu);
+ //rsDebug(" v2", pv);
+
+ return rsYuvToRGBA_float4(py, pu, pv);
+}
diff --git a/tests/tests/rscpp/librscpptest/Android.mk b/tests/tests/rscpp/librscpptest/Android.mk
index 9813ba6..bc2f81e 100644
--- a/tests/tests/rscpp/librscpptest/Android.mk
+++ b/tests/tests/rscpp/librscpptest/Android.mk
@@ -17,6 +17,8 @@
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_CLANG := true
LOCAL_MODULE := librscpptest_jni
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := rs_jni.cpp rs_jni_allocation.cpp
@@ -25,10 +27,18 @@
LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
LOCAL_C_INCLUDES += frameworks/rs/cpp
LOCAL_C_INCLUDES += frameworks/rs
-LOCAL_C_INCLUDES += external/stlport/stlport bionic/ bionic/libstdc++/include
LOCAL_SHARED_LIBRARIES := libdl liblog
-LOCAL_STATIC_LIBRARIES := libRScpp_static libstlport_static libcutils
+LOCAL_STATIC_LIBRARIES := libRScpp_static libcutils
+
+ifeq ($(my_32_64_bit_suffix),32)
+ LOCAL_SDK_VERSION := 8
+else
+ LOCAL_SDK_VERSION := 21
+endif
+
+LOCAL_NDK_STL_VARIANT := stlport_static
+
include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/tests/security/jni/android_security_cts_CharDeviceTest.cpp b/tests/tests/security/jni/android_security_cts_CharDeviceTest.cpp
index 9aea4b3..32f204f 100644
--- a/tests/tests/security/jni/android_security_cts_CharDeviceTest.cpp
+++ b/tests/tests/security/jni/android_security_cts_CharDeviceTest.cpp
@@ -15,6 +15,7 @@
*/
#include <jni.h>
+#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/tests/tests/security/jni/android_security_cts_KernelSettingsTest.cpp b/tests/tests/security/jni/android_security_cts_KernelSettingsTest.cpp
index bab7b57..bb5e042 100644
--- a/tests/tests/security/jni/android_security_cts_KernelSettingsTest.cpp
+++ b/tests/tests/security/jni/android_security_cts_KernelSettingsTest.cpp
@@ -20,10 +20,10 @@
#include <sys/xattr.h>
#include <errno.h>
-static jboolean android_security_cts_KernelSettingsTest_supportsXattr(JNIEnv* env, jobject thiz)
+static jboolean android_security_cts_KernelSettingsTest_supportsXattr(JNIEnv* /* env */, jobject /* thiz */)
{
- int result = getxattr("/system/bin/toolbox", "security.capability", NULL, 0);
- return ((result >= 0) || (errno == ENODATA));
+ int result = getxattr("/system/bin/cat", "security.capability", NULL, 0);
+ return ((result != -1) || (errno == ENODATA));
}
static JNINativeMethod gMethods[] = {
diff --git a/tests/tests/security/jni/android_security_cts_LinuxRngTest.cpp b/tests/tests/security/jni/android_security_cts_LinuxRngTest.cpp
index 671226b..9b8016e 100644
--- a/tests/tests/security/jni/android_security_cts_LinuxRngTest.cpp
+++ b/tests/tests/security/jni/android_security_cts_LinuxRngTest.cpp
@@ -18,6 +18,7 @@
#include <jni.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/stat.h>
/*
diff --git a/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp b/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp
index 5029f6a..00765c6 100644
--- a/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp
+++ b/tests/tests/security/jni/android_security_cts_NativeCodeTest.cpp
@@ -16,10 +16,6 @@
#include <jni.h>
#include <linux/futex.h>
-#include <linux/netlink.h>
-#include <linux/sock_diag.h>
-#include <stdio.h>
-#include <sys/socket.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include <unistd.h>
@@ -28,6 +24,7 @@
#include <sys/wait.h>
#include <signal.h>
#include <stdlib.h>
+#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/utsname.h>
@@ -38,9 +35,6 @@
#include <inttypes.h>
#include <linux/sysctl.h>
-#define PASSED 0
-#define UNKNOWN_ERROR -1
-
/*
* Returns true iff this device is vulnerable to CVE-2013-2094.
* A patch for CVE-2013-2094 can be found at
@@ -90,84 +84,6 @@
}
/*
- * Will hang if vulnerable, return 0 if successful, -1 on unforseen
- * error.
- */
-static jint android_security_cts_NativeCodeTest_doSockDiagTest(JNIEnv* env, jobject thiz)
-{
- int fd, nlmsg_size, err, len;
- char buf[1024];
- struct sockaddr_nl nladdr;
- struct nlmsghdr *nlh;
- struct msghdr msg;
- struct iovec iov;
- struct sock_diag_req* sock_diag_data;
-
- int major, minor;
- struct utsname uts;
- if (uname(&uts) != -1 &&
- sscanf(uts.release, "%d.%d", &major, &minor) == 2 &&
- ((major > 3) || ((major == 3) && (minor > 8)))) {
- // Kernels above 3.8 are patched against CVE-2013-1763
- // This test generates false positives if run on > 3.8.
- // b/17253473
- return PASSED;
- }
-
- fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG);
- if (fd == -1) {
- switch (errno) {
- /* NETLINK_SOCK_DIAG not accessible, vector dne */
- case EACCES:
- case EAFNOSUPPORT:
- case EPERM:
- case EPROTONOSUPPORT:
- return PASSED;
- default:
- return UNKNOWN_ERROR;
- }
- }
- /* prepare and send netlink packet */
- memset(&nladdr, 0, sizeof(nladdr));
- nladdr.nl_family = AF_NETLINK;
- nlmsg_size = NLMSG_ALIGN(NLMSG_HDRLEN + sizeof(sock_diag_data));
- nlh = (nlmsghdr *)malloc(nlmsg_size);
- nlh->nlmsg_len = nlmsg_size;
- nlh->nlmsg_pid = 0; //send packet to kernel
- nlh->nlmsg_type = SOCK_DIAG_BY_FAMILY;
- nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
- iov = { (void *) nlh, nlmsg_size };
- msg = { (void *) &nladdr, sizeof(nladdr), &iov, 1, NULL, 0, 0 };
- sock_diag_data = (sock_diag_req *) NLMSG_DATA(nlh);
- sock_diag_data->sdiag_family = AF_MAX+1;
- if ((err = sendmsg(fd, &msg, 0)) == -1) {
- /* SELinux blocked it */
- if (errno == 22) {
- return PASSED;
- } else {
- return UNKNOWN_ERROR;
- }
- }
- free(nlh);
-
- memset(&nladdr, 0, sizeof(nladdr));
- iov = { buf, sizeof(buf) };
- msg = { (void *) &nladdr, sizeof(nladdr), &iov, 1, NULL, 0, 0 };
- if ((len = recvmsg(fd, &msg, 0)) == -1) {
- return UNKNOWN_ERROR;
- }
- for (nlh = (struct nlmsghdr *) buf; NLMSG_OK(nlh, len); nlh = NLMSG_NEXT (nlh, len)){
- if (nlh->nlmsg_type == NLMSG_ERROR) {
- /* -22 = -EINVAL from kernel */
- if (*(int *)NLMSG_DATA(nlh) == -22) {
- return PASSED;
- }
- }
- }
- return UNKNOWN_ERROR;
-}
-
-/*
* Prior to https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/arm/include/asm/uaccess.h?id=8404663f81d212918ff85f493649a7991209fa04
* there was a flaw in the kernel's handling of get_user and put_user
* requests. Normally, get_user and put_user are supposed to guarantee
@@ -317,8 +233,6 @@
(void *) android_security_cts_NativeCodeTest_doPerfEventTest },
{ "doPerfEventTest2", "()Z",
(void *) android_security_cts_NativeCodeTest_doPerfEventTest2 },
- { "doSockDiagTest", "()I",
- (void *) android_security_cts_NativeCodeTest_doSockDiagTest },
{ "doVrootTest", "()Z",
(void *) android_security_cts_NativeCodeTest_doVrootTest },
{ "doCVE20141710Test", "()Z",
diff --git a/tests/tests/security/jni/android_security_cts_SELinuxTest.cpp b/tests/tests/security/jni/android_security_cts_SELinuxTest.cpp
index c6ce1ef..daac7d9 100644
--- a/tests/tests/security/jni/android_security_cts_SELinuxTest.cpp
+++ b/tests/tests/security/jni/android_security_cts_SELinuxTest.cpp
@@ -71,9 +71,19 @@
(void *) android_security_cts_SELinuxTest_checkSELinuxContext },
};
+static int log_callback(int type __attribute__((unused)), const char *fmt __attribute__((unused)), ...)
+{
+ /* do nothing - silence the avc denials */
+ return 0;
+}
+
int register_android_security_cts_SELinuxTest(JNIEnv* env)
{
jclass clazz = env->FindClass("android/security/cts/SELinuxTest");
+ union selinux_callback cb;
+ cb.func_log = log_callback;
+ selinux_set_callback(SELINUX_CB_LOG, cb);
+
return env->RegisterNatives(clazz, gMethods,
sizeof(gMethods) / sizeof(JNINativeMethod));
}
diff --git a/tests/tests/security/src/android/security/cts/ARTBootASLRTest.java b/tests/tests/security/src/android/security/cts/ARTBootASLRTest.java
new file mode 100644
index 0000000..c0d0c58
--- /dev/null
+++ b/tests/tests/security/src/android/security/cts/ARTBootASLRTest.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.cts;
+
+import android.test.AndroidTestCase;
+
+import junit.framework.TestCase;
+
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.io.BufferedReader;
+import java.nio.charset.Charset;
+
+/**
+ * Verify that the boot.art isn't mapped out of the system partition.
+ */
+public class ARTBootASLRTest extends AndroidTestCase {
+ public void testARTASLR() throws Exception {
+ FileInputStream ins = new FileInputStream("/proc/self/maps");
+ InputStreamReader reader = new InputStreamReader(ins, Charset.defaultCharset());
+ BufferedReader bufReader = new BufferedReader(reader);
+ String line;
+ boolean foundBootART = false;
+ while ((line = bufReader.readLine()) != null) {
+ // Check that we don't have /system/.*boot.art
+ if (line.matches("/system/.*boot\\.art")) {
+ fail("found " + line + " from system partition");
+ } else if (line.matches(".*boot\\.art")) {
+ foundBootART = true;
+ }
+ }
+ if (!foundBootART) {
+ fail("expected to find boot.art");
+ }
+ bufReader.close();
+ reader.close();
+ ins.close();
+ }
+}
diff --git a/tests/tests/security/src/android/security/cts/KernelSettingsTest.java b/tests/tests/security/src/android/security/cts/KernelSettingsTest.java
index f3163be..e401e41 100644
--- a/tests/tests/security/src/android/security/cts/KernelSettingsTest.java
+++ b/tests/tests/security/src/android/security/cts/KernelSettingsTest.java
@@ -115,7 +115,7 @@
private static native boolean supportsXattr();
- private String getFile(String filename) throws IOException {
+ static String getFile(String filename) throws IOException {
BufferedReader in = null;
try {
in = new BufferedReader(new FileReader(filename));
diff --git a/tests/tests/security/src/android/security/cts/NativeCodeTest.java b/tests/tests/security/src/android/security/cts/NativeCodeTest.java
index 0bb8d12..a2f8c09 100644
--- a/tests/tests/security/src/android/security/cts/NativeCodeTest.java
+++ b/tests/tests/security/src/android/security/cts/NativeCodeTest.java
@@ -42,12 +42,6 @@
assertTrue(doPerfEventTest2());
}
- public void testSockDiag() throws Exception {
- int result = doSockDiagTest();
- assertFalse("Encountered unexpected error: " + result + ".", (result == -1));
- assertEquals(0, result);
- }
-
public void testFutex() throws Exception {
assertTrue("Device is vulnerable to CVE-2014-3153, a vulnerability in the futex() system "
+ "call. Please apply the security patch at "
@@ -87,12 +81,6 @@
private static native boolean doPerfEventTest2();
/**
- * Hangs if device is vulnerable to CVE-2013-1763, returns -1 if
- * unexpected error occurs, 0 otherwise.
- */
- private static native int doSockDiagTest();
-
- /**
* ANDROID-11234878 / CVE-2013-6282
*
* Returns true if the device is patched against the vroot vulnerability, false otherwise.
diff --git a/tests/tests/security/src/android/security/cts/SELinuxDomainTest.java b/tests/tests/security/src/android/security/cts/SELinuxDomainTest.java
deleted file mode 100644
index 66054f9..0000000
--- a/tests/tests/security/src/android/security/cts/SELinuxDomainTest.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.security.cts;
-
-import junit.framework.TestCase;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.FileNotFoundException;
-import java.io.InputStreamReader;
-import java.lang.Runtime;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.Scanner;
-import java.util.Set;
-
-/**
- * Verify that the processes running within an SELinux domain are sane.
- *
- * TODO: Author the tests for the app contexts.
- *
- */
-public class SELinuxDomainTest extends TestCase {
-
- /**
- * Asserts that no processes are running in a domain.
- *
- * @param domain
- * The domain or SELinux context to check.
- */
- private void assertDomainEmpty(String domain) throws FileNotFoundException {
- List<ProcessDetails> procs = ProcessDetails.getProcessMap().get(domain);
- String msg = "Expected no processes in SELinux domain \"" + domain + "\""
- + " Found: \"" + procs + "\"";
- assertNull(msg, procs);
- }
-
- /**
- * Asserts that a domain exists and that only one, well defined, process is
- * running in that domain.
- *
- * @param domain
- * The domain or SELinux context to check.
- * @param executable
- * The path of the executable or application package name.
- */
- private void assertDomainOne(String domain, String executable) throws FileNotFoundException {
- List<ProcessDetails> procs = ProcessDetails.getProcessMap().get(domain);
- String msg = "Expected 1 process in SELinux domain \"" + domain + "\""
- + " Found \"" + procs + "\"";
- assertNotNull(msg, procs);
- assertEquals(msg, 1, procs.size());
-
- msg = "Expected executable \"" + executable + "\" in SELinux domain \"" + domain + "\""
- + "Found: \"" + procs + "\"";
- assertEquals(msg, executable, procs.get(0).procTitle);
- }
-
- /**
- * Asserts that a domain may exist. If a domain exists, the cardinality of
- * the domain is verified to be 1 and that the correct process is running in
- * that domain.
- *
- * @param domain
- * The domain or SELinux context to check.
- * @param executable
- * The path of the executable or application package name.
- */
- private void assertDomainZeroOrOne(String domain, String executable)
- throws FileNotFoundException {
- List<ProcessDetails> procs = ProcessDetails.getProcessMap().get(domain);
- if (procs == null) {
- /* not on all devices */
- return;
- }
-
- String msg = "Expected 1 process in SELinux domain \"" + domain + "\""
- + " Found: \"" + procs + "\"";
- assertEquals(msg, 1, procs.size());
-
- msg = "Expected executable \"" + executable + "\" in SELinux domain \"" + domain + "\""
- + "Found: \"" + procs.get(0) + "\"";
- assertEquals(msg, executable, procs.get(0).procTitle);
- }
-
- /**
- * Asserts that a domain must exist, and that the cardinality is greater
- * than or equal to 1.
- *
- * @param domain
- * The domain or SELinux context to check.
- * @param executables
- * The path of the allowed executables or application package names.
- */
- private void assertDomainN(String domain, String... executables)
- throws FileNotFoundException {
- List<ProcessDetails> procs = ProcessDetails.getProcessMap().get(domain);
- String msg = "Expected 1 or more processes in SELinux domain \"" + domain + "\""
- + " Found \"" + procs + "\"";
- assertNotNull(msg, procs);
-
- Set<String> execList = new HashSet<String>(Arrays.asList(executables));
-
- for (ProcessDetails p : procs) {
- msg = "Expected one of \"" + execList + "\" in SELinux domain \"" + domain + "\""
- + " Found: \"" + p + "\"";
- assertTrue(msg, execList.contains(p.procTitle));
- }
- }
-
- /**
- * Asserts that a domain, if it exists, is only running the listed executables.
- *
- * @param domain
- * The domain or SELinux context to check.
- * @param executables
- * The path of the allowed executables or application package names.
- */
- private void assertDomainHasExecutable(String domain, String... executables)
- throws FileNotFoundException {
- List<ProcessDetails> procs = ProcessDetails.getProcessMap().get(domain);
- if (procs == null) {
- return; // domain doesn't exist
- }
-
- Set<String> execList = new HashSet<String>(Arrays.asList(executables));
-
- for (ProcessDetails p : procs) {
- String msg = "Expected one of \"" + execList + "\" in SELinux domain \""
- + domain + "\"" + " Found: \"" + p + "\"";
- assertTrue(msg, execList.contains(p.procTitle));
- }
- }
-
- /* Init is always there */
- public void testInitDomain() throws FileNotFoundException {
- assertDomainOne("u:r:init:s0", "/init");
- }
-
- /* Ueventd is always there */
- public void testUeventdDomain() throws FileNotFoundException {
- assertDomainOne("u:r:ueventd:s0", "/sbin/ueventd");
- }
-
- /* Devices always have healthd */
- public void testHealthdDomain() throws FileNotFoundException {
- assertDomainOne("u:r:healthd:s0", "/sbin/healthd");
- }
-
- /* Servicemanager is always there */
- public void testServicemanagerDomain() throws FileNotFoundException {
- assertDomainOne("u:r:servicemanager:s0", "/system/bin/servicemanager");
- }
-
- /* Vold is always there */
- public void testVoldDomain() throws FileNotFoundException {
- assertDomainOne("u:r:vold:s0", "/system/bin/vold");
- }
-
- /* netd is always there */
- public void testNetdDomain() throws FileNotFoundException {
- assertDomainOne("u:r:netd:s0", "/system/bin/netd");
- }
-
- /* Debuggerd is always there */
- public void testDebuggerdDomain() throws FileNotFoundException {
- assertDomainN("u:r:debuggerd:s0", "/system/bin/debuggerd", "/system/bin/debuggerd64");
- }
-
- /* Surface flinger is always there */
- public void testSurfaceflingerDomain() throws FileNotFoundException {
- assertDomainOne("u:r:surfaceflinger:s0", "/system/bin/surfaceflinger");
- }
-
- /* Zygote is always running */
- public void testZygoteDomain() throws FileNotFoundException {
- assertDomainN("u:r:zygote:s0", "zygote", "zygote64");
- }
-
- /* drm server is always present */
- public void testDrmServerDomain() throws FileNotFoundException {
- assertDomainZeroOrOne("u:r:drmserver:s0", "/system/bin/drmserver");
- }
-
- /* Media server is always running */
- public void testMediaserverDomain() throws FileNotFoundException {
- assertDomainN("u:r:mediaserver:s0", "media.log", "/system/bin/mediaserver");
- }
-
- /* Installd is always running */
- public void testInstalldDomain() throws FileNotFoundException {
- assertDomainOne("u:r:installd:s0", "/system/bin/installd");
- }
-
- /* keystore is always running */
- public void testKeystoreDomain() throws FileNotFoundException {
- assertDomainOne("u:r:keystore:s0", "/system/bin/keystore");
- }
-
- /* System server better be running :-P */
- public void testSystemServerDomain() throws FileNotFoundException {
- assertDomainOne("u:r:system_server:s0", "system_server");
- }
-
- /*
- * Some OEMs do not use sdcardd so transient. Other OEMs have multiple sdcards
- * so they run the daemon multiple times.
- */
- public void testSdcarddDomain() throws FileNotFoundException {
- assertDomainHasExecutable("u:r:sdcardd:s0", "/system/bin/sdcard");
- }
-
- /* Watchdogd may or may not be there */
- public void testWatchdogdDomain() throws FileNotFoundException {
- assertDomainZeroOrOne("u:r:watchdogd:s0", "/sbin/watchdogd");
- }
-
- /* Wifi may be off so cardinality of 0 or 1 is ok */
- public void testWpaDomain() throws FileNotFoundException {
- assertDomainZeroOrOne("u:r:wpa:s0", "/system/bin/wpa_supplicant");
- }
-
- /*
- * Nothing should be running in this domain, cardinality test is all thats
- * needed
- */
- public void testInitShellDomain() throws FileNotFoundException {
- assertDomainEmpty("u:r:init_shell:s0");
- }
-
- /*
- * Nothing should be running in this domain, cardinality test is all thats
- * needed
- */
- public void testRecoveryDomain() throws FileNotFoundException {
- assertDomainEmpty("u:r:recovery:s0");
- }
-
- /*
- * Nothing should be running in this domain, cardinality test is all thats
- * needed
- */
- public void testSuDomain() throws FileNotFoundException {
- assertDomainEmpty("u:r:su:s0");
- }
-
- /*
- * Their will at least be some kernel thread running and all kthreads should
- * be in kernel context.
- */
- public void testKernelDomain() throws FileNotFoundException {
- String domain = "u:r:kernel:s0";
- List<ProcessDetails> procs = ProcessDetails.getProcessMap().get(domain);
- assertNotNull(procs);
- for (ProcessDetails p : procs) {
- assertTrue("Non Kernel thread \"" + p + "\" found!", p.isKernel());
- }
- }
-
- private static class ProcessDetails {
- public String label;
- public String procTitle;
- public long vSize;
- public int pid;
-
- private ProcessDetails(String procTitle, String label, long vSize, int pid) {
- this.label = label;
- this.procTitle = procTitle;
- this.vSize = vSize;
- this.pid = pid;
- }
-
- @Override
- public String toString() {
- return "pid: \"" + pid + "\"\tproctitle: \"" + procTitle + "\"\tlabel: \"" + label
- + "\"\tvsize: " + vSize;
- }
-
- public boolean isKernel() {
- return vSize == 0;
- }
-
- private static long getVsizeFromStat(String stat) {
- // Get the vSize, item #23 from the stat file
- // 1 2 3 4 5 6 7 8 9 10 11
- String pattern = "^\\d+ \\(\\p{Print}*\\) \\w \\d+ \\d+ \\d+ \\d+ -?\\d+ \\d+ \\d+ \\d+ "
- // 12 13 14 15 16 17 18 19 20 21 22 23
- + "\\d+ \\d+ \\d+ \\d+ \\d+ \\d+ -?\\d+ -?\\d+ \\d+ \\d+ \\d+ (\\d+) .*$";
-
- Pattern p = Pattern.compile(pattern);
- Matcher m = p.matcher(stat);
- assertTrue("failed match: \"" + stat + "\"", m.matches());
- return Long.parseLong(m.group(1));
- }
-
- private static HashMap<String, ArrayList<ProcessDetails>> getProcessMap()
- throws FileNotFoundException {
-
- HashMap<String, ArrayList<ProcessDetails>> map = new HashMap<String, ArrayList<ProcessDetails>>();
-
- File root = new File("/proc");
- if (!root.isDirectory()) {
- throw new FileNotFoundException("/proc is not a directory!");
- }
-
- for (File f : root.listFiles()) {
-
- // We only want the pid directory entries
- if (!f.isDirectory()) {
- continue;
- }
-
- int pid;
- try {
- pid = Integer.parseInt(f.getName());
- } catch (NumberFormatException e) {
- continue;
- }
-
- try {
- ProcessDetails p = getProcessDetails(pid, f);
- ArrayList<ProcessDetails> l = map.get(p.label);
- if (l == null) {
- l = new ArrayList<ProcessDetails>();
- map.put(p.label, l);
- }
- l.add(p);
- } catch (FileNotFoundException e) {
- // sometimes processes go away while the test is running.
- // Don't freak out if this happens
- }
- }
- return map;
- }
-
- private static ProcessDetails getProcessDetails(int pid, File f) throws FileNotFoundException {
- // Get the context via attr/current
- String context = new Scanner(new File(f, "attr/current")).next();
- context = context.trim();
-
- // Get the vSize, item #23 from the stat file
- String x = new Scanner(new File(f, "stat")).nextLine();
- long vSize = getVsizeFromStat(x);
-
- StringBuilder sb = new StringBuilder();
- Scanner tmp = new Scanner(new File(f, "cmdline"));
-
- // Java's scanner tends to return oddly when handling
- // long binary blobs. Probably some caching optimization.
- while (tmp.hasNext()) {
- sb.append(tmp.next().replace('\0', ' '));
- }
- tmp.close();
-
- // At this point we build up a valid proctitle, then split
- // on whitespace to get the left portion. Which is either
- // package name or process executable path. This avoids
- // the comm 16 char width limitation and is limited to PAGE_SIZE
- String cmdline = sb.toString().trim();
- cmdline = cmdline.split("\\s+")[0];
-
- return new ProcessDetails(cmdline, context, vSize, pid);
- }
-
- }
-}
diff --git a/tests/tests/security/src/android/security/cts/SELinuxTest.java b/tests/tests/security/src/android/security/cts/SELinuxTest.java
index 711cb91..baeeb6d 100644
--- a/tests/tests/security/src/android/security/cts/SELinuxTest.java
+++ b/tests/tests/security/src/android/security/cts/SELinuxTest.java
@@ -71,8 +71,6 @@
public void testZygote() {
assertFalse(checkSELinuxAccess("u:r:zygote:s0", "u:object_r:runas_exec:s0", "file", "getattr", "/system/bin/run-as"));
- // Also check init, just as a sanity check (init is unconfined, so it should pass)
- assertTrue(checkSELinuxAccess("u:r:init:s0", "u:object_r:runas_exec:s0", "file", "getattr", "/system/bin/run-as"));
}
public void testNoBooleans() throws Exception {
@@ -81,6 +79,14 @@
assertEquals(0, files.length);
}
+ public void testCTSIsUntrustedApp() throws IOException {
+ String found = KernelSettingsTest.getFile("/proc/self/attr/current");
+ String expected = "u:r:untrusted_app:s0";
+ String msg = "Expected prefix context: \"" + expected + "\"" +
+ ", Found: \"" + found + "\"";
+ assertTrue(msg, found.startsWith(expected));
+ }
+
private static native boolean checkSELinuxAccess(String scon, String tcon, String tclass, String perm, String extra);
private static native boolean checkSELinuxContext(String con);
diff --git a/tests/tests/security/tools/format_cert.sh b/tests/tests/security/tools/format_cert.sh
index 94407a0..604c1bc 100755
--- a/tests/tests/security/tools/format_cert.sh
+++ b/tests/tests/security/tools/format_cert.sh
@@ -26,16 +26,17 @@
# Output file. If not specified, the file will be named <hash>.0 where "hash"
# is the certificate's subject hash produced by:
-# openssl x509 -in cert_file -subject_hash -noout
+# openssl x509 -in cert_file -subject_hash_old -noout
out_file="$2"
# Detect whether the input file is PEM or DER.
+# It must use old_hash(MD5) function.
in_form="pem"
-subject_hash=$("$OPENSSL" x509 -in "$in_file" -inform $in_form -subject_hash \
+subject_hash=$("$OPENSSL" x509 -in "$in_file" -inform $in_form -subject_hash_old \
-noout 2>/dev/null)
if [ "$?" != "0" ]; then
in_form="der"
- subject_hash=$("$OPENSSL" x509 -in "$in_file" -inform $in_form -subject_hash \
+ subject_hash=$("$OPENSSL" x509 -in "$in_file" -inform $in_form -subject_hash_old \
-noout)
if [ "$?" != "0" ]; then
echo "Certificate file format is neither PEM nor DER"
diff --git a/tests/tests/telephony/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java b/tests/tests/telephony/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java
index 67cdd24..0527e9a 100644
--- a/tests/tests/telephony/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java
+++ b/tests/tests/telephony/src/android/telephony/cts/SmsUsageMonitorShortCodeTest.java
@@ -20,7 +20,7 @@
import android.content.pm.PackageManager;
import android.test.InstrumentationTestCase;
import android.test.UiThreadTest;
-
+import android.telephony.TelephonyManager;
import com.android.internal.telephony.SmsUsageMonitor;
/**
@@ -28,6 +28,7 @@
*/
public class SmsUsageMonitorShortCodeTest extends InstrumentationTestCase {
+ private TelephonyManager mTelephonyManager;
private PackageManager mPackageManager;
private Context mContext;
@@ -485,6 +486,12 @@
super.setUp();
mContext = getInstrumentation().getTargetContext();
mPackageManager = mContext.getPackageManager();
+ mTelephonyManager = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE);
+ }
+
+ private boolean isCDMA112(String address) {
+ return (mTelephonyManager.getPhoneType() == TelephonyManager.PHONE_TYPE_CDMA)
+ && "112".equals(address);
}
@UiThreadTest
@@ -497,7 +504,8 @@
SmsUsageMonitor monitor = new SmsUsageMonitor(mContext);
for (ShortCodeTest test : sShortCodeTests) {
assertEquals("country: " + test.countryIso + " number: " + test.address,
- test.category, monitor.checkDestination(test.address, test.countryIso));
+ test.category, isCDMA112(test.address) ? CATEGORY_NOT_SHORT_CODE :
+ monitor.checkDestination(test.address, test.countryIso));
}
}
}
diff --git a/tests/tests/text/src/android/text/format/cts/DateFormatTest.java b/tests/tests/text/src/android/text/format/cts/DateFormatTest.java
index 9d739d3..61fa37d 100644
--- a/tests/tests/text/src/android/text/format/cts/DateFormatTest.java
+++ b/tests/tests/text/src/android/text/format/cts/DateFormatTest.java
@@ -46,7 +46,6 @@
private boolean mIs24HourFormat;
private Locale mDefaultLocale;
- private String mDefaultFormat;
@Override
protected void setUp() throws Exception {
@@ -55,8 +54,6 @@
mContentResolver = mContext.getContentResolver();
mIs24HourFormat = DateFormat.is24HourFormat(mContext);
mDefaultLocale = Locale.getDefault();
- mDefaultFormat = Settings.System.getString(mContext.getContentResolver(),
- Settings.System.DATE_FORMAT);
}
@Override
@@ -67,7 +64,7 @@
if (!Locale.getDefault().equals(mDefaultLocale)) {
Locale.setDefault(mDefaultLocale);
}
- Settings.System.putString(mContentResolver, Settings.System.DATE_FORMAT, mDefaultFormat);
+
super.tearDown();
}
@@ -146,12 +143,6 @@
assertTrue(source.indexOf("5") >= 0);
assertTrue(source.indexOf("30") >= 0);
- String testFormat = "yyyy-MM-dd";
- String testOrder = "yMd";
- Settings.System.putString(mContentResolver, Settings.System.DATE_FORMAT, testFormat);
- String actualOrder = String.valueOf(DateFormat.getDateFormatOrder(mContext));
- assertEquals(testOrder, actualOrder);
-
String format = "MM/dd/yy";
String expectedString = "12/18/08";
Calendar calendar = new GregorianCalendar(YEAR, MONTH, DAY);
diff --git a/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java b/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
index 1e62819..6eb09eb 100644
--- a/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
+++ b/tests/tests/text/src/android/text/format/cts/DateUtilsTest.java
@@ -83,6 +83,9 @@
assertEquals("PM", DateUtils.getAMPMString(Calendar.PM));
}
+ // This is to test the mapping between DateUtils' public API and
+ // libcore/icu4c's implementation. More tests, in different locales, are
+ // in libcore's CTS tests.
public void test_getRelativeTimeSpanString() {
if (!LocaleUtils.isCurrentLocale(mContext, Locale.US)) {
return;
@@ -90,22 +93,15 @@
final long ONE_SECOND_IN_MS = 1000;
assertEquals("0 minutes ago",
- DateUtils.getRelativeTimeSpanString(mBaseTime - ONE_SECOND_IN_MS));
+ DateUtils.getRelativeTimeSpanString(mBaseTime - ONE_SECOND_IN_MS));
assertEquals("in 0 minutes",
- DateUtils.getRelativeTimeSpanString(mBaseTime + ONE_SECOND_IN_MS));
+ DateUtils.getRelativeTimeSpanString(mBaseTime + ONE_SECOND_IN_MS));
final long ONE_MINUTE_IN_MS = 60 * ONE_SECOND_IN_MS;
- assertEquals("1 minute ago",
- DateUtils.getRelativeTimeSpanString(0, ONE_MINUTE_IN_MS, DateUtils.MINUTE_IN_MILLIS));
- assertEquals("in 1 minute",
- DateUtils.getRelativeTimeSpanString(ONE_MINUTE_IN_MS, 0, DateUtils.MINUTE_IN_MILLIS));
-
- assertEquals("42 minutes ago",
- DateUtils.getRelativeTimeSpanString(mBaseTime - (42 * ONE_MINUTE_IN_MS),
- mBaseTime, DateUtils.MINUTE_IN_MILLIS));
- assertEquals("in 42 minutes",
- DateUtils.getRelativeTimeSpanString(mBaseTime + (42 * ONE_MINUTE_IN_MS),
- mBaseTime, DateUtils.MINUTE_IN_MILLIS));
+ assertEquals("1 minute ago", DateUtils.getRelativeTimeSpanString(0, ONE_MINUTE_IN_MS,
+ DateUtils.MINUTE_IN_MILLIS));
+ assertEquals("in 1 minute", DateUtils.getRelativeTimeSpanString(ONE_MINUTE_IN_MS, 0,
+ DateUtils.MINUTE_IN_MILLIS));
final long ONE_HOUR_IN_MS = 60 * 60 * 1000;
final long TWO_HOURS_IN_MS = 2 * ONE_HOUR_IN_MS;
@@ -113,33 +109,16 @@
mBaseTime, DateUtils.MINUTE_IN_MILLIS, DateUtils.FORMAT_NUMERIC_DATE));
assertEquals("in 2 hours", DateUtils.getRelativeTimeSpanString(mBaseTime + TWO_HOURS_IN_MS,
mBaseTime, DateUtils.MINUTE_IN_MILLIS, DateUtils.FORMAT_NUMERIC_DATE));
-
- assertEquals("in 42 mins", DateUtils.getRelativeTimeSpanString(mBaseTime + (42 * ONE_MINUTE_IN_MS),
- mBaseTime, DateUtils.MINUTE_IN_MILLIS,
- DateUtils.FORMAT_ABBREV_RELATIVE));
-
- final long ONE_DAY_IN_MS = 24 * ONE_HOUR_IN_MS;
- assertEquals("Tomorrow",
- DateUtils.getRelativeTimeSpanString(ONE_DAY_IN_MS, 0, DateUtils.DAY_IN_MILLIS, 0));
- assertEquals("in 2 days",
- DateUtils.getRelativeTimeSpanString(2 * ONE_DAY_IN_MS, 0, DateUtils.DAY_IN_MILLIS, 0));
- assertEquals("Yesterday",
- DateUtils.getRelativeTimeSpanString(0, ONE_DAY_IN_MS, DateUtils.DAY_IN_MILLIS, 0));
- assertEquals("2 days ago",
- DateUtils.getRelativeTimeSpanString(0, 2 * ONE_DAY_IN_MS, DateUtils.DAY_IN_MILLIS, 0));
-
- final long DAY_DURATION = 5 * 24 * 60 * 60 * 1000;
- assertNotNull(DateUtils.getRelativeTimeSpanString(mContext, mBaseTime - DAY_DURATION, true));
- assertNotNull(DateUtils.getRelativeTimeSpanString(mContext, mBaseTime - DAY_DURATION));
}
+ // Similar to test_getRelativeTimeSpanString(). The function here is to
+ // test the mapping between DateUtils's public API and libcore/icu4c's
+ // implementation. More tests, in different locales, are in libcore's
+ // CTS tests.
public void test_getRelativeDateTimeString() {
final long DAY_DURATION = 5 * 24 * 60 * 60 * 1000;
- assertNotNull(DateUtils.getRelativeDateTimeString(mContext,
- mBaseTime - DAY_DURATION,
- DateUtils.MINUTE_IN_MILLIS,
- DateUtils.DAY_IN_MILLIS,
- DateUtils.FORMAT_NUMERIC_DATE));
+ assertNotNull(DateUtils.getRelativeDateTimeString(mContext, mBaseTime - DAY_DURATION,
+ DateUtils.MINUTE_IN_MILLIS, DateUtils.DAY_IN_MILLIS, DateUtils.FORMAT_NUMERIC_DATE));
}
public void test_formatElapsedTime() {
@@ -211,7 +190,7 @@
long fixedTime = date.getTime();
final long HOUR_DURATION = 2 * 60 * 60 * 1000;
assertEquals("Monday", DateUtils.formatDateRange(mContext, fixedTime,
- fixedTime + HOUR_DURATION, DateUtils.FORMAT_SHOW_WEEKDAY));
+ fixedTime + HOUR_DURATION, DateUtils.FORMAT_SHOW_WEEKDAY));
}
public void testIsToday() {
@@ -221,15 +200,19 @@
}
public void test_bug_7548161() {
+ if (!LocaleUtils.isCurrentLocale(mContext, Locale.US)) {
+ return;
+ }
+
long now = System.currentTimeMillis();
long today = now;
long tomorrow = now + DateUtils.DAY_IN_MILLIS;
long yesterday = now - DateUtils.DAY_IN_MILLIS;
assertEquals("Tomorrow", DateUtils.getRelativeTimeSpanString(tomorrow, now,
- DateUtils.DAY_IN_MILLIS, 0));
+ DateUtils.DAY_IN_MILLIS, 0));
assertEquals("Yesterday", DateUtils.getRelativeTimeSpanString(yesterday, now,
- DateUtils.DAY_IN_MILLIS, 0));
+ DateUtils.DAY_IN_MILLIS, 0));
assertEquals("Today", DateUtils.getRelativeTimeSpanString(today, now,
- DateUtils.DAY_IN_MILLIS, 0));
+ DateUtils.DAY_IN_MILLIS, 0));
}
}
diff --git a/tools/selinux/SELinuxNeverallowTestFrame.py b/tools/selinux/SELinuxNeverallowTestFrame.py
index 0bf766d..45900de 100644
--- a/tools/selinux/SELinuxNeverallowTestFrame.py
+++ b/tools/selinux/SELinuxNeverallowTestFrame.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
src_header = """/*
* Copyright (C) 2014 The Android Open Source Project
diff --git a/tools/selinux/SELinuxNeverallowTestGen.py b/tools/selinux/SELinuxNeverallowTestGen.py
index 9cb1e24..bc775d6 100755
--- a/tools/selinux/SELinuxNeverallowTestGen.py
+++ b/tools/selinux/SELinuxNeverallowTestGen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
import re
import sys
diff --git a/tools/vm-tests-tf/etc/starttests b/tools/vm-tests-tf/etc/starttests
index be8fad4..4c5c0b1 100755
--- a/tools/vm-tests-tf/etc/starttests
+++ b/tools/vm-tests-tf/etc/starttests
@@ -63,7 +63,6 @@
scriptdata=$dalviktestdir/data/scriptdata
report=$dalviktest/report.html
curdate=`date`
-curmode=""
datadir=/tmp/${USER}
base=$OUT
framework=$base/system/framework
@@ -100,14 +99,6 @@
mkdir -p $datadir
mkdir -p $datadir/dalvik-cache
-if [ "$TARGET_SIMULATOR" = "true" ]; then
- echo "Simulator mode, $interpreter interpreter";
- curmode="simulator"
-else
- echo "Emulator mode, $interpreter interpreter";
- curmode="emulator"
-fi
-
echo ""
pre_report="<html><head><style>
@@ -118,7 +109,7 @@
</style></head>
<body>
<h1>Dalvik VM test suite results</h1>
-Generated $curdate (using the $curmode)
+Generated $curdate (using the emulator)
<p>
<table width='100%'>
<tr><td>Status</td><td>Target</td><td>Category</td><td>Details</td></tr>"
@@ -136,12 +127,8 @@
export jallcnt=0
export jcolumns=0
-# TODO unhack
-if [ "$TARGET_SIMULATOR" = "true" ]; then
- echo -n ""
-else
- adb push $dexcore /data/local/tmp/dexcore.jar >> /dev/null 2>&1
-fi
+# TODO unhack; dimitry: unhack what?
+adb push $dexcore /data/local/tmp/dexcore.jar >> /dev/null 2>&1
function classnameToJar()
{
@@ -175,40 +162,25 @@
# write dalvik output to file
echo -n "mk_b:" > $datadir/dalvikout
- if [ "$TARGET_SIMULATOR" = "true" ]; then
- classpath=`classnameToJar ${mainclass}`
- for dep in ${deps}; do
- depJar=`classnameToJar ${dep}`
- classpath=${classpath}:${depJar}
- done
- $valgrind $exe -Xmx512M -Xss32K -Xbootclasspath:$bpath $debug_opts \
- -classpath $dexcore:$classpath $mainclass >> $datadir/dalvikout 2>&1
+ classpath="/data/local/tmp/dexcore.jar"
+ deps=${deps}" "${mainclass}
+ pushedjars=""
+ for dep in ${deps}; do
+ depJar=`classnameToJar ${dep}`
+ depFileName=`basename ${depJar}`
+ deviceFileName=/data/local/tmp/${depFileName}
+ adb push ${depJar} ${deviceFileName} &> /dev/null
+ classpath=${classpath}:${deviceFileName}
+ pushedjars=${pushedjars}" "${deviceFileName}
+ done
- RESULTCODE=$?
- if [ ${RESULTCODE} -ne 0 ]; then
- echo "Dalvik VM failed, result=${RESULTCODE}" >> $datadir/dalvikout 2>&1
- fi
- else
- classpath="/data/local/tmp/dexcore.jar"
- deps=${deps}" "${mainclass}
- pushedjars=""
- for dep in ${deps}; do
- depJar=`classnameToJar ${dep}`
- depFileName=`basename ${depJar}`
- deviceFileName=/data/local/tmp/${depFileName}
- adb push ${depJar} ${deviceFileName} &> /dev/null
- classpath=${classpath}:${deviceFileName}
- pushedjars=${pushedjars}" "${deviceFileName}
- done
+ adb shell dalvikvm -Djava.io.tmpdir=/data/local/tmp \
+ -classpath $classpath $mainclass >> $datadir/dalvikout 2>&1 && \
+ echo -n dvmpassed: >> $datadir/dalvikout 2>&1
- adb shell dalvikvm -Djava.io.tmpdir=/data/local/tmp \
- -classpath $classpath $mainclass >> $datadir/dalvikout 2>&1 && \
- echo -n dvmpassed: >> $datadir/dalvikout 2>&1
-
- for jar in ${pushedjars}; do
- adb shell rm ${jar} &> /dev/null
- done
- fi
+ for jar in ${pushedjars}; do
+ adb shell rm ${jar} &> /dev/null
+ done
echo -n "mk_s:" >> $datadir/dalvikout
# Verify tmpout only contains mkdxc_start;mkdxc_stop -> no system.out/err