Skip to content

Commit

Permalink
Generate dummy symbols for quadruple precision (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison authored Dec 11, 2024
1 parent 403f753 commit 7098403
Show file tree
Hide file tree
Showing 16 changed files with 7,280 additions and 4,823 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
compiler: gcc
version: '13'
arch: 'arm64'
- os: ubuntu-latest
arch: 'x64'
version: '24.11'
compiler: nvidia-hpc
runs-on: ${{ matrix.os }}
steps:
- name: Check out libHSL
Expand Down Expand Up @@ -52,10 +56,14 @@ jobs:
- name: Setup libHSL
shell: bash
run: |
QUADRUPLE="true"
if [[ "${{ matrix.compiler }}" == "nvidia-hpc" || "${{ matrix.compiler }}" == "intel-classic" || "${{ matrix.compiler }}" == "intel" ]]; then
QUADRUPLE="false"
fi
cd $GITHUB_WORKSPACE/libhsl
meson setup builddir_libhsl --prefix=$GITHUB_WORKSPACE/../meson
cd $GITHUB_WORKSPACE/hsl_subset
meson setup builddir_hsl_subset --prefix=$GITHUB_WORKSPACE/../meson
meson setup builddir_hsl_subset -Dquadruple=${QUADRUPLE} --prefix=$GITHUB_WORKSPACE/../meson
- name: Build libHSL
shell: bash
Expand Down
47 changes: 10 additions & 37 deletions hsl_subset/hsl_kinds/hsl_kinds.f90
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! THIS VERSION: HSL SUBSET 1.0 - 2024-02-14 AT 16:30 GMT
! THIS VERSION: HSL SUBSET 1.1 - 2024-12-09 AT 15:50 GMT

#include "hsl_subset.h"

Expand Down Expand Up @@ -29,6 +29,15 @@ MODULE HSL_KINDS
INTEGER, PARAMETER :: c4_ = KIND( ( 1.0_r4_, 1.0_r4_ ) )
INTEGER, PARAMETER :: c8_ = KIND( ( 1.0_r8_, 1.0_r8_ ) )

! if 128 bit reals are supported, use them

#ifdef REAL_128
INTEGER, PARAMETER :: r16_ = REAL128
INTEGER, PARAMETER :: c16_ = KIND( ( 1.0_r16_, 1.0_r16_ ) )
INTEGER, PARAMETER :: qp_ = r16_
INTEGER, PARAMETER :: qpc_ = C_FLOAT128
#endif

! common aliases

INTEGER, PARAMETER :: sp_ = r4_
Expand All @@ -50,39 +59,3 @@ MODULE HSL_KINDS
#endif

END MODULE HSL_KINDS

!-*-*-*- H S L _ S U B S E T _ K I N D S _ S I N G L E M O D U L E -*-*-*-

MODULE HSL_KINDS_single
USE HSL_KINDS
IMPLICIT NONE
PUBLIC

!--------------------------------------------------------
! R e a l k i n d s ( s i n g l e p r e c i s i o n )
!--------------------------------------------------------

INTEGER, PARAMETER :: real_bytes_ = 4
INTEGER, PARAMETER :: rp_ = r4_
INTEGER, PARAMETER :: cp_ = c4_
INTEGER, PARAMETER :: rpc_ = spc_

END MODULE HSL_KINDS_single

!-*-*-*- H S L _ S U B S E T _ K I N D S _ D O U B L E M O D U L E -*-*-*-

MODULE HSL_KINDS_double
USE HSL_KINDS
IMPLICIT NONE
PUBLIC

!--------------------------------------------------------
! R e a l k i n d s ( d o u b l e p r e c i s i o n )
!--------------------------------------------------------

INTEGER, PARAMETER :: real_bytes_ = 8
INTEGER, PARAMETER :: rp_ = r8_
INTEGER, PARAMETER :: cp_ = c8_
INTEGER, PARAMETER :: rpc_ = dpc_

END MODULE HSL_KINDS_double
33 changes: 33 additions & 0 deletions hsl_subset/hsl_kinds/hsl_kinds_real.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
! THIS VERSION: HSL SUBSET 1.1 - 2024-12-11 AT 14:15 GMT

#include "hsl_subset.h"

!-*-*-*- H S L _ S U B S E T _ K I N D S _ R E A L M O D U L E -*-*-*-

MODULE HSL_KINDS_real
USE HSL_KINDS
IMPLICIT NONE
PUBLIC

!---------------------
! R e a l k i n d s
!---------------------

#ifdef REAL_32
INTEGER, PARAMETER :: real_bytes_ = 4
INTEGER, PARAMETER :: rp_ = r4_
INTEGER, PARAMETER :: cp_ = c4_
INTEGER, PARAMETER :: rpc_ = spc_
#elif REAL_128
INTEGER, PARAMETER :: real_bytes_ = 16
INTEGER, PARAMETER :: rp_ = r16_
INTEGER, PARAMETER :: cp_ = c16_
INTEGER, PARAMETER :: rpc_ = qpc_
#else
INTEGER, PARAMETER :: real_bytes_ = 8
INTEGER, PARAMETER :: rp_ = r8_
INTEGER, PARAMETER :: cp_ = c8_
INTEGER, PARAMETER :: rpc_ = dpc_
#endif

END MODULE HSL_KINDS_real
5 changes: 4 additions & 1 deletion hsl_subset/include/hsl_precision.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* THIS VERSION: HSL SUBSET 1.0 - 2024-06-22 AT 08:35 GMT
* THIS VERSION: HSL SUBSET 1.1 - 2024-11-21 AT 08:35 GMT
*
*-*-*-*-*-*-*-*-*- HSL SUBSET C INTERFACE PRECISION *-*-*-*-*-*-*-*-*-*-
*
Expand All @@ -16,6 +16,9 @@
#ifdef REAL_32
typedef float rpc_;
#define f_rpc_ "f"
#elif REAL_128
typedef __float128 rpc_;
#define f_rpc_ "Qf"
#else
typedef double rpc_;
#define f_rpc_ "lf"
Expand Down
Loading

0 comments on commit 7098403

Please sign in to comment.