aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/cl_kernels/gemm.cl
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/CL/cl_kernels/gemm.cl')
-rw-r--r--src/core/CL/cl_kernels/gemm.cl11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/CL/cl_kernels/gemm.cl b/src/core/CL/cl_kernels/gemm.cl
index 46f1645aa7..db15720ad0 100644
--- a/src/core/CL/cl_kernels/gemm.cl
+++ b/src/core/CL/cl_kernels/gemm.cl
@@ -21,9 +21,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#include "fixed_point.h"
#include "helpers.h"
+#ifdef FIXED_POINT_POSITION
+#include "fixed_point.h"
+#endif // FIXED_POINT_POSITION
+
/** This OpenCL kernel computes the "vector" 1x4 transposition of input matrix
*
* @param[in] src_ptr Pointer to the source matrix. Supported data types: U32/S32/F32
@@ -274,7 +277,11 @@ __kernel void gemm_accumulate_biases(
accum_value = vload16(0, (__global DATA_TYPE *)accum.ptr);
VEC_DATA_TYPE(DATA_TYPE, 16)
biases_value = vload16(0, (__global DATA_TYPE *)biases.ptr);
- accum_value = biases_value + accum_value;
+#ifdef FIXED_POINT_POSITION
+ accum_value = ADD_SAT_OP_EXPAND(biases_value, accum_value, DATA_TYPE, 16);
+#else // FIXED_POINT_POSITION
+ accum_value = biases_value + accum_value;
+#endif // FIXED_POINT_POSITION
// Store result in the accummulate buffer
vstore16(accum_value, 0, (__global DATA_TYPE *)accum.ptr);