| ! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s |
| |
| ! Test CUDA Fortran procedures available in cudadevice module |
| |
| attributes(global) subroutine test_sad() |
| integer :: res |
| integer :: i, j, k |
| res = __sad(i, j, k) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_sad |
| ! CHECK: %{{.*}} = fir.call @__nv_sad(%{{.*}}, %{{.*}}, %{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32, i32, i32) -> i32 |
| |
| attributes(global) subroutine test_usad() |
| integer :: res |
| integer :: i, j, k |
| res = __usad(i, j, k) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_usad |
| ! CHECK: %{{.*}} = fir.call @__nv_usad(%{{.*}}, %{{.*}}, %{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32, i32, i32) -> i32 |
| |
| attributes(global) subroutine test_dsqrt_rX() |
| double precision :: res |
| double precision :: p |
| res = __dsqrt_rd(p) |
| res = __dsqrt_rn(p) |
| res = __dsqrt_ru(p) |
| res = __dsqrt_rz(p) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_dsqrt_rx |
| ! CHECK: %{{.*}} = fir.call @__nv_dsqrt_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64 |
| ! CHECK: %{{.*}} = fir.call @__nv_dsqrt_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64 |
| ! CHECK: %{{.*}} = fir.call @__nv_dsqrt_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64 |
| ! CHECK: %{{.*}} = fir.call @__nv_dsqrt_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64 |
| |
| attributes(global) subroutine test_uint2float_rX() |
| real :: res |
| integer :: i |
| res = __uint2float_rd(i) |
| res = __uint2float_rn(i) |
| res = __uint2float_ru(i) |
| res = __uint2float_rz(i) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_uint2float_rx |
| ! CHECK: %{{.*}} = fir.call @__nv_uint2float_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_uint2float_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_uint2float_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_uint2float_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32) -> f32 |
| |
| attributes(global) subroutine test_uint2double_rn() |
| double precision :: res |
| integer :: i |
| res = __uint2double_rn(i) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_uint2double_rn |
| ! CHECK: %{{.*}} = fir.call @__nv_uint2double_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i32) -> f64 |
| |
| attributes(global) subroutine test_ull2dloat_rX() |
| real :: res |
| integer(8) :: i |
| res = __ull2float_rd(i) |
| res = __ull2float_rn(i) |
| res = __ull2float_ru(i) |
| res = __ull2float_rz(i) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_ull2dloat_rx |
| ! CHECK: %{{.*}} = fir.call @__nv_ull2float_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_ull2float_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_ull2float_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_ull2float_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32 |
| |
| attributes(global) subroutine test_log() |
| real :: res |
| real :: r |
| res = __logf(r) |
| res = __log2f(r) |
| res = __log10f(r) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_log |
| ! CHECK: %{{.*}} = fir.call @__nv_logf(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_log2f(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_log10f(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32 |
| |
| attributes(global) subroutine test_sinf() |
| real :: res |
| real :: r |
| res = __sinf(r) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_sinf |
| ! CHECK: %{{.*}} = fir.call @__nv_sinf(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32 |
| |
| attributes(global) subroutine test_tanf() |
| real :: res |
| real :: r |
| res = __tanf(r) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_tanf |
| ! CHECK: %{{.*}} = fir.call @__nv_tanf(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32 |
| |
| attributes(global) subroutine test_exp() |
| real :: res |
| real :: r |
| res = __expf(r) |
| res = __exp10f(r) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_exp |
| ! CHECK: %{{.*}} = fir.call @__nv_expf(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_exp10f(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32 |
| |
| attributes(global) subroutine test_double2ll_rX() |
| integer(8) :: res |
| double precision :: r |
| res = __double2ll_rd(r) |
| res = __double2ll_rn(r) |
| res = __double2ll_ru(r) |
| res = __double2ll_rz(r) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_double2ll_rx |
| ! CHECK: %{{.*}} = fir.call @__nv_double2ll_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64 |
| ! CHECK: %{{.*}} = fir.call @__nv_double2ll_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64 |
| ! CHECK: %{{.*}} = fir.call @__nv_double2ll_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64 |
| ! CHECK: %{{.*}} = fir.call @__nv_double2ll_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64 |
| |
| attributes(global) subroutine test_drcp_rX() |
| double precision :: res |
| double precision :: r |
| res = __drcp_rd(r) |
| res = __drcp_rn(r) |
| res = __drcp_ru(r) |
| res = __drcp_rz(r) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_drcp_rx |
| ! CHECK: %{{.*}} = fir.call @__nv_drcp_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64 |
| ! CHECK: %{{.*}} = fir.call @__nv_drcp_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64 |
| ! CHECK: %{{.*}} = fir.call @__nv_drcp_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64 |
| ! CHECK: %{{.*}} = fir.call @__nv_drcp_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> f64 |
| |
| attributes(global) subroutine test_double2ull_rX() |
| integer(8) :: res |
| double precision :: r |
| res = __double2ull_rd(r) |
| res = __double2ull_rn(r) |
| res = __double2ull_ru(r) |
| res = __double2ull_rz(r) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_double2ull_rx |
| ! CHECK: %{{.*}} = fir.call @__nv_double2ull_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64 |
| ! CHECK: %{{.*}} = fir.call @__nv_double2ull_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64 |
| ! CHECK: %{{.*}} = fir.call @__nv_double2ull_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64 |
| ! CHECK: %{{.*}} = fir.call @__nv_double2ull_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f64) -> i64 |
| |
| attributes(global) subroutine test_saturatef() |
| real :: res |
| real :: r |
| res = __saturatef(r) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_saturatef |
| ! CHECK: %{{.*}} = fir.call @__nv_saturatef(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> f32 |
| |
| attributes(global) subroutine test_float2ll_rX() |
| integer(8) :: res |
| real :: r |
| res = __float2ll_rd(r) |
| res = __float2ll_rn(r) |
| res = __float2ll_ru(r) |
| res = __float2ll_rz(r) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_float2ll_rx |
| ! CHECK: %{{.*}} = fir.call @__nv_float2ll_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i64 |
| ! CHECK: %{{.*}} = fir.call @__nv_float2ll_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i64 |
| ! CHECK: %{{.*}} = fir.call @__nv_float2ll_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i64 |
| ! CHECK: %{{.*}} = fir.call @__nv_float2ll_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i64 |
| |
| attributes(global) subroutine test_ll2float_rX() |
| real :: res |
| integer(8) :: i |
| res = __ll2float_rd(i) |
| res = __ll2float_rn(i) |
| res = __ll2float_ru(i) |
| res = __ll2float_rz(i) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_ll2float_rx |
| ! CHECK: %{{.*}} = fir.call @__nv_ll2float_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_ll2float_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_ll2float_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32 |
| ! CHECK: %{{.*}} = fir.call @__nv_ll2float_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (i64) -> f32 |
| attributes(global) subroutine test_float2int_rX() |
| integer :: res |
| real :: r |
| res = __float2int_rd(r) |
| res = __float2int_rn(r) |
| res = __float2int_ru(r) |
| res = __float2int_rz(r) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_float2int_rx |
| ! CHECK: %{{.*}} = fir.call @__nv_float2int_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32 |
| ! CHECK: %{{.*}} = fir.call @__nv_float2int_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32 |
| ! CHECK: %{{.*}} = fir.call @__nv_float2int_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32 |
| ! CHECK: %{{.*}} = fir.call @__nv_float2int_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32 |
| |
| attributes(global) subroutine test_float2uint_rX() |
| integer :: res |
| real :: r |
| res = __float2uint_rd(r) |
| res = __float2uint_rn(r) |
| res = __float2uint_ru(r) |
| res = __float2uint_rz(r) |
| end subroutine |
| |
| ! CHECK-LABEL: _QPtest_float2uint_rx |
| ! CHECK: %{{.*}} = fir.call @__nv_float2uint_rd(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32 |
| ! CHECK: %{{.*}} = fir.call @__nv_float2uint_rn(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32 |
| ! CHECK: %{{.*}} = fir.call @__nv_float2uint_ru(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32 |
| ! CHECK: %{{.*}} = fir.call @__nv_float2uint_rz(%{{.*}}) proc_attrs<bind_c> fastmath<contract> : (f32) -> i32 |