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