#ifndef PYTHONIC_INCLUDE_UTILS_BROADCAST_COPY_HPP #define PYTHONIC_INCLUDE_UTILS_BROADCAST_COPY_HPP #include "pythonic/include/types/tuple.hpp" #ifdef _OPENMP #include // as a macro so that an enlightened user can modify this variable :-) #ifndef PYTHRAN_OPENMP_MIN_ITERATION_COUNT #define PYTHRAN_OPENMP_MIN_ITERATION_COUNT 1000 #endif #endif PYTHONIC_NS_BEGIN namespace utils { /* helper function to get the dimension of an array * yields 0 for scalar types */ template struct dim_of { static const size_t value = T::value; }; template struct dim_of, void> { static const size_t value = 1 + dim_of::value; }; template struct dim_of::value>::type> { static const size_t value = 0; }; #define SPECIALIZE_DIM_OF(TYPE) \ template <> \ struct dim_of { \ static const size_t value = 0; \ } SPECIALIZE_DIM_OF(std::complex); SPECIALIZE_DIM_OF(std::complex); #undef SPECIALIZE_DIM_OF template E &broadcast_copy(E &self, F const &other); template E &broadcast_update(E &self, F const &other); } PYTHONIC_NS_END #endif