mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-08-02 06:47:46 +03:00
Rename cuda_base cuda_macros (#435)
This commit is contained in:
2
.github/workflows/pr_master.yml
vendored
2
.github/workflows/pr_master.yml
vendored
@ -91,7 +91,7 @@ jobs:
|
||||
tool: cargo-export
|
||||
- name: Build
|
||||
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
|
||||
bash .github/workflows/move_tests.sh target/tests amdgpu
|
||||
strip target/amdgpu/*
|
||||
|
2
.github/workflows/push_master.yml
vendored
2
.github/workflows/push_master.yml
vendored
@ -138,7 +138,7 @@ jobs:
|
||||
tool: cargo-export
|
||||
- name: Build
|
||||
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
|
||||
bash .github/workflows/move_tests.sh target/tests amdgpu
|
||||
strip target/amdgpu/*
|
||||
|
32
Cargo.lock
generated
32
Cargo.lock
generated
@ -301,7 +301,7 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cuda_base"
|
||||
name = "cuda_macros"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
@ -315,7 +315,7 @@ name = "cuda_types"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"bitflags 2.9.1",
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"hip_runtime-sys",
|
||||
]
|
||||
|
||||
@ -1076,7 +1076,7 @@ dependencies = [
|
||||
"bit-vec 0.6.3",
|
||||
"bitflags 1.3.2",
|
||||
"comgr",
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
"half",
|
||||
"hip_runtime-sys",
|
||||
@ -1770,7 +1770,7 @@ name = "zluda"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"comgr",
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
"dark_api",
|
||||
"dtor",
|
||||
@ -1805,7 +1805,7 @@ dependencies = [
|
||||
name = "zluda_blas"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
]
|
||||
|
||||
@ -1813,7 +1813,7 @@ dependencies = [
|
||||
name = "zluda_blaslt"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
]
|
||||
|
||||
@ -1821,7 +1821,7 @@ dependencies = [
|
||||
name = "zluda_dnn"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
]
|
||||
|
||||
@ -1830,7 +1830,7 @@ name = "zluda_dump"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cglue",
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
"dark_api",
|
||||
"detours-sys",
|
||||
@ -1857,7 +1857,7 @@ name = "zluda_dump_blas"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cglue",
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
"dark_api",
|
||||
"format",
|
||||
@ -1872,7 +1872,7 @@ name = "zluda_dump_blaslt"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cglue",
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
"dark_api",
|
||||
"format",
|
||||
@ -1898,7 +1898,7 @@ name = "zluda_dump_dnn"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cglue",
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
"dark_api",
|
||||
"format",
|
||||
@ -1913,7 +1913,7 @@ name = "zluda_dump_fft"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cglue",
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
"dark_api",
|
||||
"format",
|
||||
@ -1928,7 +1928,7 @@ name = "zluda_dump_sparse"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cglue",
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
"dark_api",
|
||||
"format",
|
||||
@ -1942,7 +1942,7 @@ dependencies = [
|
||||
name = "zluda_fft"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
]
|
||||
|
||||
@ -1963,7 +1963,7 @@ dependencies = [
|
||||
name = "zluda_ml"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
]
|
||||
|
||||
@ -1980,7 +1980,7 @@ dependencies = [
|
||||
name = "zluda_sparse"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
]
|
||||
|
||||
|
@ -4,7 +4,7 @@ resolver = "2"
|
||||
|
||||
members = [
|
||||
"comgr",
|
||||
"cuda_base",
|
||||
"cuda_macros",
|
||||
"cuda_types",
|
||||
"dark_api",
|
||||
"detours-sys",
|
||||
|
@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "cuda_base"
|
||||
name = "cuda_macros"
|
||||
version = "0.0.0"
|
||||
authors = ["Andrzej Janik <vosen@vosen.pl>"]
|
||||
edition = "2021"
|
@ -5,6 +5,6 @@ authors = ["Andrzej Janik <vosen@vosen.pl>"]
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
hip_runtime-sys = { path = "../ext/hip_runtime-sys" }
|
||||
bitflags = "2.9.1"
|
||||
|
@ -26,7 +26,7 @@ unwrap_or = "1.0.1"
|
||||
hip_runtime-sys = { path = "../ext/hip_runtime-sys" }
|
||||
comgr = { path = "../comgr" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
tempfile = "3"
|
||||
paste = "1.0"
|
||||
pretty_assertions = "1.4.1"
|
||||
|
@ -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 CUDA: std::sync::LazyLock<DynamicCuda> =
|
||||
|
@ -13,7 +13,7 @@ comgr = { path = "../comgr" }
|
||||
ptx_parser = { path = "../ptx_parser" }
|
||||
ptx = { path = "../ptx" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
hip_runtime-sys = { path = "../ext/hip_runtime-sys" }
|
||||
dark_api = { path = "../dark_api" }
|
||||
lazy_static = "1.4"
|
||||
|
@ -34,7 +34,7 @@ macro_rules! implemented {
|
||||
if !initialized() {
|
||||
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(())
|
||||
}
|
||||
)*
|
||||
@ -51,14 +51,14 @@ macro_rules! implemented_in_function {
|
||||
if !initialized() {
|
||||
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(())
|
||||
}
|
||||
)*
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::cuda_function_declarations!(
|
||||
cuda_macros::cuda_function_declarations!(
|
||||
unimplemented,
|
||||
implemented <= [
|
||||
cuCtxCreate_v2,
|
||||
|
@ -160,7 +160,7 @@ fn generate_cufft(crate_root: &PathBuf) {
|
||||
generate_functions(
|
||||
&crate_root,
|
||||
"cufft",
|
||||
&["..", "cuda_base", "src", "cufft.rs"],
|
||||
&["..", "cuda_macros", "src", "cufft.rs"],
|
||||
&module,
|
||||
);
|
||||
generate_types_library(
|
||||
@ -215,7 +215,7 @@ fn generate_cusparse(crate_root: &PathBuf) {
|
||||
generate_functions(
|
||||
&crate_root,
|
||||
"cusparse",
|
||||
&["..", "cuda_base", "src", "cusparse.rs"],
|
||||
&["..", "cuda_macros", "src", "cusparse.rs"],
|
||||
&module,
|
||||
);
|
||||
generate_types_library(
|
||||
@ -275,13 +275,13 @@ fn generate_cudnn(crate_root: &PathBuf) {
|
||||
generate_functions(
|
||||
&crate_root,
|
||||
"cudnn8",
|
||||
&["..", "cuda_base", "src", "cudnn8.rs"],
|
||||
&["..", "cuda_macros", "src", "cudnn8.rs"],
|
||||
&cudnn8_module,
|
||||
);
|
||||
generate_functions(
|
||||
&crate_root,
|
||||
"cudnn9",
|
||||
&["..", "cuda_base", "src", "cudnn9.rs"],
|
||||
&["..", "cuda_macros", "src", "cudnn9.rs"],
|
||||
&cudnn9_module,
|
||||
);
|
||||
generate_display_perflib(
|
||||
@ -633,7 +633,7 @@ fn generate_cublas(crate_root: &PathBuf) {
|
||||
generate_functions(
|
||||
&crate_root,
|
||||
"cublas",
|
||||
&["..", "cuda_base", "src", "cublas.rs"],
|
||||
&["..", "cuda_macros", "src", "cublas.rs"],
|
||||
&module,
|
||||
);
|
||||
generate_types_library(
|
||||
@ -693,7 +693,7 @@ fn generate_cublaslt(crate_root: &PathBuf) {
|
||||
std::fs::write(
|
||||
crate_root
|
||||
.join("..")
|
||||
.join("cuda_base")
|
||||
.join("cuda_macros")
|
||||
.join("src")
|
||||
.join("cublaslt_internal.rs"),
|
||||
cublaslt_internal_header,
|
||||
@ -704,7 +704,7 @@ fn generate_cublaslt(crate_root: &PathBuf) {
|
||||
generate_functions(
|
||||
&crate_root,
|
||||
"cublaslt",
|
||||
&["..", "cuda_base", "src", "cublaslt.rs"],
|
||||
&["..", "cuda_macros", "src", "cublaslt.rs"],
|
||||
&module_blas,
|
||||
);
|
||||
generate_types_library(
|
||||
@ -753,7 +753,7 @@ fn generate_cuda(crate_root: &PathBuf) -> Vec<Ident> {
|
||||
let cuda_functions = get_functions(generate_functions(
|
||||
&crate_root,
|
||||
"cuda",
|
||||
&["..", "cuda_base", "src", "cuda.rs"],
|
||||
&["..", "cuda_macros", "src", "cuda.rs"],
|
||||
&module,
|
||||
));
|
||||
generate_types_cuda(
|
||||
@ -805,7 +805,7 @@ fn generate_ml(crate_root: &PathBuf) {
|
||||
generate_functions(
|
||||
&crate_root,
|
||||
"nvml",
|
||||
&["..", "cuda_base", "src", "nvml.rs"],
|
||||
&["..", "cuda_macros", "src", "nvml.rs"],
|
||||
&module,
|
||||
);
|
||||
generate_types_library(
|
||||
|
@ -8,7 +8,7 @@ crate-type = ["cdylib"]
|
||||
name = "cublas"
|
||||
|
||||
[dependencies]
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
|
||||
[package.metadata.zluda]
|
||||
|
@ -26,7 +26,7 @@ macro_rules! implemented {
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::cublas_function_declarations!(
|
||||
cuda_macros::cublas_function_declarations!(
|
||||
unimplemented,
|
||||
implemented <= [
|
||||
cublasGetStatusName,
|
||||
|
@ -8,7 +8,7 @@ crate-type = ["cdylib"]
|
||||
name = "cublaslt"
|
||||
|
||||
[dependencies]
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
|
||||
[package.metadata.zluda]
|
||||
|
@ -26,7 +26,7 @@ macro_rules! implemented {
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::cublaslt_function_declarations!(
|
||||
cuda_macros::cublaslt_function_declarations!(
|
||||
unimplemented,
|
||||
implemented <= [
|
||||
cublasLtGetStatusName,
|
||||
|
@ -8,7 +8,7 @@ crate-type = ["cdylib"]
|
||||
name = "cudnn64_9"
|
||||
|
||||
[dependencies]
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
|
||||
[package.metadata.zluda]
|
||||
|
@ -26,7 +26,7 @@ macro_rules! implemented {
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::cudnn9_function_declarations!(
|
||||
cuda_macros::cudnn9_function_declarations!(
|
||||
unimplemented,
|
||||
implemented <= [
|
||||
cudnnGetVersion,
|
||||
|
@ -20,7 +20,7 @@ dynasmrt = "1.2"
|
||||
# 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"] }
|
||||
paste = "1.0"
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
parking_lot = "0.12.3"
|
||||
rustc-hash = "1.1.0"
|
||||
|
@ -849,7 +849,7 @@ fn format_curesult(curesult: CUresult) -> Vec<u8> {
|
||||
output_string
|
||||
}
|
||||
|
||||
use cuda_base::cuda_function_declarations;
|
||||
use cuda_macros::cuda_function_declarations;
|
||||
|
||||
use crate::log::UInt;
|
||||
cuda_function_declarations!(
|
||||
|
@ -11,7 +11,7 @@ crate-type = ["cdylib"]
|
||||
[dependencies]
|
||||
format = { path = "../format" }
|
||||
dark_api = { path = "../dark_api" }
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
zluda_dump_common = { path = "../zluda_dump_common" }
|
||||
libloading = "0.8"
|
||||
|
@ -45,4 +45,4 @@ macro_rules! unimplemented {
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::cublas_function_declarations!(unimplemented);
|
||||
cuda_macros::cublas_function_declarations!(unimplemented);
|
||||
|
@ -11,7 +11,7 @@ crate-type = ["cdylib"]
|
||||
[dependencies]
|
||||
format = { path = "../format" }
|
||||
dark_api = { path = "../dark_api" }
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
zluda_dump_common = { path = "../zluda_dump_common" }
|
||||
libloading = "0.8"
|
||||
|
@ -45,5 +45,5 @@ macro_rules! unimplemented {
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::cublaslt_function_declarations!(unimplemented);
|
||||
cuda_base::cublaslt_internal_function_declarations!(unimplemented);
|
||||
cuda_macros::cublaslt_function_declarations!(unimplemented);
|
||||
cuda_macros::cublaslt_internal_function_declarations!(unimplemented);
|
||||
|
@ -11,7 +11,7 @@ crate-type = ["cdylib"]
|
||||
[dependencies]
|
||||
format = { path = "../format" }
|
||||
dark_api = { path = "../dark_api" }
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
zluda_dump_common = { path = "../zluda_dump_common" }
|
||||
libloading = "0.8"
|
||||
|
@ -45,4 +45,4 @@ macro_rules! unimplemented {
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::cudnn9_function_declarations!(unimplemented);
|
||||
cuda_macros::cudnn9_function_declarations!(unimplemented);
|
||||
|
@ -11,7 +11,7 @@ crate-type = ["cdylib"]
|
||||
[dependencies]
|
||||
format = { path = "../format" }
|
||||
dark_api = { path = "../dark_api" }
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
zluda_dump_common = { path = "../zluda_dump_common" }
|
||||
libloading = "0.8"
|
||||
|
@ -45,4 +45,4 @@ macro_rules! unimplemented {
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::cufft_function_declarations!(unimplemented);
|
||||
cuda_macros::cufft_function_declarations!(unimplemented);
|
||||
|
@ -11,7 +11,7 @@ crate-type = ["cdylib"]
|
||||
[dependencies]
|
||||
format = { path = "../format" }
|
||||
dark_api = { path = "../dark_api" }
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
zluda_dump_common = { path = "../zluda_dump_common" }
|
||||
libloading = "0.8"
|
||||
|
@ -45,4 +45,4 @@ macro_rules! unimplemented {
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::cusparse_function_declarations!(unimplemented);
|
||||
cuda_macros::cusparse_function_declarations!(unimplemented);
|
||||
|
@ -8,7 +8,7 @@ crate-type = ["cdylib"]
|
||||
name = "cufft"
|
||||
|
||||
[dependencies]
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
|
||||
[package.metadata.zluda]
|
||||
|
@ -13,6 +13,6 @@ macro_rules! unimplemented {
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::cufft_function_declarations!(
|
||||
cuda_macros::cufft_function_declarations!(
|
||||
unimplemented
|
||||
);
|
||||
|
@ -9,7 +9,7 @@ name = "nvml"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
|
||||
[package.metadata.zluda]
|
||||
|
@ -24,7 +24,7 @@ macro_rules! implemented_fn {
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::nvml_function_declarations!(
|
||||
cuda_macros::nvml_function_declarations!(
|
||||
unimplemented_fn,
|
||||
implemented_fn <= [
|
||||
nvmlErrorString,
|
||||
|
@ -8,7 +8,7 @@ crate-type = ["cdylib"]
|
||||
name = "cusparse"
|
||||
|
||||
[dependencies]
|
||||
cuda_base = { path = "../cuda_base" }
|
||||
cuda_macros = { path = "../cuda_macros" }
|
||||
cuda_types = { path = "../cuda_types" }
|
||||
|
||||
[package.metadata.zluda]
|
||||
|
@ -26,7 +26,7 @@ macro_rules! implemented {
|
||||
};
|
||||
}
|
||||
|
||||
cuda_base::cusparse_function_declarations!(
|
||||
cuda_macros::cusparse_function_declarations!(
|
||||
unimplemented,
|
||||
implemented <= [
|
||||
cusparseGetErrorName,
|
||||
|
Reference in New Issue
Block a user