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

[Feature Request] Indexing CuArray with CuArray #155

Closed
Roger-luo opened this issue Dec 7, 2018 · 3 comments
Closed

[Feature Request] Indexing CuArray with CuArray #155

Roger-luo opened this issue Dec 7, 2018 · 3 comments
Labels
cuda array Stuff about CuArray. enhancement New feature or request

Comments

@Roger-luo
Copy link
Contributor

I guess this can be faster with GPU? But any idea on how to implement this?

A = cu(rand(2048, 2048))
B = CuArray(rand(1:2048, 1024))
A[B, 2]
@MikeInnes
Copy link
Contributor

It should be quite straightforward: the kernel just looks something like C[i] = A[B[i], 2]. Writing a very general kernel is harder though and I guess it'd have to extend GPUArray's current indexing kernels.

@Roger-luo
Copy link
Contributor Author

Yeah, I agree, I wrote my custom kernel which is not general. I found that pytorch have a general implementation however, so I think we should have one as well.

@maleadt maleadt transferred this issue from JuliaGPU/CuArrays.jl May 27, 2020
@maleadt maleadt added cuda array Stuff about CuArray. enhancement New feature or request labels May 27, 2020
@maleadt
Copy link
Member

maleadt commented Sep 4, 2020

This works now.

@maleadt maleadt closed this as completed Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda array Stuff about CuArray. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants