Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
31928ae
Merge branch 'master' into gpu-mixed-krylov
oseikuffuor1 Oct 21, 2025
a8835bb
Update autoconf build to prevent use of long double with GPUs.
oseikuffuor1 Oct 23, 2025
57d6ebb
Add utility functions for mixed-precision function development.
oseikuffuor1 Nov 14, 2025
542180e
Add new mixed-precision matrix and vector functionality.
oseikuffuor1 Nov 14, 2025
cd69eba
Updates to support use of hypre_double for dnum_nonzeros in parcsr_ma…
oseikuffuor1 Nov 14, 2025
7781cad
Minor updates to test drivers.
oseikuffuor1 Nov 14, 2025
5ce7060
Fixes for GPU build errors.
oseikuffuor1 Nov 14, 2025
91a169f
Cleanup typos and unnecessary print statements.
oseikuffuor1 Nov 14, 2025
cb030d2
Change utility function name GetSizeOfPrecision to GetSizeOfReal.
oseikuffuor1 Nov 14, 2025
8bfdbb9
Generate configure script with correct autoconf version.
oseikuffuor1 Nov 15, 2025
887c4c3
Cleanup unused variable warnings.
oseikuffuor1 Nov 15, 2025
dfea312
Some fixes and cleanup and minor refactoring for GPU build.
oseikuffuor1 Nov 18, 2025
18e458a
Add gpu function lists for utilities folder.
oseikuffuor1 Nov 18, 2025
7c44083
Added GPU-specific function lists for remaining directories.
oseikuffuor1 Nov 19, 2025
7163b69
Revert changes to MPI function location and remove unnecessary guards.
oseikuffuor1 Nov 19, 2025
1c74ee1
Updating gen_code.sh script to build code for gpu functions
rfalgout Nov 20, 2025
40f8a3a
Merge branch 'gpu-mixed-krylov' of github.com:hypre-space/hypre into …
rfalgout Nov 20, 2025
ac3e7f3
Fixed astyle changes in previous commits
oseikuffuor1 Nov 20, 2025
fd1e9e0
Merge branch 'gpu-mixed-krylov' of github.com:hypre-space/hypre into …
rfalgout Nov 20, 2025
366e620
Minor changes to config/gen_code.sh script
rfalgout Nov 20, 2025
05baa66
Removed empty gpu function lists
oseikuffuor1 Nov 21, 2025
489e1fa
Minor edit to suppress warnings for directories with no GPU function …
oseikuffuor1 Nov 21, 2025
3264a49
Minor changes to gen_code.sh to make it easier to follow
rfalgout Dec 3, 2025
1fecea4
Cosmetic changes to gen_code.sh
rfalgout Dec 3, 2025
f052718
Changed mup.*.gpu to mup.*_gpu in utilities and modified the gen_code…
rfalgout Dec 3, 2025
34762e3
Renaming mup.*.gpu to mup.*_gpu
rfalgout Dec 4, 2025
5bc2ddb
Modified gen_code.sh script to write 'mup_*_gpu.c' files
rfalgout Dec 4, 2025
3996555
First draft of gen_code.sh to put the gpu functions in separate files
rfalgout Dec 4, 2025
e20afec
Updating gen_code.sh to fix a couple of issues
rfalgout Dec 5, 2025
3fd5776
Added gpu if test to gen_code.sh script before writing '.hpp' file
rfalgout Dec 5, 2025
69c34e8
Minor edit to include internal header in wrapper function file.
oseikuffuor1 Dec 9, 2025
d4fe2a5
Changes to unify some vendor-specific return types.
oseikuffuor1 Dec 9, 2025
a3c320e
Generated new MuP wrapper code and headers for GPU support and some r…
oseikuffuor1 Dec 9, 2025
49f8e70
Fixed linker issues and updated gen_code.sh script.
oseikuffuor1 Dec 15, 2025
905f1b7
Some minor re-org. of gen_code.sh script and gix for test driver.
oseikuffuor1 Dec 16, 2025
feb75f2
Merge branch 'master' into gpu-mixed-krylov
oseikuffuor1 Dec 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 9 additions & 29 deletions src/IJ_mv/HYPRE_IJ_mv_mup.h
Original file line number Diff line number Diff line change
@@ -1,35 +1,25 @@

