|
@@ -33,7 +33,9 @@
|
|
|
#include <starpu.h>
|
|
|
#include <starpu_fxt.h>
|
|
|
|
|
|
+#ifdef STARPU_HAVE_BLAS
|
|
|
#include <common/blas.h>
|
|
|
+#endif
|
|
|
|
|
|
#ifdef STARPU_USE_CUDA
|
|
|
#include <cuda.h>
|
|
@@ -68,6 +70,7 @@ static starpu_data_handle_t A_handle, B_handle, C_handle;
|
|
|
#define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
|
|
|
#define PRINTF(fmt, ...) do { if (!getenv("STARPU_SSILENT")) {printf(fmt, ## __VA_ARGS__); fflush(stdout); }} while(0)
|
|
|
|
|
|
+#ifdef STARPU_HAVE_BLAS
|
|
|
static int check_output(void)
|
|
|
{
|
|
|
/* compute C = C - AB */
|
|
@@ -92,6 +95,7 @@ static int check_output(void)
|
|
|
return 1;
|
|
|
}
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
static void init_problem_data(void)
|
|
|
{
|
|
@@ -225,6 +229,7 @@ static void cublas_gemm(void *descr[], void *arg)
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
+#ifdef STARPU_HAVE_BLAS
|
|
|
void cpu_mult(void *descr[], void *arg, TYPE beta)
|
|
|
{
|
|
|
(void)arg;
|
|
@@ -273,6 +278,7 @@ void cpu_gemm(void *descr[], void *arg)
|
|
|
{
|
|
|
cpu_mult(descr, arg, 1.);
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
static struct starpu_perfmodel starpu_gemm_model =
|
|
|
{
|
|
@@ -282,10 +288,12 @@ static struct starpu_perfmodel starpu_gemm_model =
|
|
|
|
|
|
static struct starpu_codelet cl_gemm0 =
|
|
|
{
|
|
|
+#ifdef STARPU_HAVE_BLAS
|
|
|
.type = STARPU_SEQ, /* changed to STARPU_SPMD if -spmd is passed */
|
|
|
.max_parallelism = INT_MAX,
|
|
|
.cpu_funcs = {cpu_gemm0},
|
|
|
.cpu_funcs_name = {"cpu_gemm0"},
|
|
|
+#endif
|
|
|
#ifdef STARPU_USE_CUDA
|
|
|
.cuda_funcs = {cublas_gemm0},
|
|
|
#elif defined(STARPU_SIMGRID)
|
|
@@ -299,10 +307,12 @@ static struct starpu_codelet cl_gemm0 =
|
|
|
|
|
|
static struct starpu_codelet cl_gemm =
|
|
|
{
|
|
|
+#ifdef STARPU_HAVE_BLAS
|
|
|
.type = STARPU_SEQ, /* changed to STARPU_SPMD if -spmd is passed */
|
|
|
.max_parallelism = INT_MAX,
|
|
|
.cpu_funcs = {cpu_gemm},
|
|
|
.cpu_funcs_name = {"cpu_gemm"},
|
|
|
+#endif
|
|
|
#ifdef STARPU_USE_CUDA
|
|
|
.cuda_funcs = {cublas_gemm},
|
|
|
#elif defined(STARPU_SIMGRID)
|
|
@@ -599,10 +609,12 @@ enodev:
|
|
|
starpu_data_unregister(B_handle);
|
|
|
starpu_data_unregister(C_handle);
|
|
|
|
|
|
+#ifdef STARPU_HAVE_BLAS
|
|
|
#ifndef STARPU_SIMGRID
|
|
|
if (check)
|
|
|
ret = check_output();
|
|
|
#endif
|
|
|
+#endif
|
|
|
|
|
|
starpu_free_flags(A, zdim*ydim*sizeof(TYPE), STARPU_MALLOC_PINNED|STARPU_MALLOC_SIMULATION_FOLDED);
|
|
|
starpu_free_flags(B, xdim*zdim*sizeof(TYPE), STARPU_MALLOC_PINNED|STARPU_MALLOC_SIMULATION_FOLDED);
|