Random numbers generation

Open
#775 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp
Domain
hpc

Research direction

Start with the reported loop using compute::default_random_engine and uniform_real_distribution, then reproduce the repeated vector generation with the same engine and seed pattern. Determine whether the engine is expected to advance across iterations; done means the behavior is explained and, if incorrect, covered by a focused regression test or fix.

Written by the indexing model from the issue text.

Description

I try to generate vector of random number multiple times and it seems to generate the same vector

for example

...
auto seed = std::chrono::high_resolution_clock::now().time_since_epoch().count();
compute::default_random_engine engine(queue,seed);
compute::uniform_real_distribution GPUdistribution(0.0, 1.0);
for (int t=0; t<T;t++) {
...
GPUdistribution.generate(vec2.begin(), vec2.end(),engine,queue);
...
}

Is it necessary to destroy and regenerate engine with new seed at each iteration to get proper results?
Thanks

Dominant language
C++
Stars
1.7k
Forks
340
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/compute

All issues in boostorg/compute

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.