gtsam_points
Loading...
Searching...
No Matches
include
gtsam_points
cuda
stream_roundrobin.hpp
1
// SPDX-License-Identifier: MIT
2
// Copyright (c) 2021 Kenji Koide (k.koide@aist.go.jp)
3
4
#pragma once
5
6
#include <atomic>
7
#include <vector>
8
9
struct
CUstream_st;
10
11
namespace
gtsam_points {
12
16
class
StreamRoundRobin
{
17
public
:
18
using
cudaStream_t = CUstream_st*;
19
20
StreamRoundRobin
(
int
num_streams);
21
~StreamRoundRobin
();
22
23
void
sync_all();
24
25
cudaStream_t get_stream();
26
27
private
:
28
std::atomic_int cursor;
29
std::vector<cudaStream_t> streams;
30
};
31
32
}
// namespace gtsam_points
gtsam_points::StreamRoundRobin
Roundrobin for CUDA streams.
Definition
stream_roundrobin.hpp:16
Generated by
1.9.8