1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
// Copyright ©2015 The Gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package testblas
import (
"testing"
"golang.org/x/exp/rand"
"gonum.org/v1/gonum/blas"
)
func DtrmvBenchmark(b *testing.B, dtrmv Dtrmver, n, lda, incX int, ul blas.Uplo, tA blas.Transpose, d blas.Diag) {
rnd := rand.New(rand.NewSource(0))
a := make([]float64, n*lda)
for i := range a {
a[i] = rnd.Float64()
}
x := make([]float64, n*incX)
for i := range x {
x[i] = rnd.Float64()
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
dtrmv.Dtrmv(ul, tA, d, n, a, lda, x, incX)
}
}
|