Permalink
Browse files

Replacing CUBLAS benchmark with Harlan benchmark.

  • Loading branch information...
eholk committed Sep 18, 2013
1 parent b1a3dc3 commit ed077c9265ead87d6eab3b2dc50770b205692449
Showing with 15 additions and 3 deletions.
  1. +9 −0 dotprod/dotprod.kfc
  2. +6 −3 dotprod/main.cpp
@@ -0,0 +1,9 @@
;; This is known to work with Harlan version XXX

(module
(import ffi)

(define (harlan_dot N pa pb)
(let ((a (import-float-vec pa N))
(b (import-float-vec pb N)))
(reduce + (kernel ((a a) (b b)) (* a b))))))
@@ -62,6 +62,7 @@ float avx_unroll_dot(int, float *, float *);
float avx_unroll_prefetch_dot(int, float *, float *);
float blas_dot(int, float *, float *);
float cublas_dot(int, float *, float *);
float harlan_dot(int N, float *A, float *B);

int main() {
auto N = (128 << 20) / sizeof(float);
@@ -85,11 +86,13 @@ int main() {
TIME(avx_unroll_prefetch_dot);
TIME(blas_dot);

cublasInit();
TIME(cublas_dot);
TIME(harlan_dot);

//cublasInit();
//TIME(cublas_dot);

cublasShutdown();

//cublasShutdown();
free(A);
free(B);
}

0 comments on commit ed077c9

Please sign in to comment.