arrayfire/arrayfire-rust

[BUG] FFT example not working, Trait Bound HasAfEnum not implemented for Complex<float>

steckes opened this issue · 5 comments

Can not run the fft example: the trait HasAfEnum is not implemented for Complex<{f64}>.

Using:

  • MacOS x86_64
  • rustc version 1.62.1
  • rust edition 2021
  • arrayfire 3.8
  • num 0.4.0

The documentation of this library is saying that HasAfEnum is implemented for Complex< f32 > and Complex< f64 >.

Screenshot 2022-08-08 at 14 52 53

I'm also seeing this

@stexa Please see the implementations here

impl HasAfEnum for Complex<f32> {
type InType = Self;
type BaseType = f32;
type AbsOutType = f32;
type ArgOutType = f32;
type UnaryOutType = Self;
type ComplexOutType = Self;
type MeanOutType = Self;
type AggregateOutType = Self;
type ProductOutType = Self;
type SobelOutType = Self;
fn get_af_dtype() -> DType {
DType::C32
}
}
impl HasAfEnum for Complex<f64> {
type InType = Self;
type BaseType = f64;
type AbsOutType = f64;
type ArgOutType = f64;
type UnaryOutType = Self;
type ComplexOutType = Self;
type MeanOutType = Self;
type AggregateOutType = Self;
type ProductOutType = Self;
type SobelOutType = Self;
fn get_af_dtype() -> DType {
DType::C64
}
}
.

I am unable to reproduce this using master branch. Are you noticing this with release version of crate or master branch ?

@stexa Is still an active issue on your end ?

It is resolved! Was not working with 3.8 from crates.io, but it is working when adding arrayfire from git master branch.
[dependencies] arrayfire = { git = "https://github.com/arrayfire/arrayfire-rust" } num = "0.4.0"

It is resolved! Was not working with 3.8 from crates.io, but it is working when adding arrayfire from git master branch. [dependencies] arrayfire = { git = "https://github.com/arrayfire/arrayfire-rust" } num = "0.4.0"

Thanks for clarifying, I will try to push our a new crate soon. Sorry about the inconvenience.