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

Update the OpenMPOp to add the omp.h header.

上级 a9454113
...@@ -817,6 +817,12 @@ class OpenMPOp(Op): ...@@ -817,6 +817,12 @@ class OpenMPOp(Op):
return ['-fopenmp'] return ['-fopenmp']
return [] return []
def c_headers(self):
self.update_self_openmp()
if self.openmp:
return ["omp.h"]
return []
@staticmethod @staticmethod
def test_gxx_support(): def test_gxx_support():
code = """ code = """
...@@ -845,11 +851,12 @@ int main( int argc, const char* argv[] ) ...@@ -845,11 +851,12 @@ int main( int argc, const char* argv[] )
if OpenMPOp.gxx_support_openmp is None: if OpenMPOp.gxx_support_openmp is None:
OpenMPOp.gxx_support_openmp = OpenMPOp.test_gxx_support() OpenMPOp.gxx_support_openmp = OpenMPOp.test_gxx_support()
if not OpenMPOp.gxx_support_openmp: if not OpenMPOp.gxx_support_openmp:
#We want to warn only once. # We want to warn only once.
warnings.warn( warnings.warn(
"Your g++ compiler fails to compile OpenMP code. We" "Your g++ compiler fails to compile OpenMP code. We"
" know this happen with some version of the EPD mingw" " know this happen with some version of the EPD mingw"
" compiler. We disable openmp everywhere in Theano." " compiler and LLVM compiler on Mac OS X."
" We disable openmp everywhere in Theano."
" To remove this warning set the theano flags `openmp`" " To remove this warning set the theano flags `openmp`"
" to False.", " to False.",
stacklevel=3) stacklevel=3)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论