| 1 |
// RUN: %clang_cc1 -fsyntax-only -triple amdgcn -target-cpu gfx942 -verify %s -fcuda-is-device |
| 2 |
// RUN: %clang_cc1 -fsyntax-only -triple x86_64 -aux-triple amdgcn -verify %s |
| 3 |
|
| 4 |
#define __device__ __attribute__((device)) |
| 5 |
#define __shared__ __attribute__((shared)) |
| 6 |
|
| 7 |
__device__ double global_double; |
| 8 |
|
| 9 |
__device__ void test_global_atomic_fmax_f64_valid(double *ptr, double val) { |
| 10 |
double result; |
| 11 |
result = __builtin_amdgcn_global_atomic_fmax_f64(ptr, val); |
| 12 |
result = __builtin_amdgcn_global_atomic_fmax_f64(&global_double, val); |
| 13 |
} |
| 14 |
|
| 15 |
__device__ void test_global_atomic_fmax_f64_errors(double *ptr, double val, |
| 16 |
__shared__ double *lds_ptr, |
| 17 |
float *ptr_f) { |
| 18 |
double result; |
| 19 |
result = __builtin_amdgcn_global_atomic_fmax_f64(ptr, val, 0); // expected-error{{too many arguments to function call, expected 2, have 3}} |
| 20 |
result = __builtin_amdgcn_global_atomic_fmax_f64(lds_ptr, val); |
| 21 |
result = __builtin_amdgcn_global_atomic_fmax_f64(ptr_f, val); // expected-error{{cannot initialize a parameter of type}} |
| 22 |
} |