1 // Copyright ©2017 The Gonum Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 var benchSink complex64
14 func BenchmarkDotUnitary(t *testing.B) {
15 for _, tst := range []struct {
17 f func(x, y []complex64) complex64
19 {"DotcUnitary", DotcUnitary},
20 {"DotuUnitary", DotuUnitary},
22 for _, v := range []int64{1, 2, 3, 4, 5, 10, 100, 1e3, 5e3, 1e4, 5e4} {
23 t.Run(fmt.Sprintf("%s-%d", tst.name, v), func(b *testing.B) {
26 for i := 0; i < b.N; i++ {
27 benchSink = tst.f(x, y)
34 func BenchmarkDotInc(t *testing.B) {
35 for _, tst := range []struct {
37 f func(x, y []complex64, n, incX, incY, ix, iy uintptr) complex64
42 for _, ln := range []int{1, 2, 3, 4, 5, 10, 100, 1e3, 5e3, 1e4, 5e4} {
43 for _, inc := range []int{1, 2, 4, 10, -1, -2, -4, -10} {
44 t.Run(fmt.Sprintf("%s-%d-inc%d", tst.name, ln, inc), func(b *testing.B) {
45 b.SetBytes(int64(128 * ln))
50 for i := 0; i < b.N; i++ {
51 benchSink = tst.f(x, y, uintptr(ln), uintptr(inc), uintptr(inc), uintptr(idx), uintptr(idx))