From 61e5e89a2ee1f1461cffe81a933bfeb3eb5f6434 Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Sat, 30 Mar 2024 20:34:07 -0700 Subject: [PATCH] Bugfix: Add missing include guards to header files (#452) --- examples/arkode/CXX_parallel/ark_brusselator1D.h | 5 +++++ examples/nvector/test_nvector.h | 5 +++++ examples/utilities/custom_memory_helper_gpu.h | 5 +++++ examples/utilities/custom_memory_helper_sycl.h | 5 +++++ src/sundials/sundials_adiak_metadata.h | 5 +++++ src/sundials/sundials_iterative_impl.h | 5 +++++ 6 files changed, 30 insertions(+) diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D.h b/examples/arkode/CXX_parallel/ark_brusselator1D.h index 38cc6ee7a4..b95390bc4a 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D.h +++ b/examples/arkode/CXX_parallel/ark_brusselator1D.h @@ -12,6 +12,9 @@ * SUNDIALS Copyright End * ---------------------------------------------------------------------------*/ +#ifndef _ARK_BRUSSELATOR1D_H +#define _ARK_BRUSSELATOR1D_H + #include #include #include @@ -266,3 +269,5 @@ static int check_retval(void* returnvalue, const char* funcname, int opt); static void gpuAssert(GPU_PREFIX(Error_t) code, const char* file, int line, int abort); #endif + +#endif diff --git a/examples/nvector/test_nvector.h b/examples/nvector/test_nvector.h index 9ff1c6163e..7984712649 100644 --- a/examples/nvector/test_nvector.h +++ b/examples/nvector/test_nvector.h @@ -15,6 +15,9 @@ * test an NVECTOR module implementation. * -----------------------------------------------------------------*/ +#ifndef _TEST_NVECTOR_H +#define _TEST_NVECTOR_H + #include #include @@ -146,3 +149,5 @@ void SetTiming(int onoff, int myid); #ifdef __cplusplus } #endif + +#endif diff --git a/examples/utilities/custom_memory_helper_gpu.h b/examples/utilities/custom_memory_helper_gpu.h index ca5950a7f9..08872f983e 100644 --- a/examples/utilities/custom_memory_helper_gpu.h +++ b/examples/utilities/custom_memory_helper_gpu.h @@ -15,6 +15,9 @@ * unmanaged memory only and synchronous copies. * -----------------------------------------------------------------*/ +#ifndef _CUSTOM_MEMORY_HELPER_GPU_H +#define _CUSTOM_MEMORY_HELPER_GPU_H + #include #include #if defined(__NVCC__) @@ -157,3 +160,5 @@ SUNMemoryHelper MyMemoryHelper(SUNContext sunctx) return helper; } + +#endif diff --git a/examples/utilities/custom_memory_helper_sycl.h b/examples/utilities/custom_memory_helper_sycl.h index 6af7c0d435..3135f3ad5d 100644 --- a/examples/utilities/custom_memory_helper_sycl.h +++ b/examples/utilities/custom_memory_helper_sycl.h @@ -15,6 +15,9 @@ * unmanaged memory only and synchronous copies. * -----------------------------------------------------------------*/ +#ifndef _CUSTOM_MEMORY_HELPER_SYCL_H +#define _CUSTOM_MEMORY_HELPER_SYCL_H + #include #include #include @@ -116,3 +119,5 @@ SUNMemoryHelper MyMemoryHelper(SUNContext sunctx) return helper; } + +#endif diff --git a/src/sundials/sundials_adiak_metadata.h b/src/sundials/sundials_adiak_metadata.h index 8013dbdc6b..4e7e908a66 100644 --- a/src/sundials/sundials_adiak_metadata.h +++ b/src/sundials/sundials_adiak_metadata.h @@ -12,6 +12,9 @@ * SUNDIALS Copyright End * ----------------------------------------------------------------*/ +#ifndef _SUNDIALS_ADIAK_METADATA_H +#define _SUNDIALS_ADIAK_METADATA_H + #ifdef SUNDIALS_ADIAK_ENABLED #include @@ -142,3 +145,5 @@ static void sunAdiakCollectMetadata() #endif } #endif + +#endif diff --git a/src/sundials/sundials_iterative_impl.h b/src/sundials/sundials_iterative_impl.h index 5ebf796761..ea6c17c10e 100644 --- a/src/sundials/sundials_iterative_impl.h +++ b/src/sundials/sundials_iterative_impl.h @@ -15,6 +15,9 @@ * different iterative solvers. * ---------------------------------------------------------------------------*/ +#ifndef _SUNDIALS_ITERATIVE_IMPL_H +#define _SUNDIALS_ITERATIVE_IMPL_H + #include /* ----------------------------------------------------------------------------- @@ -33,3 +36,5 @@ struct _SUNQRData N_Vector vtemp2; sunrealtype* temp_array; }; + +#endif