Added a default value for the cuda stream in the GpuDevice constructor

This commit is contained in:
Benoit Steiner 2015-07-01 18:32:18 -07:00
parent 1e911b276c
commit 8f1d547c92

View File

@ -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_; }