From 8f1d547c9230370f2a1818424f94f8d0f507776b Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Wed, 1 Jul 2015 18:32:18 -0700 Subject: [PATCH] Added a default value for the cuda stream in the GpuDevice constructor --- unsupported/Eigen/CXX11/src/Tensor/TensorDeviceType.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceType.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceType.h index 5536b0e22..a4419c665 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceType.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceType.h @@ -291,9 +291,12 @@ static inline void setCudaSharedMemConfig(cudaSharedMemConfig config) { assert(status == cudaSuccess); } +// Cuda stream to use when no stream is specified explicitely. +static const cudaStream_t default_stream = cudaStreamDefault; + struct GpuDevice { // The cudastream is not owned: the caller is responsible for its initialization and eventual destruction. - GpuDevice(const cudaStream_t* stream) : stream_(stream) { eigen_assert(stream); } + GpuDevice(const cudaStream_t* stream = &default_stream) : stream_(stream) { eigen_assert(stream); } EIGEN_STRONG_INLINE const cudaStream_t& stream() const { return *stream_; }