I have some CUDA code I made in C and it seems to be working fine (it's plain old C and not C++). I’m running a Hadoop cluster and wanted to consolidate my code so ideally I’m looking to run it within Java (long story short: system is too complex).
Currently the C program parses a log file, takes a few thousand lines, processes each line in parallel on the GPU, saves specific errors/transactions into a linked list, and writes them to the drive.
What is the best approach to do this? Is JCUDA a perfect mapping to C CUDA or is it totally different? Or does it make sense to call C code from Java and share results (would the linked list be accessible)?
IMO? JavaCPP. For example, here is a port to Java of the example displayed on the main page of Thrust's Web site:
Your code in C should be easier to map though.
We can get this compiled and running on Linux x86_64 with these commands, or on other supported platforms by modifying the
-properties
option appropriately: