7 Jul 2012 21:13
vector-simd: some code available, and some questions
Nicolas Trangez <nicolas <at> incubaid.com>
2012-07-07 19:13:58 GMT
2012-07-07 19:13:58 GMT
All, After my message of yesterday [1] I got down to it and implemented something along those lines. I created a playground repository containing the code at [2]. Initial benchmark results at [3]. More about the benchmark at the end of this email. First some questions and requests for help: - I'm stuck with a typing issue related to 'sizeOf' calculation at [4]. I tried a couple of things, but wasn't able to figure out how to fix it. - I'm using unsafePerformIO at [5], yet I'm not certain it's OK to do so. Are there better (safer/performant/...) ways to get this working? - Currently Alignment phantom types (e.g. A8 and A16) are not related to each other: a function (like Data.Vector.SIMD.Algorithms.unsafeXorSSE42) can have this signature: unsafeXorSSE42 :: Storable a => SV.Vector SV.A16 a -> SV.Vector SV.A16 a -> SV.Vector SV.A16 a Yet, imaging I'd have an "SV.Vector SV.A32 Word8" vector at hand, the function should accept it as well (a 32-byte aligned vector is also 16-byte aligned). Is there any way to encode this at the type level? That's about it(Continue reading)As of now, I only implemented a couple of the vector API functions (the ones required to execute my benchmark). Adding the others should be trivial.
As of now, I only implemented a couple of the vector API functions (the
ones required to execute my benchmark). Adding the others should be
trivial.
Thanks for all your input!
> The alternative, if you want
> both Alignment as a superclass and the ability to constrain multiple
> types at once, is to have the above, remove the instance on tuples,
> and instead something like:
>
RSS Feed