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

fix: place ug dep behind not wasm32 flag #2760

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 4 additions & 3 deletions candle-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ accelerate-src = { workspace = true, optional = true }
byteorder = { workspace = true }
candle-kernels = { workspace = true, optional = true }
candle-metal-kernels = { workspace = true, optional = true }
metal = { workspace = true, optional = true}
metal = { workspace = true, optional = true }
cudarc = { workspace = true, optional = true }
gemm = { workspace = true }
half = { workspace = true }
Expand All @@ -28,18 +28,19 @@ rand_distr = { workspace = true }
rayon = { workspace = true }
safetensors = { workspace = true }
thiserror = { workspace = true }
ug = { workspace = true }
ug-cuda = { workspace = true, optional = true }
ug-metal = { workspace = true, optional = true }
yoke = { workspace = true }
zip = { workspace = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ug = { workspace = true }

[dev-dependencies]
anyhow = { workspace = true }
clap = { workspace = true }
criterion = { workspace = true }


[features]
default = []
cuda = ["cudarc", "dep:candle-kernels", "dep:ug-cuda"]
Expand Down
1 change: 1 addition & 0 deletions candle-core/src/cuda_backend/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ impl CudaDevice {
self.device.clone()
}

#[cfg(not(target_arch = "wasm32"))]
pub fn compile(
&self,
func_name: &'static str,
Expand Down
1 change: 1 addition & 0 deletions candle-core/src/custom_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ pub struct UgIOp1 {

impl UgIOp1 {
#[allow(unused)]
#[cfg(not(target_arch = "wasm32"))]
pub fn new(
name: &'static str,
kernel: ug::lang::ssa::Kernel,
Expand Down
1 change: 1 addition & 0 deletions candle-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ pub enum Error {
#[error("Metal error {0}")]
Metal(#[from] MetalError),

#[cfg(not(target_arch = "wasm32"))]
#[error(transparent)]
Ug(#[from] ug::Error),

Expand Down
1 change: 1 addition & 0 deletions candle-core/src/metal_backend/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ impl std::ops::Deref for MetalDevice {
}

impl MetalDevice {
#[cfg(not(target_arch = "wasm32"))]
pub fn compile(
&self,
func_name: &'static str,
Expand Down
Loading