Hello everyone!
First let me thank you for this wonderful project. I'm just starting to get using it, but it looks very promising.
Now for my question. ;)
I'm working on a Java project that up to now used jcuda and the original OpenCV Java bindings. To be able to use the newer, installed versions of Cuda and OpenCV (instead of bundled ones), I'd like to migrate to javacpp for both (the mavenised 1.4.1 and 9.1-7.1-141).
Migration to javacv I seem to have managed (test cases running now, interactive testing to come after the stuff compiles again).
But I have a hard time getting the Cuda stuff working. I guess I have to use the Cuda Driver API, like I did with jcuda. The Nvidia tutorial proposes something along this lines to initialise the driver API:
cuInit(0);
CUdevice cuDevice;
cuDeviceGet(&cuDevice, 0);
CUcontext cuContext;
cuCtxCreate(&cuContext, 0, cuDevice);
CUmodule cuModule;
cuModuleLoad(&cuModule, "VecAdd.ptx");
[...]
(condensed example, see
http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#driver-api)
That's also about what I did with jcuda. On the way porting this to cuda-platform I'm getting confused with - what seems - different data types:
cuda.cuDeviceGet takes an IntPointer, IntBuffer or int[] for the cuDevice, but
cuda.cuCtxCreate wants an int there
These types are annotated as "CUdeviceptr*". In other places I find other types annotated this way (LongPointer, LongBuffer, long[], BytePointer, ...).
How can I find my way through this? Has anybody point me to a working example, or a short tutorial or something that set's me on the right track? :)
Any pointers would be very much appreciated. :)
Cheers, Kai