MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / logical_reduce

Function logical_reduce

include/cute/algorithm/tensor_reduce.hpp:86–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 class TargetProfile,
85 class BinaryOp = cute::plus>
86CUTE_HOST_DEVICE constexpr
87void
88logical_reduce(Tensor<SrcEngine, SrcLayout> const& src,
89 Tensor<DstEngine, DstLayout> & dst,
90 TargetProfile const& target_profile,
91 BinaryOp op = {})
92{
93 // Precondition
94 assert(compatible(target_profile, shape(src)));
95
96 auto diced_layout = dice(target_profile, src.layout());
97 auto sliced_layout = slice(target_profile, src.layout());
98
99 auto red_mode = conditional_return<rank(diced_layout) == Int<0>{}>(Layout<_1,_0>{}, diced_layout);
100 auto batch_mode = conditional_return<rank(sliced_layout) == Int<0>{}>(Layout<_1,_0>{}, sliced_layout);
101
102 auto src_tensor = make_tensor(src.data(), make_layout(red_mode, batch_mode));
103
104 batch_reduce(src_tensor, dst, op);
105}
106
107} // end namespace cute

Callers 1

TESTFunction · 0.85

Calls 10

compatibleFunction · 0.85
batch_reduceFunction · 0.85
shapeFunction · 0.50
diceFunction · 0.50
sliceFunction · 0.50
rankFunction · 0.50
make_tensorFunction · 0.50
make_layoutFunction · 0.50
layoutMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected