-
Notifications
You must be signed in to change notification settings - Fork 1
/
wbExit.cpp
51 lines (35 loc) · 1.03 KB
/
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
46
47
48
49
50
51
#include <wb.h>
void wb_atExit(void) {
using std::cout;
using std::endl;
#ifdef WB_USE_CUDA
cudaDeviceSynchronize();
#endif /* WB_USE_CUDA */
cout << "==$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" << 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 /* WB_USE_CUDA */
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 */
#ifdef WB_USE_CUDA
cudaDeviceReset();
#endif
exit(0);
// assert(0);
return;
}