params.es6 1.8 KB
Newer Older
W
wangqun 已提交
1 2 3 4 5 6 7
/* eslint-disable */
/**
 * @file 参数文件
 * @author yangmingming
 */
export default `
    // conv2d的input数据
8

W
wangqun 已提交
9 10 11 12 13 14 15 16
    // 常量
    // 卷积核
    const int length_shape_filter = LENGTH_SHAPE_FILTER;
    const int width_shape_filter = WIDTH_SHAPE_FILTER;
    const int height_shape_filter = HEIGHT_SHAPE_FILTER;
    const int width_texture_filter = WIDTH_TEXTURE_FILTER;
    const int height_texture_filter = HEIGHT_TEXTURE_FILTER;
    const int channel_filter = CHANNEL_FILTER;
17

W
wangqun 已提交
18 19 20 21 22 23 24
    // 输入数据
    const int width_shape_origin = WIDTH_SHAPE_ORIGIN;
    const int height_shape_origin = HEIGHT_SHAPE_ORIGIN;
    const int length_shape_origin = LENGTH_SHAPE_ORIGIN;
    const int width_texture_origin = WIDTH_TEXTURE_ORIGIN;
    const int height_texture_origin = HEIGHT_TEXTURE_ORIGIN;
    const int channel_origin = CHANNEL_ORIGIN;
W
wangqun 已提交
25

26 27 28 29 30 31 32 33
    // bias
    const int width_shape_bias = WIDTH_SHAPE_BIAS;
    const int height_shape_bias = HEIGHT_SHAPE_BIAS;
    const int length_shape_bias = LENGTH_SHAPE_BIAS;
    const int width_texture_bias = WIDTH_TEXTURE_BIAS;
    const int height_texture_bias = HEIGHT_TEXTURE_BIAS;
    const int channel_bias = CHANNEL_BIAS;

W
wangqun 已提交
34 35 36 37 38 39 40 41 42 43 44 45
    // 计算相关
    // 拆分步长
    const int stride_h = STRIDES_X;
    const int stride_v = STRIDES_Y;
    // padding的数目
    const int padLeft = PADDINGS_X;
    const int padTop = PADDINGS_Y;
    // dilation膨胀系数
    const int dilation_h = DILATIONS_X;
    const int dilation_v = DILATIONS_Y;
    // groups
    const int groups = GROUPS;
46

W
wangqun 已提交
47 48 49
    // uniform变量
    // 卷积核
    uniform sampler2D texture_filter;
50

W
wangqun 已提交
51 52
    // 输入数据
    uniform sampler2D texture_origin;
53 54 55 56


    // bias
    uniform sampler2D texture_bias;
57 58 59 60

    // 合并 channel 计算
    const int filter_nearest_vec4 = FILTER_NEAREST_VEC4;
    const int filter_remainder_vec4 = FILTER_REMAINDER_VEC4;
W
wangqun 已提交
61
`;