arrayfire-rust: Creating an Array throws an "Unknown Error"

Two simple test programs demonstrate this error:

$ rustc --version                                                                                                                                                                          101   master
rustc 1.15.1 (021bd294c 2017-02-08)

(This same result also occurs on the latest nightly: rustc 1.17.0-nightly (956e2bcba 2017-02-12)) Cargo.toml:

[package]
name = "ArrayTest"
version = "0.1.0"
authors = ["Dillon Hammond <dillonhammond@gmail.com>"]

[dependencies]
arrayfire = "3.4.1"

src/main.rs:

extern crate arrayfire;
use arrayfire::*;

fn main() {
  let temp = [1.0f32, 2.0];
  let dims = Dim4::new(&[2, 1, 1, 1]);
  let array = Array::new(&temp, dims);
  print(&array);
}

This works and prints:

[2 1 1 1]
    1.0000
    2.0000

However the following does not work:

src/main.rs:

extern crate arrayfire;
use arrayfire::*;

fn main() {
  // let temp = [1.0f32, 2.0];
  let dims = Dim4::new(&[2, 1, 1, 1]);
  let array = Array::new(&[1.0f32, 2.0], dims);
  print(&array);
}

And errors out with:

    Finished debug [unoptimized + debuginfo] target(s) in 0.31 secs
     Running `target/debug/ArrayTest`
thread 'main' panicked at 'Error message: Unknown Error', /Users/Dillon/.cargo/registry/src/github.com-1ecc6299db9ec823/arrayfire-3.4.1/src/error.rs:72
stack backtrace:
   1:        0x10421cbca - std::sys::imp::backtrace::tracing::imp::write::hd3b65cdfe843284c
   2:        0x10421de1f - std::panicking::default_hook::{{closure}}::hf2b7428652613d83
   3:        0x10421dac7 - std::panicking::default_hook::h5da8f27db5582938
   4:        0x10421e286 - std::panicking::rust_panic_with_hook::hcef1e67c646c6802
   5:        0x10421e124 - std::panicking::begin_panic::hc2e8ca89533cd10d
   6:        0x10421e042 - std::panicking::begin_panic_fmt::h60990696c3c3a88d
   7:        0x104217cd5 - arrayfire::error::handle_error_general::h0e5d6db925a03428
   8:        0x104218022 - core::ops::Fn::call::hc9af5f45f4409d39
   9:        0x104217e2c - arrayfire::error::HANDLE_ERROR::h882ecb6e0c34188c
  10:        0x104214977 - arrayfire::array::Array::new::h36519fff17d0ea4e
  11:        0x1042149f5 - ArrayTest::main::h3a0f84221923c6d5
  12:        0x10421ec1a - __rust_maybe_catch_panic
  13:        0x10421e4f6 - std::rt::lang_start::h87cb84a8b6cb187e
  14:        0x104214a99 - main

I have installed arrayfire v3.3.2 (the library) with Homebrew and verified it works. Output of $AF_PATH:

/usr/local/opt/arrayfire

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 24 (16 by maintainers)

Most upvoted comments

@pavanky The device name says “Iris”, I think it is a Intel integrated GPU.