Skip to content

Commit

Permalink
Add changes for 4f0aa8f
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 8, 2023
1 parent 523ddc1 commit 3f306ed
Show file tree
Hide file tree
Showing 38 changed files with 724 additions and 427 deletions.
Binary file added latest/_images/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed latest/_images/architecture_0.4.3.png
Binary file not shown.
10 changes: 8 additions & 2 deletions latest/_sources/design.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The Kernel Tuner is designed to be extensible and support
different search and execution strategies. The current architecture of
the Kernel Tuner can be seen as:

.. image:: architecture_0.4.3.png
.. image:: architecture.png
:width: 500pt

At the top we have the kernel code and the Python script that tunes it,
Expand Down Expand Up @@ -48,7 +48,7 @@ building blocks for implementing runners.
The observers are explained in :ref:`observers`.

At the bottom, the backends are shown.
PyCUDA, CuPy, cuda-python and PyOpenCL are for tuning either CUDA or OpenCL kernels.
PyCUDA, CuPy, cuda-python, PyOpenCL and PyHIP are for tuning either CUDA, OpenCL, or HIP kernels.
The C
Functions implementation can actually call any compiler, typically NVCC
or GCC is used. There is limited support for tuning Fortran kernels.
Expand Down Expand Up @@ -128,6 +128,12 @@ kernel_tuner.backends.c.CFunctions
:special-members: __init__
:members:

kernel_tuner.backends.hip.HipFunctions
~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: kernel_tuner.backends.hip.HipFunctions
:special-members: __init__
:members:


Util Functions
--------------
Expand Down
9 changes: 7 additions & 2 deletions latest/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ To tune OpenCL kernels:
- First, make sure you have an OpenCL compiler for your intended OpenCL platform
- Then type: ``pip install kernel_tuner[opencl]``

Or both:
To tune HIP kernels:

- ``pip install kernel_tuner[cuda,opencl]``
- First, make sure you have an HIP runtime and compiler installed
- Then type: ``pip install kernel_tuner[hip]``

Or all:

- ``pip install kernel_tuner[cuda,opencl,hip]``

More information about how to install Kernel Tuner and its
dependencies can be found under :ref:`install`.
Expand Down
22 changes: 22 additions & 0 deletions latest/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ a.headerlink {
visibility: hidden;
}

a:visited {
color: #551A8B;
}

h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
Expand Down Expand Up @@ -670,6 +674,16 @@ dd {
margin-left: 30px;
}

.sig dd {
margin-top: 0px;
margin-bottom: 0px;
}

.sig dl {
margin-top: 0px;
margin-bottom: 0px;
}

