You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/03/31 15:53:48 UTC

[GitHub] [incubator-mxnet] wkcn commented on a change in pull request #14433: Prevent crashes for opencv exception and std::exception

wkcn commented on a change in pull request #14433:  Prevent crashes for opencv exception and std::exception
URL: https://github.com/apache/incubator-mxnet/pull/14433#discussion_r270672600
 
 

 ##########
 File path: src/resource.cc
 ##########
 @@ -190,12 +190,14 @@ class ResourceManagerImpl : public ResourceManager {
     cpu_rand_->Seed(seed);
     cpu_parallel_rand_->Seed(seed);
 #if MXNET_USE_CUDA
-    gpu_rand_.Get(ctx.dev_id, [ctx, seed, this]() {
-      return new ResourceRandom<gpu>(ctx, seed);
-    })->Seed(seed);
-    gpu_parallel_rand_.Get(ctx.dev_id, [ctx, seed, this]() {
-      return new ResourceParallelRandom<gpu>(ctx, gpu_native_rand_copy_, seed);
-    })->Seed(seed);
+    if (ctx != Context::CPU()) {
 
 Review comment:
   ctx.dev_type == kGPU may be better.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services