BitwiseXor
Applicability
Product |
Supported |
|---|---|
Atlas 350 Accelerator Card |
√ |
x |
|
x |
|
x |
|
x |
|
x |
|
x |
Function Usage
Performs a bitwise XOR operation on two inputs.

Prototype
1 2 | template <const BitwiseXorConfig& config = DEFAULT_BITWISE_XOR_CONFIG, typename T> __aicore__ inline void BitwiseXor(const LocalTensor<T>& dst, const LocalTensor<T>& src0, const LocalTensor<T>& src1, const uint32_t count) |
Parameters
Parameter |
Description |
|---|---|
config |
BitwiseXor algorithm configuration. This is an optional parameter of the BitwiseXorConfig type. The code below describes the definition. isReuseSource: This parameter is reserved. Pass the default value false. |
T |
Data type of the source and destination operands. For the Atlas 350 Accelerator Card, the supported data types are int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, and uint64_t. |
1 2 3 | struct BitwiseXorConfig { bool isReuseSource; }; |
Parameter |
Type |
Description |
|---|---|---|
dst |
Output |
Destination operand. The type is LocalTensor, and TPosition can be VECIN, VECCALC, or VECOUT. |
src0, src1 |
Input |
Source operand. The type is LocalTensor, and TPosition can be VECIN, VECCALC, or VECOUT. The source and destination operands must have the same data type. |
count |
Input |
Number of elements involved in the computation. |
Returns
None
Constraints
- The source operand address must not overlap the destination operand address.
- For details about the alignment requirements of the operand address offset, see General Description and Restrictions.
Examples
1 2 3 4 | AscendC::LocalTensor<uint32_t> src0, src1; AscendC::LocalTensor<uint32_t> dst; uint32_t count = 512; // Number of elements involved in computation AscendC::BitwiseXor(dst, src0, src1, count); |
Result example:
1 2 3 4 5 6 | Input (src0): [63, -123, 91, -107, ... -8] Input (src1): [112, -117, 78, -60, ... 16] Output (dst): [79, 14, 21, 81, ... -24] |