|
|
@@ -74,7 +74,7 @@ void BasePrefetchingDataLayer<Dtype>::InternalThreadEntry() { |
|
|
#ifndef CPU_ONLY
|
|
|
cudaStream_t stream;
|
|
|
if (Caffe::mode() == Caffe::GPU) {
|
|
|
- cudaStreamCreateWithFlags(&stream, cudaStreamNonBlocking);
|
|
|
+ CUDA_CHECK(cudaStreamCreateWithFlags(&stream, cudaStreamNonBlocking));
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
@@ -85,14 +85,19 @@ void BasePrefetchingDataLayer<Dtype>::InternalThreadEntry() { |
|
|
#ifndef CPU_ONLY
|
|
|
if (Caffe::mode() == Caffe::GPU) {
|
|
|
batch->data_.data().get()->async_gpu_push(stream);
|
|
|
- cudaStreamSynchronize(stream);
|
|
|
+ CUDA_CHECK(cudaStreamSynchronize(stream));
|
|
|
}
|
|
|
#endif
|
|
|
prefetch_full_.push(batch);
|
|
|
}
|
|
|
} catch (boost::thread_interrupted&) {
|
|
|
// Interrupted exception is expected on shutdown
|
|
|
}
|
|
|
+#ifndef CPU_ONLY
|
|
|
+ if (Caffe::mode() == Caffe::GPU) {
|
|
|
+ CUDA_CHECK(cudaStreamDestroy(stream));
|
|
|
+ }
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
template <typename Dtype>
|
|
|
|