v3.9 (#2185)
* v3.8 update x * fix blackwell gg * doc change * doc change * doc change --------- Co-authored-by: yuzhai <yuzhai@nvidia.com> Co-authored-by: Haicheng Wu <haichengw@nvidia.com> Co-authored-by: Haicheng Wu <57973641+hwu36@users.noreply.github.com>
This commit is contained in:
@ -370,12 +370,21 @@ safe_div(ScaledBasis<T,M> const& b, U const& u)
|
||||
template <class T, int M, class U>
|
||||
CUTE_HOST_DEVICE constexpr
|
||||
auto
|
||||
shape_div(ScaledBasis<T,M> const& b, U const& u)
|
||||
ceil_div(ScaledBasis<T,M> const& b, U const& u)
|
||||
{
|
||||
auto t = shape_div(b.value(), u);
|
||||
auto t = ceil_div(b.value(), u);
|
||||
return ScaledBasis<decltype(t),M>{t};
|
||||
}
|
||||
|
||||
template <class T, int N>
|
||||
CUTE_HOST_DEVICE constexpr
|
||||
auto
|
||||
abs(ScaledBasis<T,N> const& e)
|
||||
{
|
||||
auto t = abs(e.value());
|
||||
return ScaledBasis<decltype(t),N>{t};
|
||||
}
|
||||
|
||||
// Equality
|
||||
template <class T, int N, class U, int M>
|
||||
CUTE_HOST_DEVICE constexpr
|
||||
@ -399,14 +408,6 @@ operator==(T const&, ScaledBasis<U,M> const&) {
|
||||
return {};
|
||||
}
|
||||
|
||||
// Abs
|
||||
template <class T, int N>
|
||||
CUTE_HOST_DEVICE constexpr
|
||||
auto
|
||||
abs(ScaledBasis<T,N> const& e) {
|
||||
return ScaledBasis<decltype(abs(e.value())),N>{abs(e.value())};
|
||||
}
|
||||
|
||||
// Multiplication
|
||||
template <class A, class T, int N>
|
||||
CUTE_HOST_DEVICE constexpr
|
||||
|
||||
@ -124,6 +124,31 @@ using tuple_seq = make_seq<tuple_size<remove_cvref_t<Tuple>>::value>;
|
||||
template <class Tuple>
|
||||
using tuple_rseq = make_rseq<tuple_size<remove_cvref_t<Tuple>>::value>;
|
||||
|
||||
//
|
||||
// Convert a parameter pack to an int sequence
|
||||
//
|
||||
|
||||
template <class T>
|
||||
struct to_seq;
|
||||
|
||||
template <>
|
||||
struct to_seq<integer_sequence<int>> {
|
||||
using type = seq<>;
|
||||
};
|
||||
|
||||
template <int I, int... Is>
|
||||
struct to_seq<integer_sequence<int, I, Is...>> {
|
||||
using type = seq<I, Is...>;
|
||||
};
|
||||
|
||||
template <template <class...> class TupleLike, class... Ts>
|
||||
struct to_seq<TupleLike<Ts...>> {
|
||||
using type = seq<Ts::value...>;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
using to_seq_t = typename to_seq<T>::type;
|
||||
|
||||
//
|
||||
// Specialize cute::tuple-traits for std::integer_sequence
|
||||
//
|
||||
|
||||
@ -74,29 +74,40 @@ struct integral_constant : C<v> {
|
||||
|
||||
// Use cute::is_std_integral<T> to match built-in integral types (int, int64_t, unsigned, etc)
|
||||
// Use cute::is_integral<T> to match both built-in integral types AND static integral types.
|
||||
|
||||
template <class T>
|
||||
struct is_integral : bool_constant<is_std_integral<T>::value> {};
|
||||
template <auto v>
|
||||
struct is_integral<C<v> > : true_type {};
|
||||
template <class T, T v>
|
||||
struct is_integral<integral_constant<T,v>> : true_type {};
|
||||
template <class T>
|
||||
constexpr bool is_integral_v = is_integral<T>::value;
|
||||
|
||||
// Register FastDivmod as the integral type
|
||||
// Register FastDivmod as integral type
|
||||
template<>
|
||||
struct is_integral<cutlass::FastDivmod> : true_type {};
|
||||
|
||||
// is_static detects if an (abstract) value is defined completely by its type (no members)
|
||||
template <class T>
|
||||
struct is_static : bool_constant<is_empty<remove_cvref_t<T>>::value> {};
|
||||
|
||||
struct is_static : bool_constant<is_empty<T>::value> {};
|
||||
template <class T>
|
||||
struct is_static<T const > : is_static<T> {};
|
||||
template <class T>
|
||||
struct is_static<T const&> : is_static<T> {};
|
||||
template <class T>
|
||||
struct is_static<T &> : is_static<T> {};
|
||||
template <class T>
|
||||
struct is_static<T &&> : is_static<T> {};
|
||||
template <class T>
|
||||
constexpr bool is_static_v = is_static<T>::value;
|
||||
|
||||
// is_constant detects if a type is a static integral type and if v is equal to a value
|
||||
|
||||
template <auto n, class T>
|
||||
struct is_constant : false_type {};
|
||||
template <auto n, auto v>
|
||||
struct is_constant<n, C<v> > : bool_constant<v == n> {};
|
||||
template <auto n, class T, T v>
|
||||
struct is_constant<n, integral_constant<T,v>> : bool_constant<v == n> {};
|
||||
template <auto n, class T>
|
||||
struct is_constant<n, T const > : is_constant<n,T> {};
|
||||
template <auto n, class T>
|
||||
@ -105,10 +116,8 @@ template <auto n, class T>
|
||||
struct is_constant<n, T &> : is_constant<n,T> {};
|
||||
template <auto n, class T>
|
||||
struct is_constant<n, T &&> : is_constant<n,T> {};
|
||||
template <auto n, auto v>
|
||||
struct is_constant<n, C<v> > : bool_constant<v == n> {};
|
||||
template <auto n, class T, T v>
|
||||
struct is_constant<n, integral_constant<T,v>> : bool_constant<v == n> {};
|
||||
template <auto n, class T>
|
||||
constexpr bool is_constant_v = is_constant<n,T>::value;
|
||||
|
||||
//
|
||||
// Specializations
|
||||
|
||||
Reference in New Issue
Block a user