CUTLASS 3.6.0 (#1850)
* v3.6 * update changelog * update readme * fix typo * fixing typos * hopper gemm with weight prefetch --------- Co-authored-by: yuzhai <yuzhai@nvidia.com> Co-authored-by: Haicheng Wu <haichengw@nvidia.com>
This commit is contained in:
co-authored by
yuzhai
Haicheng Wu
parent
0837a2a00a
commit
cc3c29a81a
@@ -30,15 +30,13 @@
|
||||
**************************************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include <cute/config.hpp>
|
||||
|
||||
#include <cute/arch/util.hpp> // cast_smem_ptr_to_uint
|
||||
|
||||
#include <cute/pointer.hpp>
|
||||
#include <cute/pointer_swizzle.hpp>
|
||||
#include <cute/swizzle_layout.hpp>
|
||||
|
||||
#include <cute/tensor.hpp>
|
||||
#include <cute/config.hpp> // CUTE_HOST_DEVICE
|
||||
#include <cute/layout_composed.hpp> // cute::ComposedLayout
|
||||
#include <cute/pointer.hpp> // cute::make_smem_ptr
|
||||
#include <cute/pointer_sparse.hpp> // cute::is_sparse
|
||||
#include <cute/pointer_swizzle.hpp> // cute::make_swizzle_ptr
|
||||
#include <cute/arch/util.hpp> // cute::cast_smem_ptr_to_uint
|
||||
#include <cute/numeric/integral_constant.hpp> // cute::Int
|
||||
|
||||
namespace cute
|
||||
{
|
||||
@@ -124,6 +122,47 @@ as_position_independent_swizzle_tensor(Tensor&& tensor)
|
||||
CUTE_GCC_UNREACHABLE;
|
||||
}
|
||||
|
||||
// A model of a nullptr sparse_ptr<S, smem_ptr<T>> with B == sizeof_bits<T>::value
|
||||
// That represents an unset pointer. This is a placeholder type that is waiting for an smem_ptr
|
||||
template <int Sparsity, int Bits>
|
||||
struct smem_sparse_ptr_flag_bits : Int<0> {};
|
||||
|
||||
template <int Sparsity>
|
||||
using smem_sparse_ptr_flag = smem_sparse_ptr_flag_bits<Sparsity, 1>;
|
||||
|
||||
// A flagged construction method to transform ComposedLayout
|
||||
// Make a swizzle pointer tensor and check that the intended type size matches
|
||||
template <class Iterator, class SwizzleFn, int S, int B, class Layout>
|
||||
CUTE_HOST_DEVICE constexpr
|
||||
auto
|
||||
make_tensor(Iterator const& ptr,
|
||||
ComposedLayout<SwizzleFn,smem_sparse_ptr_flag_bits<S,B>,Layout> const& layout)
|
||||
{
|
||||
static_assert(is_smem<Iterator>::value, "Expected smem.");
|
||||
static_assert(is_sparse_ptr<Iterator>::value, "Expected sparse iter");
|
||||
static_assert(is_sparse<iter_value_t<Iterator>>::value, "Expected sparse elem");
|
||||
static_assert(S == iter_value_t<Iterator>::sparsity, "Expected sparsity S");
|
||||
static_assert(B == sizeof_bits<typename iter_value_t<Iterator>::raw_type>::value, "Expected B-bit pointer type");
|
||||
return make_tensor(make_swizzle_ptr(ptr, layout.layout_a()), layout.layout_b());
|
||||
}
|
||||
|
||||
// NOTE: To preserve smem_ptr_flag_bits under recast ops
|
||||
template <int N, class SwizzleFn, int S, int B, class Layout>
|
||||
CUTE_HOST_DEVICE constexpr
|
||||
auto
|
||||
upcast(ComposedLayout<SwizzleFn,smem_sparse_ptr_flag_bits<S,B>,Layout> const& layout)
|
||||
{
|
||||
static_assert(dependent_false<SwizzleFn>, "Not implemented for safety");
|
||||
}
|
||||
|
||||
template <int N, class SwizzleFn, int S, int B, class Layout>
|
||||
CUTE_HOST_DEVICE constexpr
|
||||
auto
|
||||
downcast(ComposedLayout<SwizzleFn,smem_sparse_ptr_flag_bits<S,B>,Layout> const& layout)
|
||||
{
|
||||
static_assert(dependent_false<SwizzleFn>, "Not implemented for safety");
|
||||
}
|
||||
|
||||
//
|
||||
// Display utilities
|
||||
//
|
||||
@@ -151,4 +190,10 @@ CUTE_HOST_DEVICE void print(smem_ptr_flag_bits<B> ptr)
|
||||
printf("smem_ptr[%db](unset)", B);
|
||||
}
|
||||
|
||||
template <int S, int B>
|
||||
CUTE_HOST_DEVICE void print(smem_sparse_ptr_flag_bits<S,B>)
|
||||
{
|
||||
printf("smem_sparse<%d>_ptr[%db](unset)", S, B);
|
||||
}
|
||||
|
||||
} // end namespace cute
|
||||
|
||||
Reference in New Issue
Block a user