guan404ming commented on code in PR #708:
URL: https://github.com/apache/mahout/pull/708#discussion_r2613131824
##########
qdp/qdp-core/src/lib.rs:
##########
@@ -47,9 +65,16 @@ impl QdpEngine {
pub fn new(device_id: usize) -> Result<Self> {
let device = CudaDevice::new(device_id)
.map_err(|e| MahoutError::Cuda(format!("Failed to initialize CUDA
device {}: {:?}", device_id, e)))?;
- Ok(Self {
- device // CudaDevice::new already returns Arc<CudaDevice> in
cudarc 0.11
- })
+
+ #[cfg(target_os = "linux")]
+ {
+ Ok(Self { device })
+ }
+
+ #[cfg(not(target_os = "linux"))]
+ {
+ Ok(Self { device })
+ }
Review Comment:
Make sense to me.
--
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]