#!/bin/sh
# 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)

INTERNAL_HEADER=_hypre_utilities.h

#===========================================================================
# Include guards and other includes
#===========================================================================

cat > $INTERNAL_HEADER <<@

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

#ifndef hypre_UTILITIES_HEADER
#define hypre_UTILITIES_HEADER

#include "HYPRE_utilities.h"

#ifdef HYPRE_USING_OPENMP
#include <omp.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

@

#===========================================================================
# Structures and prototypes
#===========================================================================

cat general.h                  >> $INTERNAL_HEADER
cat printf.h                   >> $INTERNAL_HEADER
cat error.h                    >> $INTERNAL_HEADER
cat mpistubs.h                 >> $INTERNAL_HEADER
cat smp.h                      >> $INTERNAL_HEADER
cat memory.h                   >> $INTERNAL_HEADER
cat omp_device.h               >> $INTERNAL_HEADER
cat threading.h                >> $INTERNAL_HEADER
cat timing.h                   >> $INTERNAL_HEADER
cat amg_linklist.h             >> $INTERNAL_HEADER
cat exchange_data.h            >> $INTERNAL_HEADER
cat caliper_instrumentation.h  >> $INTERNAL_HEADER
cat handle.h                   >> $INTERNAL_HEADER
cat gselim.h                   >> $INTERNAL_HEADER
cat int_array.h                >> $INTERNAL_HEADER
cat protos.h                   >> $INTERNAL_HEADER
cat hopscotch_hash.h           >> $INTERNAL_HEADER

#===========================================================================
# Include guards
#===========================================================================

cat >> $INTERNAL_HEADER <<@

#ifdef __cplusplus
}
#endif

#endif

@


INTERNAL_HEADER=_hypre_utilities.hpp

#===========================================================================
# Include guards and other includes
#===========================================================================

cat > $INTERNAL_HEADER <<@

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

#ifndef hypre_UTILITIES_HPP
#define hypre_UTILITIES_HPP

/* WM: todo - I have a problem where I need to include this outside the extern "C++" {} block, so I'm doing this manually here for now */
#if defined(HYPRE_USING_SYCL)
#include <CL/sycl.hpp>
#endif

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

@

#===========================================================================
# Structures and prototypes
#===========================================================================

cat device_allocator.h >> $INTERNAL_HEADER
cat device_utils.h         >> $INTERNAL_HEADER
cat device_reducer.h       >> $INTERNAL_HEADER
cat cub_allocator.h        >> $INTERNAL_HEADER

#===========================================================================
# Include guards
#===========================================================================

cat >> $INTERNAL_HEADER <<@

#ifdef __cplusplus
}
#endif

#endif

@

