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

Unexpected behaviour of GetSubView #19

Closed
Luminisc opened this issue Jun 4, 2019 · 1 comment
Closed

Unexpected behaviour of GetSubView #19

Luminisc opened this issue Jun 4, 2019 · 1 comment
Assignees
Labels
feature A new feature (or feature request) question

Comments

@Luminisc
Copy link

Luminisc commented Jun 4, 2019

I'm working on HyperSpectralImages, so I have many 3D arrays. And, for calculations, I need to get vector of values of some pixel.

For example:

imageView.GetSubView(Index3.Zero, new Index3(1, 1, imageView.Depth))

So, I assume, that extent with this size will return me the view like Z column, over values in [0,0,0],[0,0,1],[0,0,2] and etc. But, I getting the values in X row, not Z, like [0,0,0], [1,0,0], [2,0,0];

I assuming this as bug, rather than undocumented feature.

If it should work like this, @m4rs-mt can you provide some workaround for my case?
(because I'm using this for my diploma and it's critical for me)

@m4rs-mt
Copy link
Owner

m4rs-mt commented Jun 7, 2019

@Luminisc This is definitely an interesting application.

In fact, this is the intended behavior, since the concept of an ILGPU view is a raw view of the underlying memory. In your particular case, you want to access a non-contiguous memory region via a subview, which is (unfortunately) not possible with raw views. Instead, you must manually iterate over the affected elements.

We might want to integrate an additional concept of iterators to support convenient accesses in future versions :)

@m4rs-mt m4rs-mt added the feature A new feature (or feature request) label Jun 7, 2019
@m4rs-mt m4rs-mt added this to the v0.7 milestone Jun 7, 2019
@m4rs-mt m4rs-mt removed this from the v0.7 milestone Nov 3, 2019
m4rs-mt added a commit that referenced this issue Mar 4, 2020
@m4rs-mt m4rs-mt closed this as completed Mar 4, 2020
m4rs-mt added a commit that referenced this issue Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature (or feature request) question
Projects
None yet
Development

No branches or pull requests

2 participants