Types and combinators to mix linear with accelerate.
Contributions and bug reports are welcome!
Please feel free to contact me through GitHub or gitter.im.
Instances to mix linear with accelerate
License: Other
Types and combinators to mix linear with accelerate.
Contributions and bug reports are welcome!
Please feel free to contact me through GitHub or gitter.im.
I'm opening this issue for a couple of reasons:
(Edit: resolved in #6) linear-accelerate
currently doesn't build with Cabal-1.25
(which is bundled with GHC 8.2), since it causes the Setup.hs
script to break:
$ cabal configure -w /opt/ghc/8.2.1/bin/ghc
Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
trying: linear-accelerate-0.3 (user goal)
next goal: linear (dependency of linear-accelerate-0.3)
Dependency tree exhaustively searched.
Trying configure anyway.
[1 of 1] Compiling Main ( dist/setup/setup.hs, dist/setup/Main.o )
dist/setup/setup.hs:8:31: error:
Module
‘Distribution.Package’
does not export
‘PackageName(PackageName)’
|
8 | import Distribution.Package ( PackageName(PackageName), PackageId, InstalledPackageId, packageVersion, packageName )
| ^^^^^^^^^^^^^^^^^^^^^^^^
See also ekmett/lens#709, where we identified other packages with similar issues. Fixing this is quite easy with cabal-doctest
. However...
linear-accelerate
has doctests, but they aren't used! Moreover, I tried running the doctests in this package recently, but it resulted in many failures. It didn't seem like fixing the doctests would be a simple matter, either.
We should fix these separately, as the former task will likely be far easier than the latter.
Currently, building linear-accelerate against accelerate 1.4 (HEAD @ 593f5c5d at time of writing) fails with the following error:
src/Data/Array/Accelerate/Linear/Plucker.hs:59:1: error:
Could not find module ‘Data.Array.Accelerate.Array.Sugar’
Perhaps you meant
Data.Array.Accelerate.Array.Data (from accelerate-1.4.0.0)
Data.Array.Accelerate.Array.Remote (from accelerate-1.4.0.0)
Data.Array.Accelerate.Array.Unique (from accelerate-1.4.0.0)
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
59 | import Data.Array.Accelerate.Array.Sugar
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The API changes go beyond just moving the module, though, changing the import to
import Data.Array.Accelerate.Sugar.Elt
gives the following error:
src/Data/Array/Accelerate/Linear/Plucker.hs:297:8: error:
‘EltRepr’ is not a (visible) associated type of class ‘Elt’
|
297 | type EltRepr LinePass = Int8
| ^^^^^^^
src/Data/Array/Accelerate/Linear/Plucker.hs:298:3: error:
‘eltType’ is not a (visible) method of class ‘Elt’
|
298 | eltType = eltType @Int8
| ^^^^^^^
It seems like the Elt
class now provides a default implementation for each of its functions, so I think the fix might be just to replace the Elt instance of LinePass with
instance Elt LinePass
Doing this yields some (I think) unrelated errors with the Eq instance (see below), but i'm not sure this is the right fix.
Errors after replacing Elt instance with defaults:
src/Data/Array/Accelerate/Linear/Plucker.hs:312:12: error:
• Couldn't match type ‘Data.Array.Accelerate.Type.BitSize
(Data.Array.Accelerate.Representation.Tag.TAG, ())
Data.Type.Equality.== 8’
with ‘'True’
arising from a use of ‘bitcast’
• In the first argument of ‘(==)’, namely ‘bitcast x’
In the expression: bitcast x == (bitcast y :: Exp Int8)
In an equation for ‘==’:
x == y = bitcast x == (bitcast y :: Exp Int8)
|
312 | x == y = bitcast x == (bitcast y :: Exp Int8)
| ^^^^^^^^^
src/Data/Array/Accelerate/Linear/Plucker.hs:313:12: error:
• Couldn't match type ‘Data.Array.Accelerate.Type.BitSize
(Data.Array.Accelerate.Representation.Tag.TAG, ())
Data.Type.Equality.== 8’
with ‘'True’
arising from a use of ‘bitcast’
• In the first argument of ‘(/=)’, namely ‘bitcast x’
In the expression: bitcast x /= (bitcast y :: Exp Int8)
In an equation for ‘/=’:
x /= y = bitcast x /= (bitcast y :: Exp Int8)
|
313 | x /= y = bitcast x /= (bitcast y :: Exp Int8)
| ^^^^^^^^^
There's been some changes to how accelerate represents types. I've started some very preliminary work on updating linear-accelerate
. See AccelerateHS/accelerate#210 (comment)
From stackage nightly build
Building test suite 'doctests' for linear-accelerate-0.5..
<no location info>: warning: [-Wmissing-home-modules]
These modules are needed for compilation but not listed in your .cabal file's other-modules: Build_doctests
[1 of 2] Compiling Build_doctests ( dist/build/doctests/autogen/Build_doctests.hs, dist/build/doctests/doctests-tmp/Build_doctests.o )
[2 of 2] Compiling Main ( tests/doctests.hs, dist/build/doctests/doctests-tmp/Main.o )
<no location info>: warning: [-Wmissing-home-modules]
These modules are needed for compilation but not listed in your .cabal file's other-modules: Build_doctests
Linking dist/build/doctests/doctests ...
> /tmp/stackage-build14/linear-accelerate-0.5$ dist/build/doctests/doctests
### Failure in /tmp/stackage-build14/linear-accelerate-0.5/src/Data/Array/Accelerate/Linear/Matrix.hs:160: expression `identity :: Exp (M44 Int)'
expected: "let x0 = 1 in"
"let x1 = 0"
"in ((x0,x1,x1,x1),(x1,x0,x1,x1),(x1,x1,x0,x1),(x1,x1,x1,x0))"
but got: "\ESC[33mlet\ESC[0m x0 = 1 \ESC[33min\ESC[0m"
"\ESC[33mlet\ESC[0m x1 = 0"
"\ESC[33min\ESC[0m ((x0,x1,x1,x1),(x1,x0,x1,x1),(x1,x1,x0,x1),(x1,x1,x1,x0))"
Examples: 36 Tried: 35 Errors: 0 Failures: 1
Now Elt (Complex e)
instance is defined in both accelerate-fft and linear-accelerate. My proposition is to move this into the main accelerate package.
linear-accelerate-0.3
doesn't build out of the box with GHC 8.2.1-rc2 due to #6, so we should cut a minor release soon to rectify this. We're almost there, since the HEAD version of linear-accelerate
builds without issue on 8.2. We just need to update the .travis.yml
script accordingly to verify this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.