Commit 6c5a543b authored by THIBAULT Samuel's avatar THIBAULT Samuel
Browse files

Fix simgrid link on systems without blas

parent 55266b49
/* StarPU --- Runtime system for heterogeneous multicore architectures.
*
* Copyright (C) 2009, 2010-2011 Université de Bordeaux 1
* Copyright (C) 2009, 2010-2011, 2019 Université de Bordeaux 1
* Copyright (C) 2010 Centre National de la Recherche Scientifique
*
* StarPU is free software; you can redistribute it and/or modify
......@@ -20,6 +20,7 @@
#include <starpu.h>
#ifndef STARPU_SIMGRID
#ifdef STARPU_ATLAS
#include <cblas.h>
#endif
......@@ -152,6 +153,7 @@ extern double ddot_(const int *n, const double *x, const int *incx, const double
extern void sswap_(const int *n, float *x, const int *incx, float *y, const int *incy);
extern void dswap_(const int *n, double *x, const int *incx, double *y, const int *incy);
#endif
#endif
#endif /* __BLAS_H__ */
......@@ -49,6 +49,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)
#ifndef STARPU_SIMGRID
static void check_output(void)
{
/* compute C = C - AB */
......@@ -71,6 +72,7 @@ static void check_output(void)
FPRINTF(stderr, "Max error : %e\n", C[max]);
}
}
#endif
static void init_problem_data(void)
{
......@@ -135,6 +137,7 @@ static void partition_mult_data(void)
static void mult_kernel_common(void *descr[], int type)
{
#ifndef STARPU_SIMGRID
TYPE *subA = (TYPE *)STARPU_MATRIX_GET_PTR(descr[0]);
TYPE *subB = (TYPE *)STARPU_MATRIX_GET_PTR(descr[1]);
TYPE *subC = (TYPE *)STARPU_MATRIX_GET_PTR(descr[2]);
......@@ -180,6 +183,7 @@ static void mult_kernel_common(void *descr[], int type)
cudaStreamSynchronize(starpu_cuda_get_local_stream());
}
#endif
#endif
}
#ifdef STARPU_USE_CUDA
......@@ -363,8 +367,10 @@ enodev:
starpu_data_unregister(B_handle);
starpu_data_unregister(C_handle);
#ifndef STARPU_SIMGRID
if (check)
check_output();
#endif
starpu_free(A);
starpu_free(B);
......
/* StarPU --- Runtime system for heterogeneous multicore architectures.
*
* Copyright (C) 2009, 2010-2011 Université de Bordeaux 1
* Copyright (C) 2009, 2010-2011, 2019 Université de Bordeaux 1
* Copyright (C) 2010 Centre National de la Recherche Scientifique
*
* StarPU is free software; you can redistribute it and/or modify
......@@ -20,6 +20,7 @@
#include <starpu.h>
#ifndef STARPU_SIMGRID
#ifdef STARPU_ATLAS
#include <cblas.h>
#endif
......@@ -152,6 +153,7 @@ extern double ddot_(const int *n, const double *x, const int *incx, const double
extern void sswap_(const int *n, float *x, const int *incx, float *y, const int *incy);
extern void dswap_(const int *n, double *x, const int *incx, double *y, const int *incy);
#endif
#endif
#endif /* __BLAS_H__ */
......@@ -49,6 +49,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)
#ifndef STARPU_SIMGRID
static void check_output(void)
{
/* compute C = C - AB */
......@@ -71,6 +72,7 @@ static void check_output(void)
FPRINTF(stderr, "Max error : %e\n", C[max]);
}
}
#endif
static void init_problem_data(void)
{
......@@ -135,6 +137,7 @@ static void partition_mult_data(void)
static void mult_kernel_common(void *descr[], int type)
{
#ifndef STARPU_SIMGRID
TYPE *subA = (TYPE *)STARPU_MATRIX_GET_PTR(descr[0]);
TYPE *subB = (TYPE *)STARPU_MATRIX_GET_PTR(descr[1]);
TYPE *subC = (TYPE *)STARPU_MATRIX_GET_PTR(descr[2]);
......@@ -180,6 +183,7 @@ static void mult_kernel_common(void *descr[], int type)
cudaStreamSynchronize(starpu_cuda_get_local_stream());
}
#endif
#endif
}
#ifdef STARPU_USE_CUDA
......@@ -363,8 +367,10 @@ enodev:
starpu_data_unregister(B_handle);
starpu_data_unregister(C_handle);
#ifndef STARPU_SIMGRID
if (check)
check_output();
#endif
starpu_free(A);
starpu_free(B);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment