Skip to content

Commit 7f1f0f0

Browse files
committed
Add changes for 3f622bc
1 parent 2c6fdd4 commit 7f1f0f0

File tree

8 files changed

+145
-107
lines changed

8 files changed

+145
-107
lines changed

_sources/api/memory_read_write.rst.txt

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,29 @@ cast_to
99
-------
1010
.. doxygenfunction:: kernel_float::cast_to
1111

12-
load
12+
read
1313
----
14-
.. doxygenfunction:: kernel_float::load(const T*, const I&)
14+
.. doxygenfunction:: kernel_float::read(const T*, const I&, const M&)
1515

16-
load
17-
----
18-
.. doxygenfunction:: kernel_float::load(const T*, const I&, const M&)
19-
20-
loadn
21-
-----
22-
.. doxygenfunction:: kernel_float::loadn(const T*, size_t)
23-
24-
loadn
16+
write
2517
-----
26-
.. doxygenfunction:: kernel_float::loadn(const T*, size_t, size_t)
18+
.. doxygenfunction:: kernel_float::write(T*, const I&, const V&, const M&)
2719

28-
store
29-
-----
30-
.. doxygenfunction:: kernel_float::store(const V&, T *ptr, const I&)
20+
read
21+
----
22+
.. doxygenfunction:: kernel_float::read(const T*)
3123

32-
store
24+
write
3325
-----
34-
.. doxygenfunction:: kernel_float::store(const V&, T *ptr, const I&, const M&)
26+
.. doxygenfunction:: kernel_float::write(T*, const V&)
3527

36-
storen
37-
------
38-
.. doxygenfunction:: kernel_float::storen(const V&, T*, size_t)
28+
read_aligned
29+
------------
30+
.. doxygenfunction:: kernel_float::read_aligned(const T*)
3931

40-
storen
41-
------
42-
.. doxygenfunction:: kernel_float::storen(const V&, T*, size_t, size_t)
32+
write_aligned
33+
-------------
34+
.. doxygenfunction:: kernel_float::write_aligned(T*, const V&)
4335

4436
aligned_ptr
4537
-----------

_sources/guides/promotion.rst.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
Type Promotion
22
==============
33

4-
For operations that involve two input arguments (or more), ``kernel_float`` will first convert the inputs into a common type before applying the operation.
5-
For example, when adding ``vec<int, N>`` to a ``vec<float, N>``, both arguments must first be converted into a ``vec<float, N>``.
4+
For operations that involve two (or more) input arguments, ``kernel_float`` will first convert the inputs into a common type before applying the operation.
5+
For example, when adding ``vec<int, N>`` to ``vec<float, N>``, both arguments must first be converted into a ``vec<float, N>``.
66

77
This procedure is called "type promotion" and is implemented as follows.
8-
First, all arguments are converted into a vector by calling ``into_vec``.
9-
Next, all arguments must have length ``N`` or length ``1`` and vectors of length ``1`` are resized to become length ``N``.
10-
Finally, the vector element types are promoted into a common type.
8+
Initially, every argument is transformed into a vector using the ``into_vec`` function
9+
Next, all arguments must have length ``N`` or length ``1``, where vectors of length ``1`` are repeated to become length ``N``.
10+
Finally, the vector element types are promoted into a shared type.
1111

1212
The rules for element type promotion in ``kernel_float`` are slightly different than in regular C++.
13-
In short, for two element types ``T`` and ``U``, the promotion rules can be summarized as follows:
13+
In a nutshell, for two element types, the promotion rules can be summarized as follows:
1414

1515
* If one of the types is ``bool``, the result is the other type.
16-
* If one type is a floating-point type and the other is a signed or unsigned integer, the result is the floating-point type.
17-
* If both types are floating-point types, the result is the largest of the two types. An exception here is combining ``half`` and ``bfloat16``, which results in ``float``.
18-
* If both types are integer types of the same signedness, the result is the largest of the two types.
16+
* If one type is a floating-point and the other is an integer (signed or unsigned), the outcome is the floating-point type.
17+
* If both are floating-point types, the largest of the two is chosen. An exception is combining ``half`` and ``bfloat16``, which results in ``float``.
18+
* If both types are integer types of the same signedness, the largest of the two is chosen.
1919
* Combining a signed integer and unsigned integer type is not allowed.
2020

2121
Overview

api.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,12 @@ <h1>API Reference<a class="headerlink" href="#api-reference" title="Permalink to
228228
</li>
229229
<li class="toctree-l1"><a class="reference internal" href="api/memory_read_write.html">Memory read/write</a><ul>
230230
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#cast-to">cast_to</a></li>
231-
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#load">load</a></li>
232-
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#id1">load</a></li>
233-
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#loadn">loadn</a></li>
234-
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#id2">loadn</a></li>
235-
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#store">store</a></li>
236-
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#id3">store</a></li>
237-
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#storen">storen</a></li>
238-
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#id4">storen</a></li>
231+
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#read">read</a></li>
232+
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#write">write</a></li>
233+
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#id1">read</a></li>
234+
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#id2">write</a></li>
235+
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#read-aligned">read_aligned</a></li>
236+
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#write-aligned">write_aligned</a></li>
239237
<li class="toctree-l2"><a class="reference internal" href="api/memory_read_write.html#aligned-ptr">aligned_ptr</a></li>
240238
</ul>
241239
</li>

0 commit comments

Comments
 (0)