Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

Commit

Permalink
cgo: replace genBlas.pl
Browse files Browse the repository at this point in the history
  • Loading branch information
kortschak committed Sep 29, 2016
1 parent 447542b commit 908b5e9
Show file tree
Hide file tree
Showing 7 changed files with 1,007 additions and 664 deletions.
2 changes: 1 addition & 1 deletion .travis/check-generate.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

go generate github.com/gonum/blas/cgo
go generate github.com/gonum/blas/native
go generate github.com/gonum/blas/cgo
if [ -n "$(git diff -- . ':!.travis')" ]; then
exit 1
fi
1 change: 1 addition & 0 deletions .travis/linux/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -ex
go get golang.org/x/tools/cmd/cover
go get github.com/mattn/goveralls
go get github.com/gonum/floats
go get github.com/cznic/cc

# travis compiles commands in script and then executes in bash. By adding
# set -e we are changing the travis build script's behavior, and the set
Expand Down
1 change: 1 addition & 0 deletions .travis/osx/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ set -ex
go get golang.org/x/tools/cmd/cover
go get github.com/mattn/goveralls
go get github.com/gonum/floats
go get github.com/cznic/cc

# travis compiles commands in script and then executes in bash. By adding
# set -e we are changing the travis build script's behavior, and the set
Expand Down
50 changes: 25 additions & 25 deletions cgo/blas.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Do not manually edit this file. It was created by the genBlas.pl script from cblas.h.
// Do not manually edit this file. It was created by the generate_blas.go from cblas.h.

// Copyright ©2014 The Gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
Expand Down Expand Up @@ -1958,12 +1958,12 @@ func (Implementation) Sspr(ul blas.Uplo, n int, alpha float32, x []float32, incX
if n < 0 {
panic("blas: n < 0")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if incX == 0 {
panic("blas: zero x index increment")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) {
panic("blas: x index out of range")
}
Expand Down Expand Up @@ -2003,15 +2003,15 @@ func (Implementation) Sspr2(ul blas.Uplo, n int, alpha float32, x []float32, inc
if n < 0 {
panic("blas: n < 0")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if incX == 0 {
panic("blas: zero x index increment")
}
if incY == 0 {
panic("blas: zero y index increment")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) {
panic("blas: x index out of range")
}
Expand Down Expand Up @@ -2150,12 +2150,12 @@ func (Implementation) Dspr(ul blas.Uplo, n int, alpha float64, x []float64, incX
if n < 0 {
panic("blas: n < 0")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if incX == 0 {
panic("blas: zero x index increment")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) {
panic("blas: x index out of range")
}
Expand Down Expand Up @@ -2195,15 +2195,15 @@ func (Implementation) Dspr2(ul blas.Uplo, n int, alpha float64, x []float64, inc
if n < 0 {
panic("blas: n < 0")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if incX == 0 {
panic("blas: zero x index increment")
}
if incY == 0 {
panic("blas: zero y index increment")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) {
panic("blas: x index out of range")
}
Expand Down Expand Up @@ -2366,12 +2366,12 @@ func (Implementation) Chpr(ul blas.Uplo, n int, alpha float32, x []complex64, in
if n < 0 {
panic("blas: n < 0")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if incX == 0 {
panic("blas: zero x index increment")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) {
panic("blas: x index out of range")
}
Expand Down Expand Up @@ -2411,15 +2411,15 @@ func (Implementation) Chpr2(ul blas.Uplo, n int, alpha complex64, x []complex64,
if n < 0 {
panic("blas: n < 0")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if incX == 0 {
panic("blas: zero x index increment")
}
if incY == 0 {
panic("blas: zero y index increment")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) {
panic("blas: x index out of range")
}
Expand Down Expand Up @@ -2582,12 +2582,12 @@ func (Implementation) Zhpr(ul blas.Uplo, n int, alpha float64, x []complex128, i
if n < 0 {
panic("blas: n < 0")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if incX == 0 {
panic("blas: zero x index increment")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) {
panic("blas: x index out of range")
}
Expand Down Expand Up @@ -2627,15 +2627,15 @@ func (Implementation) Zhpr2(ul blas.Uplo, n int, alpha complex128, x []complex12
if n < 0 {
panic("blas: n < 0")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if incX == 0 {
panic("blas: zero x index increment")
}
if incY == 0 {
panic("blas: zero y index increment")
}
if n*(n+1)/2 > len(ap) {
panic("blas: index of ap out of range")
}
if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) {
panic("blas: x index out of range")
}
Expand Down
2 changes: 1 addition & 1 deletion cgo/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:generate ./genBlas.pl
//go:generate go run generate_blas.go

// Ensure changes made to blas/cgo are reflected in blas/native where relevant.

Expand Down
Loading

0 comments on commit 908b5e9

Please sign in to comment.