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