accelerate-io: BlockPtrs vs. Ptrs

16 views
Skip to first unread message

Henning Thielemann

unread,
Apr 17, 2018, 2:31:20 AM4/17/18
to Accelerate Project

It seems that BlockPtrs, fromPtr, toPtr have gone and now there are
similar sounding Ptrs, fromPtrs, toPtrs. Can you please mention this
change in CHANGES.md and explain what actually changed and how we can
adapt to it?

Henning Thielemann

unread,
Apr 17, 2018, 3:09:51 AM4/17/18
to Accelerate Project
ForeignPtrs, fromForeignPtrs, toForeignPtrs are probably even better for
my purposes. Unfortunately, Haddock does not show the modules
Data.Array.Accelerate.IO.Foreign.Ptr and
Data.Array.Accelerate.IO.Foreign.ForeignPtr.

Trevor McDonell

unread,
Apr 18, 2018, 2:55:58 AM4/18/18
to accelerat...@googlegroups.com
Not sure why the haddocks aren't working for you... the ones on Hackage I uploaded myself without issue.

The primary change, besides the expanded API, is that most conversions are non-copying now. For the pointer variants in particular you are interested in, you just get direct access to the underlying data, and it is up to you to use that responsibly.

`BlockPtrs` would have been in the same structure as the current `ForeignPtrs` type; i.e. the nested-tuples representation used by `EltRepr`. If you relied on the old methods copying the data into fresh arrays for you, then you'll have a little bit of extra work to do, but otherwise it should be straightforward.


Cheers,
-Trev


--
You received this message because you are subscribed to the Google Groups "Accelerate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to accelerate-hask...@googlegroups.com.
Visit this group at https://groups.google.com/group/accelerate-haskell.
For more options, visit https://groups.google.com/d/optout.

Henning Thielemann

unread,
Apr 18, 2018, 3:07:55 AM4/18/18
to Accelerate Project

On Wed, 18 Apr 2018, Trevor McDonell wrote:

> Not sure why the haddocks aren't working for you... the ones on Hackage I
> uploaded myself without issue.

I am not seeing ForeignPtr here:
https://hackage.haskell.org/package/accelerate-io-1.2.0.0

The Foreign module docs seem to be missing only in that overview page. The
module docs however exist and can be accessed via the index.

> The primary change, besides the expanded API, is that most conversions are
> non-copying now. For the pointer variants in particular you are interested
> in, you just get direct access to the underlying data, and it is up to you to
> use that responsibly.

Non-copying is better for me. Previous versions of accelerate-io forced me to
copy.

Trevor McDonell

unread,
Apr 18, 2018, 3:18:42 AM4/18/18
to accelerat...@googlegroups.com
This is what it looks like for me (and the same in safari):


Screenshot 2018-04-18 17.13.13.png


Henning Thielemann

unread,
Apr 18, 2018, 3:32:10 AM4/18/18
to Accelerate Project

On Wed, 18 Apr 2018, Trevor McDonell wrote:

> This is what it looks like for me (and the same in safari):
>
>
> Screenshot 2018-04-18 17.13.13.png

I see. The new hackage presentation style breaks the list of modules after
Data.Array.Accelerate.IO.Data.Vector.Generic and inserts a long empty
space since Data.Array.Accelerate.IO.Data.Vector.Generic.Mutable is too
long to fit left besides the right info bar. Another reason why I don't
like the new style.
Reply all
Reply to author
Forward
0 new messages