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

Allow const expressions in array sizes in OpenCL translation. #19

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

robertszafa
Copy link

There is an error when translating the tests/ShallowWater2D_memory_reduction_fpga/module_dyn_shapiro_superkernel.f95 to OpenCL. $dim_size is undefined because eval() gets variable names instead of numbers. This change returns the array size as an expression in that case. Tested on sw2d and seems to be OK.

@wimvanderbauwhede
Copy link
Owner

Before I merge this, I'd like to see the code that causes the error. It is odd because there is full constant folding of expressions in variable declarations. So I want to understand why that expression did not get folded.

@robertszafa
Copy link
Author

The code that causes the error is tests/ShallowWater2D_memory_reduction_fpga/module_dyn_shapiro_superkernel.f95. The code has not been memory reduced - it has parameters that are not folded.

I think there are two options: add folding to the translation pass (there is already a replace_param_by_val function), or use this change.

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

Successfully merging this pull request may close these issues.

None yet

2 participants