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

Packed types support {u,i}16, {u,i}8 #166

Open
andreytkachenko opened this issue Oct 11, 2024 · 1 comment
Open

Packed types support {u,i}16, {u,i}8 #166

andreytkachenko opened this issue Oct 11, 2024 · 1 comment

Comments

@andreytkachenko
Copy link

Dealing with packed types may be much better, ideally like Tensor<u16> support, with implicit packing and unpacking, alternative variant - is a packed types with pack/unpack methods, like:

  • u16x2 - packed: [u16, u16], unpacked to (u32, u32)
  • i16x2 - packed: [i16, i16], unpacked to (i32, i32)
  • u16x2f - packed: [u16, u16], unpacked to (f32, f32) with range 0..1
  • i16x2f - packed: [i16, i16], unpacked to (f32, f32) with range -1..1
  • u8x4 - packed: [u8, u8, u8, u8], unpacked to (u32, u32, u32, u32)
  • i8x4 - packed: [i8, i8, i8, i8], unpacked to (i32, i32, i32, i32)
  • u8x4f - packed: [u8, u8, u8, u8], unpacked to (f32, f32, f32, f32) with range 0..1
  • i8x4f - packed: [i8, i8, i8, i8], unpacked to (f32, f32, f32, f32) with range -1..1
@andreytkachenko andreytkachenko changed the title Packed types support ({u,i}16, {u,i}8) Packed types support {u,i}16, {u,i}8 Oct 11, 2024
@nathanielsimard
Copy link
Member

Not a bad idea. For now, we would have Tensor<Line<u16>>, but it's a long type. Maybe we should hardcode the fact that tensors always return Line<I>. You could access the line length with tensor.line_length(). So the minimum line length for Tensor<u16> would be 2, but it could be more depending on the launch options.

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

No branches or pull requests

2 participants