CUDA bugfix: set cuda device before creating stream

This commit is contained in:
Haifa Bogdan Adnan 2019-09-02 12:29:03 +03:00 committed by GitHub
parent decff308c0
commit 2614322c63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -274,6 +274,7 @@ bool CudaHasher::buildThreadData() {
thread_data.threadId = threadId; thread_data.threadId = threadId;
cudaStream_t stream; cudaStream_t stream;
cudaSetDevice(device->cudaIndex);
device->error = cudaStreamCreate(&stream); device->error = cudaStreamCreate(&stream);
if(device->error != cudaSuccess) { if(device->error != cudaSuccess) {
LOG("Error running kernel: (" + to_string(device->error) + ") cannot create cuda stream."); LOG("Error running kernel: (" + to_string(device->error) + ") cannot create cuda stream.");