Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest]
os: [macOS-12]
fail-fast: true
env:
FC: gfortran
GCC_V: 13
GCC_V: 14

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install Dependencies MacOS
if: contains(matrix.os, 'mac')
run: |
brew install gcc@${GCC_V}
sudo ln -s $(which gfortran-${GCC_V}) $(dirname $(which gfortran-${GCC_V}))/gfortran
Expand Down
5 changes: 3 additions & 2 deletions example/learn-addition.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ program learn_addition
block
real, parameter :: tolerance = 1.E-06
integer p
#ifdef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
type(tensor_t), allocatable :: network_outputs(:)
network_outputs = trainable_engine%infer(inputs)
#else
Expand All @@ -94,7 +94,8 @@ program learn_addition
do p = 1, num_pairs
print "(6G13.5, a1, 6G13.5)",network_outputs(p)%values(), "|", desired_outputs(p)%values()
end do
#ifndef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
#else
end associate
#endif
end block
Expand Down
5 changes: 3 additions & 2 deletions example/learn-exponentiation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ program learn_exponentiation
block
real, parameter :: tolerance = 1.E-06
integer p
#ifdef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
type(tensor_t), allocatable :: network_outputs(:)
network_outputs = trainable_engine%infer(inputs)
#else
Expand All @@ -94,7 +94,8 @@ program learn_exponentiation
do p = 1, num_pairs
print "(6G13.5, a1, 6G13.5)",network_outputs(p)%values(), "|", desired_outputs(p)%values()
end do
#ifndef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
#else
end associate
#endif
end block
Expand Down
5 changes: 3 additions & 2 deletions example/learn-microphysics-procedures.F90
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ program learn_microphysics_procedures
report_network_performance: &
block
integer p
#ifdef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
type(tensor_t), allocatable :: network_outputs(:)
network_outputs = trainable_engine%infer(inputs)
#else
Expand All @@ -130,7 +130,8 @@ program learn_microphysics_procedures
do p = 1, num_pairs
print "(6(G13.5,2x))", inputs(p)%values(), network_outputs(p)%values(), desired_outputs(p)%values()
end do
#ifndef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
#else
end associate
#endif
end block report_network_performance
Expand Down
5 changes: 3 additions & 2 deletions example/learn-multiplication.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ program learn_multiplication
block
real, parameter :: tolerance = 1.E-06
integer p
#ifdef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
type(tensor_t), allocatable :: network_outputs(:)
network_outputs = trainable_engine%infer(inputs)
#else
Expand All @@ -94,7 +94,8 @@ program learn_multiplication
do p = 1, num_pairs
print "(6G13.5, a1, 6G13.5)",network_outputs(p)%values(), "|", desired_outputs(p)%values()
end do
#ifndef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
#else
end associate
#endif
end block
Expand Down
5 changes: 3 additions & 2 deletions example/learn-power-series.F90
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ program learn_power_series
block
real, parameter :: tolerance = 1.E-06
integer p
#ifdef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
type(tensor_t), allocatable :: network_outputs(:)
network_outputs = trainable_engine%infer(inputs)
#else
Expand All @@ -96,7 +96,8 @@ program learn_power_series
do p = 1, num_pairs
print "(6G13.5, a1, 6G13.5)",network_outputs(p)%values(), "|", desired_outputs(p)%values()
end do
#ifndef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
#else
end associate
#endif
end block
Expand Down
5 changes: 3 additions & 2 deletions example/learn-saturated-mixing-ratio.F90
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ program train_saturated_mixture_ratio
report_network_performance: &
block
integer p
#ifdef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
type(tensor_t), allocatable :: network_outputs(:)
network_outputs = trainable_engine%infer(inputs)
#else
Expand All @@ -129,7 +129,8 @@ program train_saturated_mixture_ratio
do p = 1, num_pairs
print "(4(G13.5,2x))", inputs(p)%values(), network_outputs(p)%values(), desired_outputs(p)%values()
end do
#ifndef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
#else
end associate
#endif
end block report_network_performance
Expand Down
5 changes: 3 additions & 2 deletions example/train-and-write.F90
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ program train_and_write
block
real, parameter :: tolerance = 1.E-06
integer p
#ifdef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
type(tensor_t), allocatable :: network_outputs(:)
network_outputs = trainable_engine%infer(inputs)
#else
Expand All @@ -84,7 +84,8 @@ program train_and_write
do p = 1, num_pairs
print *,network_outputs(p)%values(),"|", inputs(p)%values(), "|", network_outputs(p)%values() - inputs(p)%values()
end do
#ifndef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
#else
end associate
#endif
end block
Expand Down
2 changes: 1 addition & 1 deletion fpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ maintainer = "rouson@lbl.gov"

[dependencies]
assert = {git = "https://github.com/sourceryinstitute/assert", tag = "1.7.0"}
julienne = {git = "https://github.com/sourceryinstitute/julienne", tag = "442819a6c11a055c94cc29e1f78d935c9736abb5"}
julienne = {git = "https://github.com/sourceryinstitute/julienne", tag = "2ca5c93e11b46395608fd00abbdf797d9be0b3d4"}
4 changes: 2 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ if ! command -v fpm > /dev/null ; then
fi
fi

FPM_FC=${FC:-"gfortran-13"}
FPM_CC=${CC:-"gcc-13"}
FPM_FC=${FC:-"gfortran-14"}
FPM_CC=${CC:-"gcc-14"}

fpm test --profile release --flag "-fopenmp"

Expand Down
10 changes: 6 additions & 4 deletions test/trainable_engine_test_m.F90
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,15 @@ function preserves_identity_mapping() result(test_passes)

block
real(rkind), parameter :: tolerance = 1.E-06
#ifdef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
type(tensor_t), allocatable :: network_outputs(:)
network_outputs = trainable_engine%infer(inputs)
#else
associate(network_outputs => trainable_engine%infer(inputs))
#endif
test_passes = maxval(abs([(network_outputs(i)%values() - inputs(i)%values(), i=1,num_pairs)])) < tolerance
#ifndef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
#else
end associate
#endif
end block
Expand Down Expand Up @@ -527,14 +528,15 @@ function perturbed_identity_converges() result(test_passes)

block
real(rkind), parameter :: tolerance = 1.E-06
#ifdef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
type(tensor_t), allocatable :: network_outputs(:)
network_outputs = trainable_engine%infer(inputs)
#else
associate(network_outputs => trainable_engine%infer(inputs))
#endif
test_passes = maxval(abs([(network_outputs(i)%values() - inputs(i)%values(), i=1,num_pairs)])) < tolerance
#ifndef _CRAYFTN
#if defined _CRAYFTN || __GFORTRAN__
#else
end associate
#endif
end block
Expand Down