Rename cuda_base cuda_macros (#435)

This commit is contained in:
Violet
2025-07-25 11:09:50 -07:00
committed by GitHub
parent ba38da0bbc
commit 8c23ef1ded
46 changed files with 61 additions and 61 deletions

View File

@ -91,7 +91,7 @@ jobs:
tool: cargo-export tool: cargo-export
- name: Build - name: Build
run: | run: |
cargo export target/tests -- test --features ci_build --workspace --exclude cuda_base --exclude ptx_parser_macros cargo export target/tests -- test --features ci_build --workspace --exclude cuda_macros --exclude ptx_parser_macros
mkdir -p target/amdgpu mkdir -p target/amdgpu
bash .github/workflows/move_tests.sh target/tests amdgpu bash .github/workflows/move_tests.sh target/tests amdgpu
strip target/amdgpu/* strip target/amdgpu/*

View File

@ -138,7 +138,7 @@ jobs:
tool: cargo-export tool: cargo-export
- name: Build - name: Build
run: | run: |
cargo export target/tests -- test --features ci_build --workspace --exclude cuda_base --exclude ptx_parser_macros cargo export target/tests -- test --features ci_build --workspace --exclude cuda_macros --exclude ptx_parser_macros
mkdir -p target/amdgpu mkdir -p target/amdgpu
bash .github/workflows/move_tests.sh target/tests amdgpu bash .github/workflows/move_tests.sh target/tests amdgpu
strip target/amdgpu/* strip target/amdgpu/*

32
Cargo.lock generated
View File

@ -301,7 +301,7 @@ dependencies = [
] ]
[[package]] [[package]]
name = "cuda_base" name = "cuda_macros"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
@ -315,7 +315,7 @@ name = "cuda_types"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"bitflags 2.9.1", "bitflags 2.9.1",
"cuda_base", "cuda_macros",
"hip_runtime-sys", "hip_runtime-sys",
] ]
@ -1076,7 +1076,7 @@ dependencies = [
"bit-vec 0.6.3", "bit-vec 0.6.3",
"bitflags 1.3.2", "bitflags 1.3.2",
"comgr", "comgr",
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
"half", "half",
"hip_runtime-sys", "hip_runtime-sys",
@ -1770,7 +1770,7 @@ name = "zluda"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"comgr", "comgr",
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
"dark_api", "dark_api",
"dtor", "dtor",
@ -1805,7 +1805,7 @@ dependencies = [
name = "zluda_blas" name = "zluda_blas"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
] ]
@ -1813,7 +1813,7 @@ dependencies = [
name = "zluda_blaslt" name = "zluda_blaslt"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
] ]
@ -1821,7 +1821,7 @@ dependencies = [
name = "zluda_dnn" name = "zluda_dnn"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
] ]
@ -1830,7 +1830,7 @@ name = "zluda_dump"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cglue", "cglue",
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
"dark_api", "dark_api",
"detours-sys", "detours-sys",
@ -1857,7 +1857,7 @@ name = "zluda_dump_blas"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cglue", "cglue",
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
"dark_api", "dark_api",
"format", "format",
@ -1872,7 +1872,7 @@ name = "zluda_dump_blaslt"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cglue", "cglue",
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
"dark_api", "dark_api",
"format", "format",
@ -1898,7 +1898,7 @@ name = "zluda_dump_dnn"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cglue", "cglue",
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
"dark_api", "dark_api",
"format", "format",
@ -1913,7 +1913,7 @@ name = "zluda_dump_fft"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cglue", "cglue",
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
"dark_api", "dark_api",
"format", "format",
@ -1928,7 +1928,7 @@ name = "zluda_dump_sparse"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cglue", "cglue",
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
"dark_api", "dark_api",
"format", "format",
@ -1942,7 +1942,7 @@ dependencies = [
name = "zluda_fft" name = "zluda_fft"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
] ]
@ -1963,7 +1963,7 @@ dependencies = [
name = "zluda_ml" name = "zluda_ml"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
] ]
@ -1980,7 +1980,7 @@ dependencies = [
name = "zluda_sparse" name = "zluda_sparse"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
] ]

View File

@ -4,7 +4,7 @@ resolver = "2"
members = [ members = [
"comgr", "comgr",
"cuda_base", "cuda_macros",
"cuda_types", "cuda_types",
"dark_api", "dark_api",
"detours-sys", "detours-sys",

View File

@ -1,5 +1,5 @@
[package] [package]
name = "cuda_base" name = "cuda_macros"
version = "0.0.0" version = "0.0.0"
authors = ["Andrzej Janik <vosen@vosen.pl>"] authors = ["Andrzej Janik <vosen@vosen.pl>"]
edition = "2021" edition = "2021"

View File

@ -5,6 +5,6 @@ authors = ["Andrzej Janik <vosen@vosen.pl>"]
edition = "2021" edition = "2021"
[dependencies] [dependencies]
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
hip_runtime-sys = { path = "../ext/hip_runtime-sys" } hip_runtime-sys = { path = "../ext/hip_runtime-sys" }
bitflags = "2.9.1" bitflags = "2.9.1"

View File

@ -26,7 +26,7 @@ unwrap_or = "1.0.1"
hip_runtime-sys = { path = "../ext/hip_runtime-sys" } hip_runtime-sys = { path = "../ext/hip_runtime-sys" }
comgr = { path = "../comgr" } comgr = { path = "../comgr" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
tempfile = "3" tempfile = "3"
paste = "1.0" paste = "1.0"
pretty_assertions = "1.4.1" pretty_assertions = "1.4.1"

View File

@ -555,7 +555,7 @@ macro_rules! dynamic_fns {
}; };
} }
cuda_base::cuda_function_declarations!(dynamic_fns); cuda_macros::cuda_function_declarations!(dynamic_fns);
static COMGR: std::sync::LazyLock<Comgr> = std::sync::LazyLock::new(|| Comgr::new().unwrap()); static COMGR: std::sync::LazyLock<Comgr> = std::sync::LazyLock::new(|| Comgr::new().unwrap());
static CUDA: std::sync::LazyLock<DynamicCuda> = static CUDA: std::sync::LazyLock<DynamicCuda> =

View File

@ -13,7 +13,7 @@ comgr = { path = "../comgr" }
ptx_parser = { path = "../ptx_parser" } ptx_parser = { path = "../ptx_parser" }
ptx = { path = "../ptx" } ptx = { path = "../ptx" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
hip_runtime-sys = { path = "../ext/hip_runtime-sys" } hip_runtime-sys = { path = "../ext/hip_runtime-sys" }
dark_api = { path = "../dark_api" } dark_api = { path = "../dark_api" }
lazy_static = "1.4" lazy_static = "1.4"

View File

@ -34,7 +34,7 @@ macro_rules! implemented {
if !initialized() { if !initialized() {
return Err(CUerror::DEINITIALIZED); return Err(CUerror::DEINITIALIZED);
} }
cuda_base::cuda_normalize_fn!( crate::r#impl::$fn_name ) ($(crate::r#impl::FromCuda::from_cuda(&$arg_id)?),*)?; cuda_macros::cuda_normalize_fn!( crate::r#impl::$fn_name ) ($(crate::r#impl::FromCuda::from_cuda(&$arg_id)?),*)?;
Ok(()) Ok(())
} }
)* )*
@ -51,14 +51,14 @@ macro_rules! implemented_in_function {
if !initialized() { if !initialized() {
return Err(CUerror::DEINITIALIZED); return Err(CUerror::DEINITIALIZED);
} }
cuda_base::cuda_normalize_fn!( crate::r#impl::function::$fn_name ) ($(crate::r#impl::FromCuda::from_cuda(&$arg_id)?),*)?; cuda_macros::cuda_normalize_fn!( crate::r#impl::function::$fn_name ) ($(crate::r#impl::FromCuda::from_cuda(&$arg_id)?),*)?;
Ok(()) Ok(())
} }
)* )*
}; };
} }
cuda_base::cuda_function_declarations!( cuda_macros::cuda_function_declarations!(
unimplemented, unimplemented,
implemented <= [ implemented <= [
cuCtxCreate_v2, cuCtxCreate_v2,

View File

@ -160,7 +160,7 @@ fn generate_cufft(crate_root: &PathBuf) {
generate_functions( generate_functions(
&crate_root, &crate_root,
"cufft", "cufft",
&["..", "cuda_base", "src", "cufft.rs"], &["..", "cuda_macros", "src", "cufft.rs"],
&module, &module,
); );
generate_types_library( generate_types_library(
@ -215,7 +215,7 @@ fn generate_cusparse(crate_root: &PathBuf) {
generate_functions( generate_functions(
&crate_root, &crate_root,
"cusparse", "cusparse",
&["..", "cuda_base", "src", "cusparse.rs"], &["..", "cuda_macros", "src", "cusparse.rs"],
&module, &module,
); );
generate_types_library( generate_types_library(
@ -275,13 +275,13 @@ fn generate_cudnn(crate_root: &PathBuf) {
generate_functions( generate_functions(
&crate_root, &crate_root,
"cudnn8", "cudnn8",
&["..", "cuda_base", "src", "cudnn8.rs"], &["..", "cuda_macros", "src", "cudnn8.rs"],
&cudnn8_module, &cudnn8_module,
); );
generate_functions( generate_functions(
&crate_root, &crate_root,
"cudnn9", "cudnn9",
&["..", "cuda_base", "src", "cudnn9.rs"], &["..", "cuda_macros", "src", "cudnn9.rs"],
&cudnn9_module, &cudnn9_module,
); );
generate_display_perflib( generate_display_perflib(
@ -633,7 +633,7 @@ fn generate_cublas(crate_root: &PathBuf) {
generate_functions( generate_functions(
&crate_root, &crate_root,
"cublas", "cublas",
&["..", "cuda_base", "src", "cublas.rs"], &["..", "cuda_macros", "src", "cublas.rs"],
&module, &module,
); );
generate_types_library( generate_types_library(
@ -693,7 +693,7 @@ fn generate_cublaslt(crate_root: &PathBuf) {
std::fs::write( std::fs::write(
crate_root crate_root
.join("..") .join("..")
.join("cuda_base") .join("cuda_macros")
.join("src") .join("src")
.join("cublaslt_internal.rs"), .join("cublaslt_internal.rs"),
cublaslt_internal_header, cublaslt_internal_header,
@ -704,7 +704,7 @@ fn generate_cublaslt(crate_root: &PathBuf) {
generate_functions( generate_functions(
&crate_root, &crate_root,
"cublaslt", "cublaslt",
&["..", "cuda_base", "src", "cublaslt.rs"], &["..", "cuda_macros", "src", "cublaslt.rs"],
&module_blas, &module_blas,
); );
generate_types_library( generate_types_library(
@ -753,7 +753,7 @@ fn generate_cuda(crate_root: &PathBuf) -> Vec<Ident> {
let cuda_functions = get_functions(generate_functions( let cuda_functions = get_functions(generate_functions(
&crate_root, &crate_root,
"cuda", "cuda",
&["..", "cuda_base", "src", "cuda.rs"], &["..", "cuda_macros", "src", "cuda.rs"],
&module, &module,
)); ));
generate_types_cuda( generate_types_cuda(
@ -805,7 +805,7 @@ fn generate_ml(crate_root: &PathBuf) {
generate_functions( generate_functions(
&crate_root, &crate_root,
"nvml", "nvml",
&["..", "cuda_base", "src", "nvml.rs"], &["..", "cuda_macros", "src", "nvml.rs"],
&module, &module,
); );
generate_types_library( generate_types_library(

View File

@ -8,7 +8,7 @@ crate-type = ["cdylib"]
name = "cublas" name = "cublas"
[dependencies] [dependencies]
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
[package.metadata.zluda] [package.metadata.zluda]

View File

@ -26,7 +26,7 @@ macro_rules! implemented {
}; };
} }
cuda_base::cublas_function_declarations!( cuda_macros::cublas_function_declarations!(
unimplemented, unimplemented,
implemented <= [ implemented <= [
cublasGetStatusName, cublasGetStatusName,

View File

@ -8,7 +8,7 @@ crate-type = ["cdylib"]
name = "cublaslt" name = "cublaslt"
[dependencies] [dependencies]
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
[package.metadata.zluda] [package.metadata.zluda]

View File

@ -26,7 +26,7 @@ macro_rules! implemented {
}; };
} }
cuda_base::cublaslt_function_declarations!( cuda_macros::cublaslt_function_declarations!(
unimplemented, unimplemented,
implemented <= [ implemented <= [
cublasLtGetStatusName, cublasLtGetStatusName,

View File

@ -8,7 +8,7 @@ crate-type = ["cdylib"]
name = "cudnn64_9" name = "cudnn64_9"
[dependencies] [dependencies]
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
[package.metadata.zluda] [package.metadata.zluda]

View File

@ -26,7 +26,7 @@ macro_rules! implemented {
}; };
} }
cuda_base::cudnn9_function_declarations!( cuda_macros::cudnn9_function_declarations!(
unimplemented, unimplemented,
implemented <= [ implemented <= [
cudnnGetVersion, cudnnGetVersion,

View File

@ -20,7 +20,7 @@ dynasmrt = "1.2"
# we don't need elf32, but goblin has a bug where elf64 does not build without elf32 # we don't need elf32, but goblin has a bug where elf64 does not build without elf32
goblin = { version = "0.4", default-features = false, features = ["elf64", "elf32", "archive"] } goblin = { version = "0.4", default-features = false, features = ["elf64", "elf32", "archive"] }
paste = "1.0" paste = "1.0"
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
parking_lot = "0.12.3" parking_lot = "0.12.3"
rustc-hash = "1.1.0" rustc-hash = "1.1.0"

View File

@ -849,7 +849,7 @@ fn format_curesult(curesult: CUresult) -> Vec<u8> {
output_string output_string
} }
use cuda_base::cuda_function_declarations; use cuda_macros::cuda_function_declarations;
use crate::log::UInt; use crate::log::UInt;
cuda_function_declarations!( cuda_function_declarations!(

View File

@ -11,7 +11,7 @@ crate-type = ["cdylib"]
[dependencies] [dependencies]
format = { path = "../format" } format = { path = "../format" }
dark_api = { path = "../dark_api" } dark_api = { path = "../dark_api" }
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
zluda_dump_common = { path = "../zluda_dump_common" } zluda_dump_common = { path = "../zluda_dump_common" }
libloading = "0.8" libloading = "0.8"

View File

@ -45,4 +45,4 @@ macro_rules! unimplemented {
}; };
} }
cuda_base::cublas_function_declarations!(unimplemented); cuda_macros::cublas_function_declarations!(unimplemented);

View File

@ -11,7 +11,7 @@ crate-type = ["cdylib"]
[dependencies] [dependencies]
format = { path = "../format" } format = { path = "../format" }
dark_api = { path = "../dark_api" } dark_api = { path = "../dark_api" }
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
zluda_dump_common = { path = "../zluda_dump_common" } zluda_dump_common = { path = "../zluda_dump_common" }
libloading = "0.8" libloading = "0.8"

View File

@ -45,5 +45,5 @@ macro_rules! unimplemented {
}; };
} }
cuda_base::cublaslt_function_declarations!(unimplemented); cuda_macros::cublaslt_function_declarations!(unimplemented);
cuda_base::cublaslt_internal_function_declarations!(unimplemented); cuda_macros::cublaslt_internal_function_declarations!(unimplemented);

View File

@ -11,7 +11,7 @@ crate-type = ["cdylib"]
[dependencies] [dependencies]
format = { path = "../format" } format = { path = "../format" }
dark_api = { path = "../dark_api" } dark_api = { path = "../dark_api" }
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
zluda_dump_common = { path = "../zluda_dump_common" } zluda_dump_common = { path = "../zluda_dump_common" }
libloading = "0.8" libloading = "0.8"

View File

@ -45,4 +45,4 @@ macro_rules! unimplemented {
}; };
} }
cuda_base::cudnn9_function_declarations!(unimplemented); cuda_macros::cudnn9_function_declarations!(unimplemented);

View File

@ -11,7 +11,7 @@ crate-type = ["cdylib"]
[dependencies] [dependencies]
format = { path = "../format" } format = { path = "../format" }
dark_api = { path = "../dark_api" } dark_api = { path = "../dark_api" }
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
zluda_dump_common = { path = "../zluda_dump_common" } zluda_dump_common = { path = "../zluda_dump_common" }
libloading = "0.8" libloading = "0.8"

View File

@ -45,4 +45,4 @@ macro_rules! unimplemented {
}; };
} }
cuda_base::cufft_function_declarations!(unimplemented); cuda_macros::cufft_function_declarations!(unimplemented);

View File

@ -11,7 +11,7 @@ crate-type = ["cdylib"]
[dependencies] [dependencies]
format = { path = "../format" } format = { path = "../format" }
dark_api = { path = "../dark_api" } dark_api = { path = "../dark_api" }
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
zluda_dump_common = { path = "../zluda_dump_common" } zluda_dump_common = { path = "../zluda_dump_common" }
libloading = "0.8" libloading = "0.8"

View File

@ -45,4 +45,4 @@ macro_rules! unimplemented {
}; };
} }
cuda_base::cusparse_function_declarations!(unimplemented); cuda_macros::cusparse_function_declarations!(unimplemented);

View File

@ -8,7 +8,7 @@ crate-type = ["cdylib"]
name = "cufft" name = "cufft"
[dependencies] [dependencies]
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
[package.metadata.zluda] [package.metadata.zluda]

View File

@ -13,6 +13,6 @@ macro_rules! unimplemented {
}; };
} }
cuda_base::cufft_function_declarations!( cuda_macros::cufft_function_declarations!(
unimplemented unimplemented
); );

View File

@ -9,7 +9,7 @@ name = "nvml"
crate-type = ["cdylib"] crate-type = ["cdylib"]
[dependencies] [dependencies]
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
[package.metadata.zluda] [package.metadata.zluda]

View File

@ -24,7 +24,7 @@ macro_rules! implemented_fn {
}; };
} }
cuda_base::nvml_function_declarations!( cuda_macros::nvml_function_declarations!(
unimplemented_fn, unimplemented_fn,
implemented_fn <= [ implemented_fn <= [
nvmlErrorString, nvmlErrorString,

View File

@ -8,7 +8,7 @@ crate-type = ["cdylib"]
name = "cusparse" name = "cusparse"
[dependencies] [dependencies]
cuda_base = { path = "../cuda_base" } cuda_macros = { path = "../cuda_macros" }
cuda_types = { path = "../cuda_types" } cuda_types = { path = "../cuda_types" }
[package.metadata.zluda] [package.metadata.zluda]

View File

@ -26,7 +26,7 @@ macro_rules! implemented {
}; };
} }
cuda_base::cusparse_function_declarations!( cuda_macros::cusparse_function_declarations!(
unimplemented, unimplemented,
implemented <= [ implemented <= [
cusparseGetErrorName, cusparseGetErrorName,