autumnai / leaf-examples

Examples for the Hacker's Machine Learning Framework Leaf
78 stars 18 forks source link

Unable to compile without cuda #6

Open oars opened 8 years ago

oars commented 8 years ago

In the toml I set:

[dependencies]
leaf = { version = "0.2.0", default-features = false }

[features]
default = ["native"
native  = ["leaf/native"]

However the compilation is failing.

   Compiling collenchyma-nn v0.3.4
/home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/collenchyma-nn-0.3.4/src/frameworks/native/helper.rs:19:5: 28:6 error: non-exhaustive patterns: `&mut OpenCL(_)` not covered [E0004]
/home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/collenchyma-nn-0.3.4/src/frameworks/native/helper.rs:19     match mem {
/home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/collenchyma-nn-0.3.4/src/frameworks/native/helper.rs:20         &mut MemoryType::Native(ref mut mem) => {
/home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/collenchyma-nn-0.3.4/src/frameworks/native/helper.rs:21             let mut mem_buffer = mem.as_mut_slice::<T::Item>();
/home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/collenchyma-nn-0.3.4/src/frameworks/native/helper.rs:22             for (index, datum) in data.enumerate() {
/home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/collenchyma-nn-0.3.4/src/frameworks/native/helper.rs:23                 mem_buffer[index] = datum;
/home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/collenchyma-nn-0.3.4/src/frameworks/native/helper.rs:24             }
                                                                                                                    ...
/home/fuego/.cargo/registry/src/github.com-88ac128001ac3a9a/collenchyma-nn-0.3.4/src/frameworks/native/helper.rs:19:5: 28:6 help: run `rustc --explain E0004` to see a detailed explanation
error: aborting due to previous error
Could not compile `collenchyma-nn`.

Is this not supported?

hobofan commented 8 years ago
  1. The examples currently only work with CUDA, I guess that should be documented in the README. :sweat_smile:
  2. You would also have to apply the feature flags to collenchyma and collenchyma-nn
oars commented 8 years ago

Tried the example on a machine with a graphics card now. I think there is still value in getting a simple example working without CUDA to make it accessible to just play around with the library.

cmyr commented 8 years ago

appreciate this isn't a priority, but fwiw I tend to do all my prototyping in a cuda-less environment, and then shift builds off to remote hardware for actual execution, so my workflow would require this at some point. :) Project looks neat though, happy to have had the excuse to install rust. :wink: