From bb0f58c82882d34ee1737227476167be9367433c Mon Sep 17 00:00:00 2001 From: txh18 Date: Sun, 31 Jan 2016 21:56:27 +0800 Subject: new changes to select_gpu --- nerv/lib/matrix/cumatrix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nerv/lib/matrix/cumatrix.c b/nerv/lib/matrix/cumatrix.c index 533dade..ea7a518 100644 --- a/nerv/lib/matrix/cumatrix.c +++ b/nerv/lib/matrix/cumatrix.c @@ -11,6 +11,8 @@ void nerv_cumatrix_select_gpu(int dev, Status *status) { fprintf(stderr, "** selecting GPU %d\n", dev); NERV_SET_STATUS(status, NERV_NORMAL, 0); CUDA_SAFE_SYNC_CALL(cudaSetDevice(dev), status); + CUDA_SAFE_SYNC_CALL(cublasDestroy(cublas_handle), status); + CUDA_SAFE_SYNC_CALL(cublasCreate(&cublas_handle), status); } void nerv_cumatrix_print_profile() { -- cgit v1.2.3-70-g09d2