66
77__attribute__ ((sycl_device))
88[[__sycl_detail__::add_ir_attributes_function(" sycl-nd-range-kernel" , 4 )]]
9- void sndrk_free_func (int *ptr, int start, int end) {
9+ void sndrk_free_func1 (int *ptr, int start, int end) {
1010 for (int i = start; i <= end; i++)
1111 ptr[i] = start;
1212}
1313
1414__attribute__ ((sycl_device))
1515[[__sycl_detail__::add_ir_attributes_function(" sycl-single-task-kernel" , " " )]]
16- void sstk_free_func (int *ptr, int start, int end) {
16+ void sstk_free_func1 (int *ptr, int start, int end) {
1717 for (int i = start; i <= end; i++)
1818 ptr[i] = start;
1919}
2020
2121template <typename T>
2222__attribute__ ((sycl_device))
2323[[__sycl_detail__::add_ir_attributes_function(" sycl-nd-range-kernel" , 4 )]]
24- void sndrk_free_func_tmpl (T *ptr) {
24+ void sndrk_free_func_tmpl1 (T *ptr) {
2525 for (int i = 0 ; i <= 7 ; i++)
2626 ptr[i] = i + 11 ;
2727}
2828
2929__attribute__ ((sycl_device))
3030[[__sycl_detail__::add_ir_attributes_function(" sycl-nd-range-kernel" , 1 )]]
31- void ovl_free_func (int *ptr) {
31+ void ovl_free_func1 (int *ptr) {
3232 for (int i = 0 ; i <= 7 ; i++)
3333 ptr[i] = i;
3434}
3535
3636[[__sycl_detail__::add_ir_attributes_function(" sycl-single-task-kernel" , 1 )]]
37- void ovl_free_func (int *ptr, int val) {
37+ void ovl_free_func1 (int *ptr, int val) {
3838 for (int i = 0 ; i <= 7 ; i++)
3939 ptr[i] = i + val;
4040}
@@ -46,12 +46,12 @@ void foo() {
4646 // expected-error@+1 {{builtin requires exactly 2 arguments}}
4747 bool b1 = __builtin_sycl_is_nd_range_kernel ();
4848 // expected-error@+1 {{builtin requires exactly 2 arguments}}
49- bool b2 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func );
49+ bool b2 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func1 );
5050
5151 // The following four are okay.
52- bool b3 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func , 4 ); // Okay
53- bool b4 = __builtin_sycl_is_nd_range_kernel (*sndrk_free_func , 4 ); // Okay
54- bool b5 = __builtin_sycl_is_nd_range_kernel (&sndrk_free_func , 4 ); // Okay
52+ bool b3 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func1 , 4 ); // Okay
53+ bool b4 = __builtin_sycl_is_nd_range_kernel (*sndrk_free_func1 , 4 ); // Okay
54+ bool b5 = __builtin_sycl_is_nd_range_kernel (&sndrk_free_func1 , 4 ); // Okay
5555 bool b6 = __builtin_sycl_is_nd_range_kernel (func, 8 ); // Okay
5656
5757 // But the next two are not.
@@ -61,35 +61,35 @@ void foo() {
6161 bool b8 = __builtin_sycl_is_nd_range_kernel (laterdef);
6262
6363 // Constexpr forms of the valid cases.
64- constexpr bool b9 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func , 4 ); // Okay and true.
64+ constexpr bool b9 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func1 , 4 ); // Okay and true.
6565 constexpr bool b10 = __builtin_sycl_is_nd_range_kernel (func, 4 ); // Okay, but false.
66- constexpr bool b11 = __builtin_sycl_is_nd_range_kernel (sstk_free_func , 4 ); // Okay, but false.
67- constexpr bool b12 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func , 8 ); // Okay, but false.
66+ constexpr bool b11 = __builtin_sycl_is_nd_range_kernel (sstk_free_func1 , 4 ); // Okay, but false.
67+ constexpr bool b12 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func1 , 8 ); // Okay, but false.
6868
6969 // expected-error@+1 {{constexpr variable 'b13' must be initialized by a constant expression}}
70- constexpr bool b13 = __builtin_sycl_is_nd_range_kernel (*sndrk_free_func , 4 ); // Okay
70+ constexpr bool b13 = __builtin_sycl_is_nd_range_kernel (*sndrk_free_func1 , 4 ); // Okay
7171 // expected-error@+1 {{constexpr variable 'b14' must be initialized by a constant expression}}
72- constexpr bool b14 = __builtin_sycl_is_nd_range_kernel (&sndrk_free_func , 4 ); // Okay
72+ constexpr bool b14 = __builtin_sycl_is_nd_range_kernel (&sndrk_free_func1 , 4 ); // Okay
7373
7474 // Test with function templates.
7575 // expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
76- constexpr bool b15 = __builtin_sycl_is_nd_range_kernel (&sndrk_free_func_tmpl <int >, 6 );
76+ constexpr bool b15 = __builtin_sycl_is_nd_range_kernel (&sndrk_free_func_tmpl1 <int >, 6 );
7777 // expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
78- constexpr bool b16 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func_tmpl <int >, 8 );
79- constexpr bool b17 = __builtin_sycl_is_nd_range_kernel ((void (*)(int *))sndrk_free_func_tmpl <int >, 12 ); // Okay
78+ constexpr bool b16 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func_tmpl1 <int >, 8 );
79+ constexpr bool b17 = __builtin_sycl_is_nd_range_kernel ((void (*)(int *))sndrk_free_func_tmpl1 <int >, 12 ); // Okay
8080
8181
8282 // Test with overloaded functions.
8383 // expected-error@+1 {{1st argument must be a function pointer (was '<overloaded function type>')}}
84- constexpr bool b18 = __builtin_sycl_is_nd_range_kernel (ovl_free_func , 4 );
85- constexpr bool b19 = __builtin_sycl_is_nd_range_kernel ((void (*)(int *))ovl_free_func , 2 ); // Okay
86- constexpr bool b20 = __builtin_sycl_is_nd_range_kernel ((void (*)(int *, int ))ovl_free_func , 2 ); // Okay
84+ constexpr bool b18 = __builtin_sycl_is_nd_range_kernel (ovl_free_func1 , 4 );
85+ constexpr bool b19 = __builtin_sycl_is_nd_range_kernel ((void (*)(int *))ovl_free_func1 , 2 ); // Okay
86+ constexpr bool b20 = __builtin_sycl_is_nd_range_kernel ((void (*)(int *, int ))ovl_free_func1 , 2 ); // Okay
8787
8888 // Test with invalid dimensions.
8989 // expected-error@+1 {{2nd argument must be a strictly positive value (was -1)}}
90- bool b21 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func , -1 );
90+ bool b21 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func1 , -1 );
9191 // expected-error@+1 {{2nd argument must be a strictly positive value (was 0)}}
92- bool b22 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func , 0 );
92+ bool b22 = __builtin_sycl_is_nd_range_kernel (sndrk_free_func1 , 0 );
9393}
9494
9595void laterdef ();
0 commit comments