-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.cpp
47 lines (42 loc) · 887 Bytes
/
main.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
#include <fstream>
#include <iostream>
#include <vector>
#include <cassert>
#include <iomanip>
#include <map>
#include "programstate.h"
using namespace std;
cl::NDRange getBestWorkspaceDim(cl::NDRange wsDim);
int main(int argc,char ** argv)
{
#if (defined (NDEBUG) || defined(_NDEBUG))
try
{
ProgramState ps (argc-1,argv+1);
ps.listenCommand();
}
catch(cl::Error & r)
{
cout << "Cl error in " << r.what() << " code: " << r.err() << endl;
cout << "Aborting..";
system("PAUSE");
return 1;
}
catch(std::exception & r)
{
cout << "Exception: " << r.what() << endl << "Aborting...";
system("PAUSE");
return 1;
}
catch(...)
{
cout << "Unknown error" << endl << endl << "Aborting...";
system("PAUSE");
return 1;
}
#else
ProgramState ps (argc-1,argv+1);
ps.listenCommand();
#endif //_NDEBUG
return 0;
}