|
48 | 48 |
|
49 | 49 | #if defined(FUSED_CONV_RELU)
|
50 | 50 | #define ACTIVATION_RELU_FUNCTION(x, c) ((Dtype)(x) > 0 ? (Dtype)(x) : ((Dtype)(x) * (Dtype)(negative_slope)))
|
51 |
| -#define NEGATIVE_SLOPE_ARG Dtype negative_slope, |
| 51 | +#define FUSED_ARG Dtype negative_slope, |
52 | 52 | #elif defined(FUSED_CONV_PRELU)
|
53 | 53 | #define ACTIVATION_RELU_FUNCTION(x, c) ((Dtype)(x) > 0 ? (Dtype)(x) : ((Dtype)(x) * (Dtype)(negative_slope[c])))
|
54 |
| -#define NEGATIVE_SLOPE_ARG __global const Dtype *negative_slope, |
| 54 | +#define FUSED_ARG __global const Dtype *negative_slope, |
55 | 55 | #elif defined(FUSED_CONV_POWER)
|
56 | 56 | #define ACTIVATION_RELU_FUNCTION(x, c) pow(x, power)
|
57 |
| -#define NEGATIVE_SLOPE_ARG Dtype power, |
| 57 | +#define FUSED_ARG Dtype power, |
58 | 58 | #elif defined(FUSED_CONV_TANH)
|
59 | 59 | #define ACTIVATION_RELU_FUNCTION(x, c) tanh(x)
|
60 |
| -#define NEGATIVE_SLOPE_ARG |
| 60 | +#define FUSED_ARG |
| 61 | +#elif defined(FUSED_CONV_RELU6) |
| 62 | +#define ACTIVATION_RELU_FUNCTION(x, c) (clamp((Dtype)(x), min_value, max_value)) |
| 63 | +#define FUSED_ARG Dtype min_value, Dtype max_value, |
61 | 64 | #else
|
62 | 65 | #define ACTIVATION_RELU_FUNCTION(x, c) (x)
|
63 |
| -#define NEGATIVE_SLOPE_ARG |
| 66 | +#define FUSED_ARG |
64 | 67 | #endif
|
65 | 68 |
|
66 | 69 | #ifdef FUSED_CONV_ELTWISE
|
|
108 | 111 |
|
109 | 112 | __kernel void ConvolveBasic(
|
110 | 113 | ELTWISE_DATA_ARG
|
111 |
| - NEGATIVE_SLOPE_ARG |
| 114 | + FUSED_ARG |
112 | 115 | __global Dtype* image_data,
|
113 | 116 | int image_offset,
|
114 | 117 | __global Dtype* kernel_data,
|
@@ -197,7 +200,7 @@ __attribute__((intel_reqd_sub_group_size(SIMD_SIZE)))
|
197 | 200 | __kernel void
|
198 | 201 | convolve_simd(
|
199 | 202 | ELTWISE_DATA_ARG
|
200 |
| - NEGATIVE_SLOPE_ARG |
| 203 | + FUSED_ARG |
201 | 204 | __global Dtype* inputs_base,
|
202 | 205 | filter_qualifier Dtype* weights_base,
|
203 | 206 | BIAS_KERNEL_ARG
|
@@ -417,7 +420,7 @@ typedef struct float0 { float s0; } float0; //never used but makes compiler happ
|
417 | 420 |
|
418 | 421 | #define GEMM_LIKE_KERNEL_ARGS \
|
419 | 422 | ELTWISE_DATA_ARG \
|
420 |
| - NEGATIVE_SLOPE_ARG \ |
| 423 | + FUSED_ARG \ |
421 | 424 | const __global Dtype *src0, \
|
422 | 425 | const __global Dtype *src1, \
|
423 | 426 | BIAS_KERNEL_ARG \
|
@@ -1731,7 +1734,7 @@ __kernel void Conv_Interleaved(GEMM_LIKE_KERNEL_ARGS)
|
1731 | 1734 |
|
1732 | 1735 | __kernel void DWCONV(
|
1733 | 1736 | ELTWISE_DATA_ARG
|
1734 |
| - NEGATIVE_SLOPE_ARG |
| 1737 | + FUSED_ARG |
1735 | 1738 | __global Dtype* image_data,
|
1736 | 1739 | __global Dtype* kernel_data,
|
1737 | 1740 | BIAS_KERNEL_ARG
|
|
0 commit comments