gonum.org/v1/gonum@v0.14.0/blas/gonum/level1float64_bench_test.go (about) 1 // Code generated by "go run gonum.org/v1/gonum/blas/testblas/benchautogen/autogen_bench_level1double.go"; DO NOT EDIT. 2 3 // Copyright ©2014 The Gonum Authors. All rights reserved. 4 // Use of this code is governed by a BSD-style 5 // license that can be found in the LICENSE file 6 7 package gonum 8 9 import ( 10 "testing" 11 12 "golang.org/x/exp/rand" 13 14 "gonum.org/v1/gonum/blas" 15 ) 16 17 const ( 18 posInc1 = 5 19 posInc2 = 3 20 negInc1 = -3 21 negInc2 = -4 22 SMALL_SLICE = 10 23 MEDIUM_SLICE = 1000 24 LARGE_SLICE = 100000 25 HUGE_SLICE = 10000000 26 ) 27 28 func randomSlice(l, idx int) []float64 { 29 if idx < 0 { 30 idx = -idx 31 } 32 s := make([]float64, l*idx) 33 for i := range s { 34 s[i] = rand.Float64() 35 } 36 return s 37 } 38 39 func benchmarkDdot(b *testing.B, n int, x []float64, incX int, y []float64, incY int) { 40 b.ResetTimer() 41 for i := 0; i < b.N; i++ { 42 impl.Ddot(n, x, incX, y, incY) 43 } 44 } 45 46 func BenchmarkDdotSmallBothUnitary(b *testing.B) { 47 n := SMALL_SLICE 48 incX := 1 49 x := randomSlice(n, incX) 50 incY := 1 51 y := randomSlice(n, incY) 52 53 benchmarkDdot(b, n, x, incX, y, incY) 54 } 55 56 func BenchmarkDdotSmallIncUni(b *testing.B) { 57 n := SMALL_SLICE 58 incX := posInc1 59 x := randomSlice(n, incX) 60 incY := 1 61 y := randomSlice(n, incY) 62 63 benchmarkDdot(b, n, x, incX, y, incY) 64 } 65 66 func BenchmarkDdotSmallUniInc(b *testing.B) { 67 n := SMALL_SLICE 68 incX := 1 69 x := randomSlice(n, incX) 70 incY := negInc1 71 y := randomSlice(n, incY) 72 73 benchmarkDdot(b, n, x, incX, y, incY) 74 } 75 76 func BenchmarkDdotSmallBothInc(b *testing.B) { 77 n := SMALL_SLICE 78 incX := posInc1 79 x := randomSlice(n, incX) 80 incY := negInc1 81 y := randomSlice(n, incY) 82 83 benchmarkDdot(b, n, x, incX, y, incY) 84 } 85 86 func BenchmarkDdotMediumBothUnitary(b *testing.B) { 87 n := MEDIUM_SLICE 88 incX := 1 89 x := randomSlice(n, incX) 90 incY := 1 91 y := randomSlice(n, incY) 92 93 benchmarkDdot(b, n, x, incX, y, incY) 94 } 95 96 func BenchmarkDdotMediumIncUni(b *testing.B) { 97 n := MEDIUM_SLICE 98 incX := posInc1 99 x := randomSlice(n, incX) 100 incY := 1 101 y := randomSlice(n, incY) 102 103 benchmarkDdot(b, n, x, incX, y, incY) 104 } 105 106 func BenchmarkDdotMediumUniInc(b *testing.B) { 107 n := MEDIUM_SLICE 108 incX := 1 109 x := randomSlice(n, incX) 110 incY := negInc1 111 y := randomSlice(n, incY) 112 113 benchmarkDdot(b, n, x, incX, y, incY) 114 } 115 116 func BenchmarkDdotMediumBothInc(b *testing.B) { 117 n := MEDIUM_SLICE 118 incX := posInc1 119 x := randomSlice(n, incX) 120 incY := negInc1 121 y := randomSlice(n, incY) 122 123 benchmarkDdot(b, n, x, incX, y, incY) 124 } 125 126 func BenchmarkDdotLargeBothUnitary(b *testing.B) { 127 n := LARGE_SLICE 128 incX := 1 129 x := randomSlice(n, incX) 130 incY := 1 131 y := randomSlice(n, incY) 132 133 benchmarkDdot(b, n, x, incX, y, incY) 134 } 135 136 func BenchmarkDdotLargeIncUni(b *testing.B) { 137 n := LARGE_SLICE 138 incX := posInc1 139 x := randomSlice(n, incX) 140 incY := 1 141 y := randomSlice(n, incY) 142 143 benchmarkDdot(b, n, x, incX, y, incY) 144 } 145 146 func BenchmarkDdotLargeUniInc(b *testing.B) { 147 n := LARGE_SLICE 148 incX := 1 149 x := randomSlice(n, incX) 150 incY := negInc1 151 y := randomSlice(n, incY) 152 153 benchmarkDdot(b, n, x, incX, y, incY) 154 } 155 156 func BenchmarkDdotLargeBothInc(b *testing.B) { 157 n := LARGE_SLICE 158 incX := posInc1 159 x := randomSlice(n, incX) 160 incY := negInc1 161 y := randomSlice(n, incY) 162 163 benchmarkDdot(b, n, x, incX, y, incY) 164 } 165 166 func BenchmarkDdotHugeBothUnitary(b *testing.B) { 167 n := HUGE_SLICE 168 incX := 1 169 x := randomSlice(n, incX) 170 incY := 1 171 y := randomSlice(n, incY) 172 173 benchmarkDdot(b, n, x, incX, y, incY) 174 } 175 176 func BenchmarkDdotHugeIncUni(b *testing.B) { 177 n := HUGE_SLICE 178 incX := posInc1 179 x := randomSlice(n, incX) 180 incY := 1 181 y := randomSlice(n, incY) 182 183 benchmarkDdot(b, n, x, incX, y, incY) 184 } 185 186 func BenchmarkDdotHugeUniInc(b *testing.B) { 187 n := HUGE_SLICE 188 incX := 1 189 x := randomSlice(n, incX) 190 incY := negInc1 191 y := randomSlice(n, incY) 192 193 benchmarkDdot(b, n, x, incX, y, incY) 194 } 195 196 func BenchmarkDdotHugeBothInc(b *testing.B) { 197 n := HUGE_SLICE 198 incX := posInc1 199 x := randomSlice(n, incX) 200 incY := negInc1 201 y := randomSlice(n, incY) 202 203 benchmarkDdot(b, n, x, incX, y, incY) 204 } 205 206 /* ------------------ */ 207 func benchmarkDnrm2(b *testing.B, n int, x []float64, incX int) { 208 b.ResetTimer() 209 for i := 0; i < b.N; i++ { 210 impl.Dnrm2(n, x, incX) 211 } 212 } 213 214 func BenchmarkDnrm2SmallUnitaryInc(b *testing.B) { 215 n := SMALL_SLICE 216 incX := 1 217 x := randomSlice(n, incX) 218 219 benchmarkDnrm2(b, n, x, incX) 220 } 221 222 func BenchmarkDnrm2SmallPosInc(b *testing.B) { 223 n := SMALL_SLICE 224 incX := posInc1 225 x := randomSlice(n, incX) 226 227 benchmarkDnrm2(b, n, x, incX) 228 } 229 230 func BenchmarkDnrm2MediumUnitaryInc(b *testing.B) { 231 n := MEDIUM_SLICE 232 incX := 1 233 x := randomSlice(n, incX) 234 235 benchmarkDnrm2(b, n, x, incX) 236 } 237 238 func BenchmarkDnrm2MediumPosInc(b *testing.B) { 239 n := MEDIUM_SLICE 240 incX := posInc1 241 x := randomSlice(n, incX) 242 243 benchmarkDnrm2(b, n, x, incX) 244 } 245 246 func BenchmarkDnrm2LargeUnitaryInc(b *testing.B) { 247 n := LARGE_SLICE 248 incX := 1 249 x := randomSlice(n, incX) 250 251 benchmarkDnrm2(b, n, x, incX) 252 } 253 254 func BenchmarkDnrm2LargePosInc(b *testing.B) { 255 n := LARGE_SLICE 256 incX := posInc1 257 x := randomSlice(n, incX) 258 259 benchmarkDnrm2(b, n, x, incX) 260 } 261 262 func BenchmarkDnrm2HugeUnitaryInc(b *testing.B) { 263 n := HUGE_SLICE 264 incX := 1 265 x := randomSlice(n, incX) 266 267 benchmarkDnrm2(b, n, x, incX) 268 } 269 270 func BenchmarkDnrm2HugePosInc(b *testing.B) { 271 n := HUGE_SLICE 272 incX := posInc1 273 x := randomSlice(n, incX) 274 275 benchmarkDnrm2(b, n, x, incX) 276 } 277 278 /* ------------------ */ 279 func benchmarkDasum(b *testing.B, n int, x []float64, incX int) { 280 b.ResetTimer() 281 for i := 0; i < b.N; i++ { 282 impl.Dasum(n, x, incX) 283 } 284 } 285 286 func BenchmarkDasumSmallUnitaryInc(b *testing.B) { 287 n := SMALL_SLICE 288 incX := 1 289 x := randomSlice(n, incX) 290 291 benchmarkDasum(b, n, x, incX) 292 } 293 294 func BenchmarkDasumSmallPosInc(b *testing.B) { 295 n := SMALL_SLICE 296 incX := posInc1 297 x := randomSlice(n, incX) 298 299 benchmarkDasum(b, n, x, incX) 300 } 301 302 func BenchmarkDasumMediumUnitaryInc(b *testing.B) { 303 n := MEDIUM_SLICE 304 incX := 1 305 x := randomSlice(n, incX) 306 307 benchmarkDasum(b, n, x, incX) 308 } 309 310 func BenchmarkDasumMediumPosInc(b *testing.B) { 311 n := MEDIUM_SLICE 312 incX := posInc1 313 x := randomSlice(n, incX) 314 315 benchmarkDasum(b, n, x, incX) 316 } 317 318 func BenchmarkDasumLargeUnitaryInc(b *testing.B) { 319 n := LARGE_SLICE 320 incX := 1 321 x := randomSlice(n, incX) 322 323 benchmarkDasum(b, n, x, incX) 324 } 325 326 func BenchmarkDasumLargePosInc(b *testing.B) { 327 n := LARGE_SLICE 328 incX := posInc1 329 x := randomSlice(n, incX) 330 331 benchmarkDasum(b, n, x, incX) 332 } 333 334 func BenchmarkDasumHugeUnitaryInc(b *testing.B) { 335 n := HUGE_SLICE 336 incX := 1 337 x := randomSlice(n, incX) 338 339 benchmarkDasum(b, n, x, incX) 340 } 341 342 func BenchmarkDasumHugePosInc(b *testing.B) { 343 n := HUGE_SLICE 344 incX := posInc1 345 x := randomSlice(n, incX) 346 347 benchmarkDasum(b, n, x, incX) 348 } 349 350 /* ------------------ */ 351 func benchmarkIdamax(b *testing.B, n int, x []float64, incX int) { 352 b.ResetTimer() 353 for i := 0; i < b.N; i++ { 354 impl.Idamax(n, x, incX) 355 } 356 } 357 358 func BenchmarkIdamaxSmallUnitaryInc(b *testing.B) { 359 n := SMALL_SLICE 360 incX := 1 361 x := randomSlice(n, incX) 362 363 benchmarkIdamax(b, n, x, incX) 364 } 365 366 func BenchmarkIdamaxSmallPosInc(b *testing.B) { 367 n := SMALL_SLICE 368 incX := posInc1 369 x := randomSlice(n, incX) 370 371 benchmarkIdamax(b, n, x, incX) 372 } 373 374 func BenchmarkIdamaxMediumUnitaryInc(b *testing.B) { 375 n := MEDIUM_SLICE 376 incX := 1 377 x := randomSlice(n, incX) 378 379 benchmarkIdamax(b, n, x, incX) 380 } 381 382 func BenchmarkIdamaxMediumPosInc(b *testing.B) { 383 n := MEDIUM_SLICE 384 incX := posInc1 385 x := randomSlice(n, incX) 386 387 benchmarkIdamax(b, n, x, incX) 388 } 389 390 func BenchmarkIdamaxLargeUnitaryInc(b *testing.B) { 391 n := LARGE_SLICE 392 incX := 1 393 x := randomSlice(n, incX) 394 395 benchmarkIdamax(b, n, x, incX) 396 } 397 398 func BenchmarkIdamaxLargePosInc(b *testing.B) { 399 n := LARGE_SLICE 400 incX := posInc1 401 x := randomSlice(n, incX) 402 403 benchmarkIdamax(b, n, x, incX) 404 } 405 406 func BenchmarkIdamaxHugeUnitaryInc(b *testing.B) { 407 n := HUGE_SLICE 408 incX := 1 409 x := randomSlice(n, incX) 410 411 benchmarkIdamax(b, n, x, incX) 412 } 413 414 func BenchmarkIdamaxHugePosInc(b *testing.B) { 415 n := HUGE_SLICE 416 incX := posInc1 417 x := randomSlice(n, incX) 418 419 benchmarkIdamax(b, n, x, incX) 420 } 421 422 /* ------------------ */ 423 func benchmarkDswap(b *testing.B, n int, x []float64, incX int, y []float64, incY int) { 424 b.ResetTimer() 425 for i := 0; i < b.N; i++ { 426 impl.Dswap(n, x, incX, y, incY) 427 } 428 } 429 430 func BenchmarkDswapSmallBothUnitary(b *testing.B) { 431 n := SMALL_SLICE 432 incX := 1 433 x := randomSlice(n, incX) 434 incY := 1 435 y := randomSlice(n, incY) 436 437 benchmarkDswap(b, n, x, incX, y, incY) 438 } 439 440 func BenchmarkDswapSmallIncUni(b *testing.B) { 441 n := SMALL_SLICE 442 incX := posInc1 443 x := randomSlice(n, incX) 444 incY := 1 445 y := randomSlice(n, incY) 446 447 benchmarkDswap(b, n, x, incX, y, incY) 448 } 449 450 func BenchmarkDswapSmallUniInc(b *testing.B) { 451 n := SMALL_SLICE 452 incX := 1 453 x := randomSlice(n, incX) 454 incY := negInc1 455 y := randomSlice(n, incY) 456 457 benchmarkDswap(b, n, x, incX, y, incY) 458 } 459 460 func BenchmarkDswapSmallBothInc(b *testing.B) { 461 n := SMALL_SLICE 462 incX := posInc1 463 x := randomSlice(n, incX) 464 incY := negInc1 465 y := randomSlice(n, incY) 466 467 benchmarkDswap(b, n, x, incX, y, incY) 468 } 469 470 func BenchmarkDswapMediumBothUnitary(b *testing.B) { 471 n := MEDIUM_SLICE 472 incX := 1 473 x := randomSlice(n, incX) 474 incY := 1 475 y := randomSlice(n, incY) 476 477 benchmarkDswap(b, n, x, incX, y, incY) 478 } 479 480 func BenchmarkDswapMediumIncUni(b *testing.B) { 481 n := MEDIUM_SLICE 482 incX := posInc1 483 x := randomSlice(n, incX) 484 incY := 1 485 y := randomSlice(n, incY) 486 487 benchmarkDswap(b, n, x, incX, y, incY) 488 } 489 490 func BenchmarkDswapMediumUniInc(b *testing.B) { 491 n := MEDIUM_SLICE 492 incX := 1 493 x := randomSlice(n, incX) 494 incY := negInc1 495 y := randomSlice(n, incY) 496 497 benchmarkDswap(b, n, x, incX, y, incY) 498 } 499 500 func BenchmarkDswapMediumBothInc(b *testing.B) { 501 n := MEDIUM_SLICE 502 incX := posInc1 503 x := randomSlice(n, incX) 504 incY := negInc1 505 y := randomSlice(n, incY) 506 507 benchmarkDswap(b, n, x, incX, y, incY) 508 } 509 510 func BenchmarkDswapLargeBothUnitary(b *testing.B) { 511 n := LARGE_SLICE 512 incX := 1 513 x := randomSlice(n, incX) 514 incY := 1 515 y := randomSlice(n, incY) 516 517 benchmarkDswap(b, n, x, incX, y, incY) 518 } 519 520 func BenchmarkDswapLargeIncUni(b *testing.B) { 521 n := LARGE_SLICE 522 incX := posInc1 523 x := randomSlice(n, incX) 524 incY := 1 525 y := randomSlice(n, incY) 526 527 benchmarkDswap(b, n, x, incX, y, incY) 528 } 529 530 func BenchmarkDswapLargeUniInc(b *testing.B) { 531 n := LARGE_SLICE 532 incX := 1 533 x := randomSlice(n, incX) 534 incY := negInc1 535 y := randomSlice(n, incY) 536 537 benchmarkDswap(b, n, x, incX, y, incY) 538 } 539 540 func BenchmarkDswapLargeBothInc(b *testing.B) { 541 n := LARGE_SLICE 542 incX := posInc1 543 x := randomSlice(n, incX) 544 incY := negInc1 545 y := randomSlice(n, incY) 546 547 benchmarkDswap(b, n, x, incX, y, incY) 548 } 549 550 func BenchmarkDswapHugeBothUnitary(b *testing.B) { 551 n := HUGE_SLICE 552 incX := 1 553 x := randomSlice(n, incX) 554 incY := 1 555 y := randomSlice(n, incY) 556 557 benchmarkDswap(b, n, x, incX, y, incY) 558 } 559 560 func BenchmarkDswapHugeIncUni(b *testing.B) { 561 n := HUGE_SLICE 562 incX := posInc1 563 x := randomSlice(n, incX) 564 incY := 1 565 y := randomSlice(n, incY) 566 567 benchmarkDswap(b, n, x, incX, y, incY) 568 } 569 570 func BenchmarkDswapHugeUniInc(b *testing.B) { 571 n := HUGE_SLICE 572 incX := 1 573 x := randomSlice(n, incX) 574 incY := negInc1 575 y := randomSlice(n, incY) 576 577 benchmarkDswap(b, n, x, incX, y, incY) 578 } 579 580 func BenchmarkDswapHugeBothInc(b *testing.B) { 581 n := HUGE_SLICE 582 incX := posInc1 583 x := randomSlice(n, incX) 584 incY := negInc1 585 y := randomSlice(n, incY) 586 587 benchmarkDswap(b, n, x, incX, y, incY) 588 } 589 590 /* ------------------ */ 591 func benchmarkDcopy(b *testing.B, n int, x []float64, incX int, y []float64, incY int) { 592 b.ResetTimer() 593 for i := 0; i < b.N; i++ { 594 impl.Dcopy(n, x, incX, y, incY) 595 } 596 } 597 598 func BenchmarkDcopySmallBothUnitary(b *testing.B) { 599 n := SMALL_SLICE 600 incX := 1 601 x := randomSlice(n, incX) 602 incY := 1 603 y := randomSlice(n, incY) 604 605 benchmarkDcopy(b, n, x, incX, y, incY) 606 } 607 608 func BenchmarkDcopySmallIncUni(b *testing.B) { 609 n := SMALL_SLICE 610 incX := posInc1 611 x := randomSlice(n, incX) 612 incY := 1 613 y := randomSlice(n, incY) 614 615 benchmarkDcopy(b, n, x, incX, y, incY) 616 } 617 618 func BenchmarkDcopySmallUniInc(b *testing.B) { 619 n := SMALL_SLICE 620 incX := 1 621 x := randomSlice(n, incX) 622 incY := negInc1 623 y := randomSlice(n, incY) 624 625 benchmarkDcopy(b, n, x, incX, y, incY) 626 } 627 628 func BenchmarkDcopySmallBothInc(b *testing.B) { 629 n := SMALL_SLICE 630 incX := posInc1 631 x := randomSlice(n, incX) 632 incY := negInc1 633 y := randomSlice(n, incY) 634 635 benchmarkDcopy(b, n, x, incX, y, incY) 636 } 637 638 func BenchmarkDcopyMediumBothUnitary(b *testing.B) { 639 n := MEDIUM_SLICE 640 incX := 1 641 x := randomSlice(n, incX) 642 incY := 1 643 y := randomSlice(n, incY) 644 645 benchmarkDcopy(b, n, x, incX, y, incY) 646 } 647 648 func BenchmarkDcopyMediumIncUni(b *testing.B) { 649 n := MEDIUM_SLICE 650 incX := posInc1 651 x := randomSlice(n, incX) 652 incY := 1 653 y := randomSlice(n, incY) 654 655 benchmarkDcopy(b, n, x, incX, y, incY) 656 } 657 658 func BenchmarkDcopyMediumUniInc(b *testing.B) { 659 n := MEDIUM_SLICE 660 incX := 1 661 x := randomSlice(n, incX) 662 incY := negInc1 663 y := randomSlice(n, incY) 664 665 benchmarkDcopy(b, n, x, incX, y, incY) 666 } 667 668 func BenchmarkDcopyMediumBothInc(b *testing.B) { 669 n := MEDIUM_SLICE 670 incX := posInc1 671 x := randomSlice(n, incX) 672 incY := negInc1 673 y := randomSlice(n, incY) 674 675 benchmarkDcopy(b, n, x, incX, y, incY) 676 } 677 678 func BenchmarkDcopyLargeBothUnitary(b *testing.B) { 679 n := LARGE_SLICE 680 incX := 1 681 x := randomSlice(n, incX) 682 incY := 1 683 y := randomSlice(n, incY) 684 685 benchmarkDcopy(b, n, x, incX, y, incY) 686 } 687 688 func BenchmarkDcopyLargeIncUni(b *testing.B) { 689 n := LARGE_SLICE 690 incX := posInc1 691 x := randomSlice(n, incX) 692 incY := 1 693 y := randomSlice(n, incY) 694 695 benchmarkDcopy(b, n, x, incX, y, incY) 696 } 697 698 func BenchmarkDcopyLargeUniInc(b *testing.B) { 699 n := LARGE_SLICE 700 incX := 1 701 x := randomSlice(n, incX) 702 incY := negInc1 703 y := randomSlice(n, incY) 704 705 benchmarkDcopy(b, n, x, incX, y, incY) 706 } 707 708 func BenchmarkDcopyLargeBothInc(b *testing.B) { 709 n := LARGE_SLICE 710 incX := posInc1 711 x := randomSlice(n, incX) 712 incY := negInc1 713 y := randomSlice(n, incY) 714 715 benchmarkDcopy(b, n, x, incX, y, incY) 716 } 717 718 func BenchmarkDcopyHugeBothUnitary(b *testing.B) { 719 n := HUGE_SLICE 720 incX := 1 721 x := randomSlice(n, incX) 722 incY := 1 723 y := randomSlice(n, incY) 724 725 benchmarkDcopy(b, n, x, incX, y, incY) 726 } 727 728 func BenchmarkDcopyHugeIncUni(b *testing.B) { 729 n := HUGE_SLICE 730 incX := posInc1 731 x := randomSlice(n, incX) 732 incY := 1 733 y := randomSlice(n, incY) 734 735 benchmarkDcopy(b, n, x, incX, y, incY) 736 } 737 738 func BenchmarkDcopyHugeUniInc(b *testing.B) { 739 n := HUGE_SLICE 740 incX := 1 741 x := randomSlice(n, incX) 742 incY := negInc1 743 y := randomSlice(n, incY) 744 745 benchmarkDcopy(b, n, x, incX, y, incY) 746 } 747 748 func BenchmarkDcopyHugeBothInc(b *testing.B) { 749 n := HUGE_SLICE 750 incX := posInc1 751 x := randomSlice(n, incX) 752 incY := negInc1 753 y := randomSlice(n, incY) 754 755 benchmarkDcopy(b, n, x, incX, y, incY) 756 } 757 758 /* ------------------ */ 759 func benchmarkDaxpy(b *testing.B, n int, alpha float64, x []float64, incX int, y []float64, incY int) { 760 b.ResetTimer() 761 for i := 0; i < b.N; i++ { 762 impl.Daxpy(n, alpha, x, incX, y, incY) 763 } 764 } 765 766 func BenchmarkDaxpySmallBothUnitary(b *testing.B) { 767 n := SMALL_SLICE 768 incX := 1 769 x := randomSlice(n, incX) 770 incY := 1 771 y := randomSlice(n, incY) 772 alpha := 2.4 773 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 774 } 775 776 func BenchmarkDaxpySmallIncUni(b *testing.B) { 777 n := SMALL_SLICE 778 incX := posInc1 779 x := randomSlice(n, incX) 780 incY := 1 781 y := randomSlice(n, incY) 782 alpha := 2.4 783 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 784 } 785 786 func BenchmarkDaxpySmallUniInc(b *testing.B) { 787 n := SMALL_SLICE 788 incX := 1 789 x := randomSlice(n, incX) 790 incY := negInc1 791 y := randomSlice(n, incY) 792 alpha := 2.4 793 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 794 } 795 796 func BenchmarkDaxpySmallBothInc(b *testing.B) { 797 n := SMALL_SLICE 798 incX := posInc1 799 x := randomSlice(n, incX) 800 incY := negInc1 801 y := randomSlice(n, incY) 802 alpha := 2.4 803 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 804 } 805 806 func BenchmarkDaxpyMediumBothUnitary(b *testing.B) { 807 n := MEDIUM_SLICE 808 incX := 1 809 x := randomSlice(n, incX) 810 incY := 1 811 y := randomSlice(n, incY) 812 alpha := 2.4 813 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 814 } 815 816 func BenchmarkDaxpyMediumIncUni(b *testing.B) { 817 n := MEDIUM_SLICE 818 incX := posInc1 819 x := randomSlice(n, incX) 820 incY := 1 821 y := randomSlice(n, incY) 822 alpha := 2.4 823 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 824 } 825 826 func BenchmarkDaxpyMediumUniInc(b *testing.B) { 827 n := MEDIUM_SLICE 828 incX := 1 829 x := randomSlice(n, incX) 830 incY := negInc1 831 y := randomSlice(n, incY) 832 alpha := 2.4 833 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 834 } 835 836 func BenchmarkDaxpyMediumBothInc(b *testing.B) { 837 n := MEDIUM_SLICE 838 incX := posInc1 839 x := randomSlice(n, incX) 840 incY := negInc1 841 y := randomSlice(n, incY) 842 alpha := 2.4 843 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 844 } 845 846 func BenchmarkDaxpyLargeBothUnitary(b *testing.B) { 847 n := LARGE_SLICE 848 incX := 1 849 x := randomSlice(n, incX) 850 incY := 1 851 y := randomSlice(n, incY) 852 alpha := 2.4 853 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 854 } 855 856 func BenchmarkDaxpyLargeIncUni(b *testing.B) { 857 n := LARGE_SLICE 858 incX := posInc1 859 x := randomSlice(n, incX) 860 incY := 1 861 y := randomSlice(n, incY) 862 alpha := 2.4 863 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 864 } 865 866 func BenchmarkDaxpyLargeUniInc(b *testing.B) { 867 n := LARGE_SLICE 868 incX := 1 869 x := randomSlice(n, incX) 870 incY := negInc1 871 y := randomSlice(n, incY) 872 alpha := 2.4 873 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 874 } 875 876 func BenchmarkDaxpyLargeBothInc(b *testing.B) { 877 n := LARGE_SLICE 878 incX := posInc1 879 x := randomSlice(n, incX) 880 incY := negInc1 881 y := randomSlice(n, incY) 882 alpha := 2.4 883 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 884 } 885 886 func BenchmarkDaxpyHugeBothUnitary(b *testing.B) { 887 n := HUGE_SLICE 888 incX := 1 889 x := randomSlice(n, incX) 890 incY := 1 891 y := randomSlice(n, incY) 892 alpha := 2.4 893 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 894 } 895 896 func BenchmarkDaxpyHugeIncUni(b *testing.B) { 897 n := HUGE_SLICE 898 incX := posInc1 899 x := randomSlice(n, incX) 900 incY := 1 901 y := randomSlice(n, incY) 902 alpha := 2.4 903 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 904 } 905 906 func BenchmarkDaxpyHugeUniInc(b *testing.B) { 907 n := HUGE_SLICE 908 incX := 1 909 x := randomSlice(n, incX) 910 incY := negInc1 911 y := randomSlice(n, incY) 912 alpha := 2.4 913 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 914 } 915 916 func BenchmarkDaxpyHugeBothInc(b *testing.B) { 917 n := HUGE_SLICE 918 incX := posInc1 919 x := randomSlice(n, incX) 920 incY := negInc1 921 y := randomSlice(n, incY) 922 alpha := 2.4 923 benchmarkDaxpy(b, n, alpha, x, incX, y, incY) 924 } 925 926 /* ------------------ */ 927 func benchmarkDrot(b *testing.B, n int, x []float64, incX int, y []float64, incY int, c, s float64) { 928 b.ResetTimer() 929 for i := 0; i < b.N; i++ { 930 impl.Drot(n, x, incX, y, incY, c, s) 931 } 932 } 933 934 func BenchmarkDrotSmallBothUnitary(b *testing.B) { 935 n := SMALL_SLICE 936 incX := 1 937 x := randomSlice(n, incX) 938 incY := 1 939 y := randomSlice(n, incY) 940 c := 0.89725836967 941 s := 0.44150585279 942 benchmarkDrot(b, n, x, incX, y, incY, c, s) 943 } 944 945 func BenchmarkDrotSmallIncUni(b *testing.B) { 946 n := SMALL_SLICE 947 incX := posInc1 948 x := randomSlice(n, incX) 949 incY := 1 950 y := randomSlice(n, incY) 951 c := 0.89725836967 952 s := 0.44150585279 953 benchmarkDrot(b, n, x, incX, y, incY, c, s) 954 } 955 956 func BenchmarkDrotSmallUniInc(b *testing.B) { 957 n := SMALL_SLICE 958 incX := 1 959 x := randomSlice(n, incX) 960 incY := negInc1 961 y := randomSlice(n, incY) 962 c := 0.89725836967 963 s := 0.44150585279 964 benchmarkDrot(b, n, x, incX, y, incY, c, s) 965 } 966 967 func BenchmarkDrotSmallBothInc(b *testing.B) { 968 n := SMALL_SLICE 969 incX := posInc1 970 x := randomSlice(n, incX) 971 incY := negInc1 972 y := randomSlice(n, incY) 973 c := 0.89725836967 974 s := 0.44150585279 975 benchmarkDrot(b, n, x, incX, y, incY, c, s) 976 } 977 978 func BenchmarkDrotMediumBothUnitary(b *testing.B) { 979 n := MEDIUM_SLICE 980 incX := 1 981 x := randomSlice(n, incX) 982 incY := 1 983 y := randomSlice(n, incY) 984 c := 0.89725836967 985 s := 0.44150585279 986 benchmarkDrot(b, n, x, incX, y, incY, c, s) 987 } 988 989 func BenchmarkDrotMediumIncUni(b *testing.B) { 990 n := MEDIUM_SLICE 991 incX := posInc1 992 x := randomSlice(n, incX) 993 incY := 1 994 y := randomSlice(n, incY) 995 c := 0.89725836967 996 s := 0.44150585279 997 benchmarkDrot(b, n, x, incX, y, incY, c, s) 998 } 999 1000 func BenchmarkDrotMediumUniInc(b *testing.B) { 1001 n := MEDIUM_SLICE 1002 incX := 1 1003 x := randomSlice(n, incX) 1004 incY := negInc1 1005 y := randomSlice(n, incY) 1006 c := 0.89725836967 1007 s := 0.44150585279 1008 benchmarkDrot(b, n, x, incX, y, incY, c, s) 1009 } 1010 1011 func BenchmarkDrotMediumBothInc(b *testing.B) { 1012 n := MEDIUM_SLICE 1013 incX := posInc1 1014 x := randomSlice(n, incX) 1015 incY := negInc1 1016 y := randomSlice(n, incY) 1017 c := 0.89725836967 1018 s := 0.44150585279 1019 benchmarkDrot(b, n, x, incX, y, incY, c, s) 1020 } 1021 1022 func BenchmarkDrotLargeBothUnitary(b *testing.B) { 1023 n := LARGE_SLICE 1024 incX := 1 1025 x := randomSlice(n, incX) 1026 incY := 1 1027 y := randomSlice(n, incY) 1028 c := 0.89725836967 1029 s := 0.44150585279 1030 benchmarkDrot(b, n, x, incX, y, incY, c, s) 1031 } 1032 1033 func BenchmarkDrotLargeIncUni(b *testing.B) { 1034 n := LARGE_SLICE 1035 incX := posInc1 1036 x := randomSlice(n, incX) 1037 incY := 1 1038 y := randomSlice(n, incY) 1039 c := 0.89725836967 1040 s := 0.44150585279 1041 benchmarkDrot(b, n, x, incX, y, incY, c, s) 1042 } 1043 1044 func BenchmarkDrotLargeUniInc(b *testing.B) { 1045 n := LARGE_SLICE 1046 incX := 1 1047 x := randomSlice(n, incX) 1048 incY := negInc1 1049 y := randomSlice(n, incY) 1050 c := 0.89725836967 1051 s := 0.44150585279 1052 benchmarkDrot(b, n, x, incX, y, incY, c, s) 1053 } 1054 1055 func BenchmarkDrotLargeBothInc(b *testing.B) { 1056 n := LARGE_SLICE 1057 incX := posInc1 1058 x := randomSlice(n, incX) 1059 incY := negInc1 1060 y := randomSlice(n, incY) 1061 c := 0.89725836967 1062 s := 0.44150585279 1063 benchmarkDrot(b, n, x, incX, y, incY, c, s) 1064 } 1065 1066 func BenchmarkDrotHugeBothUnitary(b *testing.B) { 1067 n := HUGE_SLICE 1068 incX := 1 1069 x := randomSlice(n, incX) 1070 incY := 1 1071 y := randomSlice(n, incY) 1072 c := 0.89725836967 1073 s := 0.44150585279 1074 benchmarkDrot(b, n, x, incX, y, incY, c, s) 1075 } 1076 1077 func BenchmarkDrotHugeIncUni(b *testing.B) { 1078 n := HUGE_SLICE 1079 incX := posInc1 1080 x := randomSlice(n, incX) 1081 incY := 1 1082 y := randomSlice(n, incY) 1083 c := 0.89725836967 1084 s := 0.44150585279 1085 benchmarkDrot(b, n, x, incX, y, incY, c, s) 1086 } 1087 1088 func BenchmarkDrotHugeUniInc(b *testing.B) { 1089 n := HUGE_SLICE 1090 incX := 1 1091 x := randomSlice(n, incX) 1092 incY := negInc1 1093 y := randomSlice(n, incY) 1094 c := 0.89725836967 1095 s := 0.44150585279 1096 benchmarkDrot(b, n, x, incX, y, incY, c, s) 1097 } 1098 1099 func BenchmarkDrotHugeBothInc(b *testing.B) { 1100 n := HUGE_SLICE 1101 incX := posInc1 1102 x := randomSlice(n, incX) 1103 incY := negInc1 1104 y := randomSlice(n, incY) 1105 c := 0.89725836967 1106 s := 0.44150585279 1107 benchmarkDrot(b, n, x, incX, y, incY, c, s) 1108 } 1109 1110 /* ------------------ */ 1111 func benchmarkDrotmOffDia(b *testing.B, n int, x []float64, incX int, y []float64, incY int, p blas.DrotmParams) { 1112 b.ResetTimer() 1113 for i := 0; i < b.N; i++ { 1114 impl.Drotm(n, x, incX, y, incY, p) 1115 } 1116 } 1117 1118 func BenchmarkDrotmOffDiaSmallBothUnitary(b *testing.B) { 1119 n := SMALL_SLICE 1120 incX := 1 1121 x := randomSlice(n, incX) 1122 incY := 1 1123 y := randomSlice(n, incY) 1124 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1125 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1126 } 1127 1128 func BenchmarkDrotmOffDiaSmallIncUni(b *testing.B) { 1129 n := SMALL_SLICE 1130 incX := posInc1 1131 x := randomSlice(n, incX) 1132 incY := 1 1133 y := randomSlice(n, incY) 1134 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1135 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1136 } 1137 1138 func BenchmarkDrotmOffDiaSmallUniInc(b *testing.B) { 1139 n := SMALL_SLICE 1140 incX := 1 1141 x := randomSlice(n, incX) 1142 incY := negInc1 1143 y := randomSlice(n, incY) 1144 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1145 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1146 } 1147 1148 func BenchmarkDrotmOffDiaSmallBothInc(b *testing.B) { 1149 n := SMALL_SLICE 1150 incX := posInc1 1151 x := randomSlice(n, incX) 1152 incY := negInc1 1153 y := randomSlice(n, incY) 1154 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1155 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1156 } 1157 1158 func BenchmarkDrotmOffDiaMediumBothUnitary(b *testing.B) { 1159 n := MEDIUM_SLICE 1160 incX := 1 1161 x := randomSlice(n, incX) 1162 incY := 1 1163 y := randomSlice(n, incY) 1164 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1165 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1166 } 1167 1168 func BenchmarkDrotmOffDiaMediumIncUni(b *testing.B) { 1169 n := MEDIUM_SLICE 1170 incX := posInc1 1171 x := randomSlice(n, incX) 1172 incY := 1 1173 y := randomSlice(n, incY) 1174 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1175 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1176 } 1177 1178 func BenchmarkDrotmOffDiaMediumUniInc(b *testing.B) { 1179 n := MEDIUM_SLICE 1180 incX := 1 1181 x := randomSlice(n, incX) 1182 incY := negInc1 1183 y := randomSlice(n, incY) 1184 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1185 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1186 } 1187 1188 func BenchmarkDrotmOffDiaMediumBothInc(b *testing.B) { 1189 n := MEDIUM_SLICE 1190 incX := posInc1 1191 x := randomSlice(n, incX) 1192 incY := negInc1 1193 y := randomSlice(n, incY) 1194 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1195 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1196 } 1197 1198 func BenchmarkDrotmOffDiaLargeBothUnitary(b *testing.B) { 1199 n := LARGE_SLICE 1200 incX := 1 1201 x := randomSlice(n, incX) 1202 incY := 1 1203 y := randomSlice(n, incY) 1204 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1205 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1206 } 1207 1208 func BenchmarkDrotmOffDiaLargeIncUni(b *testing.B) { 1209 n := LARGE_SLICE 1210 incX := posInc1 1211 x := randomSlice(n, incX) 1212 incY := 1 1213 y := randomSlice(n, incY) 1214 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1215 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1216 } 1217 1218 func BenchmarkDrotmOffDiaLargeUniInc(b *testing.B) { 1219 n := LARGE_SLICE 1220 incX := 1 1221 x := randomSlice(n, incX) 1222 incY := negInc1 1223 y := randomSlice(n, incY) 1224 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1225 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1226 } 1227 1228 func BenchmarkDrotmOffDiaLargeBothInc(b *testing.B) { 1229 n := LARGE_SLICE 1230 incX := posInc1 1231 x := randomSlice(n, incX) 1232 incY := negInc1 1233 y := randomSlice(n, incY) 1234 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1235 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1236 } 1237 1238 func BenchmarkDrotmOffDiaHugeBothUnitary(b *testing.B) { 1239 n := HUGE_SLICE 1240 incX := 1 1241 x := randomSlice(n, incX) 1242 incY := 1 1243 y := randomSlice(n, incY) 1244 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1245 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1246 } 1247 1248 func BenchmarkDrotmOffDiaHugeIncUni(b *testing.B) { 1249 n := HUGE_SLICE 1250 incX := posInc1 1251 x := randomSlice(n, incX) 1252 incY := 1 1253 y := randomSlice(n, incY) 1254 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1255 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1256 } 1257 1258 func BenchmarkDrotmOffDiaHugeUniInc(b *testing.B) { 1259 n := HUGE_SLICE 1260 incX := 1 1261 x := randomSlice(n, incX) 1262 incY := negInc1 1263 y := randomSlice(n, incY) 1264 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1265 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1266 } 1267 1268 func BenchmarkDrotmOffDiaHugeBothInc(b *testing.B) { 1269 n := HUGE_SLICE 1270 incX := posInc1 1271 x := randomSlice(n, incX) 1272 incY := negInc1 1273 y := randomSlice(n, incY) 1274 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{0, -0.625, 0.9375, 0}} 1275 benchmarkDrotmOffDia(b, n, x, incX, y, incY, p) 1276 } 1277 1278 /* ------------------ */ 1279 func benchmarkDrotmDia(b *testing.B, n int, x []float64, incX int, y []float64, incY int, p blas.DrotmParams) { 1280 b.ResetTimer() 1281 for i := 0; i < b.N; i++ { 1282 impl.Drotm(n, x, incX, y, incY, p) 1283 } 1284 } 1285 1286 func BenchmarkDrotmDiaSmallBothUnitary(b *testing.B) { 1287 n := SMALL_SLICE 1288 incX := 1 1289 x := randomSlice(n, incX) 1290 incY := 1 1291 y := randomSlice(n, incY) 1292 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1293 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1294 } 1295 1296 func BenchmarkDrotmDiaSmallIncUni(b *testing.B) { 1297 n := SMALL_SLICE 1298 incX := posInc1 1299 x := randomSlice(n, incX) 1300 incY := 1 1301 y := randomSlice(n, incY) 1302 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1303 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1304 } 1305 1306 func BenchmarkDrotmDiaSmallUniInc(b *testing.B) { 1307 n := SMALL_SLICE 1308 incX := 1 1309 x := randomSlice(n, incX) 1310 incY := negInc1 1311 y := randomSlice(n, incY) 1312 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1313 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1314 } 1315 1316 func BenchmarkDrotmDiaSmallBothInc(b *testing.B) { 1317 n := SMALL_SLICE 1318 incX := posInc1 1319 x := randomSlice(n, incX) 1320 incY := negInc1 1321 y := randomSlice(n, incY) 1322 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1323 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1324 } 1325 1326 func BenchmarkDrotmDiaMediumBothUnitary(b *testing.B) { 1327 n := MEDIUM_SLICE 1328 incX := 1 1329 x := randomSlice(n, incX) 1330 incY := 1 1331 y := randomSlice(n, incY) 1332 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1333 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1334 } 1335 1336 func BenchmarkDrotmDiaMediumIncUni(b *testing.B) { 1337 n := MEDIUM_SLICE 1338 incX := posInc1 1339 x := randomSlice(n, incX) 1340 incY := 1 1341 y := randomSlice(n, incY) 1342 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1343 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1344 } 1345 1346 func BenchmarkDrotmDiaMediumUniInc(b *testing.B) { 1347 n := MEDIUM_SLICE 1348 incX := 1 1349 x := randomSlice(n, incX) 1350 incY := negInc1 1351 y := randomSlice(n, incY) 1352 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1353 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1354 } 1355 1356 func BenchmarkDrotmDiaMediumBothInc(b *testing.B) { 1357 n := MEDIUM_SLICE 1358 incX := posInc1 1359 x := randomSlice(n, incX) 1360 incY := negInc1 1361 y := randomSlice(n, incY) 1362 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1363 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1364 } 1365 1366 func BenchmarkDrotmDiaLargeBothUnitary(b *testing.B) { 1367 n := LARGE_SLICE 1368 incX := 1 1369 x := randomSlice(n, incX) 1370 incY := 1 1371 y := randomSlice(n, incY) 1372 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1373 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1374 } 1375 1376 func BenchmarkDrotmDiaLargeIncUni(b *testing.B) { 1377 n := LARGE_SLICE 1378 incX := posInc1 1379 x := randomSlice(n, incX) 1380 incY := 1 1381 y := randomSlice(n, incY) 1382 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1383 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1384 } 1385 1386 func BenchmarkDrotmDiaLargeUniInc(b *testing.B) { 1387 n := LARGE_SLICE 1388 incX := 1 1389 x := randomSlice(n, incX) 1390 incY := negInc1 1391 y := randomSlice(n, incY) 1392 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1393 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1394 } 1395 1396 func BenchmarkDrotmDiaLargeBothInc(b *testing.B) { 1397 n := LARGE_SLICE 1398 incX := posInc1 1399 x := randomSlice(n, incX) 1400 incY := negInc1 1401 y := randomSlice(n, incY) 1402 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1403 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1404 } 1405 1406 func BenchmarkDrotmDiaHugeBothUnitary(b *testing.B) { 1407 n := HUGE_SLICE 1408 incX := 1 1409 x := randomSlice(n, incX) 1410 incY := 1 1411 y := randomSlice(n, incY) 1412 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1413 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1414 } 1415 1416 func BenchmarkDrotmDiaHugeIncUni(b *testing.B) { 1417 n := HUGE_SLICE 1418 incX := posInc1 1419 x := randomSlice(n, incX) 1420 incY := 1 1421 y := randomSlice(n, incY) 1422 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1423 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1424 } 1425 1426 func BenchmarkDrotmDiaHugeUniInc(b *testing.B) { 1427 n := HUGE_SLICE 1428 incX := 1 1429 x := randomSlice(n, incX) 1430 incY := negInc1 1431 y := randomSlice(n, incY) 1432 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1433 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1434 } 1435 1436 func BenchmarkDrotmDiaHugeBothInc(b *testing.B) { 1437 n := HUGE_SLICE 1438 incX := posInc1 1439 x := randomSlice(n, incX) 1440 incY := negInc1 1441 y := randomSlice(n, incY) 1442 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{5.0 / 12, 0, 0, 0.625}} 1443 benchmarkDrotmDia(b, n, x, incX, y, incY, p) 1444 } 1445 1446 /* ------------------ */ 1447 func benchmarkDrotmResc(b *testing.B, n int, x []float64, incX int, y []float64, incY int, p blas.DrotmParams) { 1448 b.ResetTimer() 1449 for i := 0; i < b.N; i++ { 1450 impl.Drotm(n, x, incX, y, incY, p) 1451 } 1452 } 1453 1454 func BenchmarkDrotmRescSmallBothUnitary(b *testing.B) { 1455 n := SMALL_SLICE 1456 incX := 1 1457 x := randomSlice(n, incX) 1458 incY := 1 1459 y := randomSlice(n, incY) 1460 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1461 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1462 } 1463 1464 func BenchmarkDrotmRescSmallIncUni(b *testing.B) { 1465 n := SMALL_SLICE 1466 incX := posInc1 1467 x := randomSlice(n, incX) 1468 incY := 1 1469 y := randomSlice(n, incY) 1470 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1471 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1472 } 1473 1474 func BenchmarkDrotmRescSmallUniInc(b *testing.B) { 1475 n := SMALL_SLICE 1476 incX := 1 1477 x := randomSlice(n, incX) 1478 incY := negInc1 1479 y := randomSlice(n, incY) 1480 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1481 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1482 } 1483 1484 func BenchmarkDrotmRescSmallBothInc(b *testing.B) { 1485 n := SMALL_SLICE 1486 incX := posInc1 1487 x := randomSlice(n, incX) 1488 incY := negInc1 1489 y := randomSlice(n, incY) 1490 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1491 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1492 } 1493 1494 func BenchmarkDrotmRescMediumBothUnitary(b *testing.B) { 1495 n := MEDIUM_SLICE 1496 incX := 1 1497 x := randomSlice(n, incX) 1498 incY := 1 1499 y := randomSlice(n, incY) 1500 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1501 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1502 } 1503 1504 func BenchmarkDrotmRescMediumIncUni(b *testing.B) { 1505 n := MEDIUM_SLICE 1506 incX := posInc1 1507 x := randomSlice(n, incX) 1508 incY := 1 1509 y := randomSlice(n, incY) 1510 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1511 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1512 } 1513 1514 func BenchmarkDrotmRescMediumUniInc(b *testing.B) { 1515 n := MEDIUM_SLICE 1516 incX := 1 1517 x := randomSlice(n, incX) 1518 incY := negInc1 1519 y := randomSlice(n, incY) 1520 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1521 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1522 } 1523 1524 func BenchmarkDrotmRescMediumBothInc(b *testing.B) { 1525 n := MEDIUM_SLICE 1526 incX := posInc1 1527 x := randomSlice(n, incX) 1528 incY := negInc1 1529 y := randomSlice(n, incY) 1530 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1531 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1532 } 1533 1534 func BenchmarkDrotmRescLargeBothUnitary(b *testing.B) { 1535 n := LARGE_SLICE 1536 incX := 1 1537 x := randomSlice(n, incX) 1538 incY := 1 1539 y := randomSlice(n, incY) 1540 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1541 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1542 } 1543 1544 func BenchmarkDrotmRescLargeIncUni(b *testing.B) { 1545 n := LARGE_SLICE 1546 incX := posInc1 1547 x := randomSlice(n, incX) 1548 incY := 1 1549 y := randomSlice(n, incY) 1550 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1551 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1552 } 1553 1554 func BenchmarkDrotmRescLargeUniInc(b *testing.B) { 1555 n := LARGE_SLICE 1556 incX := 1 1557 x := randomSlice(n, incX) 1558 incY := negInc1 1559 y := randomSlice(n, incY) 1560 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1561 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1562 } 1563 1564 func BenchmarkDrotmRescLargeBothInc(b *testing.B) { 1565 n := LARGE_SLICE 1566 incX := posInc1 1567 x := randomSlice(n, incX) 1568 incY := negInc1 1569 y := randomSlice(n, incY) 1570 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1571 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1572 } 1573 1574 func BenchmarkDrotmRescHugeBothUnitary(b *testing.B) { 1575 n := HUGE_SLICE 1576 incX := 1 1577 x := randomSlice(n, incX) 1578 incY := 1 1579 y := randomSlice(n, incY) 1580 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1581 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1582 } 1583 1584 func BenchmarkDrotmRescHugeIncUni(b *testing.B) { 1585 n := HUGE_SLICE 1586 incX := posInc1 1587 x := randomSlice(n, incX) 1588 incY := 1 1589 y := randomSlice(n, incY) 1590 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1591 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1592 } 1593 1594 func BenchmarkDrotmRescHugeUniInc(b *testing.B) { 1595 n := HUGE_SLICE 1596 incX := 1 1597 x := randomSlice(n, incX) 1598 incY := negInc1 1599 y := randomSlice(n, incY) 1600 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1601 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1602 } 1603 1604 func BenchmarkDrotmRescHugeBothInc(b *testing.B) { 1605 n := HUGE_SLICE 1606 incX := posInc1 1607 x := randomSlice(n, incX) 1608 incY := negInc1 1609 y := randomSlice(n, incY) 1610 p := blas.DrotmParams{Flag: blas.OffDiagonal, H: [4]float64{4096, -3584, 1792, 4096}} 1611 benchmarkDrotmResc(b, n, x, incX, y, incY, p) 1612 } 1613 1614 /* ------------------ */ 1615 func benchmarkDscal(b *testing.B, n int, alpha float64, x []float64, incX int) { 1616 b.ResetTimer() 1617 for i := 0; i < b.N; i++ { 1618 impl.Dscal(n, alpha, x, incX) 1619 } 1620 } 1621 1622 func BenchmarkDscalSmallUnitaryInc(b *testing.B) { 1623 n := SMALL_SLICE 1624 incX := 1 1625 x := randomSlice(n, incX) 1626 alpha := 2.4 1627 benchmarkDscal(b, n, alpha, x, incX) 1628 } 1629 1630 func BenchmarkDscalSmallPosInc(b *testing.B) { 1631 n := SMALL_SLICE 1632 incX := posInc1 1633 x := randomSlice(n, incX) 1634 alpha := 2.4 1635 benchmarkDscal(b, n, alpha, x, incX) 1636 } 1637 1638 func BenchmarkDscalMediumUnitaryInc(b *testing.B) { 1639 n := MEDIUM_SLICE 1640 incX := 1 1641 x := randomSlice(n, incX) 1642 alpha := 2.4 1643 benchmarkDscal(b, n, alpha, x, incX) 1644 } 1645 1646 func BenchmarkDscalMediumPosInc(b *testing.B) { 1647 n := MEDIUM_SLICE 1648 incX := posInc1 1649 x := randomSlice(n, incX) 1650 alpha := 2.4 1651 benchmarkDscal(b, n, alpha, x, incX) 1652 } 1653 1654 func BenchmarkDscalLargeUnitaryInc(b *testing.B) { 1655 n := LARGE_SLICE 1656 incX := 1 1657 x := randomSlice(n, incX) 1658 alpha := 2.4 1659 benchmarkDscal(b, n, alpha, x, incX) 1660 } 1661 1662 func BenchmarkDscalLargePosInc(b *testing.B) { 1663 n := LARGE_SLICE 1664 incX := posInc1 1665 x := randomSlice(n, incX) 1666 alpha := 2.4 1667 benchmarkDscal(b, n, alpha, x, incX) 1668 } 1669 1670 func BenchmarkDscalHugeUnitaryInc(b *testing.B) { 1671 n := HUGE_SLICE 1672 incX := 1 1673 x := randomSlice(n, incX) 1674 alpha := 2.4 1675 benchmarkDscal(b, n, alpha, x, incX) 1676 } 1677 1678 func BenchmarkDscalHugePosInc(b *testing.B) { 1679 n := HUGE_SLICE 1680 incX := posInc1 1681 x := randomSlice(n, incX) 1682 alpha := 2.4 1683 benchmarkDscal(b, n, alpha, x, incX) 1684 } 1685 1686 /* ------------------ */