1/*
2 * Copyright (C) 2015 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
17package com.example.android.rs.blasbenchmark;
18
19import android.app.Activity;
20import android.view.View;
21import android.util.Log;
22
23public class BlasTestList {
24    private final String TAG = "BLAS";
25    public final String RESULT_FILE = "blas_benchmark_result.csv";
26
27    /**
28     * Define enum type for test names
29     */
30    public enum TestName {
31
32        SGEMM_SMALL ("SGEMM Test Small", 1.f),
33        SGEMM_MEDIUM ("SGEMM Test Medium", 1.f),
34        SGEMM_LARGE ("SGEMM Test LARGE", 1.f),
35        BNNM_SMALL ("8Bit GEMM Test Small", 1.f),
36        BNNM_MEDIUM ("8Bit GEMM Test Medium", 1.f),
37        BNNM_LARGE ("8Bit GEMM Test Large", 1.f);
38
39        private final String name;
40        public final float baseline;
41
42        private TestName(String s, float base) {
43            name = s;
44            baseline = base;
45        }
46        private TestName(String s) {
47            name = s;
48            baseline = 1.f;
49        }
50
51        // return quoted string as displayed test name
52        public String toString() {
53            return name;
54        }
55    }
56
57    static TestBase newTest(TestName testName) {
58        switch(testName) {
59        case SGEMM_SMALL:
60            return new SGEMMTest(1);
61        case SGEMM_MEDIUM:
62            return new SGEMMTest(2);
63        case SGEMM_LARGE:
64            return new SGEMMTest(3);
65        case BNNM_SMALL:
66            return new BNNMTest(1);
67        case BNNM_MEDIUM:
68            return new BNNMTest(2);
69        case BNNM_LARGE:
70            return new BNNMTest(3);
71        }
72
73        return null;
74    }
75}
76
77