mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-01 17:50:40 +08:00
Added a default value for the cuda stream in the GpuDevice constructor
This commit is contained in:
parent
1e911b276c
commit
8f1d547c92
@ -291,9 +291,12 @@ static inline void setCudaSharedMemConfig(cudaSharedMemConfig config) {
|
|||||||
assert(status == cudaSuccess);
|
assert(status == cudaSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cuda stream to use when no stream is specified explicitely.
|
||||||
|
static const cudaStream_t default_stream = cudaStreamDefault;
|
||||||
|
|
||||||
struct GpuDevice {
|
struct GpuDevice {
|
||||||
// The cudastream is not owned: the caller is responsible for its initialization and eventual destruction.
|
// 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_; }
|
EIGEN_STRONG_INLINE const cudaStream_t& stream() const { return *stream_; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user