Skip to content

Commit

Permalink
Cublas: sometimes we would include cublas.h before including cusolver.h
Browse files Browse the repository at this point in the history
use cublasv2 by default (req. for cusolver anyway) except if cublas(v1)
is included before the dplasmajdf/aux.h include
This reverts the logic for cublas.h determination, and is a first steps
toward deprecating cublas(v1) usage entirely
  • Loading branch information
abouteiller committed Aug 9, 2024
1 parent 81e56dc commit 309fb5a
Show file tree
Hide file tree
Showing 27 changed files with 99 additions and 133 deletions.
8 changes: 4 additions & 4 deletions src/dplasmaaux_cuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
/**
* DPLASMA currently supports a mix of cublas v1 and v2, but not in the same source file. Thus,
* the simplest way to provide common headers is to require the developer to manually specify
* when cublas_v2 is needed by including the header before dplasmaaux.h. Otherwise, we will include
* cublas.h (v1) automatically if CUDA is enabled.
* when legacy cublas is needed by including the header before dplasmaaux.h. Otherwise, we will include
* cublas_v2.h (v2) automatically if CUDA is enabled.
*/
#if !defined(CUBLAS_V2_H_)
#include <cublas.h>
#if !defined(CUBLAS_H_)
#include <cublas_v2.h>
#endif /* !defined(CUBLAS_V2_H_) */

#define dplasma_cublas_side(side) \
Expand Down
5 changes: 0 additions & 5 deletions src/dtd_wrappers/zgemm.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
*
*/
#include "dplasma/config.h"

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas_v2.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */

#include "dplasma_z_dtd.h"

int
Expand Down
5 changes: 0 additions & 5 deletions src/dtd_wrappers/zherk.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
*
*/
#include "dplasma/config.h"

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas_v2.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */

#include "dplasma_z_dtd.h"

int
Expand Down
5 changes: 0 additions & 5 deletions src/dtd_wrappers/zpotrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
*
*/
#include "dplasma/config.h"

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas_v2.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */

#include "dplasma_z_dtd.h"

int
Expand Down
5 changes: 0 additions & 5 deletions src/dtd_wrappers/ztrsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@
*
*/
#include "dplasma/config.h"

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas_v2.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */

#include "dplasma_z_dtd.h"

