提交 00483dbc authored 作者: Frederic's avatar Frederic

Remove config from c key.

In particular remove nvcc.* stuff. We don't want the c_key of the config to change depending if theano.sandbox.cuda is imported or not.
上级 2f1c91cb
...@@ -34,7 +34,8 @@ _atexit_print_file = sys.stderr ...@@ -34,7 +34,8 @@ _atexit_print_file = sys.stderr
AddConfigVar('profiling.time_thunks', AddConfigVar('profiling.time_thunks',
"""Time individual thunks when profiling""", """Time individual thunks when profiling""",
BoolParam(True)) BoolParam(True),
in_c_key=False)
AddConfigVar('profiling.n_apply', AddConfigVar('profiling.n_apply',
"Number of Apply instances to print by default", "Number of Apply instances to print by default",
......
...@@ -80,7 +80,8 @@ AddConfigVar("compiledir_format", ...@@ -80,7 +80,8 @@ AddConfigVar("compiledir_format",
module subdirectory (relative to base_compiledir). module subdirectory (relative to base_compiledir).
Available keys: %s. Defaults to %r. Available keys: %s. Defaults to %r.
""" % (compiledir_format_keys, default_compiledir_format))), """ % (compiledir_format_keys, default_compiledir_format))),
StrParam(default_compiledir_format, allow_override=False)) StrParam(default_compiledir_format, allow_override=False),
in_c_key=False)
def default_compiledirname(): def default_compiledirname():
...@@ -160,7 +161,8 @@ AddConfigVar('base_compiledir', ...@@ -160,7 +161,8 @@ AddConfigVar('base_compiledir',
ConfigParam( ConfigParam(
default_base_compiledir, default_base_compiledir,
filter=filter_base_compiledir, filter=filter_base_compiledir,
allow_override=False)) allow_override=False),
in_c_key=False)
AddConfigVar('compiledir', AddConfigVar('compiledir',
"platform-dependent cache directory for compiled modules", "platform-dependent cache directory for compiled modules",
...@@ -169,7 +171,8 @@ AddConfigVar('compiledir', ...@@ -169,7 +171,8 @@ AddConfigVar('compiledir',
config.base_compiledir, config.base_compiledir,
default_compiledirname()), default_compiledirname()),
filter=filter_compiledir, filter=filter_compiledir,
allow_override=False)) allow_override=False),
in_c_key=False)
def cleanup(): def cleanup():
......
...@@ -20,14 +20,16 @@ logger = logging.getLogger(__name__) ...@@ -20,14 +20,16 @@ logger = logging.getLogger(__name__)
AddConfigVar('profile', AddConfigVar('profile',
"If VM should collect profile information", "If VM should collect profile information",
BoolParam(False)) BoolParam(False),
in_c_key=False)
AddConfigVar('profile_optimizer', AddConfigVar('profile_optimizer',
"If VM should collect optimizer profile information", "If VM should collect optimizer profile information",
BoolParam(False)) BoolParam(False),
in_c_key=False)
AddConfigVar('profile_memory', AddConfigVar('profile_memory',
"If VM should collect memory profile information and print it", "If VM should collect memory profile information and print it",
BoolParam(False)) BoolParam(False),
in_c_key=False)
def filter_vm_lazy(val): def filter_vm_lazy(val):
if val == 'False' or val is False: if val == 'False' or val is False:
...@@ -45,7 +47,8 @@ AddConfigVar('vm.lazy', ...@@ -45,7 +47,8 @@ AddConfigVar('vm.lazy',
" auto detect if lazy evaluation is needed and use the apropriate" " auto detect if lazy evaluation is needed and use the apropriate"
" version. If lazy is True/False, force the version used between" " version. If lazy is True/False, force the version used between"
" Loop/LoopGC and Stack.", " Loop/LoopGC and Stack.",
ConfigParam('None', filter_vm_lazy)) ConfigParam('None', filter_vm_lazy),
in_c_key=False)
raise_with_op = link.raise_with_op raise_with_op = link.raise_with_op
......
...@@ -27,7 +27,8 @@ AddConfigVar('cuda.root', ...@@ -27,7 +27,8 @@ AddConfigVar('cuda.root',
linker directives. Default: environment variable "CUDA_ROOT" linker directives. Default: environment variable "CUDA_ROOT"
or else "AUTO". or else "AUTO".
""", """,
StrParam(os.getenv('CUDA_ROOT', "AUTO"))) StrParam(os.getenv('CUDA_ROOT', "AUTO")),
in_c_key=False)
AddConfigVar('pycuda.init', AddConfigVar('pycuda.init',
"""If True, always initialize PyCUDA when Theano want to """If True, always initialize PyCUDA when Theano want to
...@@ -37,7 +38,8 @@ AddConfigVar('pycuda.init', ...@@ -37,7 +38,8 @@ AddConfigVar('pycuda.init',
manually by importing theano.misc.pycuda_init before theano manually by importing theano.misc.pycuda_init before theano
initialize the GPU device. initialize the GPU device.
""", """,
BoolParam(False)) BoolParam(False),
in_c_key=False)
if config.cuda.root == "AUTO": if config.cuda.root == "AUTO":
# set nvcc_path correctly and get the version # set nvcc_path correctly and get the version
......
...@@ -27,7 +27,8 @@ from theano.configparser import (config, AddConfigVar, StrParam, ...@@ -27,7 +27,8 @@ from theano.configparser import (config, AddConfigVar, StrParam,
AddConfigVar('nvcc.compiler_bindir', AddConfigVar('nvcc.compiler_bindir',
"If defined, nvcc compiler driver will seek g++ and gcc" "If defined, nvcc compiler driver will seek g++ and gcc"
" in this directory", " in this directory",
StrParam("")) StrParam(""),
in_c_key=False)
AddConfigVar('cuda.nvccflags', AddConfigVar('cuda.nvccflags',
"DEPRECATED, use nvcc.flags instead", "DEPRECATED, use nvcc.flags instead",
...@@ -51,13 +52,21 @@ def filter_nvcc_flags(s): ...@@ -51,13 +52,21 @@ def filter_nvcc_flags(s):
" nvcc.flags value is '%s'" % s) " nvcc.flags value is '%s'" % s)
return ' '.join(flags) return ' '.join(flags)
AddConfigVar('nvcc.flags', AddConfigVar('nvcc.flags',
"Extra compiler flags for nvcc", "Extra compiler flags for nvcc",
ConfigParam(config.cuda.nvccflags, filter_nvcc_flags)) ConfigParam(config.cuda.nvccflags, filter_nvcc_flags),
# Not needed in c key as it is already added.
# We remove it as we don't make the md5 of config to change
# if theano.sandbox.cuda is loaded or not.
in_c_key=False)
AddConfigVar('nvcc.fastmath', AddConfigVar('nvcc.fastmath',
"", "",
BoolParam(False)) BoolParam(False),
# Not needed in c key as it is already added.
# We remove it as we don't make the md5 of config to change
# if theano.sandbox.cuda is loaded or not.
in_c_key=False)
nvcc_path = 'nvcc' nvcc_path = 'nvcc'
nvcc_version = None nvcc_version = None
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论