Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
GPU Matrix Algebra and Operators #916
Adds basic matrix algrebra functions and operators for
How to Verify:
echo STAN_OPENCL=true>> make/local echo OPENCL_PLATFORM_ID=0>> make/local echo OPENCL_DEVICE_ID=0>> make/local make test/unit/math/gpu/opencl_add_test && ./test/unit/math/gpu/opencl_add_test make test/unit/math/gpu/opencl_subtract_test && ./test/unit/math/gpu/opencl_subtract_test make test/unit/math/gpu/opencl_copy_submatrix_test && ./test/unit/math/gpu/opencl_copy_submatrix_test make test/unit/math/gpu/opencl_copy_triangular_test && ./test/unit/math/gpu/opencl_copy_triangular_test make test/unit/math/gpu/opencl_copy_triangular_transpose_test && ./test/unit/math/gpu/opencl_copy_triangular_transpose_test make test/unit/math/gpu/opencl_identity_test && ./test/unit/math/gpu/opencl_identity_test make test/unit/math/gpu/opencl_transpose_test && ./test/unit/math/gpu/opencl_transpose_test make test/unit/math/gpu/opencl_zeros_test && ./test/unit/math/gpu/opencl_zeros_test
echo STAN_OPENCL=true>> make/local echo OPENCL_PLATFORM_ID=0>> make/local echo OPENCL_DEVICE_ID=0>> make/local ./runTests.py ./test/unit/math/ -f opencl
Copyright and Licensing
Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company):
By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:
I only modified docs so this should be passing. @syclik ready for review
Not sure if we should discuss here or on discourse, but it looks like we should start breaking up the files in the gpu folder into subfolders. Like
changed the title from
[WIP] GPU Matrix Algebra and Operators
GPU Matrix Algebra and Operators
Jun 26, 2018
I get a bit farther with my laptop. There are a bunch of statements that say
The one in my office that we got working for the previous PR.…
On Thu, Jul 5, 2018 at 5:47 PM Steve Bronder ***@***.***> wrote: Are you running this from the linux box, mac box, or your computer? — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#916 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ADOrqv0LvuBgnbPjspcX1dpfsgls8kEVks5uDolYgaJpZM4U1CTp> .
All the functions we place into
// Place a subset of Boo into Foo Foo.sub_block(Boo, 1, 1, 0, 0, 3, 3) // make a copy of Foo's lower triangular Goo = copy_triangular<stan::math::Lower>(Foo);
Should the definitions of Lower, Upper, etc. go in a more general file than the matrix_gpu one?
Almost there. A few minor changes.
I think the big one is: what is
Apologies, forgot to write docs for this.
When we pass the kernel arguments instead of writing
kernel.setArg(0, boo) kernel.setArg(1, moo) kernel.setArg(2, foo) kernel.setArg(3, doo)
we can write
set_kernel_args(kernel, boo, moo, foo, doo)
Minor change: please move the constants to
stan:::math::gpu namespace. I don't think we want to clutter the
stan::math namespace with names that are so generic. And please add the doc that the constants need to match the kernel code.
Once that's in, I can review quickly.