/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/

#ifndef HYPRE_IJ_MV_MUP_HEADER
#define HYPRE_IJ_MV_MUP_HEADER

#ifdef __cplusplus
extern "C" {
#endif

#if defined (HYPRE_MIXED_PRECISION)

/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/

/******************************************************************************
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
* HYPRE Project Developers. See the top-level COPYRIGHT file for details.
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
******************************************************************************/

#ifndef HYPRE_IJ_MV_MUP_HEADER
#define HYPRE_IJ_MV_MUP_HEADER

#ifdef __cplusplus
extern "C" {
#endif

/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/
#if defined (HYPRE_MIXED_PRECISION)

/******************************************************************************
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
* HYPRE Project Developers. See the top-level COPYRIGHT file for details.
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
******************************************************************************/
/* fixed */

/* functions */

HYPRE_Int
HYPRE_IJMatrixAdd_flt( hypre_float alpha, HYPRE_IJMatrix matrix_A, hypre_float beta, HYPRE_IJMatrix matrix_B, HYPRE_IJMatrix *matrix_C );
Expand Down Expand Up @@ -607,16 +597,7 @@ HYPRE_IJVectorUpdateValues_long_dbl( HYPRE_IJVector vector, HYPRE_Int nvalues, c
HYPRE_Int
HYPRE_IJVectorUpdateValues( HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values, HYPRE_Int action );


/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/

/******************************************************************************
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
* HYPRE Project Developers. See the top-level COPYRIGHT file for details.
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
******************************************************************************/

/* pre */

HYPRE_Int
HYPRE_IJMatrixAdd_pre( HYPRE_Precision precision, hypre_long_double alpha, HYPRE_IJMatrix matrix_A, hypre_long_double beta, HYPRE_IJMatrix matrix_B, HYPRE_IJMatrix *matrix_C );
Expand Down Expand Up @@ -810,7 +791,6 @@ HYPRE_IJVectorSetValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, H
HYPRE_Int
HYPRE_IJVectorUpdateValues_pre( HYPRE_Precision precision, HYPRE_IJVector vector, HYPRE_Int nvalues, const HYPRE_BigInt *indices, const void *values, HYPRE_Int action );


#endif

#ifdef __cplusplus
Expand Down
8 changes: 7 additions & 1 deletion src/IJ_mv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ MP_FILES = \
mup_functions.c\
mup_pre.c

MP_CUFILES=\
mup_fixed_gpu.c\
mup_functions_gpu.c\
mup_pre_gpu.c

COBJS = ${FILES:.c=.o}
CUOBJS = ${CUFILES:.c=.obj}
OBJS = ${COBJS} ${CUOBJS}
Expand All @@ -67,9 +72,10 @@ CUOBJS_single = ${CUFILES:.c=.obj_flt}
CUOBJS_double = ${CUFILES:.c=.obj_dbl}
CUOBJS_longdouble = ${CUFILES:.c=.obj_ldbl}
MP_COBJS = ${MP_FILES:.c=.o}
MP_CUOBJS = ${MP_CUFILES:.c=.obj}

OBJS = ${COBJS_single} ${COBJS_double} ${COBJS_longdouble} ${MP_COBJS}
OBJS += ${CUOBJS_single} ${CUOBJS_double} ${CUOBJS_longdouble}
OBJS += ${CUOBJS_single} ${CUOBJS_double} ${CUOBJS_longdouble} ${MP_CUOBJS}

endif

Expand Down
36 changes: 36 additions & 0 deletions src/IJ_mv/_hypre_IJ_mv.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

/*** DO NOT EDIT THIS FILE DIRECTLY (use 'headers' to generate) ***/

#ifndef hypre_IJ_HPP
#define hypre_IJ_HPP

#include <HYPRE_config.h>
#include "_hypre_utilities.hpp"

#ifdef HYPRE_MIXED_PRECISION
#include "_hypre_IJ_mv_mup_def.h"
#endif

#ifdef __cplusplus
extern "C++" {
#endif


#ifdef __cplusplus
}
#endif

#ifdef HYPRE_MIXED_PRECISION
/* The following is for user compiles and the order is important. The first
* header ensures that we do not change prototype names in user files or in the
* second header file. The second header contains all the prototypes needed by
* users for mixed precision. */
#ifndef hypre_MP_BUILD
#include "_hypre_IJ_mv_mup_undef.h"
#include "_hypre_IJ_mv_mup.h"
#include "_hypre_IJ_mv_mup.hpp"
#endif
#endif

#endif

40 changes: 10 additions & 30 deletions src/IJ_mv/_hypre_IJ_mv_mup.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/

/******************************************************************************
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
* HYPRE Project Developers. See the top-level COPYRIGHT file for details.
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
******************************************************************************/

#ifndef hypre_IJ_MV_MUP_HEADER
#define hypre_IJ_MV_MUP_HEADER

Expand All @@ -10,15 +17,7 @@ extern "C" {

#if defined (HYPRE_MIXED_PRECISION)

/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/

/******************************************************************************
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
* HYPRE Project Developers. See the top-level COPYRIGHT file for details.
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
******************************************************************************/

/* fixed */

HYPRE_Int
hypre_AuxParCSRMatrixCreate_flt( hypre_AuxParCSRMatrix **aux_matrix, HYPRE_Int local_num_rows, HYPRE_Int local_num_cols, HYPRE_Int *sizes );
Expand Down Expand Up @@ -447,28 +446,9 @@ hypre_IJVectorZeroValuesPar_dbl( hypre_IJVector *vector );
HYPRE_Int
hypre_IJVectorZeroValuesPar_long_dbl( hypre_IJVector *vector );

/* functions */

/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/

/******************************************************************************
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
* HYPRE Project Developers. See the top-level COPYRIGHT file for details.
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
******************************************************************************/



/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/

/******************************************************************************
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
* HYPRE Project Developers. See the top-level COPYRIGHT file for details.
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
******************************************************************************/


/* pre */

#endif

Expand Down
116 changes: 116 additions & 0 deletions src/IJ_mv/_hypre_IJ_mv_mup.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@

/*** DO NOT EDIT THIS FILE DIRECTLY (use ../config/gen_code.sh to generate) ***/

/******************************************************************************
* Copyright (c) 1998 Lawrence Livermore National Security, LLC and other
* HYPRE Project Developers. See the top-level COPYRIGHT file for details.
*
* SPDX-License-Identifier: (Apache-2.0 OR MIT)
******************************************************************************/

#ifndef hypre_IJ_MV_MUP_HEADER_CXX
#define hypre_IJ_MV_MUP_HEADER_CXX

#ifdef __cplusplus
extern "C" {
#endif

#if defined (HYPRE_MIXED_PRECISION)
#if defined(HYPRE_USING_GPU)

/* fixed_gpu */

HYPRE_Int
hypre_IJMatrixAssembleCommunicate_flt( hypre_IJMatrix *matrix );
HYPRE_Int
hypre_IJMatrixAssembleCommunicate_dbl( hypre_IJMatrix *matrix );
HYPRE_Int
hypre_IJMatrixAssembleCommunicate_long_dbl( hypre_IJMatrix *matrix );

HYPRE_Int
hypre_IJMatrixAssembleCompressDevice_flt( hypre_IJMatrix *matrix, HYPRE_Int reduce_stack_size );
HYPRE_Int
hypre_IJMatrixAssembleCompressDevice_dbl( hypre_IJMatrix *matrix, HYPRE_Int reduce_stack_size );
HYPRE_Int
hypre_IJMatrixAssembleCompressDevice_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int reduce_stack_size );

HYPRE_Int
hypre_IJMatrixAssembleParCSRDevice_flt( hypre_IJMatrix *matrix );
HYPRE_Int
hypre_IJMatrixAssembleParCSRDevice_dbl( hypre_IJMatrix *matrix );
HYPRE_Int
hypre_IJMatrixAssembleParCSRDevice_long_dbl( hypre_IJMatrix *matrix );

HYPRE_Int
hypre_IJMatrixGetValuesParCSRDevice_flt( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_float *values, HYPRE_Int zero_out );
HYPRE_Int
hypre_IJMatrixGetValuesParCSRDevice_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_double *values, HYPRE_Int zero_out );
HYPRE_Int
hypre_IJMatrixGetValuesParCSRDevice_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, HYPRE_BigInt *rows, HYPRE_Int *row_indexes, HYPRE_BigInt *cols, hypre_long_double *values, HYPRE_Int zero_out );

HYPRE_Int
hypre_IJMatrixSetAddValuesParCSRDevice_flt( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_float *values, const char *action );
HYPRE_Int
hypre_IJMatrixSetAddValuesParCSRDevice_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_double *values, const char *action );
HYPRE_Int
hypre_IJMatrixSetAddValuesParCSRDevice_long_dbl( hypre_IJMatrix *matrix, HYPRE_Int nrows, HYPRE_Int *ncols, const HYPRE_BigInt *rows, const HYPRE_Int *row_indexes, const HYPRE_BigInt *cols, const hypre_long_double *values, const char *action );

HYPRE_Int
hypre_IJMatrixSetConstantValuesParCSRDevice_flt( hypre_IJMatrix *matrix, hypre_float value );
HYPRE_Int
hypre_IJMatrixSetConstantValuesParCSRDevice_dbl( hypre_IJMatrix *matrix, hypre_double value );
HYPRE_Int
hypre_IJMatrixSetConstantValuesParCSRDevice_long_dbl( hypre_IJMatrix *matrix, hypre_long_double value );

HYPRE_Int
hypre_IJVectorAssembleParDevice_flt( hypre_IJVector *vector );
HYPRE_Int
hypre_IJVectorAssembleParDevice_dbl( hypre_IJVector *vector );
HYPRE_Int
hypre_IJVectorAssembleParDevice_long_dbl( hypre_IJVector *vector );

HYPRE_Int
hypre_IJVectorSetAddValuesParDevice_flt( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_float *values, const char *action );
HYPRE_Int
hypre_IJVectorSetAddValuesParDevice_dbl( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_double *values, const char *action );
HYPRE_Int
hypre_IJVectorSetAddValuesParDevice_long_dbl( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_long_double *values, const char *action );

HYPRE_Int
hypre_IJVectorUpdateValuesDevice_flt( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_float *values, HYPRE_Int action );
HYPRE_Int
hypre_IJVectorUpdateValuesDevice_dbl( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_double *values, HYPRE_Int action );
HYPRE_Int
hypre_IJVectorUpdateValuesDevice_long_dbl( hypre_IJVector *vector, HYPRE_Int num_values, const HYPRE_BigInt *indices, const hypre_long_double *values, HYPRE_Int action );

/* functions_gpu */

/* pre_gpu */


#endif
#endif

#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C++" {
#endif

#if defined (HYPRE_MIXED_PRECISION)
#if defined(HYPRE_USING_GPU)

/* fixed_gpu */


#endif
#endif

#ifdef __cplusplus
}
#endif

