You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/09/11 22:46:04 UTC

[GitHub] piiswrong commented on a change in pull request #7855: Fix missing of CUDA device on non-GPU host

piiswrong commented on a change in pull request #7855: Fix missing of CUDA device on non-GPU host
URL: https://github.com/apache/incubator-mxnet/pull/7855#discussion_r138212128
 
 

 ##########
 File path: scala-package/native/src/main/native/ml_dmlc_mxnet_native_c_api.cc
 ##########
 @@ -2301,7 +2301,9 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_mxnet_LibInfo_mxCustomOpRegister
                   ptrsArr, (jsize)0, (jsize)size, reinterpret_cast<jlong*>(ptrs));
 #if MXNET_USE_CUDA
                 mxnet::NDArray* tmp = reinterpret_cast<mxnet::NDArray*>(ptrs[0]);
-                CUDA_CALL(cudaSetDevice(tmp->ctx().dev_id));
+                if (tmp->ctx().dev_type != mxnet::Context::kCPU) {
 
 Review comment:
   == kGPU
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services