Skip to content

Commit 50ed51c

Browse files
committed
New issue from Matthias Kretz: "datapar::chunk<N> should use simd-size-type instead of size_t"
1 parent f289ed6 commit 50ed51c

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

xml/issue4231.xml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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&lt;N&gt;</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&lt;N&gt;</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>&lt;simd&gt;</tt> synopsis, as indicated:</p>
35+
36+
<blockquote>
37+
<pre>
38+
namespace std::datapar {
39+
[&hellip;]
40+
template&lt;<ins><i>simd-size-type</i></ins><del>size_t</del> N, class T, class Abi&gt;
41+
constexpr auto chunk(const basic_simd&lt;T, Abi&gt;&amp; x) noexcept;
42+
template&lt;<ins><i>simd-size-type</i></ins><del>size_t</del> N, size_t Bytes, class Abi&gt;
43+
constexpr auto chunk(const basic_simd_mask&lt;Bytes, Abi&gt;&amp; x) noexcept;
44+
[&hellip;]
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&lt;<ins><i>simd-size-type</i></ins><del>size_t</del> N, class T, class Abi&gt;
55+
constexpr auto chunk(const basic_simd&lt;T, Abi&gt;&amp; x) noexcept;
56+
</pre>
57+
<blockquote>
58+
<p>
59+
-4- <i>Effects</i>: Equivalent to: <tt>return chunk&lt;resize_t&lt;N, basic_simd&lt;T, Abi&gt;&gt;&gt;(x);</tt>
60+
</p>
61+
</blockquote>
62+
<pre>
63+
template&lt;<ins><i>simd-size-type</i></ins><del>size_t</del> N, size_t Bytes, class Abi&gt;
64+
constexpr auto chunk(const basic_simd_mask&lt;Bytes, Abi&gt;&amp; x) noexcept;
65+
</pre>
66+
<blockquote>
67+
<p>
68+
-5- <i>Effects</i>: Equivalent to: <tt>return chunk&lt;resize_t&lt;N, basic_simd_mask&lt;Bytes, Abi&gt;&gt;&gt;(x);</tt>
69+
</p>
70+
</blockquote>
71+
</blockquote>
72+
</li>
73+
74+
</ol>
75+
</resolution>
76+
77+
</issue>

0 commit comments

Comments
 (0)