2019-06-24 11:32:41 +08:00
|
|
|
|
|
|
|
layout(FORMAT, binding=0) writeonly uniform PRECISION image3D uOutput;
|
|
|
|
layout(location=1) uniform mediump sampler3D uInput0;
|
|
|
|
layout(location=2) uniform mediump sampler3D uInput1;
|
|
|
|
layout(location=3) uniform ivec4 imgSize;
|
2022-09-30 10:02:52 +08:00
|
|
|
layout(location=4) uniform int activationType;
|
2019-06-24 11:32:41 +08:00
|
|
|
|
|
|
|
layout (local_size_x = XLOCAL, local_size_y = YLOCAL, local_size_z = ZLOCAL) in;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
ivec3 pos = ivec3(gl_GlobalInvocationID);
|
|
|
|
ivec3 inSize = imgSize.xyz;
|
|
|
|
if(all(lessThan(pos, inSize)))
|
|
|
|
{
|
|
|
|
#ifdef ADD
|
|
|
|
vec4 sum = texelFetch(uInput0, pos, 0) + texelFetch(uInput1, pos, 0);
|
|
|
|
#endif
|
|
|
|
#ifdef MUL
|
|
|
|
vec4 sum = texelFetch(uInput0, pos, 0) * texelFetch(uInput1, pos, 0);
|
- dynamic computation graph (beta)
- add supports (/express)
- add tests
- add benchmarks with it (/benchmark/exprModels)
- Python
- MNN engine and tools were submitted to pip
- available on Windows/macOS/Linux
- Engine/Converter
- add supports for each op benchmarking
- refactor optimizer by separating steps
- CPU
- add supports for Conv3D, Pool3D, ELU, ReverseSequence
- fix ArgMax, Permute, Scale, BinaryOp, Slice, SliceTf
- OpenCL
- add half transform in CPU
- add broadcast supports for binary
- optimize Conv2D, Reshape, Eltwise, Gemm, etc.
- OpenGL
- add sub, real div supports for binary
- add supports for unary
- optimize Conv2D, Reshape
- Vulkan
- add max supports for eltwise
- Metal
- fix metallib missing problem
- Train/Quantization
- use express to refactor training codes
2019-09-26 21:02:07 +08:00
|
|
|
#endif
|
|
|
|
#ifdef SUB
|
|
|
|
vec4 sum = texelFetch(uInput0, pos, 0) - texelFetch(uInput1, pos, 0);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef REALDIV
|
|
|
|
vec4 sum = texelFetch(uInput0, pos, 0) / texelFetch(uInput1, pos, 0);
|
2019-06-24 11:32:41 +08:00
|
|
|
#endif
|
2022-09-30 10:02:52 +08:00
|
|
|
if(activationType == 1) {
|
|
|
|
sum = max(sum, vec4(0));
|
|
|
|
}
|
2019-06-24 11:32:41 +08:00
|
|
|
imageStore(uOutput, pos, sum);
|
|
|
|
}
|
|
|
|
}
|