@@ -13,24 +13,6 @@ if(NOT CMAKE_BUILD_TYPE)
1313 set (CMAKE_BUILD_TYPE "release" )
1414endif ()
1515
16- # handle integer size
17- if (INT)
18- message (STATUS "Configuring build for ${INT} -bit integers" )
19- add_definitions (-DINT${INT} )
20- else ()
21- message (STATUS "Configuring build for 32-bit integers" )
22- add_definitions (-DINT32)
23- endif ()
24-
25- # handle real size
26- if (REAL)
27- message (STATUS "Configuring build for ${REAL} -bit reals" )
28- add_definitions (-DREAL${REAL} )
29- else ()
30- message (STATUS "Configuring build for 32-bit reals" )
31- add_definitions (-DREAL32)
32- endif ()
33-
3416if (SERIAL)
3517 message (STATUS "Configuring build for serial execution" )
3618else ()
@@ -51,9 +33,8 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES GNU)
5133 message (STATUS "Configuring build to use BLAS from ${BLAS} " )
5234 endif ()
5335
54- set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp" )
55- set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -C -fbacktrace" )
56- set (CMAKE_Fortran_FLAGS_RELEASE "-O3 -ffast-math" )
36+ set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -fcheck=bounds -fbacktrace" )
37+ set (CMAKE_Fortran_FLAGS_RELEASE "-Ofast -fno-frontend-optimize" )
5738endif ()
5839
5940# compiler flags for ifort
@@ -64,7 +45,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES Intel)
6445 set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -coarray=single" )
6546 endif ()
6647
67- set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp - assume byterecl,realloc_lhs -heap-arrays " )
48+ set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -assume byterecl" )
6849 set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -C -traceback" )
6950 set (CMAKE_Fortran_FLAGS_RELEASE "-O3" )
7051
@@ -83,36 +64,49 @@ endif()
8364
8465# library to archive (libneural.a)
8566add_library (neural
86- src/mod_activation.f90
87- src/mod_activation_submodule.f90
88- src/mod_io.f90
89- src/mod_io_submodule.f90
90- src/mod_kinds.f90
91- src/mod_layer.f90
92- src/mod_layer_submodule.f90
93- src/mod_mnist.f90
94- src/mod_mnist_submodule.f90
95- src/mod_network.f90
96- src/mod_network_submodule.f90
97- src/mod_parallel.f90
98- src/mod_parallel_submodule.f90
99- src/mod_random.f90
100- src/mod_random_submodule.f90
67+ src/nf_activation.f90
68+ src/nf_base_layer.f90
69+ src/nf_base_layer_submodule.f90
70+ src/nf_conv2d_layer.f90
71+ src/nf_datasets_mnist.f90
72+ src/nf_datasets_mnist_submodule.f90
73+ src/nf_dense_layer.f90
74+ src/nf_dense_layer_submodule.f90
75+ src/nf.f90
76+ src/nf_input1d_layer.f90
77+ src/nf_input1d_layer_submodule.f90
78+ src/nf_input3d_layer.f90
79+ src/nf_input3d_layer_submodule.f90
80+ src/nf_io.f90
81+ src/nf_io_submodule.f90
82+ src/nf_layer_constructors.f90
83+ src/nf_layer_constructors_submodule.f90
84+ src/nf_layer.f90
85+ src/nf_layer_submodule.f90
86+ src/nf_loss.f90
87+ src/nf_loss_submodule.f90
88+ src/nf_network.f90
89+ src/nf_network_submodule.f90
90+ src/nf_optimizers.f90
91+ src/nf_parallel.f90
92+ src/nf_parallel_submodule.f90
93+ src/nf_random.f90
94+ src/nf_random_submodule.f90
10195)
10296
10397# Remove leading or trailing whitespace
10498string (REGEX REPLACE "^ | $" "" LIBS "${LIBS} " )
10599
106100# tests
107101enable_testing ()
108- foreach (execid mnist network_save network_sync set_activation_function )
102+ foreach (execid input1d_layer dense_layer dense_network )
109103 add_executable (test_${execid} test /test_${execid} .f90)
110104 target_link_libraries (test_${execid} neural ${LIBS} )
111105 add_test (test_${execid} bin/test_${execid} )
112106endforeach ()
113107
114- foreach (execid mnist mnist_epochs save_and_load simple sine)
115- add_executable (example_ ${execid} example/example_ ${execid} .f90)
116- target_link_libraries (example_ ${execid} neural ${LIBS} )
117- add_test (example_${execid} bin/example_${execid} )
108+ foreach (execid mnist simple sine)
109+ add_executable (${execid} example/${execid} .f90)
110+ target_link_libraries (${execid} neural ${LIBS} )
111+ # add_test(example_${execid} bin/example_${execid})
118112endforeach ()
0 commit comments