diff options
Diffstat (limited to 'tests')
4 files changed, 0 insertions, 151 deletions
diff --git a/tests/RenderScriptTests/LargeMatrix/Android.mk b/tests/RenderScriptTests/LargeMatrix/Android.mk deleted file mode 100644 index b113549..0000000 --- a/tests/RenderScriptTests/LargeMatrix/Android.mk +++ /dev/null @@ -1,27 +0,0 @@ -# -# Copyright (C) 2012 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. -# - -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_SRC_FILES := $(call all-java-files-under, src) \ - $(call all-renderscript-files-under, src) - -LOCAL_PACKAGE_NAME := LargeMatrix - -include $(BUILD_PACKAGE) diff --git a/tests/RenderScriptTests/LargeMatrix/AndroidManifest.xml b/tests/RenderScriptTests/LargeMatrix/AndroidManifest.xml deleted file mode 100644 index d04fae2..0000000 --- a/tests/RenderScriptTests/LargeMatrix/AndroidManifest.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> - -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.rs.matrix"> - <uses-sdk android:minSdkVersion="16" /> - <application android:label="Large Matrix" - android:hardwareAccelerated="true"> - <activity android:name="MatrixActivity"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - </intent-filter> - </activity> - </application> -</manifest> diff --git a/tests/RenderScriptTests/LargeMatrix/src/com/android/rs/matrix/MatrixActivity.java b/tests/RenderScriptTests/LargeMatrix/src/com/android/rs/matrix/MatrixActivity.java deleted file mode 100644 index 82a8e17..0000000 --- a/tests/RenderScriptTests/LargeMatrix/src/com/android/rs/matrix/MatrixActivity.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2012 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.rs.matrix; - -import java.lang.Math; - -import android.app.Activity; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Canvas; -import android.os.Bundle; -import android.renderscript.*; -import android.util.Log; -import android.view.SurfaceHolder; -import android.view.SurfaceView; -import android.view.View; -import android.widget.ImageView; -import android.widget.SeekBar; -import android.widget.TextView; - -public class MatrixActivity extends Activity { - - private RenderScript mRS; - private ScriptC_large_matrix mScript; - private Allocation mVectorIn; - private Allocation mVectorOut; - private Allocation mMatrix; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - mRS = RenderScript.create(this); - - Type.Builder tb = new Type.Builder(mRS, Element.F32_4(mRS)); - tb.setX(2000); - tb.setY(500); - Type t = tb.create(); - mMatrix = Allocation.createTyped(mRS, t); - - mVectorIn = Allocation.createSized(mRS, Element.F32_4(mRS), 500); - mVectorOut = Allocation.createSized(mRS, Element.F32_4(mRS), 500); - - mScript = new ScriptC_large_matrix(mRS, getResources(), R.raw.large_matrix); - mScript.set_gMatrix(mMatrix); - - mRS.finish(); - long dt = java.lang.System.currentTimeMillis(); - - for (int i=0; i<100; i++) { - mScript.forEach_multiply_row(mVectorIn, mVectorOut); - } - mRS.finish(); - dt = (java.lang.System.currentTimeMillis() - dt); - - Log.v("rs", "LargeMatrix mult time ms " + dt); - - float gflop = 2000.f * 2000.f * 2.f / dt / 1000000.f; - gflop *= 100; - Log.v("rs", "LargeMatrix gflop " + gflop); - } - -} diff --git a/tests/RenderScriptTests/LargeMatrix/src/com/android/rs/matrix/large_matrix.rs b/tests/RenderScriptTests/LargeMatrix/src/com/android/rs/matrix/large_matrix.rs deleted file mode 100644 index 32b668c..0000000 --- a/tests/RenderScriptTests/LargeMatrix/src/com/android/rs/matrix/large_matrix.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2012 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(com.android.rs.matrix) - -rs_allocation gMatrix; - -void multiply_row(const float4 *in, float4 *out, uint32_t x) { - uint32_t dimX = rsAllocationGetDimX(gMatrix); - - const float4 *m = (const float4 *)rsGetElementAt(gMatrix, 0, x); - float4 sum = m[0] * in[0]; - for(uint32_t ct=1; ct < dimX; ct++) { - sum += m[ct] * in[0]; - } - *out = sum; -} - |