1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
/* The following definitions are in omp_lib, which cannot be included
in gcc/testsuite/ */
#if __cplusplus >= 201103L
# define __GOMP_UINTPTR_T_ENUM : __UINTPTR_TYPE__
#else
# define __GOMP_UINTPTR_T_ENUM
#endif
typedef enum omp_interop_t __GOMP_UINTPTR_T_ENUM
{
omp_interop_none = 0,
__omp_interop_t_max__ = __UINTPTR_MAX__
} omp_interop_t;
float repl0(short, short);
#pragma omp declare variant(repl0) match(construct={dispatch}) append_args(interop(target), interop(targetsync))
float base0();
/* { dg-error "argument 1 of 'repl0' must be of 'omp_interop_t'" "" { target c } .-3 } */
/* { dg-error "argument 1 of 'float repl0\\(short int, short int\\)' must be of 'omp_interop_t'" "" { target c++ } .-4 } */
/* { dg-note "'append_args' specified here" "" { target *-*-* } .-4 } */
float repl1(omp_interop_t, omp_interop_t);
#pragma omp declare variant(repl1) match(construct={dispatch}) append_args(interop(target), interop(targetsync))
float base1();
void repl2(int *, int *, omp_interop_t, omp_interop_t);
#pragma omp declare variant(repl2) match(construct={dispatch}) adjust_args(need_device_ptr : y) \
append_args(interop(target, targetsync, prefer_type(1)), \
interop(target, prefer_type({fr(3), attr("ompx_nop")},{fr(2)},{attr("ompx_all")})))
void base2(int *x, int *y);
void repl3(int, omp_interop_t, ...);
#pragma omp declare variant(repl3) match(construct={dispatch}) \
append_args(interop(target, prefer_type("cuda", "hsa")))
void base3(int, ...);
/* { dg-note "'declare variant' candidate 'repl3' declared here" "" { target c } .-2 } */
/* { dg-note "'declare variant' candidate 'void repl3\\(int, omp_interop_t, \\.\\.\\.\\)' declared here" "" { target c++ } .-3 } */
float repl4(short, short, omp_interop_t, short);
#pragma omp declare variant(repl4) match(construct={dispatch}) append_args(interop(target)) append_args(interop(targetsync)) /* { dg-error "too many 'append_args' clauses" } */
float base4(short, short);
/* { dg-error "variant 'repl4' and base 'base4' have incompatible types" "" { target c } .-2 } */
/* { dg-error "too few arguments to function 'float repl4\\(short int, short int, omp_interop_t, short int\\)'" "" { target c++ } .-3 } */
/* { dg-note "declared here" "" { target c++ } .-5 } */
float repl5(short, short, omp_interop_t, short);
#pragma omp declare variant(repl5) match(construct={dispatch}) append_args(interop(target),interop(targetsync))
float base5(short, short);
/* { dg-error "argument 4 of 'repl5' must be of 'omp_interop_t'" "" { target c } .-3 } */
/* { dg-error "argument 4 of 'float repl5\\(short int, short int, omp_interop_t, short int\\)' must be of 'omp_interop_t'" "" { target c++ } .-4 } */
/* { dg-note "'append_args' specified here" "" { target *-*-* } .-4 } */
float repl6(short, short, omp_interop_t, short);
#pragma omp declare variant(repl6) match(construct={dispatch}) append_args(interop(target))
float base6(short, short);
/* { dg-error "variant 'repl6' and base 'base6' have incompatible types" "" { target c } .-2 } */
/* { dg-error "too few arguments to function 'float repl6\\(short int, short int, omp_interop_t, short int\\)'" "" { target c++ } .-3 } */
/* { dg-note "declared here" "" { target c++ } .-5 } */
float
test (int *a, int *b)
{
omp_interop_t obj1, obj2;
float x;
#pragma omp dispatch interop ( obj1 )
x = base1 ();
#pragma omp dispatch interop ( obj1 )
base2 (a, b);
#pragma omp dispatch
base3 (5, 1, 2, 3);
#pragma omp dispatch interop (obj2)
base3 (5, 1, 2, 3);
#pragma omp dispatch interop (obj2, obj1) /* { dg-error "the 'device' clause must be present if the 'interop' clause has more than one list item" } */
base3 (5, 1, 2, 3);
/* { dg-error "number of list items in 'interop' clause \\(2\\) exceeds the number of 'append_args' items \\(1\\) for 'declare variant' candidate 'repl3'" "" { target c } .-2 } */
/* { dg-error "number of list items in 'interop' clause \\(2\\) exceeds the number of 'append_args' items \\(1\\) for 'declare variant' candidate 'void repl3\\(int, omp_interop_t, \\.\\.\\.\\)'" "" { target c++ } .-3 } */
return x;
}
|