CUTLASS 3.2.1 (#1113)
* Updates for 3.2.1 release. * Minor fix in gemm op profiler for raster order. * Add scheduler mapping for raster order in the kernels.
This commit is contained in:
@@ -72,8 +72,16 @@ struct bit_field
|
||||
// Number of bits in data_[idx] used for NumBits if straddling, else 0
|
||||
static constexpr uint32_t bit_hi = (idx + 1 < N) ? (storage_type_bits - bit_lo) : 0;
|
||||
|
||||
private:
|
||||
// MSVC issues warning C4293 ("shift count negative or too big, undefined behavior")
|
||||
// if we use NumBits directly in the shift expression, even if the shift occurs
|
||||
// in the branch of a ternary expression where NumBits is known to be less than
|
||||
// the number of bits of the value being shifted.
|
||||
static constexpr uint32_t MollifiedNumBits = NumBits > 63u ? 63u : NumBits;
|
||||
public:
|
||||
|
||||
// NumBits mask
|
||||
static constexpr value_type mask = (NumBits < 64) ? ((uint64_t(1) << NumBits) - 1) : uint64_t(-1);
|
||||
static constexpr value_type mask = (NumBits < 64u) ? ((uint64_t(1) << MollifiedNumBits) - 1) : uint64_t(-1);
|
||||
// NumBits mask for BitStart
|
||||
static constexpr storage_type mask_lo = storage_type(mask) << bit_lo;
|
||||
// NumBits mask for leftover bits in data_[idx+1] if straddling, else 0
|
||||
|
||||
@@ -76,6 +76,10 @@ namespace detail
|
||||
template <size_t N, class T, bool IsEmpty = is_empty<T>::value>
|
||||
struct EBO;
|
||||
|
||||
template <class T, size_t N, bool B>
|
||||
CUTE_HOST_DEVICE constexpr C<N> findt(EBO<N, T, B> const&)
|
||||
{ return {}; }
|
||||
|
||||
// Specialization for types T that have no data;
|
||||
// the "static tuple leaf." Valid T here include
|
||||
// integral_constant<U, Value>, Int<Value>,
|
||||
@@ -218,6 +222,20 @@ get(tuple<T...>&& t) noexcept
|
||||
return detail::getv<I>(static_cast<tuple<T...>&&>(t));
|
||||
}
|
||||
|
||||
//
|
||||
// find a type X within a cute::tuple
|
||||
// Requires X to be unique in tuple
|
||||
// Returns a static integer
|
||||
//
|
||||
|
||||
template <class X, class... T>
|
||||
CUTE_HOST_DEVICE constexpr
|
||||
auto
|
||||
find(tuple<T...> const& t) noexcept
|
||||
{
|
||||
return detail::findt<X>(t);
|
||||
}
|
||||
|
||||
//
|
||||
// Custom is_tuple trait simply checks the existence of tuple_size
|
||||
// and assumes std::get<I>(.), std::tuple_element<I,.>
|
||||
@@ -225,7 +243,7 @@ get(tuple<T...>&& t) noexcept
|
||||
namespace detail {
|
||||
|
||||
template <class T>
|
||||
auto has_tuple_size( T*) -> integral_constant<bool, 0 <= tuple_size<T>::value>;
|
||||
auto has_tuple_size( T*) -> bool_constant<(0 <= tuple_size<T>::value)>;
|
||||
auto has_tuple_size(...) -> false_type;
|
||||
|
||||
} // end namespace detail
|
||||
@@ -347,6 +365,14 @@ tuple_cat(T0 const& t0, T1 const& t1, T2 const& t2, T3 const& t3, T4 const& t4,
|
||||
return cute::make_tuple(get<I0>(t0)..., get<I1>(t1)..., get<I2>(t2)..., get<I3>(t3)..., get<I4>(t4)...);
|
||||
}
|
||||
|
||||
template<class T0, class T1>
|
||||
struct tuple_cat_static;
|
||||
|
||||
template<class... T0s, class... T1s>
|
||||
struct tuple_cat_static<tuple<T0s...>, tuple<T1s...>> {
|
||||
using type = tuple<T0s..., T1s...>;
|
||||
};
|
||||
|
||||
} // end namespace detail
|
||||
|
||||
CUTE_HOST_DEVICE constexpr
|
||||
@@ -370,9 +396,15 @@ CUTE_HOST_DEVICE constexpr
|
||||
auto
|
||||
tuple_cat(T0 const& t0, T1 const& t1)
|
||||
{
|
||||
return detail::tuple_cat(t0, t1,
|
||||
if constexpr (is_static<T0>::value && is_static<T1>::value &&
|
||||
is_tuple<T0>::value && is_tuple<T1>::value) {
|
||||
return typename detail::tuple_cat_static<T0, T1>::type{};
|
||||
} else
|
||||
{
|
||||
return detail::tuple_cat(t0, t1,
|
||||
make_index_sequence<tuple_size<T0>::value>{},
|
||||
make_index_sequence<tuple_size<T1>::value>{});
|
||||
}
|
||||
}
|
||||
|
||||
template <class T0, class T1, class T2>
|
||||
@@ -416,7 +448,7 @@ CUTE_HOST_DEVICE constexpr
|
||||
auto
|
||||
tuple_cat(T0 const& t0, T1 const& t1, T2 const& t2, T3 const& t3, T4 const& t4, T5 const& t5, Ts const&... ts)
|
||||
{
|
||||
return cute::tuple_cat(cute::tuple_cat(t0,t1,t2,t3,t4), t5, ts...);
|
||||
return cute::tuple_cat(cute::tuple_cat(t0,t1,t2,t3,t4), cute::tuple_cat(t5, ts...));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user