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
futhark #22
Comments
Yes. Multiple people have suggested to me letting the user use an iterator. But I can't produce OpenCL code without seeing the code inside the body of the for loop. The user would be limited in what code they can have inside the body of the for loop. |
If I understand the problem clearly (unability to see code outside of a macro), I see two solutions :
(As an aside, excuse me for jumping in and offering suggestions about improvement on a project to which I am not contributing. You have done a great job with emu.) |
These are good ideas. This is actually kind of along the lines of some of the stuff I have been thinking about recently. And no, please don't stop - I really appreciate all input. Discussion is contribution IMO. |
@nestordemeure how would an iterator (with unknown length) know how to batch the data? e.g. generating the correct shape of CUDA blocks/grids |
Not related to your question @timClicks but the approach I ultimately went with for v0.3.0 is similar to what @nestordemeure described. I don't try to determine the length of the iterator. Rather, I inspect the structure of the for loop and match on one of several pre-defined patterns. For example, Basically, at compile-time, I try to come up with expressions that evaluate to a dimensions of the grid.
|
Really interesting @calebwin. Will take a look into the implementation. |
Please do! I have a 3:1 code-to-comment ratio according to |
Are you aware of Futhark ?
They let the user write GPU code with highlevel functions (in a dedicated language) that are then optimized and compiled down to openCL or Cuda.
As a long term goal, using a similar approach (or integrating with their optimizer), you could let the user use an iterator (
gpu_iter()
?) and optimize the code at compile time.The text was updated successfully, but these errors were encountered: