File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -1722,7 +1722,7 @@ def EnableIf : InheritableAttr {
17221722}
17231723
17241724def ExtVectorType : TypeAttr {
1725- let Spellings = [RegularKeyword<"__vector_type">, GNU <"ext_vector_type">];
1725+ let Spellings = [Clang <"ext_vector_type">];
17261726 let Args = [ExprArgument<"NumElements">];
17271727 let Documentation = [ExtVectorTypeDocs];
17281728}
Original file line number Diff line number Diff line change @@ -1126,12 +1126,12 @@ general-purpose code.
11261126.. code-block:: c++
11271127
11281128 template <typename T, uint32_t N>
1129- constexpr T simd_reduce(T __attribute__(( ext_vector_type(N))) v) {
1129+ constexpr T simd_reduce(T [[clang:: ext_vector_type(N)]] v) {
11301130 static_assert((N & (N - 1)) == 0, "N must be a power of two");
11311131 if constexpr (N == 1) {
11321132 return v[0];
11331133 } else {
1134- T __attribute__(( ext_vector_type(N / 2))) reduced = v.hi + v.lo;
1134+ T [[clang:: ext_vector_type(N / 2)]] reduced = v.hi + v.lo;
11351135 return simd_reduce(reduced);
11361136 }
11371137 }
@@ -1144,6 +1144,8 @@ accepted values.
11441144 using f16_x16 = _Float16 __attribute__((ext_vector_type(16)));
11451145
11461146 f16_x16 reverse(f16_x16 v) { return v.sfedcba9876543210; }
1147+
1148+ See the OpenCL documentation for some more complete examples.
11471149 }];
11481150}
11491151
Original file line number Diff line number Diff line change @@ -111,15 +111,15 @@ __device__ __bf16 test_call( __bf16 in) {
111111// CHECK-NEXT: ret void
112112//
113113__device__ void test_vec_assign () {
114- __bf16 __attribute__ (( ext_vector_type (2 ))) vec2_a, vec2_b;
114+ __bf16 [[ clang:: ext_vector_type (2 )]] vec2_a, vec2_b;
115115 vec2_a = vec2_b;
116116
117- __bf16 __attribute__ (( ext_vector_type (4 ))) vec4_a, vec4_b;
117+ __bf16 [[ clang:: ext_vector_type (4 )]] vec4_a, vec4_b;
118118 vec4_a = vec4_b;
119119
120- __bf16 __attribute__ (( ext_vector_type (8 ))) vec8_a, vec8_b;
120+ __bf16 [[ clang:: ext_vector_type (8 )]] vec8_a, vec8_b;
121121 vec8_a = vec8_b;
122122
123- __bf16 __attribute__ (( ext_vector_type (16 ))) vec16_a, vec16_b;
123+ __bf16 [[ clang:: ext_vector_type (16 )]] vec16_a, vec16_b;
124124 vec16_a = vec16_b;
125125}
You can’t perform that action at this time.
0 commit comments