int
Expand Down
11 changes: 5 additions & 6 deletions src/zgemm_NN.jdf
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
extern "C" %{
/*
* Copyright (c) 2010-2023 The University of Tennessee and The University
* Copyright (c) 2010-2024 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
*
* @precisions normal z -> s d c
* $COPYRIGHT
*
*/
#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#include "dplasmajdf.h"
#include "dplasmaaux.h"
#include "parsec/data_dist/matrix/matrix.h"
#include "parsec/data_dist/matrix/two_dim_rectangle_cyclic.h"
#include <math.h>

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */

/* Define the different shapes this JDF is using */
#define A_SHAPE 0
#define B_SHAPE 1
Expand Down
14 changes: 5 additions & 9 deletions src/zgemm_NN_gpu.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ extern "C" %{
*
*/

#include <math.h>
#include "dplasmajdf.h"
#include "dplasmaaux.h"
#include "parsec/data_dist/matrix/matrix.h"
#include "parsec/data_dist/matrix/two_dim_rectangle_cyclic.h"

#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#if defined(DPLASMA_HAVE_HIP)
#include <hipblas/hipblas.h>
#endif /* defined(DPLASMA_HAVE_HIP) */
#include "dplasmajdf.h"
#include "parsec/data_dist/matrix/matrix.h"
#include "parsec/data_dist/matrix/two_dim_rectangle_cyclic.h"
#include <math.h>

static void succ(int *x, int *y, int *z, int xMax, int yMax, int zMax, int l)
{
Expand Down
12 changes: 4 additions & 8 deletions src/zgemm_NN_summa.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ extern "C" %{
* $COPYRIGHT
*
*/
#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#include "dplasmajdf.h"
#include "dplasmaaux.h"
#include "parsec/data_dist/matrix/matrix.h"
#include "parsec/data_dist/matrix/two_dim_rectangle_cyclic.h"
#include <math.h>

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#if defined(DPLASMA_HAVE_HIP)
#include <hipblas/hipblas.h>
#endif /* defined(DPLASMA_HAVE_HIP) */

/* Define the different shapes this JDF is using */
#define A_SHAPE 0
#define B_SHAPE 1
Expand Down
11 changes: 5 additions & 6 deletions src/zgemm_NT.jdf
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
extern "C" %{
/*
* Copyright (c) 2010-2023 The University of Tennessee and The University
* Copyright (c) 2010-2024 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
*
* @precisions normal z -> s d c
* $COPYRIGHT
*
*/
#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#include "dplasmajdf.h"
#include "dplasmaaux.h"
#include "parsec/data_dist/matrix/matrix.h"
#include "parsec/data_dist/matrix/two_dim_rectangle_cyclic.h"
#include <math.h>

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */

/* Define the different shapes this JDF is using */
#define A_SHAPE 0
#define B_SHAPE 1
Expand Down
12 changes: 4 additions & 8 deletions src/zgemm_NT_summa.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ extern "C" %{
* $COPYRIGHT
*
*/
#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#include "dplasmajdf.h"
#include "dplasmaaux.h"
#include "parsec/data_dist/matrix/matrix.h"
#include "parsec/data_dist/matrix/two_dim_rectangle_cyclic.h"
#include <math.h>

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#if defined(DPLASMA_HAVE_HIP)
#include <hipblas/hipblas.h>
#endif /* defined(DPLASMA_HAVE_HIP) */

/* Define the different shapes this JDF is using */
#define A_SHAPE 0
#define B_SHAPE 1
Expand Down
11 changes: 5 additions & 6 deletions src/zgemm_TN.jdf
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
extern "C" %{
/*
* Copyright (c) 2010-2023 The University of Tennessee and The University
* Copyright (c) 2010-2024 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
*
* @precisions normal z -> s d c
* $COPYRIGHT
*
*/
#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#include "dplasmajdf.h"
#include "dplasmaaux.h"
#include "parsec/data_dist/matrix/matrix.h"
#include "parsec/data_dist/matrix/two_dim_rectangle_cyclic.h"
#include <math.h>

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */

/* Define the different shapes this JDF is using */
#define A_SHAPE 0
#define B_SHAPE 1
Expand Down
12 changes: 4 additions & 8 deletions src/zgemm_TN_summa.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ extern "C" %{
* $COPYRIGHT
*
*/
#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#include "dplasmajdf.h"
#include "dplasmaaux.h"
#include "parsec/data_dist/matrix/matrix.h"
#include "parsec/data_dist/matrix/two_dim_rectangle_cyclic.h"
#include <math.h>

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#if defined(DPLASMA_HAVE_HIP)
#include <hipblas/hipblas.h>
#endif /* defined(DPLASMA_HAVE_HIP) */

/* Define the different shapes this JDF is using */
#define A_SHAPE 0
#define B_SHAPE 1
Expand Down
11 changes: 5 additions & 6 deletions src/zgemm_TT.jdf
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
extern "C" %{
/*
* Copyright (c) 2010-2023 The University of Tennessee and The University
* Copyright (c) 2010-2024 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
*
* @precisions normal z -> s d c
* $COPYRIGHT
*
*/
#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#include "dplasmajdf.h"
#include "dplasmaaux.h"
#include "parsec/data_dist/matrix/matrix.h"
#include "parsec/data_dist/matrix/two_dim_rectangle_cyclic.h"
#include <math.h>

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */

/* Define the different shapes this JDF is using */
#define A_SHAPE 0
#define B_SHAPE 1
Expand Down
12 changes: 4 additions & 8 deletions src/zgemm_TT_summa.jdf
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ extern "C" %{
* $COPYRIGHT
*
*/
#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#include "dplasmajdf.h"
#include "dplasmaaux.h"
#include "parsec/data_dist/matrix/matrix.h"
#include "parsec/data_dist/matrix/two_dim_rectangle_cyclic.h"
#include <math.h>

#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#if defined(DPLASMA_HAVE_HIP)
#include <hipblas/hipblas.h>
#endif /* defined(DPLASMA_HAVE_HIP) */

/* Define the different shapes this JDF is using */
#define A_SHAPE 0
#define B_SHAPE 1
Expand Down
8 changes: 4 additions & 4 deletions src/zgetrf_nopiv.jdf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extern "C" %{
/*
* Copyright (c) 2010-2023 The University of Tennessee and The University
* Copyright (c) 2010-2024 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2013 Inria. All rights reserved.
Expand All @@ -10,12 +10,12 @@ extern "C" %{
* @precisions normal z -> s d c
*
*/
#include "dplasmajdf.h"
#include "parsec/data_dist/matrix/matrix.h"

#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */
#include "dplasmajdf.h"
#include "parsec/data_dist/matrix/matrix.h"

/* Define the different shapes this JDF is using */
#define DEFAULT 0
Expand Down
9 changes: 4 additions & 5 deletions src/zpoinv_L.jdf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extern "C" %{
/*
* Copyright (c) 2010-2020 The University of Tennessee and The University
* Copyright (c) 2010-2024 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2013 Inria. All rights reserved.
Expand All @@ -10,13 +10,12 @@ extern "C" %{
* @precisions normal z -> s d c
*
*/
#include "dplasmajdf.h"
#include "parsec/data_dist/matrix/matrix.h"

#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */

#include "dplasmajdf.h"
#include "parsec/data_dist/matrix/matrix.h"
%}

descA [type = "parsec_tiled_matrix_t*"]
Expand Down
9 changes: 4 additions & 5 deletions src/zpoinv_U.jdf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
extern "C" %{
/*
* Copyright (c) 2010-2020 The University of Tennessee and The University
* Copyright (c) 2010-2024 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2013 Inria. All rights reserved.
Expand All @@ -10,13 +10,12 @@ extern "C" %{
* @precisions normal z -> s d c
*
*/
#include "dplasmajdf.h"
#include "parsec/data_dist/matrix/matrix.h"

#include "dplasma/config.h"
#if defined(DPLASMA_HAVE_CUDA)
#include <cublas.h>
#endif /* defined(DPLASMA_HAVE_CUDA) */

#include "dplasmajdf.h"
#include "parsec/data_dist/matrix/matrix.h"
%}

descA [type = "parsec_tiled_matrix_t*"]
Expand Down
Loading

0 comments on commit 309fb5a

Please sign in to comment.