-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adds signed integers to DLA #27
Adds signed integers to DLA #27
Conversation
vilukissa68
commented
May 14, 2024
- Adds support for 8-bit signed integers to driver and VP
- Removes support for unsigned integers (u8) since those turned out not to be supported by the hardware
- Fixes signed clipping bounds
- Fixes PP clipping being dependant on ReLU
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly incorrect random generation going on.
examples/hpc/dla-driver/src/lib.rs
Outdated
//sprintln!("\nWrite to bank {:#x}, data: {:?}", offset, buf); | ||
for (i, b) in buf.iter().enumerate() { | ||
unsafe { ptr::write_volatile((MEMORY_BANK_BASE_ADDR + offset + i) as *mut u8, *b) }; | ||
unsafe { ptr::write_volatile((MEMORY_BANK_BASE_ADDR + offset + i) as *mut i8, *b) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to elide the type in these assignments, if types are obvious from context, e.g. write_volatile(ADDR as *mut _, value)
. Say, you have a function like write_u8()
, there is no need to re-specify the type in the implementation. This might come down to preference at the end of the day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed explicit type assignments.
let output: Vec<i8> = dla.read_output(output_width as usize * output_height as usize); | ||
output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: return expression dla.read_output(output_width as usize * output_height as usize)
without the extra assignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's all good here.
* Adds support for 8-bit signed integers to driver and VP * Removes support for unsigned integers (u8) since those turned out not to be supported by the hardware * Fixes signed clipping bounds * Fixes PP clipping being dependant on ReLU
0577693
to
07c802b
Compare