#pragma once #include "ck/utility/functional.hpp" #include "ck/utility/sequence.hpp" namespace ck { namespace detail { template struct static_for_impl; template struct static_for_impl> { template __host__ __device__ constexpr void operator()(F f) const { swallow{(f(Number{}), 0)...}; } }; } // namespace detail // F signature: F(Number) template struct static_for { __host__ __device__ constexpr static_for() { static_assert(Increment != 0 && (NEnd - NBegin) % Increment == 0, "Wrong! should satisfy (NEnd - NBegin) % Increment == 0"); static_assert((Increment > 0 && NBegin <= NEnd) || (Increment < 0 && NBegin >= NEnd), "wrongs! should (Increment > 0 && NBegin <= NEnd) || (Increment < 0 && " "NBegin >= NEnd)"); } template __host__ __device__ constexpr void operator()(F f) const { detail::static_for_impl::type>{}( f); } }; } // namespace ck