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

cgo: replace genBlas.pl #186

Merged
merged 1 commit into from
Oct 4, 2016
Merged

cgo: replace genBlas.pl #186

merged 1 commit into from
Oct 4, 2016

Conversation

kortschak
Copy link
Member

generate_blas.go replaces genBlas.pl and exercises the code in gonum/internal#36 (requires that PR to pass here because of the dependency on gonum/internal/binding).

The code itself is not pretty and much cleaner code could come from greater use of templates, but it is not perl and so others can now hopefully contribute more to the code here. The generation of cgo/lapacke will come soon (and is easier).

The minor diff in cgo/blas.go is due to a subtle difference in the ordering of parameter checking - I think it makes more sense where it is now too.

Finally, there is an option to add docs to the cgo methods. This will not add docs for cblas_[cz]* bindings because we do not have them in native, but because of the way the go/parser package works, we can add non-built doc-only files to native; go/parser ignores build tags, so will get docs from those files. Those files can then become the native implementations when that journey is embarked upon. If we want partial docs here, another PR will follow this one to add the docs that do exist.

@gonum/developers Please take a look.

@kortschak
Copy link
Member Author

Many thanks to @cznic for all his help getting me through difficulties in understanding C parsing. Thank you.

@kortschak kortschak force-pushed the gen branch 2 times, most recently from 6dfbb77 to b7ed661 Compare September 29, 2016 02:38
@kortschak
Copy link
Member Author

I am not entirely sure why this passes. Should we really be allowing this?

/cc @jonlawlor

@jonlawlor
Copy link
Contributor

Looks like a couple things happening - the git version used isn't supporting directory exclusion, which is why it complains about the magic !, which is masking the generate issue, I think. #187 is the followup.

@@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github.com/gonum/internal/binding is not installed from here since we get it for free with blas and floats via asm. Does anyone want me to be explicit here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer explicit but it's up to you.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@kortschak
Copy link
Member Author

ping for review.

Copy link
Member

@vladimir-ch vladimir-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer explicit but it's up to you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants