scalar_max

Description

Compares two source operands and returns the maximum:

Prototype

scalar_max(dst, src0, src1)

Parameters

Table 1 Parameter description

Parameter

Input/Output

Description

dst

Output

Destination operand.

Atlas training product : a Scalar of type int64

Atlas inference product AI Core: a Scalar of type int64/float32

Atlas inference product Vector Core: a Scalar of type int64/float32

Atlas A2 training product / Atlas A2 inference product : a Scalar of type int64/float32

Atlas 200I/500 A2 inference product : a Scalar of type int64/float32

src0

Input

Source operand 0.

Atlas training product : a Scalar of type int64 or an immediate of type int64

Atlas inference product AI Core: a Scalar of type int64/float32 or an immediate of type int64

Atlas inference product Vector Core: a Scalar of type int64/float32 or an immediate of type int64

Atlas A2 training product / Atlas A2 inference product : a Scalar of type int64/float32 or an immediate of type int64

Atlas 200I/500 A2 inference product : a Scalar of type int64/float32 or an immediate of type int64

src1

Input

Source operand 1.

Atlas training product : a Scalar of type int64 or an immediate of type int64

Atlas inference product AI Core: a Scalar of type int64/float32 or an immediate of type int64

Atlas inference product Vector Core: a Scalar of type int64/float32 or an immediate of type int64

Atlas A2 training product / Atlas A2 inference product : a Scalar of type int64/float32 or an immediate of type int64

Atlas 200I/500 A2 inference product : a Scalar of type int64/float32 or an immediate of type int64

Applicability

Atlas training product

Atlas inference product AI Core

Atlas inference product Vector Core

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Restrictions

The operands must have the same data type.

Returns

None

Example

from tbe import tik
tik_instance = tik.Tik()
src0_scalar = tik_instance.Scalar(dtype="int64", name='src0_scalar', init_value=3)
src1_scalar = tik_instance.Scalar(dtype="int64", name='src1_scalar', init_value=2)
dst_scalar = tik_instance.Scalar(dtype="int64", name='dst_scalar')
# dst_scalar=3
tik_instance.scalar_max(dst_scalar, src0_scalar, src1_scalar)
tik_instance.BuildCCE(kernel_name="run_scalar_max", inputs=[], outputs=[])