Skip to content

Commit 3f622bc

Browse files
committed
Minor fixes in documentation
1 parent 9760b9b commit 3f622bc

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

docs/build_api.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,15 @@ def build_index_page(groups):
212212
],
213213
"Memory read/write": [
214214
"cast_to",
215-
("load", "load(const T*, const I&)"),
216-
("load", "load(const T*, const I&, const M&)"),
217-
("loadn", "loadn(const T*, size_t)"),
218-
("loadn", "loadn(const T*, size_t, size_t)"),
219-
("store", "store(const V&, T *ptr, const I&)"),
220-
("store", "store(const V&, T *ptr, const I&, const M&)"),
221-
("storen", "storen(const V&, T*, size_t)"),
222-
("storen", "storen(const V&, T*, size_t, size_t)"),
215+
("read", "read(const T*, const I&, const M&)"),
216+
("write", "write(T*, const I&, const V&, const M&)"),
217+
218+
("read", "read(const T*)"),
219+
("write", "write(T*, const V&)"),
220+
221+
("read_aligned", "read_aligned(const T*)"),
222+
("write_aligned", "write_aligned(T*, const V&)"),
223+
223224
("aligned_ptr", "aligned_ptr", "struct"),
224225
],
225226
"Utilities": [

docs/guides/promotion.rst

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

0 commit comments

Comments
 (0)