示例#1
0
 def test_domain_set_num_threads_blas(self):
     saved_blas_nt = mkl.domain_get_max_threads(domain='blas')
     saved_fft_nt = mkl.domain_get_max_threads(domain='fft')
     saved_vml_nt = mkl.domain_get_max_threads(domain='vml')
     # set
     blas_nt = int((3 + saved_blas_nt) / 4)
     fft_nt = int((3 + 2 * saved_fft_nt) / 4)
     vml_nt = int((3 + 3 * saved_vml_nt) / 4)
     status = mkl.domain_set_num_threads(blas_nt, domain='blas')
     assert (status == 'success')
     status = mkl.domain_set_num_threads(fft_nt, domain='fft')
     assert (status == 'success')
     status = mkl.domain_set_num_threads(vml_nt, domain='vml')
     assert (status == 'success')
     # check
     assert (mkl.domain_get_max_threads(domain='blas') == blas_nt)
     assert (mkl.domain_get_max_threads(domain='fft') == fft_nt)
     assert (mkl.domain_get_max_threads(domain='vml') == vml_nt)
     # restore
     status = mkl.domain_set_num_threads(saved_blas_nt, domain='blas')
     assert (status == 'success')
     status = mkl.domain_set_num_threads(saved_fft_nt, domain='fft')
     assert (status == 'success')
     status = mkl.domain_set_num_threads(saved_vml_nt, domain='vml')
     assert (status == 'success')
示例#2
0
__all__ = [
    'hitcor', 'hitcorrad', 'cpucor', 'cpucorrad', 'cucor', 'cucorrad',
    'cpusimple', 'cusimple', 'ft', 'singleshotnorm'
]
try:
    import mkl as _mkl

    _vml_threads = _mkl.domain_get_max_threads('vml')
except ImportError:
    _mkl = None

import numba.cuda as _nbcuda
import warnings as _w

_w.filterwarnings("ignore", message="numpy.dtype size changed")
_w.filterwarnings("ignore", message="numpy.ufunc size changed")

from . import hitcor, hitcorrad, cpucor, cpucorrad, cpusimple, common, singleshotnorm  # noqa

# mkl fft
try:
    from . import autocorrelate3  # noqa

    _local = False
except ImportError as e:
    _w.warn('trying local compilation' + str(e))
    _local = True

    try:
        import pyximport as _pyx
        from sys import prefix as _prefix
示例#3
0
 def test_domain_get_max_threads_all(self):
     mkl.domain_get_max_threads(domain='all')
示例#4
0
 def test_domain_get_max_threads_pardiso(self):
     mkl.domain_get_max_threads(domain='pardiso')
示例#5
0
 def test_domain_get_max_threads_vml(self):
     mkl.domain_get_max_threads(domain='vml')
示例#6
0
 def test_domain_get_max_threads_fft(self):
     mkl.domain_get_max_threads(domain='fft')
示例#7
0
 def test_domain_get_max_threads_blas(self):
     mkl.domain_get_max_threads(domain='blas')