81 BinaryFunc func = BinaryFunc()
83 view_d(view_d_), view_a(view_a_), view_b(view_b_), func(func) { }
88 ElementD(view_a.at(coord)),
89 ElementD(view_b.at(coord))
309 cutlass::modulus<ElementD>
void operator()(Coord< LayoutD::kRank > const &coord) const
Equality check.
Definition: host/tensor_elementwise.h:86
Definition: aligned_buffer.h:35
Helper to apply a binary operator in place.
Definition: host/tensor_elementwise.h:57
void TensorAdd(TensorView< ElementD, LayoutD > d, TensorRef< ElementA, LayoutA > a, TensorRef< ElementB, LayoutB > b)
Adds two tensors and stores in the destination tensor: d = a + b.
Definition: host/tensor_elementwise.h:108
CUTLASS_HOST_DEVICE TensorCoord const & extent() const
Returns the extent of the view (the size along each logical dimension).
Definition: tensor_view.h:167
void TensorDiv(TensorView< ElementD, LayoutD > d, TensorRef< ElementA, LayoutA > a, TensorRef< ElementB, LayoutB > b)
Divides two tensors and stores in the destination tensor: d = a ./ b.
Definition: host/tensor_elementwise.h:249
BinaryFunc func
Definition: host/tensor_elementwise.h:67
Definition: functional.h:46
TensorFuncBinaryOp(TensorView< ElementD, LayoutD > const &view_d_, TensorRef< ElementA, LayoutA > const &ref_a_, TensorRef< ElementB, LayoutB > const &ref_b_, BinaryFunc func=BinaryFunc())
Constructor.
Definition: host/tensor_elementwise.h:77
TensorRef< ElementB, LayoutB > ref_b
Definition: host/tensor_elementwise.h:66
Definition: functional.h:64
void TensorSub(TensorView< ElementD, LayoutD > d, TensorRef< ElementA, LayoutA > a, TensorRef< ElementB, LayoutB > b)
Subtracts two tensors and stores in the destination tensor: d = a - b.
Definition: host/tensor_elementwise.h:154
TensorView< ElementD, LayoutD > view_d
View of left-hand-side tensor.
Definition: host/tensor_elementwise.h:64
Definition: functional.h:73
void TensorMul(TensorView< ElementD, LayoutD > d, TensorRef< ElementA, LayoutA > a, TensorRef< ElementB, LayoutB > b)
Multiplies two tensors and stores in the destination tensor: d = a .* b.
Definition: host/tensor_elementwise.h:203
Statically-sized array specifying Coords within a tensor.
Definition: coord.h:43
void TensorModulus(TensorView< ElementD, LayoutD > d, TensorRef< ElementA, LayoutA > a, TensorRef< ElementB, LayoutB > b)
Divides two tensors and stores in the destination tensor: d = a ./ b.
Definition: host/tensor_elementwise.h:296
CUTLASS_HOST_DEVICE Reference at(TensorCoord const &coord) const
Returns a reference to the element at a given Coord.
Definition: tensor_ref.h:307
void TensorForEach(Coord< Rank > extent, Func &func)
Iterates over the index space of a tensor.
Definition: host/tensor_foreach.h:87
Definition: functional.h:55
TensorFuncBinaryOp()
Constructor.
Definition: host/tensor_elementwise.h:74
Basic include for CUTLASS.
Define basic numeric operators with specializations for Array<T, N>. SIMD-ize where possible...
TensorRef< ElementA, LayoutA > ref_a
Definition: host/tensor_elementwise.h:65