提交 ca895ef3 authored 作者: Frederic's avatar Frederic

add the header_dirs in the hard part of the key.

上级 e7afef31
...@@ -16,6 +16,9 @@ Since 0.5rc2 ...@@ -16,6 +16,9 @@ Since 0.5rc2
This do use change the default, but if you used this flags, it was ignored This do use change the default, but if you used this flags, it was ignored
for module already compiled. for module already compiled.
* The Theano flag "nvcc.fastmath" is now also used for the cuda_ndarray.cu file. * The Theano flag "nvcc.fastmath" is now also used for the cuda_ndarray.cu file.
* Add the header_dirs to the hard part of the compilation key. This is
currently used only by cuda, but if we use library that are only headers,
this can be useful.
============= =============
Release Notes Release Notes
......
...@@ -801,7 +801,8 @@ class CLinker(link.Linker): ...@@ -801,7 +801,8 @@ class CLinker(link.Linker):
The key returned by this function is of the form (version, signature) The key returned by this function is of the form (version, signature)
The signature has the following form: The signature has the following form:
{{{ {{{
'CLinker.cmodule_key', compilation args, libraries, config md5, 'CLinker.cmodule_key', compilation args, libraries,
header_dirs, config md5,
(op0, input_signature0, output_signature0), (op0, input_signature0, output_signature0),
(op1, input_signature1, output_signature1), (op1, input_signature1, output_signature1),
... ...
...@@ -861,11 +862,12 @@ class CLinker(link.Linker): ...@@ -861,11 +862,12 @@ class CLinker(link.Linker):
""" """
return self.cmodule_key_(self.env, self.no_recycling, return self.cmodule_key_(self.env, self.no_recycling,
compile_args=self.compile_args(), compile_args=self.compile_args(),
libraries=self.libraries() libraries=self.libraries(),
header_dirs=self.header_dirs(),
) )
@staticmethod @staticmethod
def cmodule_key_(env, no_recycling, compile_args=[], libraries=[], def cmodule_key_(env, no_recycling, compile_args=[], libraries=[],
insert_config_md5=True): header_dirs=[], insert_config_md5=True):
""" """
Do the actual computation of cmodule_key in a static method Do the actual computation of cmodule_key in a static method
to allow it to be reused in scalar.Composite.__eq__ to allow it to be reused in scalar.Composite.__eq__
...@@ -895,6 +897,11 @@ class CLinker(link.Linker): ...@@ -895,6 +897,11 @@ class CLinker(link.Linker):
args = tuple(args) args = tuple(args)
sig.append(args) sig.append(args)
if header_dirs is not None:
args = sorted(header_dirs)
args = tuple(args)
sig.append(args)
# IMPORTANT: The 'md5' prefix is used to isolate the compilation # IMPORTANT: The 'md5' prefix is used to isolate the compilation
# parameters from the rest of the key. If you want to add more key # parameters from the rest of the key. If you want to add more key
# elements, they should be before this md5 hash if and only if they # elements, they should be before this md5 hash if and only if they
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论