forked from LaconicNetwork/kompose
Upgrade OpenShift and its dependencies.
OpenShift version 1.4.0-alpha.0
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
// Generated code do not edit. Run `go generate`.
|
||||
|
||||
// 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 asm
|
||||
|
||||
// The extra z parameter is needed because of floats.AddScaledTo
|
||||
func CaxpyUnitary(alpha complex64, x, y, z []complex64) {
|
||||
for i, v := range x {
|
||||
z[i] = alpha*v + y[i]
|
||||
}
|
||||
}
|
||||
|
||||
func CaxpyInc(alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) {
|
||||
for i := 0; i < int(n); i++ {
|
||||
y[iy] += alpha * x[ix]
|
||||
ix += incX
|
||||
iy += incY
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// Generated code do not edit. Run `go generate`.
|
||||
|
||||
// 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 asm
|
||||
|
||||
func CdotcUnitary(x, y []complex64) (sum complex64) {
|
||||
for i, v := range x {
|
||||
sum += y[i] * conj(v)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func CdotcInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) {
|
||||
for i := 0; i < int(n); i++ {
|
||||
sum += y[iy] * conj(x[ix])
|
||||
ix += incX
|
||||
iy += incY
|
||||
}
|
||||
return
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// Generated code do not edit. Run `go generate`.
|
||||
|
||||
// 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 asm
|
||||
|
||||
func CdotuUnitary(x, y []complex64) (sum complex64) {
|
||||
for i, v := range x {
|
||||
sum += y[i] * v
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func CdotuInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) {
|
||||
for i := 0; i < int(n); i++ {
|
||||
sum += y[iy] * x[ix]
|
||||
ix += incX
|
||||
iy += incY
|
||||
}
|
||||
return
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 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.
|
||||
|
||||
echo Generating zdotu.go
|
||||
echo -e '// Generated code do not edit. Run `go generate`.\n' > zdotu.go
|
||||
cat ddot.go \
|
||||
| grep -v '//+build' \
|
||||
| gofmt -r 'float64 -> complex128' \
|
||||
| sed 's/Ddot/Zdotu/' \
|
||||
>> zdotu.go
|
||||
|
||||
echo Generating zdotc.go
|
||||
echo -e '// Generated code do not edit. Run `go generate`.\n' > zdotc.go
|
||||
cat ddot.go \
|
||||
| grep -v '//+build' \
|
||||
| gofmt -r 'float64 -> complex128' \
|
||||
| gofmt -r 'y[i] * v -> y[i] * cmplx.Conj(v)' \
|
||||
| sed 's/Ddot/Zdotc/' \
|
||||
| goimports \
|
||||
>> zdotc.go
|
||||
|
||||
echo Generating zaxpy.go
|
||||
echo -e '// Generated code do not edit. Run `go generate`.\n' > zaxpy.go
|
||||
cat daxpy.go \
|
||||
| grep -v '//+build' \
|
||||
| gofmt -r 'float64 -> complex128' \
|
||||
| sed 's/Daxpy/Zaxpy/' \
|
||||
>> zaxpy.go
|
||||
|
||||
echo Generating cdotu.go
|
||||
echo -e '// Generated code do not edit. Run `go generate`.\n' > cdotu.go
|
||||
cat ddot.go \
|
||||
| grep -v '//+build' \
|
||||
| gofmt -r 'float64 -> complex64' \
|
||||
| sed 's/Ddot/Cdotu/' \
|
||||
>> cdotu.go
|
||||
|
||||
echo Generating cdotc.go
|
||||
echo -e '// Generated code do not edit. Run `go generate`.\n' > cdotc.go
|
||||
cat ddot.go \
|
||||
| grep -v '//+build' \
|
||||
| gofmt -r 'float64 -> complex64' \
|
||||
| gofmt -r 'y[i] * v -> y[i] * conj(v)' \
|
||||
| sed 's/Ddot/Cdotc/' \
|
||||
| goimports \
|
||||
>> cdotc.go
|
||||
|
||||
echo Generating caxpy.go
|
||||
echo -e '// Generated code do not edit. Run `go generate`.\n' > caxpy.go
|
||||
cat daxpy.go \
|
||||
| grep -v '//+build' \
|
||||
| gofmt -r 'float64 -> complex64' \
|
||||
| sed 's/Daxpy/Caxpy/' \
|
||||
>> caxpy.go
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// 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 asm
|
||||
|
||||
func conj(c complex64) complex64 { return complex(real(c), -imag(c)) }
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// 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.
|
||||
|
||||
//+build !amd64 noasm
|
||||
|
||||
package asm
|
||||
|
||||
// The extra z parameter is needed because of floats.AddScaledTo
|
||||
func DaxpyUnitary(alpha float64, x, y, z []float64) {
|
||||
for i, v := range x {
|
||||
z[i] = alpha*v + y[i]
|
||||
}
|
||||
}
|
||||
|
||||
func DaxpyInc(alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) {
|
||||
for i := 0; i < int(n); i++ {
|
||||
y[iy] += alpha * x[ix]
|
||||
ix += incX
|
||||
iy += incY
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// 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.
|
||||
|
||||
//+build !noasm
|
||||
|
||||
package asm
|
||||
|
||||
// The extra z parameter is needed because of floats.AddScaledTo
|
||||
func DaxpyUnitary(alpha float64, x, y, z []float64)
|
||||
|
||||
func DaxpyInc(alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr)
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
// 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.
|
||||
//
|
||||
// Some of the loop unrolling code is copied from:
|
||||
// http://golang.org/src/math/big/arith_amd64.s
|
||||
// which is distributed under these terms:
|
||||
//
|
||||
// Copyright (c) 2012 The Go Authors. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
//+build !noasm
|
||||
|
||||
// TODO(fhs): use textflag.h after we drop Go 1.3 support
|
||||
//#include "textflag.h"
|
||||
// Don't insert stack check preamble.
|
||||
#define NOSPLIT 4
|
||||
|
||||
|
||||
// func DaxpyUnitary(alpha float64, x, y, z []float64)
|
||||
// This function assumes len(y) >= len(x).
|
||||
TEXT ·DaxpyUnitary(SB),NOSPLIT,$0
|
||||
MOVHPD alpha+0(FP), X7
|
||||
MOVLPD alpha+0(FP), X7
|
||||
MOVQ x_len+16(FP), DI // n = len(x)
|
||||
MOVQ x+8(FP), R8
|
||||
MOVQ y+32(FP), R9
|
||||
MOVQ z+56(FP), R10
|
||||
|
||||
MOVQ $0, SI // i = 0
|
||||
SUBQ $2, DI // n -= 2
|
||||
JL V1 // if n < 0 goto V1
|
||||
|
||||
U1: // n >= 0
|
||||
// y[i] += alpha * x[i] unrolled 2x.
|
||||
MOVUPD 0(R8)(SI*8), X0
|
||||
MOVUPD 0(R9)(SI*8), X1
|
||||
MULPD X7, X0
|
||||
ADDPD X0, X1
|
||||
MOVUPD X1, 0(R10)(SI*8)
|
||||
|
||||
ADDQ $2, SI // i += 2
|
||||
SUBQ $2, DI // n -= 2
|
||||
JGE U1 // if n >= 0 goto U1
|
||||
|
||||
V1:
|
||||
ADDQ $2, DI // n += 2
|
||||
JLE E1 // if n <= 0 goto E1
|
||||
|
||||
// y[i] += alpha * x[i] for last iteration if n is odd.
|
||||
MOVSD 0(R8)(SI*8), X0
|
||||
MOVSD 0(R9)(SI*8), X1
|
||||
MULSD X7, X0
|
||||
ADDSD X0, X1
|
||||
MOVSD X1, 0(R10)(SI*8)
|
||||
|
||||
E1:
|
||||
RET
|
||||
|
||||
|
||||
// func DaxpyInc(alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr)
|
||||
TEXT ·DaxpyInc(SB),NOSPLIT,$0
|
||||
MOVHPD alpha+0(FP), X7
|
||||
MOVLPD alpha+0(FP), X7
|
||||
MOVQ x+8(FP), R8
|
||||
MOVQ y+32(FP), R9
|
||||
MOVQ n+56(FP), CX
|
||||
MOVQ incX+64(FP), R11
|
||||
MOVQ incY+72(FP), R12
|
||||
MOVQ ix+80(FP), SI
|
||||
MOVQ iy+88(FP), DI
|
||||
|
||||
MOVQ SI, AX // nextX = ix
|
||||
MOVQ DI, BX // nextY = iy
|
||||
ADDQ R11, AX // nextX += incX
|
||||
ADDQ R12, BX // nextY += incX
|
||||
SHLQ $1, R11 // indX *= 2
|
||||
SHLQ $1, R12 // indY *= 2
|
||||
|
||||
SUBQ $2, CX // n -= 2
|
||||
JL V2 // if n < 0 goto V2
|
||||
|
||||
U2: // n >= 0
|
||||
// y[i] += alpha * x[i] unrolled 2x.
|
||||
MOVHPD 0(R8)(SI*8), X0
|
||||
MOVHPD 0(R9)(DI*8), X1
|
||||
MOVLPD 0(R8)(AX*8), X0
|
||||
MOVLPD 0(R9)(BX*8), X1
|
||||
|
||||
MULPD X7, X0
|
||||
ADDPD X0, X1
|
||||
MOVHPD X1, 0(R9)(DI*8)
|
||||
MOVLPD X1, 0(R9)(BX*8)
|
||||
|
||||
ADDQ R11, SI // ix += incX
|
||||
ADDQ R12, DI // iy += incY
|
||||
ADDQ R11, AX // nextX += incX
|
||||
ADDQ R12, BX // nextY += incY
|
||||
|
||||
SUBQ $2, CX // n -= 2
|
||||
JGE U2 // if n >= 0 goto U2
|
||||
|
||||
V2:
|
||||
ADDQ $2, CX // n += 2
|
||||
JLE E2 // if n <= 0 goto E2
|
||||
|
||||
// y[i] += alpha * x[i] for the last iteration if n is odd.
|
||||
MOVSD 0(R8)(SI*8), X0
|
||||
MOVSD 0(R9)(DI*8), X1
|
||||
MULSD X7, X0
|
||||
ADDSD X0, X1
|
||||
MOVSD X1, 0(R9)(DI*8)
|
||||
|
||||
E2:
|
||||
RET
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// 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.
|
||||
|
||||
//+build !amd64 noasm
|
||||
|
||||
package asm
|
||||
|
||||
func DdotUnitary(x, y []float64) (sum float64) {
|
||||
for i, v := range x {
|
||||
sum += y[i] * v
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func DdotInc(x, y []float64, n, incX, incY, ix, iy uintptr) (sum float64) {
|
||||
for i := 0; i < int(n); i++ {
|
||||
sum += y[iy] * x[ix]
|
||||
ix += incX
|
||||
iy += incY
|
||||
}
|
||||
return
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// 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.
|
||||
|
||||
//+build !noasm
|
||||
|
||||
package asm
|
||||
|
||||
func DdotUnitary(x, y []float64) (sum float64)
|
||||
func DdotInc(x, y []float64, n, incX, incY, ix, iy uintptr) (sum float64)
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
// 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.
|
||||
//
|
||||
// Some of the loop unrolling code is copied from:
|
||||
// http://golang.org/src/math/big/arith_amd64.s
|
||||
// which is distributed under these terms:
|
||||
//
|
||||
// Copyright (c) 2012 The Go Authors. All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following disclaimer
|
||||
// in the documentation and/or other materials provided with the
|
||||
// distribution.
|
||||
// * Neither the name of Google Inc. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from
|
||||
// this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
//+build !noasm
|
||||
|
||||
// TODO(fhs): use textflag.h after we drop Go 1.3 support
|
||||
//#include "textflag.h"
|
||||
// Don't insert stack check preamble.
|
||||
#define NOSPLIT 4
|
||||
|
||||
|
||||
// func DdotUnitary(x, y []float64) (sum float64)
|
||||
// This function assumes len(y) >= len(x).
|
||||
TEXT ·DdotUnitary(SB),NOSPLIT,$0
|
||||
MOVQ x_len+8(FP), DI // n = len(x)
|
||||
MOVQ x+0(FP), R8
|
||||
MOVQ y+24(FP), R9
|
||||
|
||||
MOVQ $0, SI // i = 0
|
||||
MOVSD $(0.0), X7 // sum = 0
|
||||
|
||||
SUBQ $2, DI // n -= 2
|
||||
JL V1 // if n < 0 goto V1
|
||||
|
||||
U1: // n >= 0
|
||||
// sum += x[i] * y[i] unrolled 2x.
|
||||
MOVUPD 0(R8)(SI*8), X0
|
||||
MOVUPD 0(R9)(SI*8), X1
|
||||
MULPD X1, X0
|
||||
ADDPD X0, X7
|
||||
|
||||
ADDQ $2, SI // i += 2
|
||||
SUBQ $2, DI // n -= 2
|
||||
JGE U1 // if n >= 0 goto U1
|
||||
|
||||
V1: // n > 0
|
||||
ADDQ $2, DI // n += 2
|
||||
JLE E1 // if n <= 0 goto E1
|
||||
|
||||
// sum += x[i] * y[i] for last iteration if n is odd.
|
||||
MOVSD 0(R8)(SI*8), X0
|
||||
MOVSD 0(R9)(SI*8), X1
|
||||
MULSD X1, X0
|
||||
ADDSD X0, X7
|
||||
|
||||
E1:
|
||||
// Add the two sums together.
|
||||
MOVSD X7, X0
|
||||
UNPCKHPD X7, X7
|
||||
ADDSD X0, X7
|
||||
MOVSD X7, sum+48(FP) // return final sum
|
||||
RET
|
||||
|
||||
|
||||
// func DdotInc(x, y []float64, n, incX, incY, ix, iy uintptr) (sum float64)
|
||||
TEXT ·DdotInc(SB),NOSPLIT,$0
|
||||
MOVQ x+0(FP), R8
|
||||
MOVQ y+24(FP), R9
|
||||
MOVQ n+48(FP), CX
|
||||
MOVQ incX+56(FP), R11
|
||||
MOVQ incY+64(FP), R12
|
||||
MOVQ ix+72(FP), R13
|
||||
MOVQ iy+80(FP), R14
|
||||
|
||||
MOVSD $(0.0), X7 // sum = 0
|
||||
LEAQ (R8)(R13*8), SI // p = &x[ix]
|
||||
LEAQ (R9)(R14*8), DI // q = &y[ix]
|
||||
SHLQ $3, R11 // incX *= sizeof(float64)
|
||||
SHLQ $3, R12 // indY *= sizeof(float64)
|
||||
|
||||
SUBQ $2, CX // n -= 2
|
||||
JL V2 // if n < 0 goto V2
|
||||
|
||||
U2: // n >= 0
|
||||
// sum += *p * *q unrolled 2x.
|
||||
MOVHPD (SI), X0
|
||||
MOVHPD (DI), X1
|
||||
ADDQ R11, SI // p += incX
|
||||
ADDQ R12, DI // q += incY
|
||||
MOVLPD (SI), X0
|
||||
MOVLPD (DI), X1
|
||||
ADDQ R11, SI // p += incX
|
||||
ADDQ R12, DI // q += incY
|
||||
|
||||
MULPD X1, X0
|
||||
ADDPD X0, X7
|
||||
|
||||
SUBQ $2, CX // n -= 2
|
||||
JGE U2 // if n >= 0 goto U2
|
||||
|
||||
V2:
|
||||
ADDQ $2, CX // n += 2
|
||||
JLE E2 // if n <= 0 goto E2
|
||||
|
||||
// sum += *p * *q for the last iteration if n is odd.
|
||||
MOVSD (SI), X0
|
||||
MULSD (DI), X0
|
||||
ADDSD X0, X7
|
||||
|
||||
E2:
|
||||
// Add the two sums together.
|
||||
MOVSD X7, X0
|
||||
UNPCKHPD X7, X7
|
||||
ADDSD X0, X7
|
||||
MOVSD X7, sum+88(FP) // return final sum
|
||||
RET
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// Generated code do not edit. Run `go generate`.
|
||||
|
||||
// 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 asm
|
||||
|
||||
func DsdotUnitary(x, y []float32) (sum float64) {
|
||||
for i, v := range x {
|
||||
sum += float64(y[i]) * float64(v)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func DsdotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float64) {
|
||||
for i := 0; i < int(n); i++ {
|
||||
sum += float64(y[iy]) * float64(x[ix])
|
||||
ix += incX
|
||||
iy += incY
|
||||
}
|
||||
return
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// 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.
|
||||
|
||||
//go:generate ./single_precision
|
||||
//go:generate ./complex
|
||||
|
||||
package asm
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// Generated code do not edit. Run `go generate`.
|
||||
|
||||
// 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 asm
|
||||
|
||||
// The extra z parameter is needed because of floats.AddScaledTo
|
||||
func SaxpyUnitary(alpha float32, x, y, z []float32) {
|
||||
for i, v := range x {
|
||||
z[i] = alpha*v + y[i]
|
||||
}
|
||||
}
|
||||
|
||||
func SaxpyInc(alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) {
|
||||
for i := 0; i < int(n); i++ {
|
||||
y[iy] += alpha * x[ix]
|
||||
ix += incX
|
||||
iy += incY
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// Generated code do not edit. Run `go generate`.
|
||||
|
||||
// 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 asm
|
||||
|
||||
func SdotUnitary(x, y []float32) (sum float32) {
|
||||
for i, v := range x {
|
||||
sum += y[i] * v
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func SdotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float32) {
|
||||
for i := 0; i < int(n); i++ {
|
||||
sum += y[iy] * x[ix]
|
||||
ix += incX
|
||||
iy += incY
|
||||
}
|
||||
return
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 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.
|
||||
|
||||
echo Generating dsdot.go
|
||||
echo -e '// Generated code do not edit. Run `go generate`.\n' > dsdot.go
|
||||
cat ddot.go \
|
||||
| grep -v '//+build' \
|
||||
| gofmt -r '[]float64 -> []float32' \
|
||||
| gofmt -r 'a * b -> float64(a) * float64(b)' \
|
||||
| sed 's/Ddot/Dsdot/' \
|
||||
>> dsdot.go
|
||||
|
||||
echo Generating sdot.go
|
||||
echo -e '// Generated code do not edit. Run `go generate`.\n' > sdot.go
|
||||
cat ddot.go \
|
||||
| grep -v '//+build' \
|
||||
| gofmt -r 'float64 -> float32' \
|
||||
| sed 's/Ddot/Sdot/' \
|
||||
>> sdot.go
|
||||
|
||||
echo Generating saxpy.go
|
||||
echo -e '// Generated code do not edit. Run `go generate`.\n' > saxpy.go
|
||||
cat daxpy.go \
|
||||
| grep -v '//+build' \
|
||||
| gofmt -r 'float64 -> float32' \
|
||||
| sed 's/Daxpy/Saxpy/' \
|
||||
>> saxpy.go
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// Generated code do not edit. Run `go generate`.
|
||||
|
||||
// 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 asm
|
||||
|
||||
// The extra z parameter is needed because of floats.AddScaledTo
|
||||
func ZaxpyUnitary(alpha complex128, x, y, z []complex128) {
|
||||
for i, v := range x {
|
||||
z[i] = alpha*v + y[i]
|
||||
}
|
||||
}
|
||||
|
||||
func ZaxpyInc(alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) {
|
||||
for i := 0; i < int(n); i++ {
|
||||
y[iy] += alpha * x[ix]
|
||||
ix += incX
|
||||
iy += incY
|
||||
}
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// Generated code do not edit. Run `go generate`.
|
||||
|
||||
// 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 asm
|
||||
|
||||
import "math/cmplx"
|
||||
|
||||
func ZdotcUnitary(x, y []complex128) (sum complex128) {
|
||||
for i, v := range x {
|
||||
sum += y[i] * cmplx.Conj(v)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ZdotcInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) {
|
||||
for i := 0; i < int(n); i++ {
|
||||
sum += y[iy] * cmplx.Conj(x[ix])
|
||||
ix += incX
|
||||
iy += incY
|
||||
}
|
||||
return
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// Generated code do not edit. Run `go generate`.
|
||||
|
||||
// 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 asm
|
||||
|
||||
func ZdotuUnitary(x, y []complex128) (sum complex128) {
|
||||
for i, v := range x {
|
||||
sum += y[i] * v
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func ZdotuInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) {
|
||||
for i := 0; i < int(n); i++ {
|
||||
sum += y[iy] * x[ix]
|
||||
ix += incX
|
||||
iy += incY
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user