imate
C++/CUDA Reference
random_array_generator.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu>
3  * SPDX-License-Identifier: BSD-3-Clause
4  * SPDX-FileType: SOURCE
5  *
6  * This program is free software: you can redistribute it and/or modify it
7  * under the terms of the license found in the LICENSE.txt file in the root
8  * directory of this source tree.
9  */
10 
11 
12 #ifndef _RANDOM_GENERATOR_RANDOM_ARRAY_GENERATOR_H_
13 #define _RANDOM_GENERATOR_RANDOM_ARRAY_GENERATOR_H_
14 
15 
16 // =======
17 // Headers
18 // =======
19 
20 #include "../_definitions/types.h" // IndexType, LongIndexType
21 #include "./random_number_generator.h" // RandomNumberGenerator
22 
23 
24 // ==============
25 // Random Vectors
26 // ==============
27 
35 
36 template <typename DataType>
38 {
39  public:
40 
41  // generate random array
42  static void generate_random_array(
43  RandomNumberGenerator& random_number_generator,
44  DataType* array,
45  const LongIndexType array_size,
46  const IndexType num_threads);
47 };
48 
49 
50 #endif // _RANDOM_GENERATOR_RANDOM_ARRAY_GENERATOR_H_
A static class to generate random set of vectors. This class acts as a templated namespace,...
static void generate_random_array(RandomNumberGenerator &random_number_generator, DataType *array, const LongIndexType array_size, const IndexType num_threads)
Generates a pseudo-random array with Rademacher distribution where elements are either +1 or -1.
Generates 64-bit integers on multiple parallel threads.
int LongIndexType
Definition: types.h:60
int IndexType
Definition: types.h:65