GHOST  1.1.2
General, Hybrid, and Optimized Sparse Toolkit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rand.h
Go to the documentation of this file.
1 
6 #ifndef GHOST_RAND_H
7 #define GHOST_RAND_H
8 
9 #include "error.h"
10 
11 typedef enum
12 {
18 
19 #define GHOST_RAND_SEED_ALL (GHOST_RAND_SEED_PU|GHOST_RAND_SEED_RANK|GHOST_RAND_SEED_TIME)
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
35  ghost_error ghost_rand_get(unsigned int **s);
47  void ghost_rand_destroy();
61  ghost_error ghost_rand_seed(ghost_rand_seed_type which, unsigned int seed);
73  bool ghost_rand_customseed();
74 #ifdef __cplusplus
75 }
76 #endif
77 #endif
ghost_rand_seed_type
Definition: rand.h:11
ghost_error ghost_rand_seed(ghost_rand_seed_type which, unsigned int seed)
Set the random number seed.
Definition: rand.c:74
Definition: rand.h:14
Types, functions and macros for error handling.
void ghost_rand_destroy()
Destroy the random states.
Definition: rand.c:151
ghost_error
Error return type.
Definition: error.h:23
bool ghost_rand_customseed()
Check whether a custom seed has been set.
Definition: rand.c:143
int ghost_rand_cu_seed_get()
Get the CUDA random seed.
Definition: rand.c:161
ghost_error ghost_rand_create()
Create a random seed for each PU of the machine.
Definition: rand.c:17
ghost_error ghost_rand_get(unsigned int **s)
Get a random state for the calling thread.
Definition: rand.c:59
Definition: rand.h:15
Definition: rand.h:13
Definition: rand.h:16