You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@singa.apache.org by GitBox <gi...@apache.org> on 2020/06/10 07:57:03 UTC

[GitHub] [singa] nudles commented on a change in pull request #728: Fix create_cuda_gpu

nudles commented on a change in pull request #728:
URL: https://github.com/apache/singa/pull/728#discussion_r437931959



##########
File path: python/singa/device.py
##########
@@ -113,10 +113,8 @@ def create_cuda_gpu(set_default=False):
         a swig converted CudaGPU device.
     '''
     assert singa.USE_CUDA, 'SINGA has not been compiled with CUDA enabled.'
-    devices = singa.Platform.CreateCudaGPUs(1)
-    if set_default:
-        set_default_device(devices[0])
-    return devices[0]
+    device = create_cuda_gpu_on(0, set_default)

Review comment:
       I think we should create a default_gpu_device attribute for the device module
   
   ```python
   default_gpu_device = None
   
   def create_cuda_gpu():
       assert ...
       if default_gpu_device is None:
           default_gpu_device = create_cuda_gpu_on(0)
       return default_gpu_device
   ```




----------------------------------------------------------------
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