Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

af_index_t #31

Open
shanedidona opened this issue Apr 22, 2020 · 3 comments
Open

af_index_t #31

shanedidona opened this issue Apr 22, 2020 · 3 comments
Labels

Comments

@shanedidona
Copy link

The struct af_index_t is not yet present in the ArrayFire wrapper. The use of C-style unions has confused our efforts to add this. Right now we are exploring shucking data back and forth between the CPU and GPU to emulate this functionality but this not as fast as using methods/structs which keep data on the GPU.

@9prady9
Copy link
Member

9prady9 commented Apr 23, 2020

That is precisely the reason we provided helper API to create and manage the af_index_t structure without having to deal with it at the wrapper level. Please look at the below functions at http://arrayfire.org/docs/group__index__func__index.htm defined in af/index.h header.

  • af_create_indexers
  • af_set_array_indexer
  • af_set_seq_indexer
  • af_set_seq_param_indexer
  • af_release_indexers

If it is of any help, you can also look at how rust wrapper uses the same functions to expose indexing based functionality. https://github.com/arrayfire/arrayfire-rust/blob/master/src/index.rs

@umar456
Copy link
Member

umar456 commented Apr 23, 2020

It looks like you can use af_seq objects but not af_index_t which allows you to index with array objects. Is that correct? Can you give me an example of what operation you are trying to do?

@9prady9
Copy link
Member

9prady9 commented Apr 23, 2020

Well, if it is always going to be sequences, yeah, no need to touch af_index_t structure. But to write a generic wrapper than can handle af_array for indexing, the wrapper has to handle af_index_t struct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants