|
| 1 | +<?xml version='1.0' encoding='utf-8' standalone='no'?> |
| 2 | +<!DOCTYPE issue SYSTEM "lwg-issue.dtd"> |
| 3 | + |
| 4 | +<issue num="4231" status="New"> |
| 5 | +<title><tt>datapar::chunk<N></tt> should use <tt><i>simd-size-type</i></tt> instead of <tt>size_t</tt></title> |
| 6 | +<section> |
| 7 | +<sref ref="[simd.syn]"/><sref ref="[simd.creation]"/> |
| 8 | +</section> |
| 9 | +<submitter>Matthias Kretz</submitter> |
| 10 | +<date>22 Mar 2025</date> |
| 11 | +<priority>99</priority> |
| 12 | + |
| 13 | +<discussion> |
| 14 | +<p> |
| 15 | +All index values and simd widths in subclause "Data-parallel types" use the |
| 16 | +type <tt><i>simd-size-type</i></tt>. Specifically, the NTTP of `std::datapar::resize` |
| 17 | +uses <tt><i>simd-size-type</i></tt> and `std::datapar::chunk` is "implemented" |
| 18 | +using `std::datapar::resize`. |
| 19 | +<p/> |
| 20 | +For <tt>chunk<N></tt>, <tt>N</tt> is of type `size_t` and needs to be |
| 21 | +converted to <tt><i>simd-size-type</i></tt> in the effects clause where it is |
| 22 | +passed to resize. The NTTP of chunk should use <tt><i>simd-size-type</i></tt> |
| 23 | +instead of `size_t`. |
| 24 | +</p> |
| 25 | +</discussion> |
| 26 | + |
| 27 | +<resolution> |
| 28 | +<p> |
| 29 | +This wording is relative to <paper num="N5008"/>. |
| 30 | +</p> |
| 31 | + |
| 32 | +<ol> |
| 33 | + |
| 34 | +<li><p>Modify <sref ref="[simd.syn]"/>, header <tt><simd></tt> synopsis, as indicated:</p> |
| 35 | + |
| 36 | +<blockquote> |
| 37 | +<pre> |
| 38 | +namespace std::datapar { |
| 39 | + […] |
| 40 | + template<<ins><i>simd-size-type</i></ins><del>size_t</del> N, class T, class Abi> |
| 41 | + constexpr auto chunk(const basic_simd<T, Abi>& x) noexcept; |
| 42 | + template<<ins><i>simd-size-type</i></ins><del>size_t</del> N, size_t Bytes, class Abi> |
| 43 | + constexpr auto chunk(const basic_simd_mask<Bytes, Abi>& x) noexcept; |
| 44 | + […] |
| 45 | +} |
| 46 | +</pre> |
| 47 | +</blockquote> |
| 48 | +</li> |
| 49 | + |
| 50 | +<li><p>Modify <sref ref="[simd.creation]"/> as indicated:</p> |
| 51 | + |
| 52 | +<blockquote> |
| 53 | +<pre> |
| 54 | +template<<ins><i>simd-size-type</i></ins><del>size_t</del> N, class T, class Abi> |
| 55 | + constexpr auto chunk(const basic_simd<T, Abi>& x) noexcept; |
| 56 | +</pre> |
| 57 | +<blockquote> |
| 58 | +<p> |
| 59 | +-4- <i>Effects</i>: Equivalent to: <tt>return chunk<resize_t<N, basic_simd<T, Abi>>>(x);</tt> |
| 60 | +</p> |
| 61 | +</blockquote> |
| 62 | +<pre> |
| 63 | +template<<ins><i>simd-size-type</i></ins><del>size_t</del> N, size_t Bytes, class Abi> |
| 64 | + constexpr auto chunk(const basic_simd_mask<Bytes, Abi>& x) noexcept; |
| 65 | +</pre> |
| 66 | +<blockquote> |
| 67 | +<p> |
| 68 | +-5- <i>Effects</i>: Equivalent to: <tt>return chunk<resize_t<N, basic_simd_mask<Bytes, Abi>>>(x);</tt> |
| 69 | +</p> |
| 70 | +</blockquote> |
| 71 | +</blockquote> |
| 72 | +</li> |
| 73 | + |
| 74 | +</ol> |
| 75 | +</resolution> |
| 76 | + |
| 77 | +</issue> |
0 commit comments