cuda_stream.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #pragma once
6 #ifdef CUML_ENABLE_GPU
7 #include <cuda_runtime_api.h>
8 #endif
9 
10 namespace raft_proto {
11 #ifdef CUML_ENABLE_GPU
12 using cuda_stream = cudaStream_t;
13 #else
14 using cuda_stream = int;
15 #endif
16 inline void synchronize(cuda_stream stream)
17 {
18 #ifdef CUML_ENABLE_GPU
19  cudaStreamSynchronize(stream);
20 #endif
21 }
22 } // namespace raft_proto
Definition: buffer.hpp:24
void synchronize(cuda_stream stream)
Definition: cuda_stream.hpp:16
int cuda_stream
Definition: cuda_stream.hpp:14