HIP: Heterogenous-computing Interface for Portability
Loading...
Searching...
No Matches
math_fwd.h
1/*
2Copyright (c) 2015 - 2023 Advanced Micro Devices, Inc. All rights reserved.
3
4Permission is hereby granted, free of charge, to any person obtaining a copy
5of this software and associated documentation files (the "Software"), to deal
6in the Software without restriction, including without limitation the rights
7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8copies of the Software, and to permit persons to whom the Software is
9furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20THE SOFTWARE.
21*/
22
23#pragma once
24
25#if !defined(__HIPCC_RTC__)
26#include "host_defines.h"
27#include "amd_hip_vector_types.h" // For Native_vec_
28#endif
29
30#if defined(__cplusplus)
31 extern "C" {
32#endif
33
34// DOT FUNCTIONS
35#if defined(__clang__) && defined(__HIP__)
36__device__
37__attribute__((const))
38int __ockl_sdot2(
39 HIP_vector_base<short, 2>::Native_vec_,
40 HIP_vector_base<short, 2>::Native_vec_,
41 int, bool);
42
43__device__
44__attribute__((const))
45unsigned int __ockl_udot2(
46 HIP_vector_base<unsigned short, 2>::Native_vec_,
47 HIP_vector_base<unsigned short, 2>::Native_vec_,
48 unsigned int, bool);
49
50__device__
51__attribute__((const))
52int __ockl_sdot4(
53 HIP_vector_base<char, 4>::Native_vec_,
54 HIP_vector_base<char, 4>::Native_vec_,
55 int, bool);
56
57__device__
58__attribute__((const))
59unsigned int __ockl_udot4(
60 HIP_vector_base<unsigned char, 4>::Native_vec_,
61 HIP_vector_base<unsigned char, 4>::Native_vec_,
62 unsigned int, bool);
63
64__device__
65__attribute__((const))
66int __ockl_sdot8(int, int, int, bool);
67
68__device__
69__attribute__((const))
70unsigned int __ockl_udot8(unsigned int, unsigned int, unsigned int, bool);
71#endif
72
73#if !__CLANG_HIP_RUNTIME_WRAPPER_INCLUDED__
74// BEGIN FLOAT
75__device__
76__attribute__((const))
77float __ocml_acos_f32(float);
78__device__
79__attribute__((pure))
80float __ocml_acosh_f32(float);
81__device__
82__attribute__((const))
83float __ocml_asin_f32(float);
84__device__
85__attribute__((pure))
86float __ocml_asinh_f32(float);
87__device__
88__attribute__((const))
89float __ocml_atan2_f32(float, float);
90__device__
91__attribute__((const))
92float __ocml_atan_f32(float);
93__device__
94__attribute__((pure))
95float __ocml_atanh_f32(float);
96__device__
97__attribute__((pure))
98float __ocml_cbrt_f32(float);
99__device__
100__attribute__((const))
101float __ocml_ceil_f32(float);
102__device__
103__attribute__((const))
104__device__
105float __ocml_copysign_f32(float, float);
106__device__
107float __ocml_cos_f32(float);
108__device__
109float __ocml_native_cos_f32(float);
110__device__
111__attribute__((pure))
112__device__
113float __ocml_cosh_f32(float);
114__device__
115float __ocml_cospi_f32(float);
116__device__
117float __ocml_i0_f32(float);
118__device__
119float __ocml_i1_f32(float);
120__device__
121__attribute__((pure))
122float __ocml_erfc_f32(float);
123__device__
124__attribute__((pure))
125float __ocml_erfcinv_f32(float);
126__device__
127__attribute__((pure))
128float __ocml_erfcx_f32(float);
129__device__
130__attribute__((pure))
131float __ocml_erf_f32(float);
132__device__
133__attribute__((pure))
134float __ocml_erfinv_f32(float);
135__device__
136__attribute__((pure))
137float __ocml_exp10_f32(float);
138__device__
139__attribute__((pure))
140float __ocml_native_exp10_f32(float);
141__device__
142__attribute__((pure))
143float __ocml_exp2_f32(float);
144__device__
145__attribute__((pure))
146float __ocml_exp_f32(float);
147__device__
148__attribute__((pure))
149float __ocml_native_exp_f32(float);
150__device__
151__attribute__((pure))
152float __ocml_expm1_f32(float);
153__device__
154__attribute__((const))
155float __ocml_fabs_f32(float);
156__device__
157__attribute__((const))
158float __ocml_fdim_f32(float, float);
159__device__
160__attribute__((const))
161float __ocml_floor_f32(float);
162__device__
163__attribute__((const))
164float __ocml_fma_f32(float, float, float);
165__device__
166__attribute__((const))
167float __ocml_fmax_f32(float, float);
168__device__
169__attribute__((const))
170float __ocml_fmin_f32(float, float);
171__device__
172__attribute__((const))
173__device__
174float __ocml_fmod_f32(float, float);
175__device__
176float __ocml_frexp_f32(float, __attribute__((address_space(5))) int*);
177__device__
178__attribute__((const))
179float __ocml_hypot_f32(float, float);
180__device__
181__attribute__((const))
182int __ocml_ilogb_f32(float);
183__device__
184__attribute__((const))
185int __ocml_isfinite_f32(float);
186__device__
187__attribute__((const))
188int __ocml_isinf_f32(float);
189__device__
190__attribute__((const))
191int __ocml_isnan_f32(float);
192__device__
193float __ocml_j0_f32(float);
194__device__
195float __ocml_j1_f32(float);
196__device__
197__attribute__((const))
198float __ocml_ldexp_f32(float, int);
199__device__
200float __ocml_lgamma_f32(float);
201__device__
202__attribute__((pure))
203float __ocml_log10_f32(float);
204__device__
205__attribute__((pure))
206float __ocml_native_log10_f32(float);
207__device__
208__attribute__((pure))
209float __ocml_log1p_f32(float);
210__device__
211__attribute__((pure))
212float __ocml_log2_f32(float);
213__device__
214__attribute__((pure))
215float __ocml_native_log2_f32(float);
216__device__
217__attribute__((const))
218float __ocml_logb_f32(float);
219__device__
220__attribute__((pure))
221float __ocml_log_f32(float);
222__device__
223__attribute__((pure))
224float __ocml_native_log_f32(float);
225__device__
226float __ocml_modf_f32(float, __attribute__((address_space(5))) float*);
227__device__
228__attribute__((const))
229float __ocml_nearbyint_f32(float);
230__device__
231__attribute__((const))
232float __ocml_nextafter_f32(float, float);
233__device__
234__attribute__((const))
235float __ocml_len3_f32(float, float, float);
236__device__
237__attribute__((const))
238float __ocml_len4_f32(float, float, float, float);
239__device__
240__attribute__((pure))
241float __ocml_ncdf_f32(float);
242__device__
243__attribute__((pure))
244float __ocml_ncdfinv_f32(float);
245__device__
246__attribute__((pure))
247float __ocml_pow_f32(float, float);
248__device__
249__attribute__((pure))
250float __ocml_pown_f32(float, int);
251__device__
252__attribute__((pure))
253float __ocml_rcbrt_f32(float);
254__device__
255__attribute__((const))
256float __ocml_remainder_f32(float, float);
257__device__
258float __ocml_remquo_f32(float, float, __attribute__((address_space(5))) int*);
259__device__
260__attribute__((const))
261float __ocml_rhypot_f32(float, float);
262__device__
263__attribute__((const))
264float __ocml_rint_f32(float);
265__device__
266__attribute__((const))
267float __ocml_rlen3_f32(float, float, float);
268__device__
269__attribute__((const))
270float __ocml_rlen4_f32(float, float, float, float);
271__device__
272__attribute__((const))
273float __ocml_round_f32(float);
274__device__
275__attribute__((pure))
276float __ocml_rsqrt_f32(float);
277__device__
278__attribute__((const))
279float __ocml_scalb_f32(float, float);
280__device__
281__attribute__((const))
282float __ocml_scalbn_f32(float, int);
283__device__
284__attribute__((const))
285int __ocml_signbit_f32(float);
286__device__
287float __ocml_sincos_f32(float, __attribute__((address_space(5))) float*);
288__device__
289float __ocml_sincospi_f32(float, __attribute__((address_space(5))) float*);
290__device__
291float __ocml_sin_f32(float);
292__device__
293float __ocml_native_sin_f32(float);
294__device__
295__attribute__((pure))
296float __ocml_sinh_f32(float);
297__device__
298float __ocml_sinpi_f32(float);
299__device__
300__attribute__((const))
301float __ocml_sqrt_f32(float);
302__device__
303__attribute__((const))
304float __ocml_native_sqrt_f32(float);
305__device__
306float __ocml_tan_f32(float);
307__device__
308__attribute__((pure))
309float __ocml_tanh_f32(float);
310__device__
311float __ocml_tgamma_f32(float);
312__device__
313__attribute__((const))
314float __ocml_trunc_f32(float);
315__device__
316float __ocml_y0_f32(float);
317__device__
318float __ocml_y1_f32(float);
319
320// BEGIN INTRINSICS
321__device__
322__attribute__((const))
323float __ocml_add_rte_f32(float, float);
324__device__
325__attribute__((const))
326float __ocml_add_rtn_f32(float, float);
327__device__
328__attribute__((const))
329float __ocml_add_rtp_f32(float, float);
330__device__
331__attribute__((const))
332float __ocml_add_rtz_f32(float, float);
333__device__
334__attribute__((const))
335float __ocml_sub_rte_f32(float, float);
336__device__
337__attribute__((const))
338float __ocml_sub_rtn_f32(float, float);
339__device__
340__attribute__((const))
341float __ocml_sub_rtp_f32(float, float);
342__device__
343__attribute__((const))
344float __ocml_sub_rtz_f32(float, float);
345__device__
346__attribute__((const))
347float __ocml_mul_rte_f32(float, float);
348__device__
349__attribute__((const))
350float __ocml_mul_rtn_f32(float, float);
351__device__
352__attribute__((const))
353float __ocml_mul_rtp_f32(float, float);
354__device__
355__attribute__((const))
356float __ocml_mul_rtz_f32(float, float);
357__device__
358__attribute__((const))
359float __ocml_div_rte_f32(float, float);
360__device__
361__attribute__((const))
362float __ocml_div_rtn_f32(float, float);
363__device__
364__attribute__((const))
365float __ocml_div_rtp_f32(float, float);
366__device__
367__attribute__((const))
368float __ocml_div_rtz_f32(float, float);
369__device__
370__attribute__((const))
371float __ocml_sqrt_rte_f32(float);
372__device__
373__attribute__((const))
374float __ocml_sqrt_rtn_f32(float);
375__device__
376__attribute__((const))
377float __ocml_sqrt_rtp_f32(float);
378__device__
379__attribute__((const))
380float __ocml_sqrt_rtz_f32(float);
381__device__
382__attribute__((const))
383float __ocml_fma_rte_f32(float, float, float);
384__device__
385__attribute__((const))
386float __ocml_fma_rtn_f32(float, float, float);
387__device__
388__attribute__((const))
389float __ocml_fma_rtp_f32(float, float, float);
390__device__
391__attribute__((const))
392float __ocml_fma_rtz_f32(float, float, float);
393// END INTRINSICS
394// END FLOAT
395
396// BEGIN DOUBLE
397__device__
398__attribute__((const))
399double __ocml_acos_f64(double);
400__device__
401__attribute__((pure))
402double __ocml_acosh_f64(double);
403__device__
404__attribute__((const))
405double __ocml_asin_f64(double);
406__device__
407__attribute__((pure))
408double __ocml_asinh_f64(double);
409__device__
410__attribute__((const))
411double __ocml_atan2_f64(double, double);
412__device__
413__attribute__((const))
414double __ocml_atan_f64(double);
415__device__
416__attribute__((pure))
417double __ocml_atanh_f64(double);
418__device__
419__attribute__((pure))
420double __ocml_cbrt_f64(double);
421__device__
422__attribute__((const))
423double __ocml_ceil_f64(double);
424__device__
425__attribute__((const))
426double __ocml_copysign_f64(double, double);
427__device__
428double __ocml_cos_f64(double);
429__device__
430__attribute__((pure))
431double __ocml_cosh_f64(double);
432__device__
433double __ocml_cospi_f64(double);
434__device__
435double __ocml_i0_f64(double);
436__device__
437double __ocml_i1_f64(double);
438__device__
439__attribute__((pure))
440double __ocml_erfc_f64(double);
441__device__
442__attribute__((pure))
443double __ocml_erfcinv_f64(double);
444__device__
445__attribute__((pure))
446double __ocml_erfcx_f64(double);
447__device__
448__attribute__((pure))
449double __ocml_erf_f64(double);
450__device__
451__attribute__((pure))
452double __ocml_erfinv_f64(double);
453__device__
454__attribute__((pure))
455double __ocml_exp10_f64(double);
456__device__
457__attribute__((pure))
458double __ocml_exp2_f64(double);
459__device__
460__attribute__((pure))
461double __ocml_exp_f64(double);
462__device__
463__attribute__((pure))
464double __ocml_expm1_f64(double);
465__device__
466__attribute__((const))
467double __ocml_fabs_f64(double);
468__device__
469__attribute__((const))
470double __ocml_fdim_f64(double, double);
471__device__
472__attribute__((const))
473double __ocml_floor_f64(double);
474__device__
475__attribute__((const))
476double __ocml_fma_f64(double, double, double);
477__device__
478__attribute__((const))
479double __ocml_fmax_f64(double, double);
480__device__
481__attribute__((const))
482double __ocml_fmin_f64(double, double);
483__device__
484__attribute__((const))
485double __ocml_fmod_f64(double, double);
486__device__
487double __ocml_frexp_f64(double, __attribute__((address_space(5))) int*);
488__device__
489__attribute__((const))
490double __ocml_hypot_f64(double, double);
491__device__
492__attribute__((const))
493int __ocml_ilogb_f64(double);
494__device__
495__attribute__((const))
496int __ocml_isfinite_f64(double);
497__device__
498__attribute__((const))
499int __ocml_isinf_f64(double);
500__device__
501__attribute__((const))
502int __ocml_isnan_f64(double);
503__device__
504double __ocml_j0_f64(double);
505__device__
506double __ocml_j1_f64(double);
507__device__
508__attribute__((const))
509double __ocml_ldexp_f64(double, int);
510__device__
511double __ocml_lgamma_f64(double);
512__device__
513__attribute__((pure))
514double __ocml_log10_f64(double);
515__device__
516__attribute__((pure))
517double __ocml_log1p_f64(double);
518__device__
519__attribute__((pure))
520double __ocml_log2_f64(double);
521__device__
522__attribute__((const))
523double __ocml_logb_f64(double);
524__device__
525__attribute__((pure))
526double __ocml_log_f64(double);
527__device__
528double __ocml_modf_f64(double, __attribute__((address_space(5))) double*);
529__device__
530__attribute__((const))
531double __ocml_nearbyint_f64(double);
532__device__
533__attribute__((const))
534double __ocml_nextafter_f64(double, double);
535__device__
536__attribute__((const))
537double __ocml_len3_f64(double, double, double);
538__device__
539__attribute__((const))
540double __ocml_len4_f64(double, double, double, double);
541__device__
542__attribute__((pure))
543double __ocml_ncdf_f64(double);
544__device__
545__attribute__((pure))
546double __ocml_ncdfinv_f64(double);
547__device__
548__attribute__((pure))
549double __ocml_pow_f64(double, double);
550__device__
551__attribute__((pure))
552double __ocml_pown_f64(double, int);
553__device__
554__attribute__((pure))
555double __ocml_rcbrt_f64(double);
556__device__
557__attribute__((const))
558double __ocml_remainder_f64(double, double);
559__device__
560double __ocml_remquo_f64(
561 double, double, __attribute__((address_space(5))) int*);
562__device__
563__attribute__((const))
564double __ocml_rhypot_f64(double, double);
565__device__
566__attribute__((const))
567double __ocml_rint_f64(double);
568__device__
569__attribute__((const))
570double __ocml_rlen3_f64(double, double, double);
571__device__
572__attribute__((const))
573double __ocml_rlen4_f64(double, double, double, double);
574__device__
575__attribute__((const))
576double __ocml_round_f64(double);
577__device__
578__attribute__((pure))
579double __ocml_rsqrt_f64(double);
580__device__
581__attribute__((const))
582double __ocml_scalb_f64(double, double);
583__device__
584__attribute__((const))
585double __ocml_scalbn_f64(double, int);
586__device__
587__attribute__((const))
588int __ocml_signbit_f64(double);
589__device__
590double __ocml_sincos_f64(double, __attribute__((address_space(5))) double*);
591__device__
592double __ocml_sincospi_f64(double, __attribute__((address_space(5))) double*);
593__device__
594double __ocml_sin_f64(double);
595__device__
596__attribute__((pure))
597double __ocml_sinh_f64(double);
598__device__
599double __ocml_sinpi_f64(double);
600__device__
601__attribute__((const))
602double __ocml_sqrt_f64(double);
603__device__
604double __ocml_tan_f64(double);
605__device__
606__attribute__((pure))
607double __ocml_tanh_f64(double);
608__device__
609double __ocml_tgamma_f64(double);
610__device__
611__attribute__((const))
612double __ocml_trunc_f64(double);
613__device__
614double __ocml_y0_f64(double);
615__device__
616double __ocml_y1_f64(double);
617
618// BEGIN INTRINSICS
619__device__
620__attribute__((const))
621double __ocml_add_rte_f64(double, double);
622__device__
623__attribute__((const))
624double __ocml_add_rtn_f64(double, double);
625__device__
626__attribute__((const))
627double __ocml_add_rtp_f64(double, double);
628__device__
629__attribute__((const))
630double __ocml_add_rtz_f64(double, double);
631__device__
632__attribute__((const))
633double __ocml_sub_rte_f64(double, double);
634__device__
635__attribute__((const))
636double __ocml_sub_rtn_f64(double, double);
637__device__
638__attribute__((const))
639double __ocml_sub_rtp_f64(double, double);
640__device__
641__attribute__((const))
642double __ocml_sub_rtz_f64(double, double);
643__device__
644__attribute__((const))
645double __ocml_mul_rte_f64(double, double);
646__device__
647__attribute__((const))
648double __ocml_mul_rtn_f64(double, double);
649__device__
650__attribute__((const))
651double __ocml_mul_rtp_f64(double, double);
652__device__
653__attribute__((const))
654double __ocml_mul_rtz_f64(double, double);
655__device__
656__attribute__((const))
657double __ocml_div_rte_f64(double, double);
658__device__
659__attribute__((const))
660double __ocml_div_rtn_f64(double, double);
661__device__
662__attribute__((const))
663double __ocml_div_rtp_f64(double, double);
664__device__
665__attribute__((const))
666double __ocml_div_rtz_f64(double, double);
667__device__
668__attribute__((const))
669double __ocml_sqrt_rte_f64(double);
670__device__
671__attribute__((const))
672double __ocml_sqrt_rtn_f64(double);
673__device__
674__attribute__((const))
675double __ocml_sqrt_rtp_f64(double);
676__device__
677__attribute__((const))
678double __ocml_sqrt_rtz_f64(double);
679__device__
680__attribute__((const))
681double __ocml_fma_rte_f64(double, double, double);
682__device__
683__attribute__((const))
684double __ocml_fma_rtn_f64(double, double, double);
685__device__
686__attribute__((const))
687double __ocml_fma_rtp_f64(double, double, double);
688__device__
689__attribute__((const))
690double __ocml_fma_rtz_f64(double, double, double);
691// END INTRINSICS
692// END DOUBLE
693
694#endif // !__CLANG_HIP_RUNTIME_WRAPPER_INCLUDED__
695
696#if defined(__cplusplus)
697 } // extern "C"
698#endif