提交 76d67b49 authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #1753 from nouiz/py26

Fix test in py26 (travis-ci)
...@@ -16,8 +16,9 @@ performance reasons. So if Theano links to a parallel implementation, ...@@ -16,8 +16,9 @@ performance reasons. So if Theano links to a parallel implementation,
those operations will run in parallel in Theano. those operations will run in parallel in Theano.
The most frequent way to control the number of threads used is via the The most frequent way to control the number of threads used is via the
``OMP_NUM_THREADS`` environment variable. Set it to the number of threads ``OMP_NUM_THREADS`` environment variable. Set it to the number of
you want to use before starting the python process. threads you want to use before starting the python process. Some BLAS
implementation support other enviroment variable.
Parallel element wise ops with OpenMP Parallel element wise ops with OpenMP
...@@ -26,7 +27,8 @@ Parallel element wise ops with OpenMP ...@@ -26,7 +27,8 @@ Parallel element wise ops with OpenMP
Because element wise ops work on every tensor entry independently they Because element wise ops work on every tensor entry independently they
can be easily parallelized using OpenMP. can be easily parallelized using OpenMP.
To use OpenMP you must set the OpenMP flag in Theano configuration. To use OpenMP you must set the ``openmp`` flag to ``True`` in Theano
configuration.
You can use the flag ``openmp_elemwise_minsize`` to set the minimum You can use the flag ``openmp_elemwise_minsize`` to set the minimum
tensor size for which the operation is parallelized because for short tensor size for which the operation is parallelized because for short
...@@ -42,3 +44,7 @@ which you can use to tune the value of ``openmp_elemwise_minsize`` for ...@@ -42,3 +44,7 @@ which you can use to tune the value of ``openmp_elemwise_minsize`` for
your machine. The script runs two elemwise operations (a fast one and your machine. The script runs two elemwise operations (a fast one and
a slow one) for a vector of size ``openmp_elemwise_minsize`` with and a slow one) for a vector of size ``openmp_elemwise_minsize`` with and
without OpenMP and shows the time difference between the cases. without OpenMP and shows the time difference between the cases.
The only way to control the number of threads used is via the
``OMP_NUM_THREADS`` environment variable. Set it to the number of threads
you want to use before starting the python process.
...@@ -30,7 +30,7 @@ def test_unpickle_cudandarray_as_numpy_ndarray_flag0(): ...@@ -30,7 +30,7 @@ def test_unpickle_cudandarray_as_numpy_ndarray_flag0():
try: try:
testfile_dir = os.path.dirname(os.path.realpath(__file__)) testfile_dir = os.path.dirname(os.path.realpath(__file__))
fname = 'CudaNdarray.pkl' fname = 'CudaNdarray.pkl'
if sys.version_info.major == 3: if sys.version_info[0] == 3:
fname = 'CudaNdarray_py3.pkl' fname = 'CudaNdarray_py3.pkl'
with open(os.path.join(testfile_dir, fname), 'rb') as fp: with open(os.path.join(testfile_dir, fname), 'rb') as fp:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论