main.es6 794 字节
Newer Older
W
wangqun 已提交
1 2 3 4 5 6 7 8 9
/* eslint-disable */
/**
 * @file 加法主函数
 * @author yangmingming
 */
export default `
// start函数
void main(void) {
    // 输出数据
10 11
    ivec4 oPos = getOutputTensorPosLIMIT_OUT();
    float o = getValueFromTensorPosLIMIT_ORIGIN_origin(oPos.r, oPos.g, oPos.b, oPos.a);
W
wangqun 已提交
12
	ivec4 pos_counter;
W
wangqun 已提交
13 14 15
	float c = 0.0;

	if (axis == 1){
16
        c = getValueFromTensorPosLIMIT_COUNTER_counter(0, oPos.r, oPos.g, oPos.b);
W
wangqun 已提交
17 18
    }
    else if (axis == 2){
19
        c = getValueFromTensorPosLIMIT_COUNTER_counter(0, 0, oPos.r, oPos.g);
W
wangqun 已提交
20 21
    }
    else if (axis == 3){
22
        c = getValueFromTensorPosLIMIT_COUNTER_counter(0, 0, 0, oPos.r);
W
wangqun 已提交
23 24
    }
    else {
25
        c = getValueFromTensorPosLIMIT_COUNTER_counter(oPos.r, oPos.g, oPos.b, oPos.a);
W
wangqun 已提交
26
    }
W
wangqun 已提交
27
	float res = c + o;
W
wangqun 已提交
28
	setOutput(float(res));
W
wangqun 已提交
29 30
}
`;