aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortxh18 <[email protected]>2016-01-31 21:56:27 +0800
committertxh18 <[email protected]>2016-01-31 21:56:27 +0800
commitbb0f58c82882d34ee1737227476167be9367433c (patch)
treeefa65085fbf36cab624c526729f9222905b019f4
parente7240d5bfa73b441c85672b8fae9255640cfc336 (diff)
new changes to select_gpu
-rw-r--r--nerv/lib/matrix/cumatrix.c2
1 files changed, 2 insertions, 0 deletions
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() {