diff options
author | Determinant <ted.sybil@gmail.com> | 2016-02-24 16:58:32 +0800 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2016-02-24 16:58:32 +0800 |
commit | e91fc2ddaa74dd2c46ce93c9e92020d66c037c8e (patch) | |
tree | 94165c3c81b1af93e9b77b408372c0d9ff23dd6b /nerv/lib/matrix/generic/cukernel.cu | |
parent | 9642bd16922b288c81dee25f17373466ae6888c4 (diff) |
add CuContext/MContextwrapped-handles
Diffstat (limited to 'nerv/lib/matrix/generic/cukernel.cu')
-rw-r--r-- | nerv/lib/matrix/generic/cukernel.cu | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/nerv/lib/matrix/generic/cukernel.cu b/nerv/lib/matrix/generic/cukernel.cu index 51e3b6a..0e09cfa 100644 --- a/nerv/lib/matrix/generic/cukernel.cu +++ b/nerv/lib/matrix/generic/cukernel.cu @@ -445,13 +445,12 @@ extern "C" { cudaStreamSynchronize(0); } - extern curandGenerator_t curand_gen; - void cudak_(cuda_rand_uniform)(const Matrix *a) { + void cudak_(cuda_rand_uniform)(const Matrix *a, CuContext *context) { #ifdef MATRIX_USE_FLOAT - curandGenerateUniform(curand_gen, MATRIX_ELEM_PTR(a), a->nrow * a->stride / sizeof(MATRIX_ELEM)); + curandGenerateUniform(context->curand_gen, MATRIX_ELEM_PTR(a), a->nrow * a->stride / sizeof(MATRIX_ELEM)); #endif #ifdef MATRIX_USE_DOUBLE - curandGenerateUniformDouble(curand_gen, MATRIX_ELEM_PTR(a), a->nrow * a->stride / sizeof(MATRIX_ELEM)); + curandGenerateUniformDouble(context->curand_gen, MATRIX_ELEM_PTR(a), a->nrow * a->stride / sizeof(MATRIX_ELEM)); #endif } |