Skip to content

Commit

Permalink
Attempt at optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Pencilcaseman committed Aug 16, 2023
1 parent 49e950b commit 63e834b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions librapid/include/librapid/array/operations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@

#define LIBRAPID_UNARY_SHAPE_EXTRACTOR \
template<typename... Args> \
LIBRAPID_NODISCARD static LIBRAPID_ALWAYS_INLINE auto getShape( \
LIBRAPID_NODISCARD static LIBRAPID_ALWAYS_INLINE auto &getShape( \
const std::tuple<Args...> &args) { \
static_assert(sizeof...(Args) == 1, "Invalid number of arguments for unary operation"); \
return std::get<0>(args).shape(); \
}

#define LIBRAPID_BINARY_SHAPE_EXTRACTOR \
template<typename First, typename Second> \
LIBRAPID_NODISCARD static LIBRAPID_ALWAYS_INLINE auto getShapeImpl( \
LIBRAPID_NODISCARD static LIBRAPID_ALWAYS_INLINE auto &getShapeImpl( \
const std::tuple<First, Second> &tup) { \
if constexpr (TypeInfo<std::decay_t<First>>::type != detail::LibRapidType::Scalar && \
TypeInfo<std::decay_t<Second>>::type != detail::LibRapidType::Scalar) { \
Expand Down

0 comments on commit 63e834b

Please sign in to comment.