forked from vosen/ZLUDA
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement cuda runtime api. (cudart) (#17)
* [WIP] Implement cudart. * wip * wip * Implement cudart. * wip * Ready to merge.
- Loading branch information
1 parent
95f8810
commit 11cc584
Showing
8 changed files
with
10,497 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ members = [ | |
"zluda_redirect", | ||
"zluda_rt", | ||
"zluda_rtc", | ||
"zluda_runtime", | ||
"zluda_sparse", | ||
] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "zluda_runtime" | ||
version = "0.0.0" | ||
authors = ["Seunghoon Lee <[email protected]>"] | ||
edition = "2018" | ||
|
||
[lib] | ||
name = "cudart" | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
hip_common = { path = "../hip_common" } | ||
hip_runtime-sys = { path = "../hip_runtime-sys" } | ||
|
||
[package.metadata.zluda] | ||
linux_names = ["libcudart.so.10", "libcudart.so.11"] | ||
dump_names = ["libcudart.so"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bindgen \\wsl.localhost\Ubuntu-22.04\usr\include\cuda_runtime.h -o src/cudart.rs --allowlist-function="^cuda.*" --allowlist-type="cu.*" --default-enum-style=newtype --no-layout-tests --no-derive-debug -- -I\\wsl.localhost\Ubuntu-22.04\usr\include | ||
sed -i -e 's/extern "C" {//g' -e 's/-> cudaError_t;/-> cudaError_t { crate::unsupported()/g' -e 's/pub fn /#[no_mangle] pub extern "system" fn /g' src/cudart.rs | ||
rustfmt src/cudart.rs |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#[no_mangle] | ||
pub extern "system" fn cudaProfilerInitialize( | ||
configFile: *const ::std::os::raw::c_char, | ||
outputFile: *const ::std::os::raw::c_char, | ||
outputMode: cudaOutputMode_t, | ||
) -> cudaError_t { | ||
crate::unsupported() | ||
} | ||
|
||
#[no_mangle] | ||
pub extern "system" fn cudaProfilerStart() -> cudaError_t { | ||
crate::unsupported() | ||
} | ||
|
||
#[no_mangle] | ||
pub extern "system" fn cudaProfilerStop() -> cudaError_t { | ||
crate::unsupported() | ||
} |
Oops, something went wrong.