gtsam_points
Loading...
Searching...
No Matches
easy_profiler_cuda.hpp
1// SPDX-License-Identifier: MIT
2// Copyright (c) 2021 Kenji Koide (k.koide@aist.go.jp)
3
4#pragma once
5
6#include <vector>
7#include <chrono>
8#include <fstream>
9#include <iostream>
10
11struct CUevent_st;
12struct CUstream_st;
13
14namespace gtsam_points {
16public:
18 const std::string& prof_label,
19 CUstream_st* stream,
20 int events_cache_size = 10,
21 bool enabled = true,
22 bool debug = false,
23 std::ostream& ost = std::cout);
24
26
27 void push(const std::string& label, CUstream_st* stream = nullptr);
28
29private:
30 CUevent_st* get_event();
31
32public:
33 const bool enabled;
34 const bool debug;
35 const std::string prof_label;
36
37 std::vector<std::string> labels;
38 std::vector<std::chrono::high_resolution_clock::time_point> times;
39 std::vector<CUevent_st*> events;
40
41 int events_count;
42 std::vector<CUevent_st*> events_cache;
43
44 std::ostream& ost;
45 std::ofstream ofs;
46};
47
48} // namespace gtsam_points
Definition easy_profiler_cuda.hpp:15