#endif

18 changes: 18 additions & 0 deletions src/IJ_mv/_hypre_IJ_mv_mup_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,23 @@
#define hypre_ijvectorsetmaxoffprocelmt HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorsetmaxoffprocelmt )
#define hypre_ijvectorsetobjecttype HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorsetobjecttype )
#define hypre_ijvectorsetvalues HYPRE_FIXEDPRECISION_FUNC ( hypre_ijvectorsetvalues )
#define hypreCUDAKernel_IJVectorUpdateValues HYPRE_FIXEDPRECISION_FUNC ( hypreCUDAKernel_IJVectorUpdateValues )
#define hypreGPUKernel_IJMatrixValues_dev1 HYPRE_FIXEDPRECISION_FUNC ( hypreGPUKernel_IJMatrixValues_dev1 )
#define hypreGPUKernel_IJVectorAssemblePar HYPRE_FIXEDPRECISION_FUNC ( hypreGPUKernel_IJVectorAssemblePar )
#define hypre_AuxParCSRMatrixStackReallocate HYPRE_FIXEDPRECISION_FUNC ( hypre_AuxParCSRMatrixStackReallocate )
#define hypre_IJMatrixAssembleCommunicate HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixAssembleCommunicate )
#define hypre_IJMatrixAssembleCompressDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixAssembleCompressDevice )
#define hypre_IJMatrixAssembleParCSRDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixAssembleParCSRDevice )
#define hypre_IJMatrixAssembleSortAndReduce1 HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixAssembleSortAndReduce1 )
#define hypre_IJMatrixAssembleSortAndReduce2 HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixAssembleSortAndReduce2 )
#define hypre_IJMatrixAssembleSortAndReduce3 HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixAssembleSortAndReduce3 )
#define hypre_IJMatrixGetValuesParCSRDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixGetValuesParCSRDevice )
#define hypre_IJMatrixSetAddValuesParCSRDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetAddValuesParCSRDevice )
#define hypre_IJMatrixSetConstantValuesParCSRDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_IJMatrixSetConstantValuesParCSRDevice )
#define hypre_IJVectorAssembleParDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorAssembleParDevice )
#define hypre_IJVectorAssembleSortAndReduce1 HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorAssembleSortAndReduce1 )
#define hypre_IJVectorAssembleSortAndReduce3 HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorAssembleSortAndReduce3 )
#define hypre_IJVectorSetAddValuesParDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorSetAddValuesParDevice )
#define hypre_IJVectorUpdateValuesDevice HYPRE_FIXEDPRECISION_FUNC ( hypre_IJVectorUpdateValuesDevice )

