aboutsummaryrefslogtreecommitdiff
path: root/nerv/lib/matrix/cumatrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'nerv/lib/matrix/cumatrix.c')
-rw-r--r--nerv/lib/matrix/cumatrix.c4
1 files changed, 4 insertions, 0 deletions
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 <string.h>
+#include <time.h>
#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);