Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make integer_subbyte Fully Compliant with is_integral #1632

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/cute/numeric/int.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include <cstdint>
#endif

#include <cute/numeric/integral_constant.hpp>
#include <cutlass/integer_subbyte.h>
Comment on lines +39 to +40
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

were these headers required? we already had

using int2_t  = cutlass::int2b_t;
using int4_t  = cutlass::int4b_t;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double-checked and the second isn't but the first is, due to is_integral. I will remove the first. My IDE (CLion) is very pedantic sometimes, that's why I initially added.

#include <cutlass/numeric_types.h>

namespace cute
Expand Down Expand Up @@ -101,4 +103,7 @@ using uint_byte = uint_bit<8*N>;
template <int N>
using uint_byte_t = typename uint_byte<N>::type;

template<int Bits, bool Signed>
struct is_integral<cutlass::integer_subbyte<Bits, Signed>> : true_type {};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add one for unsigned too?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The template covers both since unsigned is Signed=false, see here


} // namespace cute