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