Skip to content

Commit f5ff1e9

Browse files
committed
solve bug
1 parent 1e52e15 commit f5ff1e9

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

ctmd/linalg/norm.hpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,12 @@ template <typename dtype = void, typename InType>
5050
[[nodiscard]] inline constexpr auto
5151
norm(InType &&In, const MPMode mpmode = MPMode::NONE) noexcept {
5252
const auto in = core::to_const_mdspan(std::forward<InType>(In));
53+
auto out = core::create_out<dtype>(std::index_sequence<1>{},
54+
ctmd::extents<uint8_t>{}, in);
5355

54-
if (mpmode == MPMode::SIMD) [[unlikely]] {
55-
return ctmd::sqrt(ctmd::sum<-1>(ctmd::multiply(in, in, mpmode), mpmode),
56-
mpmode);
57-
}
56+
norm(in, out, mpmode);
5857

59-
return core::batch_out<dtype>(
60-
[](auto &&...elems) {
61-
detail::norm_impl(std::forward<decltype(elems)>(elems)...);
62-
},
63-
std::index_sequence<1>{}, ctmd::extents<uint8_t>{}, mpmode, in);
58+
return out;
6459
}
6560

6661
} // namespace linalg

0 commit comments

Comments
 (0)