dl > dd:last-child,
dl > dd:last-child > :last-child {
margin-bottom: 0;
Expand Down Expand Up @@ -738,6 +752,14 @@ abbr, acronym {
cursor: help;
}

.translated {
background-color: rgba(207, 255, 207, 0.2)
}

.untranslated {
background-color: rgba(255, 207, 207, 0.2)
}

/* -- code displays --------------------------------------------------------- */

pre {
Expand Down
2 changes: 1 addition & 1 deletion latest/_static/css/theme.css

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions latest/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
const DOCUMENTATION_OPTIONS = {
VERSION: '0.4.5',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
Expand Down
1 change: 1 addition & 0 deletions latest/_static/pygments.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
Expand Down
26 changes: 17 additions & 9 deletions latest/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ const _removeChildren = (element) => {
const _escapeRegExp = (string) =>
string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string

const _displayItem = (item, searchTerms) => {
const _displayItem = (item, searchTerms, highlightTerms) => {
const docBuilder = DOCUMENTATION_OPTIONS.BUILDER;
const docUrlRoot = DOCUMENTATION_OPTIONS.URL_ROOT;
const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX;
const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY;
const contentRoot = document.documentElement.dataset.content_root;

const [docName, title, anchor, descr, score, _filename] = item;

Expand All @@ -75,20 +75,24 @@ const _displayItem = (item, searchTerms) => {
if (dirname.match(/\/index\/$/))
dirname = dirname.substring(0, dirname.length - 6);
else if (dirname === "index/") dirname = "";
requestUrl = docUrlRoot + dirname;
requestUrl = contentRoot + dirname;
linkUrl = requestUrl;
} else {
// normal html builders
requestUrl = docUrlRoot + docName + docFileSuffix;
requestUrl = contentRoot + docName + docFileSuffix;
linkUrl = docName + docLinkSuffix;
}
let linkEl = listItem.appendChild(document.createElement("a"));
linkEl.href = linkUrl + anchor;
linkEl.dataset.score = score;
linkEl.innerHTML = title;
if (descr)
if (descr) {
listItem.appendChild(document.createElement("span")).innerHTML =
" (" + descr + ")";
// highlight search terms in the description
if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
}
else if (showSearchSummary)
fetch(requestUrl)
.then((responseData) => responseData.text())
Expand All @@ -97,6 +101,9 @@ const _displayItem = (item, searchTerms) => {
listItem.appendChild(
Search.makeSearchSummary(data, searchTerms)
);
// highlight search terms in the summary
if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js
highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted"));
});
Search.output.appendChild(listItem);
};
Expand All @@ -115,14 +122,15 @@ const _finishSearch = (resultCount) => {
const _displayNextItem = (
results,
resultCount,
searchTerms
searchTerms,
highlightTerms,
) => {
// results left, load the summary and display it
// this is intended to be dynamic (don't sub resultsCount)
if (results.length) {
_displayItem(results.pop(), searchTerms);
_displayItem(results.pop(), searchTerms, highlightTerms);
setTimeout(
() => _displayNextItem(results, resultCount, searchTerms),
() => _displayNextItem(results, resultCount, searchTerms, highlightTerms),
5
);
}
Expand Down Expand Up @@ -360,7 +368,7 @@ const Search = {
// console.info("search results:", Search.lastresults);

// print the results
_displayNextItem(results, results.length, searchTerms);
_displayNextItem(results, results.length, searchTerms, highlightTerms);
},

/**
Expand Down
16 changes: 13 additions & 3 deletions latest/_static/sphinx_highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ const _highlight = (node, addItems, text, className) => {
}

span.appendChild(document.createTextNode(val.substr(pos, text.length)));
const rest = document.createTextNode(val.substr(pos + text.length));
parent.insertBefore(
span,
parent.insertBefore(
document.createTextNode(val.substr(pos + text.length)),
rest,
node.nextSibling
)
);
node.nodeValue = val.substr(0, pos);
/* There may be more occurrences of search term in this node. So call this
* function recursively on the remaining fragment.
*/
_highlight(rest, addItems, text, className);

if (isInSVG) {
const rect = document.createElementNS(
Expand Down Expand Up @@ -140,5 +145,10 @@ const SphinxHighlight = {
},
};

_ready(SphinxHighlight.highlightSearchWords);
_ready(SphinxHighlight.initEscapeListener);
_ready(() => {
/* Do not call highlightSearchWords() when we are on the search page.
* It will highlight words from the *previous* search query.
*/
if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords();
SphinxHighlight.initEscapeListener();
});
8 changes: 4 additions & 4 deletions latest/cache_files.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/documentation_options.js?v=340bb9e5"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
Expand Down Expand Up @@ -101,7 +101,7 @@
<div itemprop="articleBody">

<section id="cache-files">
<span id="cache"></span><h1>Cache files<a class="headerlink" href="#cache-files" title="Permalink to this heading"></a></h1>
<span id="cache"></span><h1>Cache files<a class="headerlink" href="#cache-files" title="Link to this heading"></a></h1>
<p>A very useful feature of Kernel Tuner is the ability to store benchmarking results in a cache file during tuning. You can enable cache files by
passing any filename to the <code class="docutils literal notranslate"><span class="pre">cache=</span></code> optional argument of <code class="docutils literal notranslate"><span class="pre">tune_kernel</span></code>.</p>
<p>The benchmark results of individual kernel configurations are appended to the cache file as Kernel Tuner is running. This also allows Kernel Tuner
Expand Down
8 changes: 4 additions & 4 deletions latest/contents.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/documentation_options.js?v=340bb9e5"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
Expand Down Expand Up @@ -100,7 +100,7 @@
<div itemprop="articleBody">

<section id="the-kernel-tuner-documentation">
<h1>The Kernel Tuner documentation<a class="headerlink" href="#the-kernel-tuner-documentation" title="Permalink to this heading"></a></h1>
<h1>The Kernel Tuner documentation<a class="headerlink" href="#the-kernel-tuner-documentation" title="Link to this heading"></a></h1>
<div class="toctree-wrapper compound">
<p class="caption" role="heading"><span class="caption-text">Kernel Tuner</span></p>
<ul>
Expand Down
18 changes: 9 additions & 9 deletions latest/contributing.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<script src="_static/js/html5shiv.min.js"></script>
<![endif]-->

<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/sphinx_highlight.js"></script>
<script src="_static/documentation_options.js?v=340bb9e5"></script>
<script src="_static/doctools.js?v=888ff710"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
Expand Down Expand Up @@ -109,10 +109,10 @@
<div class="toctree-wrapper compound">
</div>
<section id="contribution-guide">
<span id="contributing"></span><h1>Contribution guide<a class="headerlink" href="#contribution-guide" title="Permalink to this heading"></a></h1>
<span id="contributing"></span><h1>Contribution guide<a class="headerlink" href="#contribution-guide" title="Link to this heading"></a></h1>
<p>Thank you for considering to contribute to Kernel Tuner!</p>
<section id="reporting-issues">
<h2>Reporting Issues<a class="headerlink" href="#reporting-issues" title="Permalink to this heading"></a></h2>
<h2>Reporting Issues<a class="headerlink" href="#reporting-issues" title="Link to this heading"></a></h2>
<p>Not all contributions are code, creating an issue also helps us to improve. When you create an issue about a problem, please ensure the following:</p>
<ul class="simple">
<li><p>Describe what you expected to happen.</p></li>
Expand All @@ -122,7 +122,7 @@ <h2>Reporting Issues<a class="headerlink" href="#reporting-issues" title="Permal
</ul>
</section>
<section id="contributing-code">
<h2>Contributing Code<a class="headerlink" href="#contributing-code" title="Permalink to this heading"></a></h2>
<h2>Contributing Code<a class="headerlink" href="#contributing-code" title="Link to this heading"></a></h2>
<p>For contributing code to Kernel Tuner please select an issue to work on or create a new issue to propose a change or addition. For significant changes, it is required to first create an issue and discuss the proposed changes. Then fork the repository, create a branch, one per change or addition, and create a pull request.</p>
<p>Kernel Tuner follows the Google Python style guide, with Sphinxdoc docstrings for module public functions. Please use <cite>pylint</cite> to check your Python changes.</p>
<p>Before creating a pull request please ensure the following:</p>
Expand All @@ -138,7 +138,7 @@ <h2>Contributing Code<a class="headerlink" href="#contributing-code" title="Perm
have look at the <a class="reference external" href="https://kerneltuner.github.io/kernel_tuner/stable/design.html">design documentation</a>, or discuss it in the issue regarding your additions.</p>
</section>
<section id="development-setup">
<h2>Development setup<a class="headerlink" href="#development-setup" title="Permalink to this heading"></a></h2>
<h2>Development setup<a class="headerlink" href="#development-setup" title="Link to this heading"></a></h2>
<p>You can install the packages required to run the tests using:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pip<span class="w"> </span>install<span class="w"> </span>-e<span class="w"> </span>.<span class="o">[</span>dev<span class="o">]</span>
</pre></div>
Expand All @@ -149,7 +149,7 @@ <h2>Development setup<a class="headerlink" href="#development-setup" title="Perm
changes in the source files.</p>
</section>
<section id="running-tests">
<h2>Running tests<a class="headerlink" href="#running-tests" title="Permalink to this heading"></a></h2>
<h2>Running tests<a class="headerlink" href="#running-tests" title="Link to this heading"></a></h2>
<p>To run the tests you can use <code class="docutils literal notranslate"><span class="pre">pytest</span> <span class="pre">-v</span> <span class="pre">test/</span></code> in the top-level directory.</p>
<p>Note that tests that require PyCuda and/or a CUDA capable GPU will be skipped if these
are not installed/present. The same holds for tests that require PyOpenCL, Cupy, Nvidia CUDA.</p>
Expand All @@ -159,7 +159,7 @@ <h2>Running tests<a class="headerlink" href="#running-tests" title="Permalink to
these will also use the installed package.</p>
</section>
<section id="building-documentation">
<h2>Building documentation<a class="headerlink" href="#building-documentation" title="Permalink to this heading"></a></h2>
<h2>Building documentation<a class="headerlink" href="#building-documentation" title="Link to this heading"></a></h2>
<p>Documentation is located in the <code class="docutils literal notranslate"><span class="pre">doc/</span></code> directory. This is where you can type
<code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">html</span></code> to generate the html pages in the <code class="docutils literal notranslate"><span class="pre">doc/build/html</span></code> directory.
The source files used for building the documentation are located in
Expand Down
Loading

0 comments on commit 3f306ed

Please sign in to comment.