Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert BLAS tests to use testsets #19820

Merged
merged 1 commit into from
Jan 4, 2017
Merged

Convert BLAS tests to use testsets #19820

merged 1 commit into from
Jan 4, 2017

Conversation

kshyatt
Copy link
Contributor

@kshyatt kshyatt commented Jan 2, 2017

No description provided.

@kshyatt kshyatt added domain:linear algebra Linear algebra test This change adds or pertains to unit tests labels Jan 2, 2017
Copy link
Member

@andreasnoack andreasnoack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Only a few minor comments.

if elty == Complex64 || elty == Complex128
U = complex.(U, U)
V = complex.(V, V)
@testset "syr2k! and her2k!" begin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'd get more informative errors if you keep the separation of syr2k and her2k, pull the for loop into the @testset (instead of using begin), and interpolate $elty into the string.

@test tril(LinAlg.BLAS.her2k('L','N',U,V)) ≈ tril(U*V' + V*U')
@test triu(LinAlg.BLAS.her2k('U','N',U,V)) ≈ triu(U*V' + V*U')
@test tril(LinAlg.BLAS.her2k('L','C',U,V)) ≈ tril(U'*V + V'*U)
@test triu(LinAlg.BLAS.her2k('U','C',U,V)) ≈ triu(U'*V + V'*U)
end

## BLAS tests - testing the interface code to BLAS routines
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making this for loop a @testset and putting the elty in the test string will make it easier to locate the error.

@@ -51,252 +52,261 @@ for elty in [Float32, Float64, Complex64, Complex128]
v41 = convert(Vector{elty}, [4:-1:1;])

let n = 10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but let doesn't seem necessary anymore.

if elty <: Real
x1 = convert(Vector{elty}, randn(n))
x2 = convert(Vector{elty}, randn(n))
α = rand(elty)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this indented an extra level?

A = rand(elty,n,n)
Aherm = A + A'
Asymm = A + A.'
@testset "symv and hemv" begin

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid blank line right after begin

@kshyatt
Copy link
Contributor Author

kshyatt commented Jan 3, 2017

Did I get everything? Is that test fail my fault?

@andreasnoack
Copy link
Member

This looks like #19792

@testset "axpy" begin
if elty <: Real
x1 = convert(Vector{elty}, randn(n))
x2 = convert(Vector{elty}, randn(n))
α = rand(elty)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this alpha could've been reused for both Real and non-Real elty, not that it makes too much difference

@tkelman tkelman merged commit da20cee into master Jan 4, 2017
@tkelman tkelman deleted the ksh/blasset branch January 4, 2017 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:linear algebra Linear algebra test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants