Skip to content

Commit e0fcd82

Browse files
committed
Added fill_random description in CHANGELOG
1 parent 7e9c043 commit e0fcd82

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

CHANGELOG.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,32 @@ See how it works:
128128

129129
#### Random number generation
130130

131-
1. Support for analytical random number generation added for many functors added via `hydra::Distribution<FunctorType> specializations (see example `example/random/basic_distributions.inl`).
132-
2. Parallel filling of containers with random numbers (see example `example/random/fill_basic_distributions.inl`).
131+
1. Support for analytical pseudo-random number generation (APRNG) added for many functors added via `hydra::Distribution<FunctorType>` specializations (see example `example/random/basic_distributions.inl`).
132+
2. Parallel filling of containers with random numbers (see example `example/random/fill_basic_distributions.inl`). In particular, there are some convenience functions in order to deploy in a generic and simple way the parallel filling of containers transparently, independently of the back-end. For a given instance of the functor of interest, the framework is informed of the presence of the APRNG method in compile time. If the APRNG
133+
is not found a compile error is emitted, informing and suggesting the user to use the `hydra::sample` interface, which implements a different filling strategy. The facility is decoupled from the underlying PRNG engine, in order to be compatible with the current pseudo-random engines already imlemented in Hydra, and future algorithms that will be made available over the time. If the user needs to use a specific PRNG engine, its type can be passed as template parameter to the convenience function, otherwise the `hydra_thrust::default_random_engine` is used. As an example of filling of containers with random numbers see the snippet below:
134+
135+
```cpp
136+
...
137+
#include <hydra/functions/Gaussian.h>
138+
...
139+
140+
declvar(Xvar, double)
141+
142+
int main(int argv, char** argc)
143+
{
144+
...
145+
146+
auto gauss = hydra::Gaussian<Xvar>(mean, signa);
147+
148+
auto data_d = hydra::device::vector<Xvar>(nentries);
149+
150+
hydra::fill_random(data_d , gauss);
151+
152+
...
153+
}
154+
```
155+
The filling functions can be called also with a specific backend policy and with iterators instead of the whole container. The seed used by the PRNG engine can be also passed to the function as last parameter. The collection of all the convenience functions can be found in `hydra/RandomFill.h`.
156+
133157

134158
#### Phase-space generation
135159

0 commit comments

Comments
 (0)