Warning: This file is not a C or C++ file. It does not have highlighting.

1//===-- include/flang/Runtime/transformational.h ----------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// Defines the API for the type-independent transformational intrinsic functions
10// that rearrange data in arrays: CSHIFT, EOSHIFT, PACK, RESHAPE, SPREAD,
11// TRANSPOSE, and UNPACK.
12// These are naive allocating implementations; optimized forms that manipulate
13// pointer descriptors or that supply functional views of arrays remain to
14// be defined and may instead be part of lowering (see docs/ArrayComposition.md)
15// for details).
16
17#ifndef FORTRAN_RUNTIME_TRANSFORMATIONAL_H_
18#define FORTRAN_RUNTIME_TRANSFORMATIONAL_H_
19
20#include "flang/Common/float128.h"
21#include "flang/Runtime/cpp-type.h"
22#include "flang/Runtime/entry-names.h"
23#include <cinttypes>
24
25namespace Fortran::runtime {
26
27class Descriptor;
28
29extern "C" {
30
31void RTDECL(Reshape)(Descriptor &result, const Descriptor &source,
32 const Descriptor &shape, const Descriptor *pad = nullptr,
33 const Descriptor *order = nullptr, const char *sourceFile = nullptr,
34 int line = 0);
35
36void RTDECL(BesselJn_2)(Descriptor &result, int32_t n1, int32_t n2, float x,
37 float bn2, float bn2_1, const char *sourceFile = nullptr, int line = 0);
38
39void RTDECL(BesselJn_3)(Descriptor &result, int32_t n1, int32_t n2, float x,
40 float bn2, float bn2_1, const char *sourceFile = nullptr, int line = 0);
41
42void RTDECL(BesselJn_4)(Descriptor &result, int32_t n1, int32_t n2, float x,
43 float bn2, float bn2_1, const char *sourceFile = nullptr, int line = 0);
44
45void RTDECL(BesselJn_8)(Descriptor &result, int32_t n1, int32_t n2, double x,
46 double bn2, double bn2_1, const char *sourceFile = nullptr, int line = 0);
47
48#if LDBL_MANT_DIG == 64
49void RTDECL(BesselJn_10)(Descriptor &result, int32_t n1, int32_t n2,
50 long double x, long double bn2, long double bn2_1,
51 const char *sourceFile = nullptr, int line = 0);
52#endif
53
54#if LDBL_MANT_DIG == 113 || HAS_FLOAT128
55void RTDECL(BesselJn_16)(Descriptor &result, int32_t n1, int32_t n2,
56 CppFloat128Type x, CppFloat128Type bn2, CppFloat128Type bn2_1,
57 const char *sourceFile = nullptr, int line = 0);
58#endif
59
60void RTDECL(BesselJnX0_2)(Descriptor &result, int32_t n1, int32_t n2,
61 const char *sourceFile = nullptr, int line = 0);
62
63void RTDECL(BesselJnX0_3)(Descriptor &result, int32_t n1, int32_t n2,
64 const char *sourceFile = nullptr, int line = 0);
65
66void RTDECL(BesselJnX0_4)(Descriptor &result, int32_t n1, int32_t n2,
67 const char *sourceFile = nullptr, int line = 0);
68
69void RTDECL(BesselJnX0_8)(Descriptor &result, int32_t n1, int32_t n2,
70 const char *sourceFile = nullptr, int line = 0);
71
72#if LDBL_MANT_DIG == 64
73void RTDECL(BesselJnX0_10)(Descriptor &result, int32_t n1, int32_t n2,
74 const char *sourceFile = nullptr, int line = 0);
75#endif
76
77#if LDBL_MANT_DIG == 113 || HAS_FLOAT128
78void RTDECL(BesselJnX0_16)(Descriptor &result, int32_t n1, int32_t n2,
79 const char *sourceFile = nullptr, int line = 0);
80#endif
81
82void RTDECL(BesselYn_2)(Descriptor &result, int32_t n1, int32_t n2, float x,
83 float bn1, float bn1_1, const char *sourceFile = nullptr, int line = 0);
84
85void RTDECL(BesselYn_3)(Descriptor &result, int32_t n1, int32_t n2, float x,
86 float bn1, float bn1_1, const char *sourceFile = nullptr, int line = 0);
87
88void RTDECL(BesselYn_4)(Descriptor &result, int32_t n1, int32_t n2, float x,
89 float bn1, float bn1_1, const char *sourceFile = nullptr, int line = 0);
90
91void RTDECL(BesselYn_8)(Descriptor &result, int32_t n1, int32_t n2, double x,
92 double bn1, double bn1_1, const char *sourceFile = nullptr, int line = 0);
93
94#if LDBL_MANT_DIG == 64
95void RTDECL(BesselYn_10)(Descriptor &result, int32_t n1, int32_t n2,
96 long double x, long double bn1, long double bn1_1,
97 const char *sourceFile = nullptr, int line = 0);
98#endif
99
100#if LDBL_MANT_DIG == 113 || HAS_FLOAT128
101void RTDECL(BesselYn_16)(Descriptor &result, int32_t n1, int32_t n2,
102 CppFloat128Type x, CppFloat128Type bn1, CppFloat128Type bn1_1,
103 const char *sourceFile = nullptr, int line = 0);
104#endif
105
106void RTDECL(BesselYnX0_2)(Descriptor &result, int32_t n1, int32_t n2,
107 const char *sourceFile = nullptr, int line = 0);
108
109void RTDECL(BesselYnX0_3)(Descriptor &result, int32_t n1, int32_t n2,
110 const char *sourceFile = nullptr, int line = 0);
111
112void RTDECL(BesselYnX0_4)(Descriptor &result, int32_t n1, int32_t n2,
113 const char *sourceFile = nullptr, int line = 0);
114
115void RTDECL(BesselYnX0_8)(Descriptor &result, int32_t n1, int32_t n2,
116 const char *sourceFile = nullptr, int line = 0);
117
118#if LDBL_MANT_DIG == 64
119void RTDECL(BesselYnX0_10)(Descriptor &result, int32_t n1, int32_t n2,
120 const char *sourceFile = nullptr, int line = 0);
121#endif
122
123#if LDBL_MANT_DIG == 113 || HAS_FLOAT128
124void RTDECL(BesselYnX0_16)(Descriptor &result, int32_t n1, int32_t n2,
125 const char *sourceFile = nullptr, int line = 0);
126#endif
127
128void RTDECL(Cshift)(Descriptor &result, const Descriptor &source,
129 const Descriptor &shift, int dim = 1, const char *sourceFile = nullptr,
130 int line = 0);
131void RTDECL(CshiftVector)(Descriptor &result, const Descriptor &source,
132 std::int64_t shift, const char *sourceFile = nullptr, int line = 0);
133
134void RTDECL(Eoshift)(Descriptor &result, const Descriptor &source,
135 const Descriptor &shift, const Descriptor *boundary = nullptr, int dim = 1,
136 const char *sourceFile = nullptr, int line = 0);
137void RTDECL(EoshiftVector)(Descriptor &result, const Descriptor &source,
138 std::int64_t shift, const Descriptor *boundary = nullptr,
139 const char *sourceFile = nullptr, int line = 0);
140
141void RTDECL(Pack)(Descriptor &result, const Descriptor &source,
142 const Descriptor &mask, const Descriptor *vector = nullptr,
143 const char *sourceFile = nullptr, int line = 0);
144
145void RTDECL(Spread)(Descriptor &result, const Descriptor &source, int dim,
146 std::int64_t ncopies, const char *sourceFile = nullptr, int line = 0);
147
148void RTDECL(Transpose)(Descriptor &result, const Descriptor &matrix,
149 const char *sourceFile = nullptr, int line = 0);
150
151void RTDECL(Unpack)(Descriptor &result, const Descriptor &vector,
152 const Descriptor &mask, const Descriptor &field,
153 const char *sourceFile = nullptr, int line = 0);
154
155} // extern "C"
156} // namespace Fortran::runtime
157#endif // FORTRAN_RUNTIME_TRANSFORMATIONAL_H_
158

Warning: This file is not a C or C++ file. It does not have highlighting.

source code of flang/include/flang/Runtime/transformational.h