-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.cuh
More file actions
42 lines (30 loc) · 1.06 KB
/
common.cuh
File metadata and controls
42 lines (30 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// Created by alex on 7/27/20.
//
#ifndef SENSORSIM_COMMON_CUH
#define SENSORSIM_COMMON_CUH
#include <iostream>
#include <chrono>
//#define DEBUG_BUILD
#ifdef DEBUG_BUILD
#define DEBUG(x) std::cerr << x
#define DEBUG_DETAIL(x) x
#else
# define DEBUG(x) do {} while (0)
# define DEBUG_DETAIL(x) do {} while (0)
#endif
#define PRINT_UPDATE_DELAY 1 //Used with timer
#define MSG_MAX_SIZE 1500 //Max size of a message must be > RAND_FLOW_MSG_SIZE or max size message from pcap
#define MSG_BLOCK_SIZE 1024 //Number of messages to process in parallel
#define RAND_FLOW_MSG_SIZE 1024 //Size of the Messages in Random Flow
#define RAND_FLOW_MSG_COUNT 1024 //Number of Messages in the Flow
struct timer
{
typedef std::chrono::steady_clock clock ;
typedef std::chrono::seconds seconds ;
void reset() { start = clock::now() ; }
unsigned long long seconds_elapsed() const
{ return std::chrono::duration_cast<seconds>( clock::now() - start ).count() ; }
private: clock::time_point start = clock::now() ;
};
#endif //SENSORSIM_COMMON_CUH