each_mode.inl 3.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
/**
 * \file dnn/src/common/elemwise/each_mode.inl
 * MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
 *
 * Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 */
// generated by gen_elemwise_each_mode.py
#define MEGDNN_FOREACH_ELEMWISE_MODE_UNARY_FLOAT(cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(RELU, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ABS, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(NEGATE, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ACOS, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ASIN, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(CEIL, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(COS, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(EXP, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(EXPM1, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(FLOOR, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(LOG, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(LOG1P, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(SIGMOID, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(SIN, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(TANH, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(FAST_TANH, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ROUND, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ERF, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ERFINV, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ERFC, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ERFCINV, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(H_SWISH, cb) \

#define MEGDNN_FOREACH_ELEMWISE_MODE_UNARY_INT(cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(RELU, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ABS, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(NEGATE, cb) \

#define MEGDNN_FOREACH_ELEMWISE_MODE_BINARY_FLOAT(cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ABS_GRAD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ADD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(FLOOR_DIV, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(MAX, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(MIN, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(MOD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(MUL, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(SIGMOID_GRAD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(SUB, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(SWITCH_GT0, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(TANH_GRAD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(LT, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(LEQ, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(EQ, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(FUSE_ADD_RELU, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(TRUE_DIV, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(POW, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(LOG_SUM_EXP, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(FUSE_ADD_TANH, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(FAST_TANH_GRAD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(FUSE_ADD_SIGMOID, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ATAN2, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(H_SWISH_GRAD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(FUSE_ADD_H_SWISH, cb) \

#define MEGDNN_FOREACH_ELEMWISE_MODE_BINARY_INT(cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ABS_GRAD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(ADD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(FLOOR_DIV, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(MAX, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(MIN, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(MOD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(MUL, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(SIGMOID_GRAD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(SUB, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(SWITCH_GT0, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(TANH_GRAD, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(LT, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(LEQ, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(EQ, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(FUSE_ADD_RELU, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(SHL, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(SHR, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(RMULH, cb) \

#define MEGDNN_FOREACH_ELEMWISE_MODE_TERNARY_FLOAT(cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(COND_LEQ_MOV, cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(FUSE_MUL_ADD3, cb) \

#define MEGDNN_FOREACH_ELEMWISE_MODE_TERNARY_INT(cb) \
    MEGDNN_ELEMWISE_MODE_ENABLE(COND_LEQ_MOV, cb) \