Skip to content

Commit b0e0c1c

Browse files
stephenhinesAndroid (Google) Code Review
authored andcommitted
Merge "Add case for NEON min to RSTest" into jb-mr1-dev
2 parents e4fcedf + 6e1b917 commit b0e0c1c

File tree

3 files changed

+61
-0
lines changed

3 files changed

+61
-0
lines changed

tests/RenderScriptTests/tests/src/com/android/rs/test/RSTestCore.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public void init(RenderScriptGL rs, Resources res, int width, int height) {
8686
unitTests.add(new UT_math(this, mRes, mCtx));
8787
unitTests.add(new UT_math_conformance(this, mRes, mCtx));
8888
unitTests.add(new UT_math_agree(this, mRes, mCtx));
89+
unitTests.add(new UT_min(this, mRes, mCtx));
8990
unitTests.add(new UT_element(this, mRes, mCtx));
9091
unitTests.add(new UT_sampler(this, mRes, mCtx));
9192
unitTests.add(new UT_program_store(this, mRes, mCtx));
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (C) 2012 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.android.rs.test;
18+
19+
import android.content.Context;
20+
import android.content.res.Resources;
21+
import android.renderscript.*;
22+
23+
public class UT_min extends UnitTest {
24+
private Resources mRes;
25+
26+
protected UT_min(RSTestCore rstc, Resources res, Context ctx) {
27+
super(rstc, "Min (relaxed)", ctx);
28+
mRes = res;
29+
}
30+
31+
public void run() {
32+
RenderScript pRS = RenderScript.create(mCtx);
33+
ScriptC_min s = new ScriptC_min(pRS, mRes, R.raw.min);
34+
pRS.setMessageHandler(mRsMessage);
35+
s.invoke_min_test();
36+
pRS.finish();
37+
waitForMessage();
38+
pRS.destroy();
39+
}
40+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include "shared.rsh"
2+
#pragma rs_fp_relaxed
3+
4+
volatile uchar2 res_uc_2 = 1;
5+
volatile uchar2 src1_uc_2 = 1;
6+
volatile uchar2 src2_uc_2 = 1;
7+
8+
void min_test() {
9+
bool failed = false;
10+
11+
res_uc_2 = min(src1_uc_2, src2_uc_2);
12+
13+
if (failed) {
14+
rsSendToClientBlocking(RS_MSG_TEST_FAILED);
15+
}
16+
else {
17+
rsSendToClientBlocking(RS_MSG_TEST_PASSED);
18+
}
19+
}
20+

0 commit comments

Comments
 (0)