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

Conversation

osayamenja
Copy link

Context

See #1631

Change

Adds integral type trait for integer_subbyte

@osayamenja
Copy link
Author

@thakkarV Closing the loop on #1631, let me know if this is not actually needed and I will close this instead.

Comment on lines +39 to +40
#include <cute/numeric/integral_constant.hpp>
#include <cutlass/integer_subbyte.h>
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.

@@ -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

@thakkarV
Copy link
Collaborator

@ccecka for review too

@osayamenja
Copy link
Author

If needed, I can also register float8 and half for is_floating_point

Copy link

This PR has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d if there is no activity in the next 60 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants