Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
26345f1
project structure
ReneEnjilian Jul 30, 2025
e4328e3
identify driver package in cuJava
ReneEnjilian Jul 31, 2025
b4dc0e0
design new Pointer class for GPU
ReneEnjilian Aug 1, 2025
3aacd42
implement sizeof class
ReneEnjilian Aug 2, 2025
eac4673
implement CudaDataType class
ReneEnjilian Aug 2, 2025
80bf049
refactor class names
ReneEnjilian Aug 2, 2025
4ac9c83
add CudaException
ReneEnjilian Aug 2, 2025
12d5caf
cpp/jni structure
ReneEnjilian Aug 3, 2025
5602512
implement CudaError
ReneEnjilian Aug 3, 2025
d5a7a1b
implement CudaDeviceProp
ReneEnjilian Aug 3, 2025
015f3da
add liceanse to Cmake
ReneEnjilian Aug 3, 2025
08bb405
implement CudaMemcpyKind
ReneEnjilian Aug 3, 2025
ed9b4a3
load lib
ReneEnjilian Aug 3, 2025
9616023
set cuda error messaging
ReneEnjilian Aug 4, 2025
612b8e8
first stage of implementation is completed
ReneEnjilian Aug 20, 2025
bb35dd4
fix javadoc
ReneEnjilian Aug 20, 2025
ec268c7
fix deprecated notification
ReneEnjilian Aug 20, 2025
191aa1c
add cudaFreeNative
ReneEnjilian Aug 20, 2025
ecc7e73
add cudamemset
ReneEnjilian Aug 20, 2025
45363d8
add cudaDeviceSynchronize
ReneEnjilian Aug 20, 2025
428707a
add setExceptionsEnabled
ReneEnjilian Aug 20, 2025
849d8b7
add cudaMallocManaged
ReneEnjilian Aug 20, 2025
638c250
add cudaMemGetInfo
ReneEnjilian Aug 21, 2025
b9f2d36
add cudaDeviceScheduleBlockingSync
ReneEnjilian Aug 21, 2025
af30fe7
add cudaGetDeviceCount
ReneEnjilian Aug 21, 2025
af5ba22
add cudaSetDevice
ReneEnjilian Aug 21, 2025
8846b60
add method definition in header
ReneEnjilian Aug 21, 2025
d4aece3
add cudaSetDeviceFlags
ReneEnjilian Aug 21, 2025
968aaac
add header def
ReneEnjilian Aug 21, 2025
c805598
add cudaGetDevice
ReneEnjilian Aug 21, 2025
ce2a73f
minor fix
ReneEnjilian Aug 21, 2025
115f040
add cudaGetDeviceProperties
ReneEnjilian Aug 21, 2025
5b3770c
complete jni side of cudaDeviceProperties
ReneEnjilian Aug 22, 2025
1a1bc4c
rebuild runtime lib
ReneEnjilian Aug 22, 2025
45ccbbc
delete build folder for now
ReneEnjilian Aug 23, 2025
7718c01
start cuda context
ReneEnjilian Aug 23, 2025
6d680c0
implement CUdevice_attribute
ReneEnjilian Aug 24, 2025
b993088
add CUdeviceptr
ReneEnjilian Aug 24, 2025
4ab7abf
implement CUfunction
ReneEnjilian Aug 24, 2025
123762d
add CUmodule
ReneEnjilian Aug 24, 2025
c169684
implement CUresult
ReneEnjilian Aug 24, 2025
b04542f
start cuda stream
ReneEnjilian Aug 25, 2025
1f403fc
implement java side of driver
ReneEnjilian Aug 27, 2025
4ec9d2c
setup driver core class
ReneEnjilian Aug 27, 2025
dc0abb5
add common for driver in native
ReneEnjilian Aug 27, 2025
859595f
wrap-up driver package
ReneEnjilian Aug 28, 2025
76b6145
implement java side and strcuture for cusparse
ReneEnjilian Aug 28, 2025
1c1afb4
delete no-op build
ReneEnjilian Aug 28, 2025
f6d86f0
first half of cusparse
ReneEnjilian Aug 30, 2025
85c32a9
next batch
ReneEnjilian Aug 30, 2025
d981d2c
next batch
ReneEnjilian Aug 30, 2025
6cb7ddd
next
ReneEnjilian Aug 31, 2025
c8e581e
some cleaning
ReneEnjilian Aug 31, 2025
7a94e44
start shipping cublas java side
ReneEnjilian Aug 31, 2025
7205d80
cublas first batch
ReneEnjilian Aug 31, 2025
0820e3d
cublas done
ReneEnjilian Aug 31, 2025
e1d0a68
add todos and final cleanup
ReneEnjilian Aug 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/main/cpp/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#-------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#-------------------------------------------------------------

cmake_minimum_required(VERSION 3.18)
project(cujava_jni LANGUAGES CXX)

# Build the subprojects
add_subdirectory(common)
add_subdirectory(runtime)
add_subdirectory(driver)
add_subdirectory(cusparse)
add_subdirectory(cublas)
39 changes: 39 additions & 0 deletions src/main/cpp/jni/build_cujava_libs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
#-------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#-------------------------------------------------------------

set -euo pipefail

# Usage (from src/main/cpp/jni):
# chmod +x build_cujava_libs.sh
# ./build_cujava_libs.sh # default build dir: ./build, type: Release

BUILD_DIR="${1:-build}"
BUILD_TYPE="${BUILD_TYPE:-Release}"

echo "==> Configuring (BUILD_DIR=$BUILD_DIR, BUILD_TYPE=$BUILD_TYPE)"
cmake -S . -B "$BUILD_DIR" -DCMAKE_BUILD_TYPE="$BUILD_TYPE"

echo "==> Building"
cmake --build "$BUILD_DIR" --config "$BUILD_TYPE" -j

echo "==> Done. Artifacts should be in ../../lib"
ls -l ../lib/libcujava_runtime.so || true
54 changes: 54 additions & 0 deletions src/main/cpp/jni/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#-------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#-------------------------------------------------------------

cmake_minimum_required(VERSION 3.18)

project(CuJavaCommonJNI LANGUAGES CXX)

find_package(JNI REQUIRED)

add_library(CuJavaCommonJNI STATIC
cujava_logger.cpp
cujava_jni_utils.cpp
cujava_pointer_utils.cpp
)

# PIC because this static lib is linked into shared libs
set_target_properties(CuJavaCommonJNI PROPERTIES
CXX_STANDARD 11
POSITION_INDEPENDENT_CODE ON
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../lib
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../lib
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../lib
)

target_include_directories(CuJavaCommonJNI
PUBLIC
${JNI_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR} # headers in common/
)

# Propagate JNI to consumers (runtime, etc.)
target_link_libraries(CuJavaCommonJNI
PUBLIC
${JNI_LIBRARIES}
)

Loading