Skip to content

Commit

Permalink
[bug] Fix the parity of the RNG (taichi-dev#7239)
Browse files Browse the repository at this point in the history
Issue: taichi-dev#7182

### Brief Summary
  • Loading branch information
lin-hitonami authored and quadpixels committed May 13, 2023
1 parent 7f3b55d commit d36660f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions taichi/runtime/llvm/llvm_runtime_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,9 +579,9 @@ void LlvmRuntimeExecutor::materialize_runtime(MemoryPool *memory_pool,
auto *const runtime_jit = tlctx->runtime_jit_module;

// Starting random state for the program calculated using the random seed.
// The seed is multiplied by 2^20 so that two programs with different seeds
// The seed is multiplied by 1048391 so that two programs with different seeds
// will not have overlapping random states in any thread.
int starting_rand_state = config_->random_seed * 1048576;
int starting_rand_state = config_->random_seed * 1048391;

// Number of random states. One per CPU/CUDA thread.
int num_rand_states = 0;
Expand Down

0 comments on commit d36660f

Please sign in to comment.