-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'bugfix/magma-cudatoolkit' into bugfix/find-magma
- Loading branch information
Showing
10 changed files
with
162 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* ----------------------------------------------------------------- | ||
* Programmer(s): Cody J. Balos @ LLNL | ||
* ----------------------------------------------------------------- | ||
* SUNDIALS Copyright Start | ||
* Copyright (c) 2002-2023, Lawrence Livermore National Security | ||
* and Southern Methodist University. | ||
* All rights reserved. | ||
* | ||
* See the top-level LICENSE and NOTICE files for details. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
* SUNDIALS Copyright End | ||
* ----------------------------------------------------------------- | ||
* This header files defines internal utility functions and macros | ||
* for working with CUDA. | ||
* ----------------------------------------------------------------- | ||
*/ | ||
|
||
#include <assert.h> | ||
#include <stdio.h> | ||
|
||
#include <cuda_runtime.h> | ||
#include <cusolverDn.h> | ||
#include <cusolverSp.h> | ||
|
||
#include <sundials/sundials_types.h> | ||
|
||
#ifndef _SUNDIALS_CUSOLVER_H | ||
#define _SUNDIALS_CUSOLVER_H | ||
|
||
#ifdef __cplusplus /* wrapper to enable C++ usage */ | ||
extern "C" { | ||
#endif | ||
|
||
/* --------------------------------------------------------------------------- | ||
* Utility macros | ||
* ---------------------------------------------------------------------------*/ | ||
|
||
#define SUNDIALS_CUSOLVER_VERIFY(cuerr) SUNDIALS_CUSOLVER_Assert(cuerr, __FILE__, __LINE__) | ||
|
||
|
||
/* --------------------------------------------------------------------------- | ||
* Utility functions | ||
* ---------------------------------------------------------------------------*/ | ||
|
||
inline booleantype SUNDIALS_CUSOLVER_Assert(cusolverStatus_t status, const char *file, int line) | ||
{ | ||
if (status != CUSOLVER_STATUS_SUCCESS) | ||
{ | ||
#ifdef SUNDIALS_DEBUG | ||
fprintf(stderr, | ||
"ERROR in cuSOLVER runtime operation: cusolverStatus_t = %d %s:%d\n", | ||
status, file, line); | ||
#ifdef SUNDIALS_DEBUG_ASSERT | ||
assert(false); | ||
#endif | ||
#endif | ||
return SUNFALSE; /* Assert failed */ | ||
} | ||
return SUNTRUE; /* Assert OK */ | ||
} | ||
|
||
#ifdef __cplusplus /* wrapper to enable C++ usage */ | ||
} | ||
#endif | ||
|
||
#endif /* _SUNDIALS_CUSOLVER_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* ----------------------------------------------------------------- | ||
* Programmer(s): Cody J. Balos @ LLNL | ||
* ----------------------------------------------------------------- | ||
* SUNDIALS Copyright Start | ||
* Copyright (c) 2002-2023, Lawrence Livermore National Security | ||
* and Southern Methodist University. | ||
* All rights reserved. | ||
* | ||
* See the top-level LICENSE and NOTICE files for details. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
* SUNDIALS Copyright End | ||
* ----------------------------------------------------------------- | ||
* This header files defines internal utility functions and macros | ||
* for working with CUDA. | ||
* ----------------------------------------------------------------- | ||
*/ | ||
|
||
#include <assert.h> | ||
#include <stdio.h> | ||
|
||
#include <cuda_runtime.h> | ||
#include <cusparse.h> | ||
|
||
#include <sundials/sundials_types.h> | ||
|
||
#ifndef _SUNDIALS_CUSPARSE_H | ||
#define _SUNDIALS_CUSPARSE_H | ||
|
||
#ifdef __cplusplus /* wrapper to enable C++ usage */ | ||
extern "C" { | ||
#endif | ||
|
||
/* --------------------------------------------------------------------------- | ||
* Utility macros | ||
* ---------------------------------------------------------------------------*/ | ||
|
||
#define SUNDIALS_CUSPARSE_VERIFY(cuerr) SUNDIALS_CUSPARSE_Assert(cuerr, __FILE__, __LINE__) | ||
|
||
/* --------------------------------------------------------------------------- | ||
* Utility functions | ||
* ---------------------------------------------------------------------------*/ | ||
|
||
inline booleantype SUNDIALS_CUSPARSE_Assert(cusparseStatus_t status, const char *file, int line) | ||
{ | ||
if (status != CUSPARSE_STATUS_SUCCESS) | ||
{ | ||
#ifdef SUNDIALS_DEBUG | ||
fprintf(stderr, | ||
"ERROR in cuSPARSE runtime operation: cusparseStatus_t = %d %s:%d\n", | ||
status, file, line); | ||
#ifdef SUNDIALS_DEBUG_ASSERT | ||
assert(false); | ||
#endif | ||
#endif | ||
return SUNFALSE; /* Assert failed */ | ||
} | ||
return SUNTRUE; /* Assert OK */ | ||
} | ||
|
||
#ifdef __cplusplus /* wrapper to enable C++ usage */ | ||
} | ||
#endif | ||
|
||
#endif /* _SUNDIALS_CUSPARSE_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters