ReneEnjilian opened a new pull request, #2311:
URL: https://github.com/apache/systemds/pull/2311

   This PR starts the implementation of custom Java–CUDA bindings for SystemDS, 
called **cujava**. The long-term goal is to replace **JCuda** altogether. The 
project is split into a Java layer and a C++/JNI layer. In this PR I’ve focused 
on the **runtime** and laid the foundation for the remaining modules.
   ### Project structure
   `src/main/java/org.apache.sysds/cujava:`
   
   **cujava/
   ├─ cublas/
   ├─ cudnn/
   ├─ cusolver/
   ├─ cusparse/
   ├─ driver/
   ├─ interop/
   └─ runtime/
   ----├─ CudaDeviceProp
   ----├─ CudaError
   ----├─ CudaMemcpyKind
   ----└─ CuJava
   CudaDataType
   CudaException
   CuJavaLibLoader
   NativePointerObject
   Pointer
   Sizeof**
   
   Each directory contains the corresponding Java-side implementation. So far, 
I have focused on the runtime package.
   
   `src/main/cpp/jni:`
   
   **jni/
   ├─ common/
   ├─ cublas/
   ├─ cudnn/
   ├─ cusolver/
   ├─ cusparse/
   ├─ driver/
   └─ runtime/
   build_cujava_libs.sh
   CMakeLists.txt**
   
   These directories hold the C++/JNI implementations that mirror the Java 
side. Each directory has its own CMakeLists.txt to produce a dedicated shared 
library. The libraries are emitted under `src/main/cpp/lib`. In this PR I 
implemented the initial parts of runtime and common; the rest will follow in 
the next PRs.
   
   
   ### Example usage
   Writing code with cuJava is reminiscent of JCuda—only the imports change:
   
   `import org.apache.sysds.cujava.runtime.CuJava;`
   `CuJava.cudaMalloc(...);`
   
   
   ### Notes
   
   - **Parallel to JCuda:** cuJava currently exists alongside JCuda and is not 
integrated into the SystemDS GPU backend yet. The existing GPU backend remains 
unchanged and continues to use JCuda. The newly added cuJava runtime methods 
have been tested successfully.
   - **API scope:** cuJava intentionally implements only the CUDA/NVIDIA 
library calls that SystemDS actually uses. This downsized approach—contrary to 
JCuda’s full coverage—enables faster upgrades to newer CUDA versions: we only 
need to update deprecated APIs we rely on. In contrast, JCuda must update every 
deprecated method, which is cumbersome and wasteful.
   
   @mboehm7 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@systemds.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to