arrayfire / arrayfire-haskell

Haskell bindings to ArrayFire
http://hackage.haskell.org/package/arrayfire
BSD 3-Clause "New" or "Revised" License
59 stars 5 forks source link

Getting a failure on these tests that is very strange #49

Closed chiroptical closed 4 months ago

chiroptical commented 2 years ago

https://github.com/arrayfire/arrayfire-haskell/blob/5d621602bb925ce5122a66011003498cbe638e2b/test/ArrayFire/ArithSpec.hs#L30-L33

I am not sure this is entirely helpful, feel free to close. I would like to use arrayfire for a project I am starting. It is included in my nix setup via https://github.com/chiroptical/homing-pigeon/blob/main/default.nix.

However, I am getting errors from these tests after setting my LD_LIBRARY_PATH appropriately. Here is the output from the test,

  test/ArrayFire/ArithSpec.hs:31:7: 
  1) ArrayFire.Arith, Arith tests, Should take cubed root
       expected: ArrayFire Array
                 [1 1 1 1]
                     3.0000 

        but got: ArrayFire Array
                 [1 1 1 1]
                     3.0000 

I am wondering if it is comparing the pointers and not doing an element-wise comparison? AFAICT, I tried some C++ code and arrayA == arrayB seems to generate an element-wise comparison but I am unsure how equals is handled in Haskell-land.

leftaroundabout commented 4 months ago

This is not really a failure, just a harmless float-inexactness. Addressed in #59.