guan404ming commented on code in PR #690:
URL: https://github.com/apache/mahout/pull/690#discussion_r2594481190
##########
qdp/qdp-core/src/gpu/encodings/amplitude.rs:
##########
@@ -121,6 +122,129 @@ impl QuantumEncoder for AmplitudeEncoder {
fn description(&self) -> &'static str {
"Amplitude encoding with L2 normalization"
}
+
+ /// Override to avoid intermediate Vec allocation. Processes chunks
directly to GPU offsets.
+ fn encode_chunked(
+ &self,
+ device: &Arc<CudaDevice>,
+ chunks: &[Float64Array],
+ num_qubits: usize,
+ ) -> Result<GpuStateVector> {
+ #[cfg(target_os = "linux")]
+ {
+ let total_len: usize = chunks.iter().map(|c| c.len()).sum();
Review Comment:
Shall we reuse the pre-process module here?
--
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]