The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
CUDAStream.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 2023-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#pragma once
12// Gaudi
14
15// CUDA
16#ifndef __CUDACC__
17# include <cuda_runtime.h>
18#endif
19
20namespace Gaudi::CUDA {
21 class Stream {
22 private:
23 cudaStream_t m_stream;
26
27 public:
30 ~Stream();
31
33 inline operator cudaStream_t() { return m_stream; }
34
36 inline const Gaudi::AsynchronousAlgorithm* parent() { return m_parent; }
37
40
43
46 };
47} // namespace Gaudi::CUDA
Base class for asynchronous algorithms.
const Gaudi::AsynchronousAlgorithm * parent()
Access the parent algorithm.
Definition CUDAStream.h:36
void removeDependency()
INTERNAL: Remove a dependency.
Definition CUDAStream.h:45
void registerDependency()
INTERNAL: Register a dependency.
Definition CUDAStream.h:42
StatusCode await()
Yield fiber until stream is done.
Stream(const Gaudi::AsynchronousAlgorithm *parent)
Create a new Stream. Should happen once per algorithm.
cudaStream_t m_stream
Definition CUDAStream.h:23
const Gaudi::AsynchronousAlgorithm * m_parent
Definition CUDAStream.h:24
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64