#endif
18 changes: 18 additions & 0 deletions src/IJ_mv/_hypre_IJ_mv_mup_undef.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,3 +177,21 @@
#undef hypre_ijvectorsetmaxoffprocelmt
#undef hypre_ijvectorsetobjecttype
#undef hypre_ijvectorsetvalues
#undef hypreCUDAKernel_IJVectorUpdateValues
#undef hypreGPUKernel_IJMatrixValues_dev1
#undef hypreGPUKernel_IJVectorAssemblePar
#undef hypre_AuxParCSRMatrixStackReallocate
#undef hypre_IJMatrixAssembleCommunicate
#undef hypre_IJMatrixAssembleCompressDevice
#undef hypre_IJMatrixAssembleParCSRDevice
#undef hypre_IJMatrixAssembleSortAndReduce1
#undef hypre_IJMatrixAssembleSortAndReduce2
#undef hypre_IJMatrixAssembleSortAndReduce3
#undef hypre_IJMatrixGetValuesParCSRDevice
#undef hypre_IJMatrixSetAddValuesParCSRDevice
#undef hypre_IJMatrixSetConstantValuesParCSRDevice
#undef hypre_IJVectorAssembleParDevice
#undef hypre_IJVectorAssembleSortAndReduce1
#undef hypre_IJVectorAssembleSortAndReduce3
#undef hypre_IJVectorSetAddValuesParDevice
#undef hypre_IJVectorUpdateValuesDevice
Loading