Skip to content

Commit a5c3e96

Browse files
committed
Add [parallel.simd.traits]
1 parent a2ae84c commit a5c3e96

File tree

1 file changed

+170
-0
lines changed

1 file changed

+170
-0
lines changed

data_parallel_types.html

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,176 @@ <h1><ins><code>simd</code> ABI tags</ins></h1>
375375
</p>
376376
</cxx-section>
377377

378+
<cxx-section id="parallel.simd.traits">
379+
<h1><ins><code>simd</code> type traits</ins></h1>
380+
381+
<ins>
382+
<code>template&lt;class&gt; struct is_abi_tag { <em>see-below</em> };</code>
383+
</ins>
384+
385+
<p>
386+
<ins>
387+
The type <code>is_abi_tag&lt;T&gt;</code> is a <code>UnaryTypeTrait</code> with a <code>BaseCharacteristic</code> of <code>true_type</code> if <code>T</code> is a standard or extended ABI tag, and <code>false_type</code> otherwise.
388+
</ins>
389+
</p>
390+
391+
<p>
392+
<ins>
393+
The behavior of a program that adds specializations for <code>is_abi_tag</code> is undefined.
394+
</ins>
395+
</p>
396+
397+
<ins>
398+
<code>template&lt;class&gt; struct is_simd { <em>see-below</em> };</code>
399+
</ins>
400+
401+
<p>
402+
<ins>
403+
The type <code>is_simd&lt;T&gt;</code> is a <code>UnaryTypeTrait</code> with a <code>BaseCharacteristic</code> of <code>true_type</code> if <code>T</code> is a specialization of the <code>simd</code> class template, and <code>false_type</code> otherwise.
404+
</ins>
405+
</p>
406+
407+
<p>
408+
<ins>
409+
The behavior of a program that adds specializations for <code>is_simd</code> is undefined.
410+
</ins>
411+
</p>
412+
413+
<p>
414+
<ins>
415+
The type <code>is_simd_mask&lt;T&gt;</code> is a <code>UnaryTypeTrait</code> with a <code>BaseCharacteristic</code> of <code>true_type</code> if <code>T</code> is a specialization of the <code>simd_mask</code> class template, and <code>false_type</code> otherwise.
416+
</ins>
417+
</p>
418+
419+
<p>
420+
<ins>
421+
The behavior of a program that adds specializations for <code>is_simd_mask</code> is undefined.
422+
</ins>
423+
</p>
424+
425+
<ins>
426+
<code>template&lt;class T&gt; struct is_simd_flag_type { <em>see-below</em> };</code>
427+
</ins>
428+
429+
<p>
430+
<ins>
431+
The type <code>is_simd_flag_type&lt;class T&gt;</code> is a <code>UnaryTypeTrait</code> with a <code>BaseCharacteristic</code> of <code>true_type</code> if <code>T</code> is one of
432+
433+
<bl>
434+
<li>
435+
<ins>
436+
<code>element_aligned_tag</code>, or
437+
</ins>
438+
</li>
439+
440+
<li>
441+
<ins>
442+
<code>vector_aligned_tag</code>, or
443+
</ins>
444+
</li>
445+
446+
<li>
447+
<ins>
448+
<code>overaligned_tag&lt;N&gt;</code> with <code>N &gt; 0</code> and <code>N</code> an integral power of two,
449+
</ins>
450+
</li>
451+
</bl>
452+
453+
<br>
454+
455+
<ins>
456+
and <code>false_type</code> otherwise.
457+
</ins>
458+
</ins>
459+
</p>
460+
461+
<p>
462+
<ins>
463+
The behavior of a program that adds specializations for <code>is_simd_flag_type</code> is undefined.
464+
</ins>
465+
</p>
466+
467+
<ins>
468+
<code>template&lt;class T, class Abi = simd_abi::compatible&lt;T&gt;&gt; struct simd_size { <em>see-below</em> };</code>
469+
</ins>
470+
471+
<p>
472+
<ins>
473+
<code>simd_size&lt;T, Abi&gt;</code> has a member <code>value</code> if and only if
474+
475+
<bl>
476+
<li>
477+
<ins>
478+
<code>T</code> is a vectorizable type, and
479+
</ins>
480+
</li>
481+
482+
<li>
483+
<ins>
484+
<code>is_abi_tag_v&lt;Abi&gt;</code> is <code>true</code>.
485+
</ins>
486+
</li>
487+
</bl>
488+
489+
<br>
490+
491+
<ins>
492+
<cxx-note>
493+
The rules are different from <cxx-ref to="parallel.simd.overview"></cxx-ref>.
494+
</cxx-note>
495+
</ins>
496+
</ins>
497+
</p>
498+
499+
<p>
500+
<ins>
501+
If <code>value</code> is present, the type <code>simd_size&lt;T, Abi&gt;</code> is a <code>BinaryTypeTrait</code> with a <code>BaseCharacteristic</code> of <code>integral_constant&lt;size_t, N&gt;</code> with <code>N</code> equal to the number of elements in a <code>simd&lt;T, Abi&gt;</code> object. <cxx-note>If <code>simd&lt;T, Abi&gt;</code> is not supported for the currently targeted system, <code>simd_size&lt;T, Abi&gt;::value</code> produces the value <code>simd&lt;T, Abi&gt;::size()</code> would return if it were supported.</cxx-note>
502+
</ins>
503+
</p>
504+
505+
<p>
506+
<ins>
507+
The behavior of a program that adds specializations for <code>simd_size</code> is undefined.
508+
</ins>
509+
</p>
510+
511+
<ins>
512+
<code>template&lt;class T, class U = typename T::value_type&gt; struct memory_alignment { <em>see-below</em> };</code>
513+
</ins>
514+
515+
<p>
516+
<ins>
517+
<code>memory_alignment&lt;T, U&gt;</code> has a member <code>value</code> if and only if
518+
</ins>
519+
520+
<bl>
521+
<li>
522+
<ins>
523+
<code>is_simd_mask_v&lt;T&gt;</code> is <code>true</code> and <code>U</code> is <code>bool</code>, or
524+
</ins>
525+
</li>
526+
527+
<li>
528+
<ins>
529+
<code>is_simd_v&lt;T&gt;</code> is <code>true</code> and <code>U</code> is a vectorizable type.
530+
</ins>
531+
</li>
532+
</bl>
533+
</p>
534+
535+
<p>
536+
<ins>
537+
If <code>value</code> is present, the type <code>memory_alignment&lt;T, U&gt;</code> is a <code>BinaryTypeTrait</code> with a <code>BaseCharacteristic</code> of <code>integral_constant&lt;size_t, N&gt;</code> for some implementation-defined <code>N</code> (see <cxx-ref to="parallel.simd.copy"></cxx-ref> and <cxx-ref to="parallel.simd.mask.copy"></cxx-ref>). <cxx-note><code>value</code> identifies the alignment restrictions on pointers used for (converting) loads and stores for the give type <code>T</code> on arrays of type <code>U</code>.</cxx-note>
538+
</ins>
539+
</p>
540+
541+
<p>
542+
<ins>
543+
The behavior of a program that adds specializations for <code>memory_alignment</code> is undefined.
544+
</ins>
545+
</p>
546+
</cxx-section>
547+
378548
<cxx-section id="parallel.simd.overview">
379549
</cxx-section>
380550
</cxx-clause>

0 commit comments

Comments
 (0)