xref: /libCEED/julia/LibCEED.jl/test/rundevtests.jl (revision ffa5d67cac94379470c78ef400e8bd2c0655d3e7)
1using Test, LibCEED, LinearAlgebra, StaticArrays
2
3@testset "LibCEED Development Tests" begin
4    @test ceedversion() isa VersionNumber
5    @test isrelease() == false
6
7    @testset "CeedVector" begin
8        n = 10
9        c = Ceed()
10
11        v1 = rand(n)
12        v2 = rand(n)
13        v3 = rand(n)
14
15        cv1 = CeedVector(c, v1)
16        cv2 = CeedVector(c, v2)
17        cv3 = CeedVector(c, v3)
18
19        alpha = rand()
20
21        scale!(cv1, alpha)
22        v1 .*= alpha
23        @test @witharray_read(a = cv1, a == v1)
24
25        pointwisemult!(cv1, cv2, cv3)
26        v1 .= v2.*v3
27        @test @witharray_read(a = cv1, a == v1)
28
29        axpy!(alpha, cv2, cv1)
30        axpy!(alpha, v2, v1)
31        @test @witharray_read(a = cv1, a ≈ v1)
32    end
33end
34