提交 43cc967e authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Make it so that you can use some other device than 'opencl' or 'cuda'

上级 27a4b85f
...@@ -4,7 +4,7 @@ import subprocess ...@@ -4,7 +4,7 @@ import subprocess
from theano.configparser import ( from theano.configparser import (
AddConfigVar, BoolParam, ConfigParam, DeviceParam, EnumStr, IntParam, AddConfigVar, BoolParam, ConfigParam, DeviceParam, EnumStr, IntParam,
TheanoConfigParser) StrParam, TheanoConfigParser)
from theano.misc.cpucount import cpuCount from theano.misc.cpucount import cpuCount
from theano.misc.windows import call_subprocess_Popen from theano.misc.windows import call_subprocess_Popen
...@@ -53,6 +53,14 @@ AddConfigVar('device', ...@@ -53,6 +53,14 @@ AddConfigVar('device',
in_c_key=False, in_c_key=False,
) )
AddConfigVar('gpuarray.init_device',
"""
Device to initialize for gpuarray use without moving
computations automatically.
""",
StrParam(''),
in_c_key=False)
AddConfigVar('init_gpu_device', AddConfigVar('init_gpu_device',
("Initialize the gpu device to use, works only if device=cpu. " ("Initialize the gpu device to use, works only if device=cpu. "
"Unlike 'device', setting this option will NOT move computations, " "Unlike 'device', setting this option will NOT move computations, "
......
import logging import logging
import theano import theano
from theano.configparser import config, AddConfigVar, StrParam, \ from theano.configparser import config
BoolParam, IntParam
from theano.compile import optdb from theano.compile import optdb
_logger_name = 'theano.sandbox.gpuarray' _logger_name = 'theano.sandbox.gpuarray'
...@@ -18,15 +17,6 @@ try: ...@@ -18,15 +17,6 @@ try:
except ImportError: except ImportError:
pygpu = None pygpu = None
AddConfigVar('gpuarray.init_device',
"""
Device to initialize for gpuarray use without moving
computations automatically.
""",
StrParam(''))
# This is for documentation not to depend on the availability of pygpu # This is for documentation not to depend on the availability of pygpu
from type import (GpuArrayType, GpuArrayVariable, GpuArrayConstant, from type import (GpuArrayType, GpuArrayVariable, GpuArrayConstant,
GpuArraySharedVariable, gpuarray_shared_constructor) GpuArraySharedVariable, gpuarray_shared_constructor)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论