forked from abduld/libwb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wbExit.cpp
47 lines (33 loc) · 1012 Bytes
/
wbExit.cpp
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
43
44
45
#include <iostream>
#include <wb.h>
void wb_atExit(void) {
#ifdef WB_USE_CUDA
cudaDeviceSynchronize();
#endif /* WB_USE_CUDA */
using std::cout;
using std::endl;
cout << "{\n"
<< wbString_quote("timer") << ":" << wbTimer_toJSON() << ",\n"
<< wbString_quote("logger") << ":" << wbLogger_toJSON() << ",\n";
#ifdef WB_USE_CUDA
cout << wbString_quote("cuda_memory") << ":" << _cudaMallocSize << ",\n";
#endif
if (solutionJSON) {
cout << wbString_quote("solution_exists") << ": true,\n";
cout << wbString_quote("solution") << ":" << solutionJSON << "\n";
} else {
cout << wbString_quote("solution_exists") << ": false\n";
}
cout << "}" << endl;
//wbTimer_delete(_timer);
//wbLogger_delete(_logger);
_timer = NULL;
_logger = NULL;
//wbFile_atExit();
#ifdef WB_DEBUG_MEMMGR_SUPPORT_STATS
memmgr_print_stats();
#endif /* WB_DEBUG_MEMMGR_SUPPORT_STATS */
//exit(0);
//assert(0);
return ;
}