Skip to content
Open
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
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ set(BLAS_TESTS
set(LAPACK_TESTS
rand_mat_svd_test)

set(CMAKE_Fortran_STANDARD 2008)
set(FVERSION "-std=f2008 -cpp")
set(FLAGS1 "-Wall -Wextra -Wpedantic")
#set(WERROR "-Werror")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${FVERSION} ${FLAGS1} ${WERROR}")

# We now create the c wrapper that handles command line arguments for testing.
# The xxx_main.c files are generated by CMake.
# The test functions are forward declared with extern.
Expand Down
11 changes: 6 additions & 5 deletions blas_test.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,28 @@ module blas_test_mod
implicit none
contains

integer function saxpy_test() result(ret) bind(C)
integer(c_int) function saxpy_test() result(ret) bind(C)
real :: x(2), y(2)
data x/0.0, 2.0/, y/1.0, 0.0/

real :: tol = 1e-5
call saxpy(2, 2.0, x, 1, y, 1)

if (y(1) == 1.0 .and. y(2) == 4.0) then
if (abs(y(1) - 1.0) < tol .and. abs(y(2) - 4.0) < tol) then
ret = 0
else
ret = 1
end if
end function saxpy_test

integer function sgemv_test() result(ret) bind(C)
integer(c_int) function sgemv_test() result(ret) bind(C)
real :: matrix(2, 2), vector(2)
data matrix/1.0, 0.0, 0.0, 1.0/, vector/1.0, 2.0/
real :: y(2)
real :: tol = 1e-5

call sgemv('n', 2, 2, 2.0, matrix, 2, vector, 1, 0.0, y, 1)

if (y(1) == 2.0 .and. y(2) == 4.0) then
if (abs(y(1) - 2.0) < tol .and. abs(y(2) - 4.0) < tol) then
ret = 0
else
ret = 1
Expand Down
4 changes: 2 additions & 2 deletions lapack_test.f90
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ module lapack_test_mod
contains

function rand_mat_svd_test() result(ret) bind(C)
integer :: ret
integer(c_int) :: ret
integer :: iseed(4)
integer :: info, lwork, allocstat, i
integer :: info, lwork, allocstat
real :: mat(8, 8), s(8), dummy_u, dummy_vt, qwork(1)
real, allocatable :: work(:)

Expand Down