#ifdef NO_INTEROP_T_DEF
void foo_v1(float *, void *);
#pragma omp declare variant(foo_v1) append_args(interop(target)) \
match(construct={dispatch})
void foo_v1(float *);
#else
typedef void *omp_interop_t;
int Other;
#if _OPENMP >= 202011
#ifdef __cplusplus
class A {
public:
void memberfoo_v0(float *A, float *B, int *I);
void memberfoo_v1(float *A, float *B, int *I, omp_interop_t IOp);
#pragma omp declare variant(memberfoo_v0) match(construct={dispatch}) \
append_args(interop(target))
#pragma omp declare variant(memberfoo_v1) match(construct={dispatch}) \
append_args(interop(target),interop(target))
void memberbar(float *A, float *B, int *I) { return; }
static void smemberfoo_v0(float *A, float *B, int *I);
static void smemberfoo_v1(float *A, float *B, int *I, omp_interop_t IOp);
#pragma omp declare variant(smemberfoo_v0) match(construct={dispatch}) \
append_args(interop(target))
#pragma omp declare variant(smemberfoo_v1) match(construct={dispatch}) \
append_args(interop(target),interop(target))
static void smemberbar(float *A, float *B, int *I) { return; }
virtual void vmemberfoo_v0(float *A, float *B, int *I);
virtual void vmemberfoo_v1(float *A, float *B, int *I, omp_interop_t IOp);
#pragma omp declare variant(vmemberfoo_v0) match(construct={dispatch}) \
append_args(interop(target))
#pragma omp declare variant(vmemberfoo_v1) match(construct={dispatch}) \
append_args(interop(target))
virtual void vmemberbar(float *A, float *B, int *I) { return; }
virtual void pvmemberfoo_v0(float *A, float *B, int *I) = 0;
virtual void pvmemberfoo_v1(float *A, float *B, int *I, omp_interop_t IOp) = 0;
#pragma omp declare variant(pvmemberfoo_v0) match(construct={dispatch}) \
append_args(interop(target))
#pragma omp declare variant(pvmemberfoo_v1) match(construct={dispatch}) \
append_args(interop(target))
virtual void pvmemberbar(float *A, float *B, int *I) = 0;
};
template <typename T> void templatefoo_v0(const T& t);
template <typename T> void templatefoo_v1(const T& t, omp_interop_t I);
template <typename T> void templatebar(const T& t) {}
#pragma omp declare variant(templatefoo_v0<int>) match(construct={dispatch}) \
append_args(interop(target))
#pragma omp declare variant(templatefoo_v1<int>) match(construct={dispatch}) \
append_args(interop(target),interop(target))
void templatebar(const int &t) {}
#endif #endif
void foo_v1(float *AAA, float *BBB, int *I) { return; }
void foo_v2(float *AAA, float *BBB, int *I) { return; }
void foo_v3(float *AAA, float *BBB, int *I) { return; }
void foo_v4(float *AAA, float *BBB, int *I, omp_interop_t IOp) { return; }
#if _OPENMP >= 202011
void vararg_foo(const char *fmt, omp_interop_t it, ...);
#pragma omp declare variant(vararg_foo) match(construct={dispatch}) \
append_args(interop(target))
void vararg_bar(const char *fmt, ...) { return; }
#pragma omp declare variant(vararg_foo) match(construct={dispatch}) \
append_args(interop(target))
void vararg_bar2(const char *fmt) { return; }
#pragma omp declare variant(foo_v1) \
match(construct={dispatch}, device={arch(arm)}) \
adjust_args(need_device_ptr:AAA,BBB) adjust_args(need_device_ptr:AAA)
#pragma omp declare variant(foo_v1) \
match(construct={dispatch}, device={arch(ppc)}), \
adjust_args(need_device_ptr:AAA) adjust_args(nothing:AAA)
#pragma omp declare variant(foo_v1) \
adjust_args(nothing:J) \
match(construct={dispatch}, device={arch(x86,x86_64)})
#pragma omp declare variant(foo_v3) \
adjust_args(nothing:Other) \
match(construct={dispatch}, device={arch(x86,x86_64)})
#pragma omp declare variant(foo_v3) \
adjust_args(nothing:BBB) match(construct={target}, device={arch(arm)})
#pragma omp declare variant(foo_v3) \
adjust_args(nothing:BBB) match(device={arch(ppc)})
#pragma omp declare variant(foo_v1)
#pragma omp declare variant(foo_v1) other
#pragma omp declare variant(foo_v1) match(construct={dispatch}) \
append_args(foobar(target))
#pragma omp declare variant(foo_v1) match(construct={dispatch}) \
append_args(interop(target)) \
append_args(interop(targetsync))
#pragma omp declare variant(foo_v4) \
append_args(interop(target)) match(construct={target})
#pragma omp declare variant(foo_v4) \
match(construct={target}) append_args(interop(target))
#pragma omp declare variant(foo_v4) match(construct={dispatch}) \
append_args(interop(target,target))
#pragma omp declare variant(foo_v4) match(construct={dispatch}) \
append_args(interop(targetsync,targetsync))
#pragma omp declare variant(foo_v4) match(construct={dispatch}) \
append_args(interop())
#pragma omp declare variant(foo_v4) match(construct={dispatch}) \
append_args(interop(somethingelse))
#pragma omp declare variant(foo_v1) match(construct={dispatch}) \
append_args(interop(target))
#pragma omp declare variant(foo_v1) match(construct={dispatch}) \
append_args(interop(target),interop(targetsync))
#pragma omp declare variant(foo_v4) match(construct={dispatch}) \
append_args(interop(target),interop(targetsync))
#pragma omp declare variant(foo_v4) match(construct={dispatch})
#endif #if _OPENMP < 202011
#pragma omp declare variant(foo_v1) \
adjust_args(need_device_ptr:AAA) match(device={arch(arm)})
#pragma omp declare variant(foo_v1) \
append_args(interop(target)) match(device={arch(arm)})
#endif
void foo(float *AAA, float *BBB, int *I) { return; }
#endif
#ifdef C
void c_variant(omp_interop_t);
#pragma omp declare variant(c_variant) \
append_args(interop(target)) match(construct={dispatch})
void c_base() {}
#ifdef WIN
void _cdecl win_c_variant(omp_interop_t);
#pragma omp declare variant(win_c_variant) \
append_args(interop(target)) match(construct={dispatch})
void _cdecl win_c_base() {}
#endif #endif