This is an automated email from the ASF dual-hosted git repository.
hcr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/mahout.git
The following commit(s) were added to refs/heads/main by this push:
new 634f0e12f replacing internal error-to-string with comprehensive
implementation (#1124)
634f0e12f is described below
commit 634f0e12f8cd4c78c97ced6279c777dc7e10be2f
Author: ChenChen Lai <[email protected]>
AuthorDate: Thu Mar 5 22:32:14 2026 +0800
replacing internal error-to-string with comprehensive implementation (#1124)
---
qdp/qdp-core/src/gpu/memory.rs | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/qdp/qdp-core/src/gpu/memory.rs b/qdp/qdp-core/src/gpu/memory.rs
index f8d0a571a..baa9a2988 100644
--- a/qdp/qdp-core/src/gpu/memory.rs
+++ b/qdp/qdp-core/src/gpu/memory.rs
@@ -25,6 +25,9 @@ use std::ffi::c_void;
#[cfg(target_os = "linux")]
use std::sync::Arc;
+#[cfg(target_os = "linux")]
+use crate::error::cuda_error_to_string;
+
/// Precision of the GPU state vector.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Precision {
@@ -40,17 +43,6 @@ fn bytes_to_mib(bytes: usize) -> f64 {
bytes as f64 / (1024.0 * 1024.0)
}
-#[cfg(target_os = "linux")]
-fn cuda_error_to_string(code: i32) -> &'static str {
- match code {
- 0 => "cudaSuccess",
- 2 => "cudaErrorMemoryAllocation",
- 3 => "cudaErrorInitializationError",
- 30 => "cudaErrorUnknown",
- _ => "Unknown CUDA error",
- }
-}
-
#[cfg(target_os = "linux")]
fn query_cuda_mem_info() -> Result<(usize, usize)> {
unsafe {