From cda1767a2e8d27befb302e0c52cecb2dbd485a9a Mon Sep 17 00:00:00 2001 From: srijeet2310 <53825099+srijeet2310@users.noreply.github.com> Date: Sun, 16 Oct 2022 12:45:31 +0530 Subject: [PATCH] Added random and constant stride test prog. The changes are in the bottom of your code in commented fashion. --- tests/test-progs/stride/stride.cc | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tests/test-progs/stride/stride.cc b/tests/test-progs/stride/stride.cc index d39a5e3d9f..fe53b11783 100644 --- a/tests/test-progs/stride/stride.cc +++ b/tests/test-progs/stride/stride.cc @@ -71,3 +71,60 @@ int main(int argc, char* argv[]) return 0; } +///////////////////////////////////////////////////////////////////////////////////////////////////// +// #include + +// using namespace std; + +// int randomNum() +// { +// return (rand() % 27999); +// } + +// //constant stride +// int main() +// { +// srand(time(0)); +// vector v1 (128000, 20); +// vector v2 (128000, 30); + +// int i; + +// cout << "Hello, This is srijeet" << endl; + +// for(i = 0; i < v1.size(); i+=64) +// { +// v1[i] = v1[i] + v2[v1.size() - 1 - i]; +// cout << v1[i] << " " << v2[v1.size() - 1 - i] << endl; +// } + +// cout << "Srijeet : ends" << endl; +// return 0; +// } + +// //random stride +// int main() +// { +// srand(time(0)); +// vector v1 (28000, 20); +// vector v2 (28000, 30); + +// int i; + +// cout << "Hello, This is srijeet" << endl; + +// for(i = 0; i < 2000; i++) +// { +// v1[randomNum()] = v1[randomNum()] + v2[randomNum()] + randomNum(); +// v2[randomNum()] = v2[randomNum()] + v1[randomNum()] + randomNum(); + + +// cout << v1[randomNum()] << " " << v2[randomNum()] << endl; +// } +// cout << "Srijeet : ends" << endl; +// return 0; +// } + + + +