|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | +<meta charset="utf-8"> |
| 5 | +<title>Issue 4231: datapar::chunk<N> should use simd-size-type instead of size_t</title> |
| 6 | +<meta property="og:title" content="Issue 4231: datapar::chunk<N> should use simd-size-type instead of size_t"> |
| 7 | +<meta property="og:description" content="C++ library issue. Status: New"> |
| 8 | +<meta property="og:url" content="https://cplusplus.github.io/LWG/issue4231.html"> |
| 9 | +<meta property="og:type" content="website"> |
| 10 | +<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png"> |
| 11 | +<meta property="og:image:alt" content="C++ logo"> |
| 12 | +<style> |
| 13 | + p {text-align:justify} |
| 14 | + li {text-align:justify} |
| 15 | + pre code.backtick::before { content: "`" } |
| 16 | + pre code.backtick::after { content: "`" } |
| 17 | + blockquote.note |
| 18 | + { |
| 19 | + background-color:#E0E0E0; |
| 20 | + padding-left: 15px; |
| 21 | + padding-right: 15px; |
| 22 | + padding-top: 1px; |
| 23 | + padding-bottom: 1px; |
| 24 | + } |
| 25 | + ins {background-color:#A0FFA0} |
| 26 | + del {background-color:#FFA0A0} |
| 27 | + table.issues-index { border: 1px solid; border-collapse: collapse; } |
| 28 | + table.issues-index th { text-align: center; padding: 4px; border: 1px solid; } |
| 29 | + table.issues-index td { padding: 4px; border: 1px solid; } |
| 30 | + table.issues-index td:nth-child(1) { text-align: right; } |
| 31 | + table.issues-index td:nth-child(2) { text-align: left; } |
| 32 | + table.issues-index td:nth-child(3) { text-align: left; } |
| 33 | + table.issues-index td:nth-child(4) { text-align: left; } |
| 34 | + table.issues-index td:nth-child(5) { text-align: center; } |
| 35 | + table.issues-index td:nth-child(6) { text-align: center; } |
| 36 | + table.issues-index td:nth-child(7) { text-align: left; } |
| 37 | + table.issues-index td:nth-child(5) span.no-pr { color: red; } |
| 38 | + @media (prefers-color-scheme: dark) { |
| 39 | + html { |
| 40 | + color: #ddd; |
| 41 | + background-color: black; |
| 42 | + } |
| 43 | + ins { |
| 44 | + background-color: #225522 |
| 45 | + } |
| 46 | + del { |
| 47 | + background-color: #662222 |
| 48 | + } |
| 49 | + a { |
| 50 | + color: #6af |
| 51 | + } |
| 52 | + a:visited { |
| 53 | + color: #6af |
| 54 | + } |
| 55 | + blockquote.note |
| 56 | + { |
| 57 | + background-color: rgba(255, 255, 255, .10) |
| 58 | + } |
| 59 | + } |
| 60 | +</style> |
| 61 | +</head> |
| 62 | +<body> |
| 63 | +<hr> |
| 64 | +<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#New">New</a> status.</em></p> |
| 65 | +<h3 id="4231"><a href="lwg-active.html#4231">4231</a>. <code>datapar::chunk<N></code> should use <code><i>simd-size-type</i></code> instead of <code>size_t</code></h3> |
| 66 | +<p><b>Section:</b> 29.10.3 <a href="https://wg21.link/simd.syn">[simd.syn]</a>, 29.10.7.8 <a href="https://wg21.link/simd.creation">[simd.creation]</a> <b>Status:</b> <a href="lwg-active.html#New">New</a> |
| 67 | + <b>Submitter:</b> Matthias Kretz <b>Opened:</b> 2025-03-22 <b>Last modified:</b> 2025-03-22</p> |
| 68 | +<p><b>Priority: </b>Not Prioritized |
| 69 | +</p> |
| 70 | +<p><b>View all issues with</b> <a href="lwg-status.html#New">New</a> status.</p> |
| 71 | +<p><b>Discussion:</b></p> |
| 72 | +<p> |
| 73 | +All index values and simd widths in subclause "Data-parallel types" use the |
| 74 | +type <code><i>simd-size-type</i></code>. Specifically, the NTTP of <code class='backtick'>std::datapar::resize</code> |
| 75 | +uses <code><i>simd-size-type</i></code> and <code class='backtick'>std::datapar::chunk</code> is "implemented" |
| 76 | +using <code class='backtick'>std::datapar::resize</code>. |
| 77 | +<p/> |
| 78 | +For <code>chunk<N></code>, <code>N</code> is of type <code class='backtick'>size_t</code> and needs to be |
| 79 | +converted to <code><i>simd-size-type</i></code> in the effects clause where it is |
| 80 | +passed to resize. The NTTP of chunk should use <code><i>simd-size-type</i></code> |
| 81 | +instead of <code class='backtick'>size_t</code>. |
| 82 | +</p> |
| 83 | + |
| 84 | + |
| 85 | +<p id="res-4231"><b>Proposed resolution:</b></p> |
| 86 | +<p> |
| 87 | +This wording is relative to <a href="https://wg21.link/N5008">N5008</a>. |
| 88 | +</p> |
| 89 | + |
| 90 | +<ol> |
| 91 | + |
| 92 | +<li><p>Modify 29.10.3 <a href="https://wg21.link/simd.syn">[simd.syn]</a>, header <code><simd></code> synopsis, as indicated:</p> |
| 93 | + |
| 94 | +<blockquote> |
| 95 | +<pre> |
| 96 | +namespace std::datapar { |
| 97 | + […] |
| 98 | + template<<ins><i>simd-size-type</i></ins><del>size_t</del> N, class T, class Abi> |
| 99 | + constexpr auto chunk(const basic_simd<T, Abi>& x) noexcept; |
| 100 | + template<<ins><i>simd-size-type</i></ins><del>size_t</del> N, size_t Bytes, class Abi> |
| 101 | + constexpr auto chunk(const basic_simd_mask<Bytes, Abi>& x) noexcept; |
| 102 | + […] |
| 103 | +} |
| 104 | +</pre> |
| 105 | +</blockquote> |
| 106 | +</li> |
| 107 | + |
| 108 | +<li><p>Modify 29.10.7.8 <a href="https://wg21.link/simd.creation">[simd.creation]</a> as indicated:</p> |
| 109 | + |
| 110 | +<blockquote> |
| 111 | +<pre> |
| 112 | +template<<ins><i>simd-size-type</i></ins><del>size_t</del> N, class T, class Abi> |
| 113 | + constexpr auto chunk(const basic_simd<T, Abi>& x) noexcept; |
| 114 | +</pre> |
| 115 | +<blockquote> |
| 116 | +<p> |
| 117 | +-4- <i>Effects</i>: Equivalent to: <code>return chunk<resize_t<N, basic_simd<T, Abi>>>(x);</code> |
| 118 | +</p> |
| 119 | +</blockquote> |
| 120 | +<pre> |
| 121 | +template<<ins><i>simd-size-type</i></ins><del>size_t</del> N, size_t Bytes, class Abi> |
| 122 | + constexpr auto chunk(const basic_simd_mask<Bytes, Abi>& x) noexcept; |
| 123 | +</pre> |
| 124 | +<blockquote> |
| 125 | +<p> |
| 126 | +-5- <i>Effects</i>: Equivalent to: <code>return chunk<resize_t<N, basic_simd_mask<Bytes, Abi>>>(x);</code> |
| 127 | +</p> |
| 128 | +</blockquote> |
| 129 | +</blockquote> |
| 130 | +</li> |
| 131 | + |
| 132 | +</ol> |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | +</body> |
| 139 | +</html> |
0 commit comments