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

iterate over the same memory buffer multiple times in one kernel call #2008

Open
antonio-fc opened this issue Jan 8, 2025 · 1 comment
Open

Comments

@antonio-fc
Copy link

This is more of a general question. I am trying to multiply the data of a memory buffer by multiple scalars. So data points [a, b, c, d, e], are all multiplied by scalar A, then scalar B, etc. However, I have not found a way to do this without calling the kernel twice (once for A and once for B). I know it is possible to broadcast the data points and do the multiplications in different compute tiles, but for the application I want to implement this does not work since the number of scalars is higher than the number of compute tiles.

Please let me know if this is possible, and if not what are the alternatives for this kind of design.

@jgmelber
Copy link
Collaborator

Hi! For this sort of discussion it is always better to discuss around some code. For this, I would say you have to call the kernel twice or implement the computation twice within a larger kernel where you pass in multiple scalar values.

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

No branches or pull requests

2 participants