diff --git a/utils/main.cpp b/utils/main.cpp new file mode 100644 index 0000000..c21ab69 --- /dev/null +++ b/utils/main.cpp @@ -0,0 +1,30 @@ +#include "timing.h" // tic(), toc() +#include "info.h" +#include "std_lib_facilities.h" // overload [] : by Stroustrup +#include +using namespace std; + +int main(int argc , char const *argv[]) +{ + cout << "Check my own headers\n" << endl; + + tic(); // start timer + check_env(argc, argv); // info on compiler + printGPUInfo(); // info on GPU. Only in NVCC_ + double tt(toc()); // end timer + cout << "\n\nSeconds: " << tt << endl; + + vector aa(5,-1.2345); + try + { + cout << "\nThe next line should result in an exception\n"; + cout << aa[5] << endl;// Stroustrups overloading should check the index range + } + catch (Range_error &re) + { + cout << "Index out of range!!!\n"; + } + + return 0; +} +