projects
/
platform
/
upstream
/
caffeonacl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d002799
)
have rng_stream initialize RNG if not already initialized
author
Jeff Donahue
<jeff.donahue@gmail.com>
Tue, 8 Apr 2014 21:24:48 +0000
(14:24 -0700)
committer
Jeff Donahue
<jeff.donahue@gmail.com>
Wed, 9 Apr 2014 03:17:17 +0000
(20:17 -0700)
include/caffe/common.hpp
patch
|
blob
|
history
diff --git
a/include/caffe/common.hpp
b/include/caffe/common.hpp
index
1829026
..
af7dcc4
100644
(file)
--- a/
include/caffe/common.hpp
+++ b/
include/caffe/common.hpp
@@
-96,6
+96,9
@@
class Caffe {
// Getters for boost rng, curand, and cublas handles
inline static const RNG& rng_stream() {
+ if (!Get().random_generator_) {
+ Get().random_generator_.reset(new RNG());
+ }
return *(Get().random_generator_);
}
inline static cublasHandle_t cublas_handle() { return Get().cublas_handle_; }