ops.es6 8.1 KB
Newer Older
W
wangqun 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/* eslint-disable */
import common_params from '../../shader/atom/common_params';
import common_func from '../../shader/atom/common_func';
import prefix from '../../shader/atom/prefix';
import prefix2 from '../../shader/atom/prefix2';
import suffix from '../../shader/atom/suffix';
import ivec56 from '../../shader/atom/type_ivec56';

import conv2d_params from '../../shader/conv2d/params';
import conv2d_func from '../../shader/conv2d/main';
import conv2d_conf from '../../shader/conv2d/conf';
import conv2d_depthwise_params from '../../shader/conv2d_depthwise/params';
import conv2d_depthwise_func from '../../shader/conv2d_depthwise/main';
import conv2d_depthwise_conf from '../../shader/conv2d_depthwise/conf';
W
wangqun 已提交
15 16 17
import conv2d_transpose_params from '../../shader/conv2d_transpose/params';
import conv2d_transpose_func from '../../shader/conv2d_transpose/main';
import conv2d_transpose_conf from '../../shader/conv2d_transpose/conf';
W
wangqun 已提交
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
import dynamic_params from '../../shader/dynamic/params';
import dynamic_func from '../../shader/dynamic/main';
import dynamic_conf from '../../shader/dynamic/conf';
import pool2d_params from '../../shader/pool2d/params';
import pool2d_func from '../../shader/pool2d/main';
import pool2d_conf from '../../shader/pool2d/conf';
import pool2d_max_params from '../../shader/pool2d_max/params';
import pool2d_max_func from '../../shader/pool2d_max/main';
import pool2d_max_conf from '../../shader/pool2d_max/conf';
import pool2d_winograd_params from '../../shader/pool2d_winograd/params';
import pool2d_winograd_func from '../../shader/pool2d_winograd/main';
import pool2d_winograd_conf from '../../shader/pool2d_winograd/conf';
import elementwise_add_params from '../../shader/elementwise_add/params';
import elementwise_add_func from '../../shader/elementwise_add/main';
import elementwise_add_conf from '../../shader/elementwise_add/conf';
import mul_params from '../../shader/mul/params';
import mul_func from '../../shader/mul/main';
import mul_conf from '../../shader/mul/conf';
import softmax_params from '../../shader/softmax/params';
import softmax_func from '../../shader/softmax/main';
import softmax_conf from '../../shader/softmax/conf';
import batchnorm_params from '../../shader/batchnorm/params';
import batchnorm_func from '../../shader/batchnorm/main';
import batchnorm_conf from '../../shader/batchnorm/conf';
W
wangqun 已提交
42 43 44 45 46 47
import reshape_params from '../../shader/reshape/params';
import reshape_func from '../../shader/reshape/main';
import reshape_conf from '../../shader/reshape/conf';
import transpose_params from '../../shader/transpose/params';
import transpose_func from '../../shader/transpose/main';
import transpose_conf from '../../shader/transpose/conf';
W
wangqun 已提交
48 49 50 51 52 53 54 55 56

import conv2d_elementwise_add_params from '../../shader/conv2d_elementwise_add/params';
import conv2d_elementwise_add_func from '../../shader/conv2d_elementwise_add/main';
import conv2d_elementwise_add_conf from '../../shader/conv2d_elementwise_add/conf';

import conv2d_elementwise_add_winograd_params from '../../shader/conv2d_elementwise_add_winograd/params';
import conv2d_elementwise_add_winograd_func from '../../shader/conv2d_elementwise_add_winograd/main';
import conv2d_elementwise_add_winograd_conf from '../../shader/conv2d_elementwise_add_winograd/conf';

W
wangqun 已提交
57 58 59 60 61 62 63 64
import concat_params from '../../shader/concat/params';
import concat_func from '../../shader/concat/main';
import concat_conf from '../../shader/concat/conf';

import split_params from '../../shader/split/params';
import split_func from '../../shader/split/main';
import split_conf from '../../shader/split/conf';

