File tree Expand file tree Collapse file tree 5 files changed +82
-8
lines changed Expand file tree Collapse file tree 5 files changed +82
-8
lines changed Original file line number Diff line number Diff line change 1+ name : Run tests
2+
3+ on :
4+ push :
5+ paths-ignore :
6+ - ' README.md'
7+ branches :
8+ - main
9+ pull_request :
10+ paths-ignore :
11+ - ' README.md'
12+ branches :
13+ - main
14+
15+ jobs :
16+ test :
17+ runs-on : ${{ matrix.os }}
18+ strategy :
19+ fail-fast : false
20+ matrix :
21+ julia-version : [1.6, 1.8]
22+ julia-arch : [x64]
23+ os : [ubuntu-latest, windows-latest, macOS-latest]
24+ # exclude:
25+ # - os: macOS-latest
26+ # julia-arch: x86
27+
28+ steps :
29+ - uses : actions/checkout@v1.0.0
30+ - uses : julia-actions/setup-julia@latest
31+ with :
32+ version : ${{ matrix.julia-version }}
33+ - uses : julia-actions/julia-buildpkg@master
34+ - uses : julia-actions/julia-runtest@master
35+ - uses : julia-actions/julia-uploadcodecov@master
36+ env :
37+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
38+ # - uses: julia-actions/julia-uploadcoveralls@master
39+ # env:
40+ # COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
Original file line number Diff line number Diff line change 11/Manifest.toml
2+ .vscode
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ blis_jll = "0.9"
1212julia = " 1"
1313
1414[extras ]
15+ LinearAlgebra = " 37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1516Test = " 8dfed614-e22c-5e08-85e1-65c5234f0b40"
1617
1718[targets ]
18- test = [" Test" ]
19+ test = [" Test" , " LinearAlgebra " ]
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ using blis_jll
44using LinearAlgebra
55
66function get_num_threads ()
7- err = @ccall blis. bli_thread_get_num_threads ():: Cint
8- err == - 1 && throw (ErrorException (" return value was -1" ))
9- return nothing
7+ ret = @ccall blis. bli_thread_get_num_threads ():: Cint
8+ ret == - 1 && throw (ErrorException (" return value was -1" ))
9+ return ret
1010end
1111
1212function set_num_threads (nthreads)
13- err = @ccall blis. bli_thread_set_num_threads (nthreads:: Cint ):: Cvoid
14- err == - 1 && throw (ErrorException (" return value was -1" ))
13+ ret = @ccall blis. bli_thread_set_num_threads (nthreads:: Cint ):: Cvoid
14+ ret == - 1 && throw (ErrorException (" return value was -1" ))
1515 return nothing
1616end
1717
Original file line number Diff line number Diff line change 1- using BLISBLAS
21using Test
2+ using LinearAlgebra
3+
4+ function blas ()
5+ libs = BLAS. get_config (). loaded_libs
6+ lib = lowercase (basename (last (libs). libname))
7+ if contains (lib, " openblas" )
8+ return :openblas
9+ elseif contains (lib, " blis" )
10+ return :blis
11+ else
12+ return :unknown
13+ end
14+ end
315
416@testset " BLISBLAS.jl" begin
5- # Write your tests here.
17+ @testset " Sanity Tests" begin
18+ @test blas () == :openblas
19+ using BLISBLAS
20+ @test blas () == :blis
21+ @test LinearAlgebra. peakflops () > 0
22+ end
23+
24+ @testset " BLAS threads" begin
25+ @test isnothing (BLISBLAS. set_num_threads (1 ))
26+ @test BLISBLAS. get_num_threads () == 1
27+ @test isnothing (BLISBLAS. set_num_threads (2 ))
28+ @test BLISBLAS. get_num_threads () == 2
29+ @test isnothing (BLISBLAS. set_num_threads (3 ))
30+ @test BLISBLAS. get_num_threads () == 3
31+ end
32+
33+ @testset " BLAS" begin
34+ # run all BLAS tests of the LinearAlgebra stdlib (i.e. LinearAlgebra/test/blas.jl)
35+ linalg_stdlib_test_path = joinpath (dirname (pathof (LinearAlgebra)), " .." , " test" )
36+ include (joinpath (linalg_stdlib_test_path, " blas.jl" ))
37+ end
638end
You can’t perform that action at this time.
0 commit comments