aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Zagieboylo <dzag1600@berkeley.edu>2014-05-01 12:21:40 -0700
committerDrew Zagieboylo <dzag1600@berkeley.edu>2014-05-01 12:21:40 -0700
commit906b8e30b5020ef9def3a13971083be5e1fb4494 (patch)
tree506aaddc3b0cd82488560bbd93746d003c52ed51
parent7be73e6fb3e48f02e0c6b57dce2789331f6534c5 (diff)
downloadriscv-tests-906b8e30b5020ef9def3a13971083be5e1fb4494.zip
riscv-tests-906b8e30b5020ef9def3a13971083be5e1fb4494.tar.gz
riscv-tests-906b8e30b5020ef9def3a13971083be5e1fb4494.tar.bz2
put clog mem into util.h and updated stream benchmark
-rw-r--r--benchmarks/common/util.h13
-rw-r--r--benchmarks/sdisorder/sdisorder.c16
-rw-r--r--benchmarks/stream/stream_d.c11
3 files changed, 25 insertions, 15 deletions
diff --git a/benchmarks/common/util.h b/benchmarks/common/util.h
index 6c4f963..d0a3805 100644
--- a/benchmarks/common/util.h
+++ b/benchmarks/common/util.h
@@ -109,6 +109,19 @@ static void __attribute__((noinline)) barrier(int ncores)
__sync_synchronize();
}
+void clogMem(int len, int step, int its)
+{
+ int arr[len];
+ int j = its;
+ while(j > 0) {
+ for (int i = 0; i < len; i += step) {
+ int idx = i % len;
+ arr[idx] = arr[idx] + 1;
+ }
+ j -= 1;
+ }
+}
+
#ifdef __riscv
#include "encoding.h"
#endif
diff --git a/benchmarks/sdisorder/sdisorder.c b/benchmarks/sdisorder/sdisorder.c
index 0581b18..49daf60 100644
--- a/benchmarks/sdisorder/sdisorder.c
+++ b/benchmarks/sdisorder/sdisorder.c
@@ -1,3 +1,4 @@
+#include "util.h"
#include <stdio.h>
#include <stdlib.h>
@@ -60,23 +61,10 @@ void RandGenBench(int n) {
}
-void clogMem(uint len, uint step, uint its)
-{
- uint arr[len];
- uint j = its;
- while(j > 0) {
- for (uint i = 0; i < len; i += step) {
- uint idx = i % len;
- arr[idx] = arr[idx] + 1;
- }
- j -= 1;
- }
-}
-
void thread_entry(int cid, int nc)
{
while (cid != 0) {
- clogMem(1<<18, 64<<3,1<<7);
+ // clogMem(1<<18, 64<<3,1<<7);
}
}
diff --git a/benchmarks/stream/stream_d.c b/benchmarks/stream/stream_d.c
index ad07253..088d339 100644
--- a/benchmarks/stream/stream_d.c
+++ b/benchmarks/stream/stream_d.c
@@ -7,6 +7,7 @@
*/
/* Set THREAD_NBR macro equal to the number of threads if a multithreaded OpenMP run */
/* Set to 1 if a single-CPU run */
+#include "util.h"
#define THREAD_NBR 1
#if defined(THREAD_NBR)
@@ -43,7 +44,7 @@
* that should be good to about 5% precision.
*/
-# define N 20000 // 2000000
+# define N 2000 // 2000000
# define NTIMES 10
# define OFFSET 0
@@ -90,6 +91,14 @@ static double bytes[4] = {
};
+void
+thread_entry(int cid, int nc)
+{
+ while (cid !=0) {
+ clogMem(1<<16, 64>>2, 1<<7);
+ }
+}
+
int
main()
{