mirror of
https://github.com/opencv/opencv.git
synced 2025-06-16 23:00:51 +08:00
dnn(ocl4dnn): calculate activation expression once
- to avoid multiple conditional calls via sub_group() functions
This commit is contained in:
parent
81c94357e8
commit
eec468fa13
@ -69,10 +69,16 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef FUSED_CONV_ELTWISE
|
#ifdef FUSED_CONV_ELTWISE
|
||||||
#define ACTIVATION_FUNCTION(_dst_, _offset_, _data_, _channel_) do { (_dst_)[(_offset_)] = ACTIVATION_RELU_FUNCTION(eltwise_data[(_offset_)] + (_data_), _channel_);} while(0)
|
#define ACTIVATION_FUNCTION(_dst_, _offset_, _data_, _channel_) do { \
|
||||||
|
const Dtype _x_ = eltwise_data[(_offset_)] + (_data_); \
|
||||||
|
(_dst_)[(_offset_)] = ACTIVATION_RELU_FUNCTION(_x_, _channel_); \
|
||||||
|
} while(0)
|
||||||
#define ELTWISE_DATA_ARG __global Dtype* eltwise_data,
|
#define ELTWISE_DATA_ARG __global Dtype* eltwise_data,
|
||||||
#else
|
#else
|
||||||
#define ACTIVATION_FUNCTION(_dst_, _offset_, _data_, _channel_) do { (_dst_)[(_offset_)] = ACTIVATION_RELU_FUNCTION(_data_, _channel_);} while(0)
|
#define ACTIVATION_FUNCTION(_dst_, _offset_, _data_, _channel_) do { \
|
||||||
|
const Dtype _x_ = (_data_); \
|
||||||
|
(_dst_)[(_offset_)] = ACTIVATION_RELU_FUNCTION(_x_, _channel_); \
|
||||||
|
} while(0)
|
||||||
#define ELTWISE_DATA_ARG
|
#define ELTWISE_DATA_ARG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user