From a7608a67f16f745309409f6a004354121e0b3ba6 Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 15 Feb 2016 16:18:13 +0800 Subject: move curand_gen out of the matrix layout --- nerv/lib/matrix/cumatrix.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nerv/lib/matrix/cumatrix.c') diff --git a/nerv/lib/matrix/cumatrix.c b/nerv/lib/matrix/cumatrix.c index a8ed075..04205e4 100644 --- a/nerv/lib/matrix/cumatrix.c +++ b/nerv/lib/matrix/cumatrix.c @@ -2,9 +2,11 @@ #include "../common.h" #include "cuda_helper.h" #include +#include #define PROFILE_HASHMAP_SIZE 123457 static cublasHandle_t cublas_handle; static cudaEvent_t profile_start, profile_stop; +curandGenerator_t curand_gen; static HashMap *profile; void nerv_cumatrix_print_profile() { @@ -37,6 +39,8 @@ void accu_profile(const char *name, float delta) { void nerv_cumatrix_init() { cublasCreate(&cublas_handle); + curandCreateGenerator(&curand_gen, CURAND_RNG_PSEUDO_DEFAULT); + curandSetPseudoRandomGeneratorSeed(curand_gen, time(NULL)); cudaEventCreate(&profile_start); cudaEventCreate(&profile_stop); profile = hashmap_create(PROFILE_HASHMAP_SIZE, bkdr_hash, strcmp); -- cgit v1.2.3-70-g09d2