rich7420 commented on code in PR #675:
URL: https://github.com/apache/mahout/pull/675#discussion_r2579257460
##########
qdp/qdp-kernels/src/lib.rs:
##########
@@ -47,8 +47,8 @@ unsafe extern "C" {
pub fn launch_amplitude_encode(
input_d: *const f64,
state_d: *mut c_void,
- input_len: i32,
- state_len: i32,
+ input_len: usize,
+ state_len: usize,
Review Comment:
This is to prevent Integer Overflow and ensure HPC safety.While we currently
limit to 30 qubits, the state vector length scales as 2^N .
30 qubits approximate 1 billion (fits in i32) but 31 qubits will exceed
i32::MAX, would wrap to negative!
So I think for safety, we should change to `usize`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]