I modified your script to create the arrays directly on the GPU. How do I attach a file to the post?
Your GPU modification of complexcirclefactory seems to work on my GPU. It is possible to directly create certain kinds of arrays directly on the GPU, which may be more efficient than creating them on the CPU and transferring them onto the GPU using gpuArray: https://www.mathworks.com/help/distcomp/establish-arrays-on-a-gpu.html#bspvmhe-1
I modified your script to create the arrays directly on the GPU. How do I attach a file to the post?
--
http://www.manopt.org
---
You received this message because you are subscribed to a topic in the Google Groups "Manopt" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/manopttoolbox/atiMDxPtY1c/unsubscribe.
To unsubscribe from this group and all its topics, send an email to manopttoolbox+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/manopttoolbox.
To view this discussion on the web visit https://groups.google.com/d/msgid/manopttoolbox/d9c12b01-eddc-48ea-b0e5-410f8064ac88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I didn't mean to have separate files. I think this would create a lot of code duplication. If you look at the example worked out here, changes to the existing factory are really minor.
I'm thinking we could simply have an extra input that indicates if we want the gpu version or not.
Inside the code, we can have
If gpuflag
gpustring = 'gpuArray'
Else
gpustring = 'double'
End
And we pass this string to any array creating function such as zeros, eye, randn, etc. (need to check what's needed a'd available.)
For the collects, we can just do this actually:
Have a generic tool that takes M and a list of field names, and returns the same M but with indicated fields composed with gather. That's a one liner and it's flexible. We only call it if gpuflag is true.
What do you think? This would require very small changes, it seems to me, and also would introduce no difference at all if gpuflag is false.
You put that line of code in your original GPU modification of complexcirclefactory.
M.vec = @(x, u_mat) gather([real(u_mat) ; imag(u_mat)]);