We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When we initialize the variable x within the kernel as shown below, an error is generated indicating that it has failed to realize reduction.
x
void foo(double step, int steps, double *sum) { for (int i = 0; i < steps; i++) { double x = (i + 0.5) * step; sum[0] += 4.0 / (1.0 + x * x); } }
The following error is generated when the kernel is run in loopy_api.py.
loopy_api.py
Traceback (most recent call last): File "/home/xenon/projects/nomp/libnomp/python/loopy_api.py", line 813, in <module> lp_knl = realize_reduction(lp_knl, "sum") File "/home/xenon/projects/nomp/libnomp/python/reduction.py", line 113, in realize_reduction tunit = lp.make_kernel( File "/home/xenon/mambaforge/envs/libnomp/lib/python3.10/site-packages/loopy/kernel/creation.py", line 2569, in make_kernel tunit = make_function(*args, **kwargs) File "/home/xenon/mambaforge/envs/libnomp/lib/python3.10/site-packages/loopy/kernel/creation.py", line 2497, in make_function check_for_duplicate_insn_ids(knl) File "/home/xenon/mambaforge/envs/libnomp/lib/python3.10/site-packages/loopy/translation_unit.py", line 703, in _collective_transform return transform(kernel, *args, **kwargs) File "/home/xenon/mambaforge/envs/libnomp/lib/python3.10/site-packages/loopy/check.py", line 417, in check_for_duplicate_insn_ids raise LoopyError("duplicate instruction id: '%s'" % insn.id) loopy.diagnostic.LoopyError: duplicate instruction id: '_nomp_insn'
However, the following kernel works as expected.
void foo(double step, int steps, double *sum) { for (int i = 0; i < steps; i++) { sum[0] += 4.0 / (1.0 + (i + 0.5) * step * (i + 0.5) * step); } }
The text was updated successfully, but these errors were encountered:
This should be easy to fix. I think the issue is the following line in reduction.py generating instructions ids already generated in loopy_api.py: https://github.com/nomp-org/libnomp/blob/main/python/reduction.py#L106
reduction.py
Sorry, something went wrong.
I think this was a typo on my part. I should have used the following function (get_instruction_id_generator()) instead of get_var_name_generator(): https://github.com/inducer/loopy/blob/main/loopy/kernel/__init__.py#L258
get_instruction_id_generator()
get_var_name_generator()
No branches or pull requests
When we initialize the variable
x
within the kernel as shown below, an error is generated indicating that it has failed to realize reduction.The following error is generated when the kernel is run in
loopy_api.py
.However, the following kernel works as expected.
The text was updated successfully, but these errors were encountered: