Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

let specify GPU to use.

  • Loading branch information...
ledyba committed Dec 21, 2018
1 parent e93279b commit cf5d7c86221d480ebe6e67ec2318b3a0d97b8870
Showing with 9 additions and 1 deletion.
  1. +1 −0 cpyrit/config.py
  2. +8 −1 cpyrit/cpyrit.py
@@ -27,6 +27,7 @@
def default_config():
config = {'default_storage': 'file://',
'use_CUDA': 'false',
'CUDA_device': '-1',
'use_OpenCL': 'false',
'rpc_server': 'false',
'rpc_announce': 'true',
@@ -437,9 +437,16 @@ def __init__(self):
if config.cfg['use_CUDA'] == 'true' and 'cpyrit._cpyrit_cuda' in sys.modules and config.cfg['use_OpenCL'] == 'false':

CUDA = _cpyrit_cuda.listDevices()
use_device_idx = -1
if 'CUDA_device' in config.cfg:
use_device_idx = int(config.cfg['CUDA_device'])

for dev_idx, device in enumerate(CUDA):
self.CUDAs.append(CUDACore(queue=self, dev_idx=dev_idx))
if use_device_idx >= 0:
if use_device_idx == dev_idx:
self.CUDAs.append(CUDACore(queue=self, dev_idx=dev_idx))
else:
self.CUDAs.append(CUDACore(queue=self, dev_idx=dev_idx))


# OpenCL

0 comments on commit cf5d7c8

Please sign in to comment.
You can’t perform that action at this time.