xref: /freebsd-src/contrib/llvm-project/clang/lib/Headers/__clang_hip_libdevice_declares.h (revision 8a4dda33d67586ca2624f2a38417baa03a533a7f)
15ffd83dbSDimitry Andric /*===---- __clang_hip_libdevice_declares.h - HIP device library decls -------===
25ffd83dbSDimitry Andric  *
35ffd83dbSDimitry Andric  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
45ffd83dbSDimitry Andric  * See https://llvm.org/LICENSE.txt for license information.
55ffd83dbSDimitry Andric  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65ffd83dbSDimitry Andric  *
75ffd83dbSDimitry Andric  *===-----------------------------------------------------------------------===
85ffd83dbSDimitry Andric  */
95ffd83dbSDimitry Andric 
105ffd83dbSDimitry Andric #ifndef __CLANG_HIP_LIBDEVICE_DECLARES_H__
115ffd83dbSDimitry Andric #define __CLANG_HIP_LIBDEVICE_DECLARES_H__
125ffd83dbSDimitry Andric 
1306c3fb27SDimitry Andric #if !defined(__HIPCC_RTC__) && __has_include("hip/hip_version.h")
1406c3fb27SDimitry Andric #include "hip/hip_version.h"
1506c3fb27SDimitry Andric #endif // __has_include("hip/hip_version.h")
1606c3fb27SDimitry Andric 
17e8d8bef9SDimitry Andric #ifdef __cplusplus
185ffd83dbSDimitry Andric extern "C" {
19e8d8bef9SDimitry Andric #endif
205ffd83dbSDimitry Andric 
215ffd83dbSDimitry Andric // BEGIN FLOAT
225ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_acos_f32(float);
235ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_acosh_f32(float);
245ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_asin_f32(float);
255ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_asinh_f32(float);
265ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_atan2_f32(float, float);
275ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_atan_f32(float);
285ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_atanh_f32(float);
295ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_cbrt_f32(float);
305ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_ceil_f32(float);
315ffd83dbSDimitry Andric __device__ __attribute__((const)) __device__ float __ocml_copysign_f32(float,
325ffd83dbSDimitry Andric                                                                        float);
335ffd83dbSDimitry Andric __device__ float __ocml_cos_f32(float);
345ffd83dbSDimitry Andric __device__ float __ocml_native_cos_f32(float);
355ffd83dbSDimitry Andric __device__ __attribute__((pure)) __device__ float __ocml_cosh_f32(float);
365ffd83dbSDimitry Andric __device__ float __ocml_cospi_f32(float);
375ffd83dbSDimitry Andric __device__ float __ocml_i0_f32(float);
385ffd83dbSDimitry Andric __device__ float __ocml_i1_f32(float);
395ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_erfc_f32(float);
405ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_erfcinv_f32(float);
415ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_erfcx_f32(float);
425ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_erf_f32(float);
435ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_erfinv_f32(float);
445ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_exp10_f32(float);
455ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_native_exp10_f32(float);
465ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_exp2_f32(float);
475ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_exp_f32(float);
485ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_native_exp_f32(float);
495ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_expm1_f32(float);
505ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_fabs_f32(float);
515ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_fdim_f32(float, float);
525ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_floor_f32(float);
535ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_fma_f32(float, float, float);
545ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_fmax_f32(float, float);
555ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_fmin_f32(float, float);
565ffd83dbSDimitry Andric __device__ __attribute__((const)) __device__ float __ocml_fmod_f32(float,
575ffd83dbSDimitry Andric                                                                    float);
585ffd83dbSDimitry Andric __device__ float __ocml_frexp_f32(float,
595ffd83dbSDimitry Andric                                   __attribute__((address_space(5))) int *);
605ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_hypot_f32(float, float);
615ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_ilogb_f32(float);
625ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_isfinite_f32(float);
635ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_isinf_f32(float);
645ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_isnan_f32(float);
655ffd83dbSDimitry Andric __device__ float __ocml_j0_f32(float);
665ffd83dbSDimitry Andric __device__ float __ocml_j1_f32(float);
675ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_ldexp_f32(float, int);
685ffd83dbSDimitry Andric __device__ float __ocml_lgamma_f32(float);
695ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_log10_f32(float);
705ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_native_log10_f32(float);
715ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_log1p_f32(float);
725ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_log2_f32(float);
735ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_native_log2_f32(float);
745ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_logb_f32(float);
755ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_log_f32(float);
765ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_native_log_f32(float);
775ffd83dbSDimitry Andric __device__ float __ocml_modf_f32(float,
785ffd83dbSDimitry Andric                                  __attribute__((address_space(5))) float *);
795ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_nearbyint_f32(float);
805ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_nextafter_f32(float, float);
815ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_len3_f32(float, float, float);
825ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_len4_f32(float, float, float,
835ffd83dbSDimitry Andric                                                         float);
845ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_ncdf_f32(float);
855ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_ncdfinv_f32(float);
865ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_pow_f32(float, float);
87e8d8bef9SDimitry Andric __device__ __attribute__((pure)) float __ocml_pown_f32(float, int);
885ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_rcbrt_f32(float);
895ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_remainder_f32(float, float);
905ffd83dbSDimitry Andric __device__ float __ocml_remquo_f32(float, float,
915ffd83dbSDimitry Andric                                    __attribute__((address_space(5))) int *);
925ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_rhypot_f32(float, float);
935ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_rint_f32(float);
945ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_rlen3_f32(float, float, float);
955ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_rlen4_f32(float, float, float,
965ffd83dbSDimitry Andric                                                          float);
975ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_round_f32(float);
985ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_rsqrt_f32(float);
995ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_scalb_f32(float, float);
1005ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_scalbn_f32(float, int);
1015ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_signbit_f32(float);
1025ffd83dbSDimitry Andric __device__ float __ocml_sincos_f32(float,
1035ffd83dbSDimitry Andric                                    __attribute__((address_space(5))) float *);
1045ffd83dbSDimitry Andric __device__ float __ocml_sincospi_f32(float,
1055ffd83dbSDimitry Andric                                      __attribute__((address_space(5))) float *);
1065ffd83dbSDimitry Andric __device__ float __ocml_sin_f32(float);
1075ffd83dbSDimitry Andric __device__ float __ocml_native_sin_f32(float);
1085ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_sinh_f32(float);
1095ffd83dbSDimitry Andric __device__ float __ocml_sinpi_f32(float);
1105ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_sqrt_f32(float);
1115ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_native_sqrt_f32(float);
1125ffd83dbSDimitry Andric __device__ float __ocml_tan_f32(float);
1135ffd83dbSDimitry Andric __device__ __attribute__((pure)) float __ocml_tanh_f32(float);
1145ffd83dbSDimitry Andric __device__ float __ocml_tgamma_f32(float);
1155ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_trunc_f32(float);
1165ffd83dbSDimitry Andric __device__ float __ocml_y0_f32(float);
1175ffd83dbSDimitry Andric __device__ float __ocml_y1_f32(float);
1185ffd83dbSDimitry Andric 
1195ffd83dbSDimitry Andric // BEGIN INTRINSICS
1205ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_add_rte_f32(float, float);
1215ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_add_rtn_f32(float, float);
1225ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_add_rtp_f32(float, float);
1235ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_add_rtz_f32(float, float);
1245ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_sub_rte_f32(float, float);
1255ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_sub_rtn_f32(float, float);
1265ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_sub_rtp_f32(float, float);
1275ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_sub_rtz_f32(float, float);
1285ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_mul_rte_f32(float, float);
1295ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_mul_rtn_f32(float, float);
1305ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_mul_rtp_f32(float, float);
1315ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_mul_rtz_f32(float, float);
1325ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_div_rte_f32(float, float);
1335ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_div_rtn_f32(float, float);
1345ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_div_rtp_f32(float, float);
1355ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_div_rtz_f32(float, float);
136e8d8bef9SDimitry Andric __device__ __attribute__((const)) float __ocml_sqrt_rte_f32(float);
137e8d8bef9SDimitry Andric __device__ __attribute__((const)) float __ocml_sqrt_rtn_f32(float);
138e8d8bef9SDimitry Andric __device__ __attribute__((const)) float __ocml_sqrt_rtp_f32(float);
139e8d8bef9SDimitry Andric __device__ __attribute__((const)) float __ocml_sqrt_rtz_f32(float);
1405ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_fma_rte_f32(float, float, float);
1415ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_fma_rtn_f32(float, float, float);
1425ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_fma_rtp_f32(float, float, float);
1435ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ocml_fma_rtz_f32(float, float, float);
1445ffd83dbSDimitry Andric // END INTRINSICS
1455ffd83dbSDimitry Andric // END FLOAT
1465ffd83dbSDimitry Andric 
1475ffd83dbSDimitry Andric // BEGIN DOUBLE
1485ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_acos_f64(double);
1495ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_acosh_f64(double);
1505ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_asin_f64(double);
1515ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_asinh_f64(double);
1525ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_atan2_f64(double, double);
1535ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_atan_f64(double);
1545ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_atanh_f64(double);
1555ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_cbrt_f64(double);
1565ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_ceil_f64(double);
1575ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_copysign_f64(double, double);
1585ffd83dbSDimitry Andric __device__ double __ocml_cos_f64(double);
1595ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_cosh_f64(double);
1605ffd83dbSDimitry Andric __device__ double __ocml_cospi_f64(double);
1615ffd83dbSDimitry Andric __device__ double __ocml_i0_f64(double);
1625ffd83dbSDimitry Andric __device__ double __ocml_i1_f64(double);
1635ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_erfc_f64(double);
1645ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_erfcinv_f64(double);
1655ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_erfcx_f64(double);
1665ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_erf_f64(double);
1675ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_erfinv_f64(double);
1685ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_exp10_f64(double);
1695ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_exp2_f64(double);
1705ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_exp_f64(double);
1715ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_expm1_f64(double);
1725ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_fabs_f64(double);
1735ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_fdim_f64(double, double);
1745ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_floor_f64(double);
1755ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_fma_f64(double, double, double);
1765ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_fmax_f64(double, double);
1775ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_fmin_f64(double, double);
1785ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_fmod_f64(double, double);
1795ffd83dbSDimitry Andric __device__ double __ocml_frexp_f64(double,
1805ffd83dbSDimitry Andric                                    __attribute__((address_space(5))) int *);
1815ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_hypot_f64(double, double);
1825ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_ilogb_f64(double);
1835ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_isfinite_f64(double);
1845ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_isinf_f64(double);
1855ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_isnan_f64(double);
1865ffd83dbSDimitry Andric __device__ double __ocml_j0_f64(double);
1875ffd83dbSDimitry Andric __device__ double __ocml_j1_f64(double);
1885ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_ldexp_f64(double, int);
1895ffd83dbSDimitry Andric __device__ double __ocml_lgamma_f64(double);
1905ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_log10_f64(double);
1915ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_log1p_f64(double);
1925ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_log2_f64(double);
1935ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_logb_f64(double);
1945ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_log_f64(double);
1955ffd83dbSDimitry Andric __device__ double __ocml_modf_f64(double,
1965ffd83dbSDimitry Andric                                   __attribute__((address_space(5))) double *);
1975ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_nearbyint_f64(double);
1985ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_nextafter_f64(double, double);
1995ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_len3_f64(double, double,
2005ffd83dbSDimitry Andric                                                          double);
2015ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_len4_f64(double, double, double,
2025ffd83dbSDimitry Andric                                                          double);
2035ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_ncdf_f64(double);
2045ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_ncdfinv_f64(double);
2055ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_pow_f64(double, double);
206e8d8bef9SDimitry Andric __device__ __attribute__((pure)) double __ocml_pown_f64(double, int);
2075ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_rcbrt_f64(double);
2085ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_remainder_f64(double, double);
2095ffd83dbSDimitry Andric __device__ double __ocml_remquo_f64(double, double,
2105ffd83dbSDimitry Andric                                     __attribute__((address_space(5))) int *);
2115ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_rhypot_f64(double, double);
2125ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_rint_f64(double);
2135ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_rlen3_f64(double, double,
2145ffd83dbSDimitry Andric                                                           double);
2155ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_rlen4_f64(double, double,
2165ffd83dbSDimitry Andric                                                           double, double);
2175ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_round_f64(double);
2185ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_rsqrt_f64(double);
2195ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_scalb_f64(double, double);
2205ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_scalbn_f64(double, int);
2215ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_signbit_f64(double);
2225ffd83dbSDimitry Andric __device__ double __ocml_sincos_f64(double,
2235ffd83dbSDimitry Andric                                     __attribute__((address_space(5))) double *);
2245ffd83dbSDimitry Andric __device__ double
2255ffd83dbSDimitry Andric __ocml_sincospi_f64(double, __attribute__((address_space(5))) double *);
2265ffd83dbSDimitry Andric __device__ double __ocml_sin_f64(double);
2275ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_sinh_f64(double);
2285ffd83dbSDimitry Andric __device__ double __ocml_sinpi_f64(double);
2295ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_sqrt_f64(double);
2305ffd83dbSDimitry Andric __device__ double __ocml_tan_f64(double);
2315ffd83dbSDimitry Andric __device__ __attribute__((pure)) double __ocml_tanh_f64(double);
2325ffd83dbSDimitry Andric __device__ double __ocml_tgamma_f64(double);
2335ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_trunc_f64(double);
2345ffd83dbSDimitry Andric __device__ double __ocml_y0_f64(double);
2355ffd83dbSDimitry Andric __device__ double __ocml_y1_f64(double);
2365ffd83dbSDimitry Andric 
2375ffd83dbSDimitry Andric // BEGIN INTRINSICS
2385ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_add_rte_f64(double, double);
2395ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_add_rtn_f64(double, double);
2405ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_add_rtp_f64(double, double);
2415ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_add_rtz_f64(double, double);
2425ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_sub_rte_f64(double, double);
2435ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_sub_rtn_f64(double, double);
2445ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_sub_rtp_f64(double, double);
2455ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_sub_rtz_f64(double, double);
2465ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_mul_rte_f64(double, double);
2475ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_mul_rtn_f64(double, double);
2485ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_mul_rtp_f64(double, double);
2495ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_mul_rtz_f64(double, double);
2505ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_div_rte_f64(double, double);
2515ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_div_rtn_f64(double, double);
2525ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_div_rtp_f64(double, double);
2535ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_div_rtz_f64(double, double);
254e8d8bef9SDimitry Andric __device__ __attribute__((const)) double __ocml_sqrt_rte_f64(double);
255e8d8bef9SDimitry Andric __device__ __attribute__((const)) double __ocml_sqrt_rtn_f64(double);
256e8d8bef9SDimitry Andric __device__ __attribute__((const)) double __ocml_sqrt_rtp_f64(double);
257e8d8bef9SDimitry Andric __device__ __attribute__((const)) double __ocml_sqrt_rtz_f64(double);
2585ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_fma_rte_f64(double, double,
2595ffd83dbSDimitry Andric                                                             double);
2605ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_fma_rtn_f64(double, double,
2615ffd83dbSDimitry Andric                                                             double);
2625ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_fma_rtp_f64(double, double,
2635ffd83dbSDimitry Andric                                                             double);
2645ffd83dbSDimitry Andric __device__ __attribute__((const)) double __ocml_fma_rtz_f64(double, double,
2655ffd83dbSDimitry Andric                                                             double);
2665ffd83dbSDimitry Andric 
2675ffd83dbSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_ceil_f16(_Float16);
2685ffd83dbSDimitry Andric __device__ _Float16 __ocml_cos_f16(_Float16);
269bdd1243dSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_cvtrtn_f16_f32(float);
270bdd1243dSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_cvtrtp_f16_f32(float);
271bdd1243dSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_cvtrtz_f16_f32(float);
2725ffd83dbSDimitry Andric __device__ __attribute__((pure)) _Float16 __ocml_exp_f16(_Float16);
2735ffd83dbSDimitry Andric __device__ __attribute__((pure)) _Float16 __ocml_exp10_f16(_Float16);
2745ffd83dbSDimitry Andric __device__ __attribute__((pure)) _Float16 __ocml_exp2_f16(_Float16);
2755ffd83dbSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_floor_f16(_Float16);
2765ffd83dbSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_fma_f16(_Float16, _Float16,
2775ffd83dbSDimitry Andric                                                           _Float16);
278bdd1243dSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_fmax_f16(_Float16, _Float16);
279bdd1243dSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_fmin_f16(_Float16, _Float16);
2805ffd83dbSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_fabs_f16(_Float16);
2815ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_isinf_f16(_Float16);
2825ffd83dbSDimitry Andric __device__ __attribute__((const)) int __ocml_isnan_f16(_Float16);
2835ffd83dbSDimitry Andric __device__ __attribute__((pure)) _Float16 __ocml_log_f16(_Float16);
2845ffd83dbSDimitry Andric __device__ __attribute__((pure)) _Float16 __ocml_log10_f16(_Float16);
2855ffd83dbSDimitry Andric __device__ __attribute__((pure)) _Float16 __ocml_log2_f16(_Float16);
2865ffd83dbSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_rint_f16(_Float16);
2875ffd83dbSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_rsqrt_f16(_Float16);
2885ffd83dbSDimitry Andric __device__ _Float16 __ocml_sin_f16(_Float16);
2895ffd83dbSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_sqrt_f16(_Float16);
2905ffd83dbSDimitry Andric __device__ __attribute__((const)) _Float16 __ocml_trunc_f16(_Float16);
291e8d8bef9SDimitry Andric __device__ __attribute__((pure)) _Float16 __ocml_pown_f16(_Float16, int);
2925ffd83dbSDimitry Andric 
2935ffd83dbSDimitry Andric typedef _Float16 __2f16 __attribute__((ext_vector_type(2)));
2945ffd83dbSDimitry Andric typedef short __2i16 __attribute__((ext_vector_type(2)));
2955ffd83dbSDimitry Andric 
29606c3fb27SDimitry Andric // We need to match C99's bool and get an i1 in the IR.
29706c3fb27SDimitry Andric #ifdef __cplusplus
29806c3fb27SDimitry Andric typedef bool __ockl_bool;
29906c3fb27SDimitry Andric #else
30006c3fb27SDimitry Andric typedef _Bool __ockl_bool;
30106c3fb27SDimitry Andric #endif
30206c3fb27SDimitry Andric 
3035ffd83dbSDimitry Andric __device__ __attribute__((const)) float __ockl_fdot2(__2f16 a, __2f16 b,
30406c3fb27SDimitry Andric                                                      float c, __ockl_bool s);
3055ffd83dbSDimitry Andric __device__ __attribute__((const)) __2f16 __ocml_ceil_2f16(__2f16);
3065ffd83dbSDimitry Andric __device__ __attribute__((const)) __2f16 __ocml_fabs_2f16(__2f16);
3075ffd83dbSDimitry Andric __device__ __2f16 __ocml_cos_2f16(__2f16);
3085ffd83dbSDimitry Andric __device__ __attribute__((pure)) __2f16 __ocml_exp_2f16(__2f16);
3095ffd83dbSDimitry Andric __device__ __attribute__((pure)) __2f16 __ocml_exp10_2f16(__2f16);
3105ffd83dbSDimitry Andric __device__ __attribute__((pure)) __2f16 __ocml_exp2_2f16(__2f16);
3115ffd83dbSDimitry Andric __device__ __attribute__((const)) __2f16 __ocml_floor_2f16(__2f16);
3125ffd83dbSDimitry Andric __device__ __attribute__((const))
3135ffd83dbSDimitry Andric __2f16 __ocml_fma_2f16(__2f16, __2f16, __2f16);
3145ffd83dbSDimitry Andric __device__ __attribute__((const)) __2i16 __ocml_isinf_2f16(__2f16);
3155ffd83dbSDimitry Andric __device__ __attribute__((const)) __2i16 __ocml_isnan_2f16(__2f16);
3165ffd83dbSDimitry Andric __device__ __attribute__((pure)) __2f16 __ocml_log_2f16(__2f16);
3175ffd83dbSDimitry Andric __device__ __attribute__((pure)) __2f16 __ocml_log10_2f16(__2f16);
3185ffd83dbSDimitry Andric __device__ __attribute__((pure)) __2f16 __ocml_log2_2f16(__2f16);
31906c3fb27SDimitry Andric 
320*8a4dda33SDimitry Andric #if HIP_VERSION_MAJOR * 100 + HIP_VERSION_MINOR >= 560
32106c3fb27SDimitry Andric #define __DEPRECATED_SINCE_HIP_560(X) __attribute__((deprecated(X)))
32206c3fb27SDimitry Andric #else
32306c3fb27SDimitry Andric #define __DEPRECATED_SINCE_HIP_560(X)
32406c3fb27SDimitry Andric #endif
32506c3fb27SDimitry Andric 
32606c3fb27SDimitry Andric // Deprecated, should be removed when rocm releases using it are no longer
32706c3fb27SDimitry Andric // relevant.
32806c3fb27SDimitry Andric __DEPRECATED_SINCE_HIP_560("use ((_Float16)1.0) / ")
__llvm_amdgcn_rcp_f16(_Float16 x)32906c3fb27SDimitry Andric __device__ inline _Float16 __llvm_amdgcn_rcp_f16(_Float16 x) {
33006c3fb27SDimitry Andric   return ((_Float16)1.0f) / x;
3315ffd83dbSDimitry Andric }
33206c3fb27SDimitry Andric 
33306c3fb27SDimitry Andric __DEPRECATED_SINCE_HIP_560("use ((__2f16)1.0) / ")
33406c3fb27SDimitry Andric __device__ inline __2f16
__llvm_amdgcn_rcp_2f16(__2f16 __x)33506c3fb27SDimitry Andric __llvm_amdgcn_rcp_2f16(__2f16 __x)
33606c3fb27SDimitry Andric {
33706c3fb27SDimitry Andric   return ((__2f16)1.0f) / __x;
33806c3fb27SDimitry Andric }
33906c3fb27SDimitry Andric 
34006c3fb27SDimitry Andric #undef __DEPRECATED_SINCE_HIP_560
34106c3fb27SDimitry Andric 
3425ffd83dbSDimitry Andric __device__ __attribute__((const)) __2f16 __ocml_rint_2f16(__2f16);
3435ffd83dbSDimitry Andric __device__ __attribute__((const)) __2f16 __ocml_rsqrt_2f16(__2f16);
3445ffd83dbSDimitry Andric __device__ __2f16 __ocml_sin_2f16(__2f16);
3455ffd83dbSDimitry Andric __device__ __attribute__((const)) __2f16 __ocml_sqrt_2f16(__2f16);
3465ffd83dbSDimitry Andric __device__ __attribute__((const)) __2f16 __ocml_trunc_2f16(__2f16);
347e8d8bef9SDimitry Andric __device__ __attribute__((const)) __2f16 __ocml_pown_2f16(__2f16, __2i16);
3485ffd83dbSDimitry Andric 
349e8d8bef9SDimitry Andric #ifdef __cplusplus
3505ffd83dbSDimitry Andric } // extern "C"
351e8d8bef9SDimitry Andric #endif
3525ffd83dbSDimitry Andric 
3535ffd83dbSDimitry Andric #endif // __CLANG_HIP_LIBDEVICE_DECLARES_H__
354