Skip to content

Commit

Permalink
build based on cb75d53
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Nov 13, 2024
1 parent 28284e0 commit b2fdfeb
Show file tree
Hide file tree
Showing 23 changed files with 264 additions and 192 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-12T18:42:29","documenter_version":"1.7.0"}}
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-13T17:27:01","documenter_version":"1.8.0"}}
8 changes: 4 additions & 4 deletions dev/api/accumulate/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev/api/binarysearch/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev/api/custom_structs/index.html

Large diffs are not rendered by default.

53 changes: 48 additions & 5 deletions dev/api/foreachindex/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev/api/map/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev/api/mapreduce/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev/api/predicates/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev/api/reduce/index.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions dev/api/sort/index.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dev/api/task_partition/index.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dev/api/using_backends/index.html

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions dev/api/utilities/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Utilities · AcceleratedKernels.jl</title><meta name="title" content="Utilities · AcceleratedKernels.jl"/><meta property="og:title" content="Utilities · AcceleratedKernels.jl"/><meta property="twitter:title" content="Utilities · AcceleratedKernels.jl"/><meta name="description" content="Documentation for AcceleratedKernels.jl."/><meta property="og:description" content="Documentation for AcceleratedKernels.jl."/><meta property="twitter:description" content="Documentation for AcceleratedKernels.jl."/><meta property="og:url" content="https://juliagpu.github.io/KernelAbstractions.jl/api/utilities/"/><meta property="twitter:url" content="https://juliagpu.github.io/KernelAbstractions.jl/api/utilities/"/><link rel="canonical" href="https://juliagpu.github.io/KernelAbstractions.jl/api/utilities/"/><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../search_index.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/catppuccin-mocha.css" data-theme-name="catppuccin-mocha"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/catppuccin-macchiato.css" data-theme-name="catppuccin-macchiato"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/catppuccin-frappe.css" data-theme-name="catppuccin-frappe"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/catppuccin-latte.css" data-theme-name="catppuccin-latte"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../../"><img src="../../assets/logo.png" alt="AcceleratedKernels.jl logo"/></a><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../../">Overview</a></li><li><a class="tocitem" href="../../benchmarks/">Benchmarks</a></li><li><a class="tocitem" href="../../performance/">Performance Tips</a></li><li><span class="tocitem">Manual</span><ul><li><a class="tocitem" href="../using_backends/">Using Different Backends</a></li><li><a class="tocitem" href="../foreachindex/">General Loops</a></li><li><a class="tocitem" href="../map/">Map</a></li><li><a class="tocitem" href="../sort/">Sorting</a></li><li><a class="tocitem" href="../reduce/">Reduce</a></li><li><a class="tocitem" href="../mapreduce/">MapReduce</a></li><li><a class="tocitem" href="../accumulate/">Accumulate</a></li><li><a class="tocitem" href="../binarysearch/">Binary Search</a></li><li><a class="tocitem" href="../predicates/">Predicates</a></li><li><a class="tocitem" href="../custom_structs/">Custom Structs</a></li><li><a class="tocitem" href="../task_partition/">Task Partitioning</a></li><li class="is-active"><a class="tocitem" href>Utilities</a></li></ul></li><li><a class="tocitem" href="../../testing/">Testing</a></li><li><a class="tocitem" href="../../debugging/">Debugging Kernels</a></li><li><a class="tocitem" href="../../roadmap/">Roadmap</a></li><li><a class="tocitem" href="../../references/">References</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Manual</a></li><li class="is-active"><a href>Utilities</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Utilities</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/JuliaGPU/AcceleratedKernels.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/JuliaGPU/AcceleratedKernels.jl/blob/main/docs/src/api/utilities.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h3 id="Utilities"><a class="docs-heading-anchor" href="#Utilities">Utilities</a><a id="Utilities-1"></a><a class="docs-heading-anchor-permalink" href="#Utilities" title="Permalink"></a></h3><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="AcceleratedKernels.TypeWrap" href="#AcceleratedKernels.TypeWrap"><code>AcceleratedKernels.TypeWrap</code></a><span class="docstring-category">Type</span><span class="is-flex-grow-1 docstring-article-toggle-button" title="Collapse docstring"></span></header><section><div><pre><code class="language-julia hljs">struct TypeWrap{T} end
TypeWrap(T) = TypeWrap{T}()
Base.:*(x::Number, ::TypeWrap{T}) where T = T(x)</code></pre><p>Allow type conversion via multiplication, like <code>5i32</code> for <code>5 * i32</code> where <code>i32</code> is a <code>TypeWrap</code>.</p><p><strong>Examples</strong></p><pre><code class="language-julia hljs">import AcceleratedKernels as AK
u32 = AK.TypeWrap{UInt32}
println(typeof(5u32))

# output
UInt32</code></pre><p>This is used e.g. to set integer literals inside kernels as u16 to ensure no indices are promoted beyond the index base type.</p><p>For example, Metal uses <code>UInt32</code> indices, but if it is mixed with a Julia integer literal (<code>Int64</code> by default) like in <code>src[ithread + 1]</code>, we incur a type cast to <code>Int64</code>. Instead, we can use <code>src[ithread + 1u16]</code> or <code>src[ithread + 0x1]</code> to ensure the index is <code>UInt32</code> and avoid the cast; as the integer literal <code>1u16</code> has a shorter type than <code>ithread</code>, it is automatically promoted (at compile time) to the <code>ithread</code> type, whether <code>ithread</code> is signed or unsigned as per the backend.</p><pre><code class="language-julia hljs"># Defaults defined
1u8, 2u16, 3u32, 4u64
5i8, 6i16, 7i32, 8i64</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaGPU/AcceleratedKernels.jl/blob/cb75d53e786033327c45d3d9a911701a4bc63446/src/utils.jl#L6-L37">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../task_partition/">« Task Partitioning</a><a class="docs-footer-nextpage" href="../../testing/">Testing »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Wednesday 13 November 2024 17:27">Wednesday 13 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit b2fdfeb

Please sign in to comment.