Skip to content

Commit

Permalink
SPEC CPU examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrusch committed May 2, 2023
1 parent e09539e commit b1c0400
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_examples/CPU2006_SingleLinkCluster.c
@@ -0,0 +1,24 @@
//taken from SPEC CPU2006 hmmer/src/weight.c SingleLinkCluster

int nondet();

//O(n^2)
void SingleLinkCluster(unsigned int n, int a, int b, int i) {
a = n;
b = 0;
while(a > 0) {
a = a - 1;
b = b + 1;
while(b > 0) {
b = b - 1;
i = n - 1;
while(i > 0)
if(a > 0 && nondet()) {
a = a - 1;
b = b + 1;
}
i = i - 1;
}
}
}

26 changes: 26 additions & 0 deletions tests/test_examples/CPU2006_XNU.c
@@ -0,0 +1,26 @@
//taken from SPEC CPU2006 hmmer/src/masks.c XNU

int nondet();

//O(n)
void xnu(int len, int beg, int end, int i, int k) {
// beg = 0;
// end = 0;
// i = 0;
while (i < len) {
i = i + 1;
if (nondet())
end = i;
if (nondet()) {
k = beg;
while (k < end)
k = k + 1;
end = i;
beg = end;
} else if (nondet()) {
end = i;
beg = end;
}
}
}

0 comments on commit b1c0400

Please sign in to comment.