add unsigned integers #14

Closed
opened 2021-09-22 14:43:14 +08:00 by sb10q · 4 comments

uint32 and uint64, like their numpy counterparts

uint32 and uint64, like their numpy counterparts
ychenfo was assigned by sb10q 2021-09-24 11:41:31 +08:00
sb10q added the
low-priority
label 2021-09-24 12:48:08 +08:00
Poster
Owner

After this is done, replace workarounds int32(int64(constant)) in the code.

After this is done, replace workarounds ``int32(int64(constant))`` in the code.
Poster
Owner

Doesn't work for host lists of uint32. If you annotate an object attribute Kernel[list[uint32]], the host value cannot be processed with an error such as error when getting type of field `trf_mmap` (Incompatible types: int32 and uint32).

e.g.

@nac3
class Foo:
  trf_mmap: Kernel[list[uint32]]
  
  def __init__(self):
    self.trf_mmap = [1, 2, 3]
Doesn't work for host lists of uint32. If you annotate an object attribute ``Kernel[list[uint32]]``, the host value cannot be processed with an error such as ``error when getting type of field `trf_mmap` (Incompatible types: int32 and uint32)``. e.g. ```python @nac3 class Foo: trf_mmap: Kernel[list[uint32]] def __init__(self): self.trf_mmap = [1, 2, 3] ```
Poster
Owner

This works:

self.trf_mmap = [uint32(1), uint32(2), uint32(3)]
This works: ``` self.trf_mmap = [uint32(1), uint32(2), uint32(3)] ```
sb10q closed this issue 2022-03-08 18:55:05 +08:00
Poster
Owner

After this is done, replace workarounds int32(int64(constant)) in the code.

There's actually a lot more to do in the drivers to make good use of uint32, and I'm not sure how beneficial that is. Anyway this is not a top priority.

> After this is done, replace workarounds int32(int64(constant)) in the code. There's actually a lot more to do in the drivers to make good use of uint32, and I'm not sure how beneficial that is. Anyway this is not a top priority.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#14
There is no content yet.