Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
2db4928e
Unverified
Commit
2db4928e
authored
Nov 07, 2022
by
Muhammed Fatih BALIN
Committed by
GitHub
Nov 08, 2022
Browse files
a better way to init threadlocal prng (#4808)
Co-authored-by:
Quan (Andy) Gan
<
coin2028@hotmail.com
>
parent
11c866ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
include/dgl/random.h
include/dgl/random.h
+4
-1
No files found.
include/dgl/random.h
View file @
2db4928e
...
@@ -57,7 +57,10 @@ class RandomEngine {
...
@@ -57,7 +57,10 @@ class RandomEngine {
/**
/**
* @brief Set the seed of this random number generator
* @brief Set the seed of this random number generator
*/
*/
void
SetSeed
(
uint32_t
seed
)
{
rng_
.
seed
(
seed
+
GetThreadId
());
}
void
SetSeed
(
uint32_t
seed
)
{
std
::
seed_seq
seq
{
seed
,
GetThreadId
()};
rng_
.
seed
(
seq
);
}
/**
/**
* @brief Generate an arbitrary random 32-bit integer.
* @brief Generate an arbitrary random 32-bit integer.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment