MKL utility functions
=====================

.. raw:: html

    <p>The <cite>accelerate.mkl</cite> module contains a set of functions to configure
    and retrieve information about the underlying Intel MKL library.</p>
    <div class="section" id="reference">
    <h2>Reference<a class="headerlink" href="#reference" title="Permalink to this headline">¶</a></h2>
    <dl class="function">
    <dt id="accelerate.mkl.set_num_threads">
    <code class="descclassname">accelerate.mkl.</code><code class="descname">set_num_threads</code><span class="sig-paren">(</span><em>n</em><span class="sig-paren">)</span><a class="headerlink" href="#accelerate.mkl.set_num_threads" title="Permalink to this definition">¶</a></dt>
    <dd><p>Set the number of threads Intel MKL should use. This is
    only a hint, and no guarantee is made this number of
    threads will actually be used. This function takes
    precedence over the environment variable
    MKL_NUM_THREADS.</p>
    <p>This function wraps the Intel MKL function
    <code class="docutils literal"><span class="pre">mkl_set_num_threads</span></code>.</p>
    </dd></dl>

    <dl class="function">
    <dt id="accelerate.mkl.get_max_threads">
    <code class="descclassname">accelerate.mkl.</code><code class="descname">get_max_threads</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &rarr; int<a class="headerlink" href="#accelerate.mkl.get_max_threads" title="Permalink to this definition">¶</a></dt>
    <dd><p>Return the number of threads Intel MKL is targeting for
    parallelism.</p>
    <p>This function wraps the Intel MKL function
    <code class="docutils literal"><span class="pre">mkl_get_max_threads</span></code>.</p>
    </dd></dl>

    <dl class="function">
    <dt id="accelerate.mkl.get_version_string">
    <code class="descclassname">accelerate.mkl.</code><code class="descname">get_version_string</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &rarr; str<a class="headerlink" href="#accelerate.mkl.get_version_string" title="Permalink to this definition">¶</a></dt>
    <dd><p>Return the Intel MKL version information as a string.</p>
    <p>This function wraps the Intel MKL function
    <code class="docutils literal"><span class="pre">mkl_get_version_string</span></code>.</p>
    </dd></dl>

    <dl class="function">
    <dt id="accelerate.mkl.mem_stat">
    <code class="descclassname">accelerate.mkl.</code><code class="descname">mem_stat</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &rarr; int, int<a class="headerlink" href="#accelerate.mkl.mem_stat" title="Permalink to this definition">¶</a></dt>
    <dd><p>Return a (bytes, blocks) tuple of memory usage
    statistics about the underlying Intel MKL memory
    allocator. The return tuple contains:</p>
    <ul class="simple">
    <li>The total number of bytes allocated (bytes).</li>
    <li>The number of allocated blocks (blocks).</li>
    </ul>
    <p>This function wraps the Intel MKL function
    <code class="docutils literal"><span class="pre">mkl_mem_stat</span></code>.</p>
    </dd></dl>

    <dl class="function">
    <dt id="accelerate.mkl.get_cpu_clocks">
    <code class="descclassname">accelerate.mkl.</code><code class="descname">get_cpu_clocks</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &rarr; int<a class="headerlink" href="#accelerate.mkl.get_cpu_clocks" title="Permalink to this definition">¶</a></dt>
    <dd><p>Return elapsed CPU clocks as an integer. This may be
    useful when timing short intervals with high resolution.
    Note the result is limited to unsigned 64 bit integers,
    so wrapping of elapsed time is possible.</p>
    <p>This function wraps the Intel MKL function
    <code class="docutils literal"><span class="pre">mkl_get_cpu_clocks</span></code>.</p>
    </dd></dl>

    <dl class="function">
    <dt id="accelerate.mkl.get_cpu_frequency">
    <code class="descclassname">accelerate.mkl.</code><code class="descname">get_cpu_frequency</code><span class="sig-paren">(</span><span class="sig-paren">)</span> &rarr; int<a class="headerlink" href="#accelerate.mkl.get_cpu_frequency" title="Permalink to this definition">¶</a></dt>
    <dd><p>Return CPU frequency in GHz as a float. Note the result
    may vary from run to run as it returns the current
    frequency. That frequency can change in some systems due
    to several factors (i.e. power management).</p>
    <p>This function wraps the Intel MKL function
    <code class="docutils literal"><span class="pre">mkl_get_cpu_frequency</span></code>.</p>
    </dd></dl>
