Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changed the order

  • Loading branch information...
commit b1faf38af5fab9ca0fb0b20d65c58a900de02420 1 parent d992d40
@lh3 lh3 authored
Showing with 16 additions and 15 deletions.
  1. +16 −15 test/kbit_test.c
View
31 test/kbit_test.c
@@ -103,20 +103,6 @@ int main(void)
for (i = 0; i < N; ++i)
x[i] = (uint64_t)lrand48() << 32 | lrand48();
- fprintf(stderr, "===> Count '%c' in 2-bit encoded integers <===\n", "ACGT"[c]);
-
- t = clock();
- for (j = 0, cnt = 0; j < M; ++j)
- for (i = 0; i < N; ++i)
- cnt += kbi_DNAcount64(x[i], c);
- fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "kbit", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC);
-
- t = clock();
- for (j = 0, cnt = 0; j < M; ++j)
- for (i = 0; i < N; ++i)
- cnt += bt1_countInU64(x[i], c);
- fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "bowtie1", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC);
-
fprintf(stderr, "\n===> Calculate # of 1 in an integer (popcount) <===\n");
t = clock();
@@ -129,7 +115,7 @@ int main(void)
for (j = 0, cnt = 0; j < M; ++j)
for (i = 0; i < N; ++i)
cnt += bt1_pop64(x[i]);
- fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "bowtie1", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC);
+ fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "wiki-popcount_2", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC);
t = clock();
for (j = 0, cnt = 0; j < M; ++j)
@@ -142,6 +128,21 @@ int main(void)
cnt += sse2_bit_count((__m128i*)x, (__m128i*)(x+N));
fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "SSE2-32bit", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC);
+ fprintf(stderr, "\n===> Count '%c' in 2-bit encoded integers <===\n", "ACGT"[c]);
+
+ t = clock();
+ for (j = 0, cnt = 0; j < M; ++j)
+ for (i = 0; i < N; ++i)
+ cnt += kbi_DNAcount64(x[i], c);
+ fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "kbit", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC);
+
+ t = clock();
+ for (j = 0, cnt = 0; j < M; ++j)
+ for (i = 0; i < N; ++i)
+ cnt += bt1_countInU64(x[i], c);
+ fprintf(stderr, "%20s\t%20ld\t%10.3f\n", "bowtie1", (long)cnt, (double)(clock() - t) / CLOCKS_PER_SEC);
+
+ fprintf(stderr, "\n");
free(x);
return 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.