Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDA runtime api #262

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
651df01
add rust bindings cudart using bindgen
psmyth94 Jun 7, 2024
3d68169
add cudart as a target for binding generation
psmyth94 Jun 7, 2024
c61f530
change the name to runtime
psmyth94 Jun 7, 2024
366b0f6
change the name to runtime instead of cudart
psmyth94 Jun 7, 2024
82c22f4
rename module to runtime instead of cudart
psmyth94 Jun 7, 2024
44136c6
convert driver error to runtime error
psmyth94 Jun 7, 2024
1c95532
removed lib since runtime does not need libloading
psmyth94 Jun 8, 2024
c3696cc
added stream, device, and function
psmyth94 Jun 8, 2024
46727b0
add sys_12020
psmyth94 Jun 9, 2024
490547b
modify bindings
psmyth94 Jun 9, 2024
3f115cf
fix: update function to reflect the runtime api
psmyth94 Jun 11, 2024
161722b
add cuda_runtime.h in wrapper and bind objects with both CUDA and cuda
psmyth94 Jun 11, 2024
f85ec2f
initial commit of the safe implementation of runtime api
psmyth94 Jun 13, 2024
44717be
first final draft of cuda runtime api in cudarc
psmyth94 Jun 17, 2024
a6a2596
create test kernels
psmyth94 Jun 17, 2024
9016c92
change tests to use statically compiled code
psmyth94 Jun 20, 2024
0332cd7
use cudaFunction_t instead of raw pointer
psmyth94 Jun 20, 2024
dc6f817
fix: add missing sys
psmyth94 Jun 20, 2024
886fea6
run cargo fix
psmyth94 Jun 20, 2024
899822d
Merge remote-tracking branch 'origin' into cudart
psmyth94 Jun 20, 2024
7fbbcc3
remove get_function_by_symbol; no idea how it works
psmyth94 Jun 20, 2024
f635a00
add missing import
psmyth94 Jun 20, 2024
731085c
add ptx loading via driver api
psmyth94 Jul 1, 2024
7d96aed
replace device pointers as raw pointers and remove _driver_device
psmyth94 Jul 1, 2024
f63a2d3
no longer need to compile test kernels
psmyth94 Jul 1, 2024
49cf56a
add ptx and threading for interop with driver api
psmyth94 Jul 1, 2024
df16c57
fix: add *mut c_void instead of c_void
psmyth94 Jul 1, 2024
f89c22c
replace cudaLaunchKernel with cuLauncKernel and add other cudaDevice
psmyth94 Jul 1, 2024
dd0346f
fix imports
psmyth94 Jul 1, 2024
292de1b
add attributes to interop with driver api
psmyth94 Jul 1, 2024
eb37141
default of device_ptr is *mut and not *const
psmyth94 Jul 1, 2024
96e5eec
convert device pointers created via cudart to CUdeviceptr
psmyth94 Jul 1, 2024
c686a22
change tests to use nvrtc instead of pre-compiled libs
psmyth94 Jul 1, 2024
d7ddf8d
add threading for driver api interop
psmyth94 Jul 1, 2024
173d545
pre-compiled test kernels no longer needed
psmyth94 Jul 1, 2024
cf1125a
change back to cudaLaunchKernel
psmyth94 Jul 1, 2024
0315ff4
remove bind_to_thread as it is not needed
psmyth94 Jul 1, 2024
9934fc1
Merge branch 'coreylowman:main' into cudart
psmyth94 Jul 1, 2024
cca6aa0
add version management functions
psmyth94 Jul 18, 2024
0026837
add cudaFree
psmyth94 Jul 18, 2024
a5d1d17
remove unused DriverError
psmyth94 Jul 18, 2024
10a3c46
redundant conversion
psmyth94 Jul 18, 2024
3aa26e8
add cuda version 11.8
psmyth94 Jul 18, 2024
dab3f60
Merge branch 'coreylowman:main' into cudart
psmyth94 Jul 18, 2024
4951394
lib retrieval handled internally
psmyth94 Jul 19, 2024
7fadea0
add all supported cuda versions
psmyth94 Jul 19, 2024
b2f34c2
update sys_12020
psmyth94 Jul 19, 2024
951b94e
add 12060
psmyth94 Aug 9, 2024
8925020
Merge branch 'main' into cudart
psmyth94 Aug 26, 2024
57e7faa
add runtime in the defaults
psmyth94 Aug 26, 2024
2f34c2f
Merge branch 'main' of github.com:coreylowman/cudarc into cudart
psmyth94 Oct 11, 2024
5c97bff
add 11040, 11050, 11060, and 12060 in results.rs and sys/mod.rs
psmyth94 Oct 11, 2024
ffc2bfc
remove the safe api
psmyth94 Oct 11, 2024
c7342f0
remove documentation about safe api and remove safe api from mod
psmyth94 Oct 11, 2024
7bc94b9
cuda 12.0.0 doesn't support cudaDeviceSyncMemops
psmyth94 Oct 11, 2024
f045bf7
add 12040
psmyth94 Oct 11, 2024
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
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ keywords = [
features = ["cuda-12060", "f16", "cudnn"]

[features]
default = ["std", "cublas", "cublaslt", "curand", "driver", "nvrtc"]
default = ["std", "cublas", "cublaslt", "curand", "driver", "runtime", "nvrtc"]

cuda-version-from-build-system = []
cuda-11040 = []
Expand All @@ -46,6 +46,7 @@ nvrtc = []
driver = ["nvrtc"]
cublas = ["driver"]
cublaslt = ["driver"]
runtime = ["driver"]
cudnn = ["driver"]
curand = ["driver"]
nccl = ["driver"]
Expand Down
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ fn dynamic_linking(major: usize, minor: usize) {
println!("cargo:rustc-link-lib=dylib=cublasLt");
#[cfg(feature = "cudnn")]
println!("cargo:rustc-link-lib=dylib=cudnn");
#[cfg(feature = "runtime")]
println!("cargo:rustc-link-lib=dylib=cudart");
}

#[allow(unused)]
Expand Down
2 changes: 1 addition & 1 deletion run-bindgen.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare -a modules=("cublas" "cublaslt" "cudnn" "curand" "driver" "nccl" "nvrtc")
declare -a modules=("cublas" "cublaslt" "cudnn" "curand" "driver" "runtime" "nccl" "nvrtc")
for path in "${modules[@]}"
do
cd src/${path}/sys
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ pub mod cudnn;
pub mod curand;
#[cfg(feature = "driver")]
pub mod driver;
#[cfg(feature = "runtime")]
pub mod runtime;
#[cfg(feature = "nccl")]
pub mod nccl;
#[cfg(feature = "nvrtc")]
Expand Down
6 changes: 6 additions & 0 deletions src/runtime/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//! Wrappers around the [CUDA Runtime API](https://docs.nvidia.com/cuda/cuda-runtime-api/index.html),
//! in two levels: an unsafe low-level API and a (still unsafe) thin wrapper around it.

pub mod result;
#[allow(warnings)]
pub mod sys;
Loading