W
wangqun 已提交
65 66 67 68 69 70 71 72 73 74 75
import getArrayIndexFromTensorPos from '../../shader/atom/getArrayIndexFromTensorPos';
import getArrayIndexFromTexturePos from '../../shader/atom/getArrayIndexFromTexturePos';
import getTensorPosFromArrayIndex from '../../shader/atom/getTensorPosFromArrayIndex';
import getTexturePosFromArrayIndex from '../../shader/atom/getTexturePosFromArrayIndex';
import getValueFromTexturePos from '../../shader/atom/getValueFromTexturePos';
import getValueFromTensorPos from '../../shader/atom/getValueFromTensorPos';
import getValueFromTensorPosPacked from '../../shader/atom/getValueFromTensorPosPacked';
import moveTexture2PosToReal from '../../shader/atom/moveTexture2PosToReal';
import getPixelsFromTexturePos from '../../shader/atom/getPixelsFromTexturePos';
import getRangePowSumFromArrayIndex from '../../shader/atom/getRangePowSumFromArrayIndex';
import getRangeSumFromArrayIndex from '../../shader/atom/getRangeSumFromArrayIndex';
W
wangqun 已提交
76
import transferFromNHWCtoNCHW from '../../shader/atom/transferFromNHWCtoNCHW';
W
wangqun 已提交
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
import sigmoid from '../../shader/atom/sigmoid';
import prelu from '../../shader/atom/prelu';
import scale from '../../shader/atom/scale';
import softmax from '../../shader/atom/softmax';
/**
 * @file op文件
 * @author yangmingming
 */

export default {
    common: {
        params: common_params,
        func: common_func,
        prefix,
        prefix2,
        suffix,
        ivec56
    },
    ops: {
W
wangqun 已提交
96 97 98 99 100
    	conv2d_transpose:{
            params: conv2d_transpose_params,
            func: conv2d_transpose_func,
            confs: conv2d_transpose_conf
		},
W
wangqun 已提交
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
        conv2d: {
            params: conv2d_params,
            func: conv2d_func,
            confs: conv2d_conf
        },
        conv2d_depthwise: {
            params: conv2d_depthwise_params,
            func: conv2d_depthwise_func,
            confs: conv2d_depthwise_conf
        },
        conv2d_elementwise_add: {
            params: conv2d_elementwise_add_params,
            func: conv2d_elementwise_add_func,
            confs: conv2d_elementwise_add_conf
        },
        conv2d_elementwise_add_winograd: {
            params: conv2d_elementwise_add_winograd_params,
            func: conv2d_elementwise_add_winograd_func,
            confs: conv2d_elementwise_add_winograd_conf
        },
        dynamic: {
            params: dynamic_params,
            func: dynamic_func,
            confs: dynamic_conf
        },
        pool2d: {
            params: pool2d_params,
            func: pool2d_func,
            confs: pool2d_conf
        },
        pool2d_max: {
            params: pool2d_max_params,
            func: pool2d_max_func,
            confs: pool2d_max_conf
        },
        pool2d_winograd: {
            params: pool2d_winograd_params,
            func: pool2d_winograd_func,
            confs: pool2d_winograd_conf
        },
        elementwise_add: {
            params: elementwise_add_params,
            func: elementwise_add_func,
            confs: elementwise_add_conf
        },
        mul: {
            params: mul_params,
            func: mul_func,
            confs: mul_conf
        },
W
wangqun 已提交
151 152 153 154 155 156 157 158 159 160
        concat: {
            params: concat_params,
            func: concat_func,
            confs: concat_conf
        },
        split: {
            params: split_params,
            func: split_func,
            confs: split_conf
        },
W
wangqun 已提交
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
        relu: {
            params: dynamic_params,
            func: dynamic_func,
            confs: dynamic_conf
        },
        relu6: {
            params: dynamic_params,
            func: dynamic_func,
            confs: dynamic_conf
        },
        scale: {
            params: dynamic_params,
            func: dynamic_func,
            confs: dynamic_conf
        },
        softmax: {
            params: softmax_params,
            func: softmax_func,
            confs: softmax_conf
        },
        batchnorm: {
            params: batchnorm_params,
            func: batchnorm_func,
            confs: batchnorm_conf
W
wangqun 已提交
185 186 187 188 189 190 191 192 193 194 195
        },
		reshape: {
			params: reshape_params,
			func: reshape_func,
			confs: reshape_conf
		},
		transpose: {
			params: transpose_params,
			func: transpose_func,
			confs: transpose_conf
		}
W
wangqun 已提交
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
    },
    atoms: {
        getArrayIndexFromTensorPos,
        getArrayIndexFromTexturePos,
        getTensorPosFromArrayIndex,
        getTexturePosFromArrayIndex,
        getValueFromTexturePos,
        getValueFromTensorPos,
        getValueFromTensorPosPacked,
        moveTexture2PosToReal,
        getPixelsFromTexturePos,
        getRangeSumFromArrayIndex,
        getRangePowSumFromArrayIndex,
        sigmoid,
        prelu,
        scale,
W
wangqun 已提交
212 213
        softmax,
        transferFromNHWCtoNCHW
W
wangqun 已提交
214 215
    }
};