ops.hpp 1.38 KB
Newer Older
1
2
3
4
5
6
7
#ifndef __INFINIOPTEST_OPS_HPP__
#define __INFINIOPTEST_OPS_HPP__
#include "test.hpp"

/*
 * Declare all the tests here
 */
PanZezhong's avatar
PanZezhong committed
8
DECLARE_INFINIOP_TEST(gemm)
9
DECLARE_INFINIOP_TEST(random_sample)
Catheriany's avatar
Catheriany committed
10
DECLARE_INFINIOP_TEST(mul)
11
DECLARE_INFINIOP_TEST(clip)
MaHang's avatar
MaHang committed
12
DECLARE_INFINIOP_TEST(swiglu)
13
DECLARE_INFINIOP_TEST(add)
14

15
16
17
18
19
20
21
#define REGISTER_INFINIOP_TEST(name)                      \
    {                                                     \
        #name,                                            \
        {                                                 \
            infiniop_test::name::Test::build,             \
            infiniop_test::name::Test::attribute_names(), \
            infiniop_test::name::Test::tensor_names(),    \
22
            infiniop_test::name::Test::output_names(),    \
23
        }},
24
25
26
27

/*
 * Register all the tests here
 */
Catheriany's avatar
Catheriany committed
28
29
30
31
32
#define TEST_BUILDER_MAPPINGS                 \
    {                                         \
        REGISTER_INFINIOP_TEST(gemm)          \
        REGISTER_INFINIOP_TEST(random_sample) \
        REGISTER_INFINIOP_TEST(add)           \
Catheriany's avatar
Catheriany committed
33
        REGISTER_INFINIOP_TEST(mul)           \
34
        REGISTER_INFINIOP_TEST(clip)          \
35
36
        REGISTER_INFINIOP_TEST(swiglu)        \
    }
37
38

namespace infiniop_test {
PanZezhong's avatar
PanZezhong committed
39
40

// Global variable for {op_name: builder} mappings
41
42
43
44
45
extern std::unordered_map<std::string, const TestBuilder> TEST_BUILDERS;

} // namespace infiniop_test

#endif