Compute Library
 21.02
elementwise_operation_quantized.cl File Reference
#include "helpers.h"

Go to the source code of this file.

Macros

#define SUB(x, y)   (x - y)
 
#define ADD(x, y)   (x + y)
 
#define MAX(x, y)   max((x), (y))
 
#define MIN(x, y)   min((x), (y))
 
#define SQUARED_DIFF(x, y)   (x - y) * (x - y)
 
#define PRELU(x, y)   (select(y * x, x, CONVERT((x > (DATA_TYPE_OUT)0), SELECT_VEC_DATA_TYPE(float, VEC_SIZE_OUT))))
 
#define DIV(x, y)   (x / y)
 
#define CONVERT_RTE(x, type)   (convert_##type##_rte((x)))
 
#define CONVERT_DOWN(x, type)   CONVERT_RTE(x, type)
 
#define OP_FUN_NAME_STR(op)   elementwise_operation_##op##_quantized
 
#define OP_FUN_NAME(op)   OP_FUN_NAME_STR(op)
 

Macro Definition Documentation

◆ ADD

#define ADD (   x,
 
)    (x + y)

Definition at line 27 of file elementwise_operation_quantized.cl.

◆ CONVERT_DOWN

#define CONVERT_DOWN (   x,
  type 
)    CONVERT_RTE(x, type)

Definition at line 35 of file elementwise_operation_quantized.cl.

◆ CONVERT_RTE

#define CONVERT_RTE (   x,
  type 
)    (convert_##type##_rte((x)))

Definition at line 34 of file elementwise_operation_quantized.cl.

◆ DIV

#define DIV (   x,
 
)    (x / y)

Definition at line 32 of file elementwise_operation_quantized.cl.

◆ MAX

◆ MIN

#define MIN (   x,
 
)    min((x), (y))

Definition at line 29 of file elementwise_operation_quantized.cl.

◆ OP_FUN_NAME

#define OP_FUN_NAME (   op)    OP_FUN_NAME_STR(op)

Definition at line 38 of file elementwise_operation_quantized.cl.

◆ OP_FUN_NAME_STR

#define OP_FUN_NAME_STR (   op)    elementwise_operation_##op##_quantized

Definition at line 37 of file elementwise_operation_quantized.cl.

◆ PRELU

#define PRELU (   x,
 
)    (select(y * x, x, CONVERT((x > (DATA_TYPE_OUT)0), SELECT_VEC_DATA_TYPE(float, VEC_SIZE_OUT))))

Definition at line 31 of file elementwise_operation_quantized.cl.

◆ SQUARED_DIFF

#define SQUARED_DIFF (   x,
 
)    (x - y) * (x - y)

Definition at line 30 of file elementwise_operation_quantized.cl.

◆ SUB

#define SUB (   x,
 
)    (x - y)

Definition at line 26 of file elementwise_operation_quantized.cl.