xref: /llvm-project/flang/include/flang/Runtime/random.h (revision cc71e69459474c19ae7c0ce019abd7a5e12430d6)
1 //===-- include/flang/Runtime/random.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 // Intrinsic subroutines RANDOM_INIT, RANDOM_NUMBER, and RANDOM_SEED.
10 
11 #include "flang/Runtime/entry-names.h"
12 #include <cstdint>
13 
14 namespace Fortran::runtime {
15 class Descriptor;
16 extern "C" {
17 
18 void RTNAME(RandomInit)(bool repeatable, bool image_distinct);
19 
20 void RTNAME(RandomNumber)(
21     const Descriptor &harvest, const char *source, int line);
22 
23 // RANDOM_SEED may be called with a value for at most one of its three
24 // optional arguments.  Most calls map to an entry point for that value,
25 // or the entry point for no values.  If argument presence cannot be
26 // determined at compile time, function RandomSeed can be called to make
27 // the selection at run time.
28 void RTNAME(RandomSeedSize)(
29     const Descriptor *size, const char *source, int line);
30 void RTNAME(RandomSeedPut)(const Descriptor *put, const char *source, int line);
31 void RTNAME(RandomSeedGet)(const Descriptor *get, const char *source, int line);
32 void RTNAME(RandomSeedDefaultPut)();
33 void RTNAME(RandomSeed)(const Descriptor *size, const Descriptor *put,
34     const Descriptor *get, const char *source, int line);
35 
36 } // extern "C"
37 } // namespace Fortran::runtime
38