class
SushiBLAS::LogicOps
Records comparisons, boolean combinations and truth tests of tensors.
- Declared in
include/SushiBLAS/engine/logic/logic.hpp
Note
Every operand must have storage and dense strides, and the operands of one call must share one shape: the library does not broadcast.
Public member functions
explicit LogicOps(TaskRecorder &recorder) noexceptBuilds a view that records through recorder, which must outlive the view.
explicit LogicOps(Engine &engine) noexceptBuilds a view that records on engine's own graph.
LogicOps(const LogicOps &)=defaultLogicOps & operator=(const LogicOps &)=deleteLogicOps(LogicOps &&)=defaultLogicOps & operator=(LogicOps &&)=delete~LogicOps()=defaultTaskHandle equal(const Tensor &A, const Tensor &B, Tensor &result)Element-wise equality comparison: A == B.
Parameters
AFirst input tensor.
BSecond input tensor.
resultOutput tensor (1 if true, 0 if false).
Returns
The handle of the recorded task.
TaskHandle not_equal(const Tensor &A, const Tensor &B, Tensor &result)Element-wise inequality comparison: A != B.
Parameters
AFirst input tensor.
BSecond input tensor.
resultOutput tensor (1 if true, 0 if false).
Returns
The handle of the recorded task.
TaskHandle greater(const Tensor &A, const Tensor &B, Tensor &result)Element-wise comparison: A > B.
Parameters
AFirst input tensor.
BSecond input tensor.
resultOutput tensor (1 if true, 0 if false).
Returns
The handle of the recorded task.
TaskHandle less(const Tensor &A, const Tensor &B, Tensor &result)Element-wise comparison: A < B.
Parameters
AFirst input tensor.
BSecond input tensor.
resultOutput tensor (1 if true, 0 if false).
Returns
The handle of the recorded task.
TaskHandle greater_equal(const Tensor &A, const Tensor &B, Tensor &result)Element-wise comparison: A >= B.
Parameters
AFirst input tensor.
BSecond input tensor.
resultOutput tensor (1 if true, 0 if false).
Returns
The handle of the recorded task.
TaskHandle less_equal(const Tensor &A, const Tensor &B, Tensor &result)Element-wise comparison: A <= B.
Parameters
AFirst input tensor.
BSecond input tensor.
resultOutput tensor (1 if true, 0 if false).
Returns
The handle of the recorded task.
TaskHandle where(const Tensor &condition, const Tensor &A, const Tensor &B, Tensor &out)Selects A where condition is non-zero and B elsewhere, like numpy.where.
TaskHandle logical_and(const Tensor &A, const Tensor &B, Tensor &out)Element-wise logical AND of two tensors.
Parameters
AInput tensor A.
BInput tensor B.
outOutput tensor (1 if both non-zero, else 0).
Returns
The handle of the recorded task.
TaskHandle logical_or(const Tensor &A, const Tensor &B, Tensor &out)Element-wise logical OR of two tensors.
Parameters
AInput tensor A.
BInput tensor B.
outOutput tensor (1 if either non-zero, else 0).
Returns
The handle of the recorded task.
TaskHandle logical_xor(const Tensor &A, const Tensor &B, Tensor &out)Element-wise logical XOR of two tensors.
Parameters
AInput tensor A.
BInput tensor B.
outOutput tensor (1 if exactly one is non-zero, else 0).
Returns
The handle of the recorded task.
TaskHandle logical_not(const Tensor &A, Tensor &out)Element-wise logical NOT of a tensor.
Parameters
AInput tensor.
outOutput tensor (1 if zero, 0 if non-zero).
Returns
The handle of the recorded task.
TaskHandle all(const Tensor &t, Tensor &result)Check if all elements are non-zero (Logical ALL reduction).
Parameters
tInput tensor.
resultScalar output (1 if all true, else 0).
Returns
The handle of the recorded task.
TaskHandle any(const Tensor &t, Tensor &result)Check if any element is non-zero (Logical ANY reduction).
Parameters
tInput tensor.
resultScalar output (1 if any true, else 0).
Returns
The handle of the recorded task.

