Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/cudamatrix/cu-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ void CuDevice::Initialize() {
cudaSetDevice(device_id_);
// Initialize CUBLAS.
CUBLAS_SAFE_CALL(cublasCreate(&cublas_handle_));
CUBLAS_SAFE_CALL(cublasSetStream(cublas_handle_, cudaStreamPerThread));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@galv, thanks. I believe justin mentioned that we also need to use this cudaStreamPerThread for other API calls, like memcpy.

// Initialize the cuSPARSE library
CUSPARSE_SAFE_CALL(cusparseCreate(&cusparse_handle_));

CUSPARSE_SAFE_CALL(cusparseSetStream(cusparse_handle_, cudaStreamPerThread));
}
}

Expand Down Expand Up @@ -243,8 +244,10 @@ void CuDevice::FinalizeActiveGpu() {
// the main thread.
// Initialize CUBLAS.
CUBLAS_SAFE_CALL(cublasCreate(&cublas_handle_));
CUBLAS_SAFE_CALL(cublasSetStream(cublas_handle_, cudaStreamPerThread));
// Initialize the cuSPARSE library
CUSPARSE_SAFE_CALL(cusparseCreate(&cusparse_handle_));
CUSPARSE_SAFE_CALL(cusparseSetStream(cusparse_handle_, cudaStreamPerThread));

// Notify the user which GPU is being userd.
char name[128];
Expand Down