0

On http://www.jcuda.org/samples/samples.html, currently there is JCusolverSamples20151013.zip for download. It seems that a current version of jcuda like 0.7.5 or 0.7 fits it.

However, JCusolverSp_LinearSolver_Direct.java, one of the two java files, cannot compile, and it contains 5 errors wrt 3 different methods. All of the error messages are similar to the following message about discrepancy of the last argument, 'Pointer' instead of 'int[]':

The method cusolverSpDcsrlsvchol(cusolverSpHandle, int, int, cusparseMatDescr, Pointer, Pointer, Pointer, Pointer, double, int, Pointer, Pointer) in the type JCusolverSp is not applicable for the arguments (cusolverSpHandle, int, int, cusparseMatDescr, Pointer, Pointer, Pointer, Pointer, double, int, Pointer, int[])

enter image description here

I have also checked JCuda 0.7.0, and the APIs regarding the methods are the same. I am new to Jcuda so I don't know how to modify the sample JCusolverSp_LinearSolver_Direct java file. How to make it work?

Tom
  • 3,168
  • 5
  • 27
  • 36
  • Apologies for this one. You seem to be using JCuda 0.7.0, right? The type of the `singularity` parameter changed between 0.7.0 and 0.7.5 (it is *always* in host memory), and this samples archive was created for 0.7.5. It *might* already work for your version when you pass in a `Pointer.to(singularity)` in this case, but I can't test this right now. BTW: The samples are currently being moved to GitHub ( https://github.com/jcuda/jcuda-samples ), but the JCusolver samples have *not* been added there yet. I'll add them ASAP (likely Monday), but also only for JCuda >= 0.7.5 – Marco13 Oct 08 '16 at 04:32
  • The samples are now at https://github.com/jcuda/jcuda-samples/tree/master/JCudaSamples/src/main/java/jcuda/jcusolver/samples . If you encounter problems (particularly when you are using JCuda >= 0.7.5), just drop me a note. – Marco13 Oct 10 '16 at 17:11
  • Thanks a lot, and I will check it. – Tom Oct 11 '16 at 07:46
  • You might have noticed that I added https://github.com/jcuda/jcuda-samples/blob/master/JCudaSamples/src/main/java/jcuda/jcusolver/samples/JCusolverSpSample.java in the meantime. It's based on the original samples, but written in a *slightly* more "Java-ish" way. It compares all available solvers and prints some timing information, maybe you'll consider it helpful. – Marco13 Oct 11 '16 at 16:12

0 Answers0