Skip to content

Commit

Permalink
Add a basic test for OpenBLAS
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommers committed Oct 14, 2022
1 parent a2282e8 commit 5c2bb31
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test cases/frameworks/36 blas lapack/main.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
! minimal BLAS test
program AHH

implicit none
integer :: n, incx, xs
real :: multval
integer :: x(4)
external sccal

! A very simple test case, scalar x vector
n = 4
multval = 3.0
incx = 1
x = [1, 2, 3, 4]

call sscal(n, multval, x, incx)

xs = int(sum(x))

if (xs == 30) then
print '("OK: BLAS sum of scaled 1-D array = ",i2)', xs
else
print '("NOK: BLAS sum of scaled 1-D array = ",i2)', xs
end if
end
16 changes: 16 additions & 0 deletions test cases/frameworks/36 blas lapack/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
project('test blas and lapack', 'c')

openblas_dep = dependency('openblas', required: false)
if not openblas_dep.found()
error('MESON_SKIP_TEST: OpenBLAS library not available')
endif

#c_exe = executable('blas_c', 'main.c',
# dependencies: [openblas_dep])
#test('openblas_dep', c_exe, timeout: 30)

if add_languages('fortran', required: false)
f_exe = executable('openblas_fortran', 'main.f90',
dependencies: [openblas_dep])
test('openblas_fortran', f_exe, timeout: 30)
endif
3 changes: 3 additions & 0 deletions test cases/frameworks/36 blas lapack/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"skip_on_jobname": ["azure", "bionic", "cygwin", "fedora", "msys2", "opensuse"]
}

0 comments on commit 5c2bb31

Please sign in to comment.