Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument names and types in API functions #11

Merged
merged 6 commits into from
Nov 13, 2015
Merged

Argument names and types in API functions #11

merged 6 commits into from
Nov 13, 2015

Conversation

dfdx
Copy link
Contributor

@dfdx dfdx commented Oct 29, 2015

It turns out that currently all low-level functions (e.g. clblasSaxpy) have neither names, nor types of variables, e.g.:

julia> methods(clblasSaxpy)
clblasSaxpy(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Array{OpenCL.CmdQueue,1})
....

which makes it pretty hard to inspect and call such functions. This PR is an attempt to provide new low-level API with all the same functionality, but improved function signatures, e.g.:

clblasSaxpy(n::UInt64, alpha::Float32, X::Ptr{Void}, offx::UInt64, incx::Int32, Y::Ptr{Void}, offy::UInt64, incy::Int32, inQueues::Array{OpenCL.CmdQueue,1})

Here's is a lost of planned tasks that I'm going to follow if nobody has objections/suggestions:

  • Implement @blasfun and @blasfun2 similar to @blas_func and @blas_func, but with argument names and types
  • Translate L1 functions
  • Translate L2 functions
  • Translate L3 functions

The next step (probably, as a separate PR) will be to create high-level API, wrapping this one and using cl.CLArray instead of plain buffers.

Discussion is welcome.

@dfdx dfdx changed the title [WIP] Argument names and types in API functions Argument names and types in API functions Nov 4, 2015
@dfdx
Copy link
Contributor Author

dfdx commented Nov 4, 2015

All functions are now translated to the new API (with proper argument names and types). I left old definitions for a couple of functions since future-based variants were implemented over them (e.g. see SCAL). Not sure if somebody is using it, please let me know if you do.

Since this PR doesn't introduce anything new and only improves existing functionality, I'll keep it here for one more week and merge myself if no one objects.

@jakebolewski
Copy link
Member

@dfdx thanks!. As you see the current implementation was the first pass / bare amount of functionality implemented to be useful. All your improvements are reasonable, so I would just run with things for the time being and not wait on review.

jakebolewski added a commit that referenced this pull request Nov 13, 2015
Argument names and types in API functions
@jakebolewski jakebolewski merged commit 47633c9 into master Nov 13, 2015
dfdx added a commit that referenced this pull request Nov 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants