提交 3fd5e633 authored 作者: Frederic's avatar Frederic

Add some doc how to test multi-core implementation.

上级 a6feb426
......@@ -20,6 +20,12 @@ The most frequent way to control the number of threads used is via the
threads you want to use before starting the Python process. Some BLAS
implementations support other environment variables.
To test if you BLAS support OpenMP/Multiple cores, you can use the theano/misc/check_blas.py scripts from the command line like this::
OMP_NUM_THREAD=1 python theano/misc/check_blas.py -q
OMP_NUM_THREAD=2 python theano/misc/check_blas.py -q
Parallel element wise ops with OpenMP
=====================================
......@@ -46,5 +52,13 @@ a slow one) for a vector of size ``openmp_elemwise_minsize`` with and
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.
``OMP_NUM_THREADS`` environment variable. Set it to the number of
threads you want to use before starting the Python process. You can
test this with this command::
$OMP_NUM_THREADS=2 python theano/misc/elemwise_openmp_speedup.py
#The output
Fast op time without openmp 0.000533s with openmp 0.000474s speedup 1.12
Slow op time without openmp 0.002987s with openmp 0.001553s speedup 1.92
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论