Adding keywords to poems #18
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After #4, users have the ability to specify keywords in both verses and stanzas, but not poems.
This is because the poems ultimately transform into kernels and keywords are tricky to implement in C (I guess you could do some variadic tricks, but it's not worth figuring out at this time.
Long story short, there are advantages to allowing users to set keywords for poems. These could be set automatically when kernels are configured, so the user doesn't need to manually set the arguments.
The problem is that I cannot find a way to support all keywords. I have attached a simple sketch that does most of the work for simple keywords (let's say
a = 5), but it is missing the translation from'5'(achar) to avoid *necessary for OpenCL. This is doable and was actually mainly done in 5a41798#diff-51ed3eaef734d969a6896d213bba2507fd36aad88a28207bdf2726916aa525c8L97.The problem is kwargs like
a = 5*x. This poses 2 problems:x? Where is it defined? In some random C code?5*xin the simple method used above?So long-story short, kwargs for poems are half-baked at best, but there's probably a good way to do this if I think about it a bit.