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

OpenMP #273

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
337b2db
Format change.
isazi Aug 21, 2024
852f198
First very draft attempt at feature parity OpenACC/OpenMP.
isazi Aug 21, 2024
a2cee37
Added OpenMP tests.
isazi Aug 21, 2024
0067fd5
Fixed two failing tests.
isazi Aug 21, 2024
debcb64
A fix was necessary in the Compiler backend to have OpenMP working.
isazi Aug 21, 2024
bb95d7b
Fixed test.
isazi Aug 21, 2024
ba02b31
Fixing the examples.
isazi Aug 21, 2024
828d4c6
Matrix multiply example for OpenMP.
isazi Aug 21, 2024
24857cc
Adding correctness check.
isazi Aug 22, 2024
3d32c47
Refactor function.
isazi Aug 22, 2024
21e56af
Bug fixed.
isazi Aug 22, 2024
1f815e2
Adding missing parameter.
isazi Aug 22, 2024
ddf501f
Another bug fixed.
isazi Aug 22, 2024
1698a9b
Updated the OpenMP matrix multiply.
isazi Aug 22, 2024
2fffcf0
Update vector add OpenMP code.
isazi Sep 5, 2024
c0d240a
Using "restrict" is too compiler specific.
isazi Sep 5, 2024
62809fa
Reorder parameters.
isazi Sep 17, 2024
fbdadd7
Draft example of a histogram.
isazi Sep 17, 2024
d844e97
Bound the values inside the array.
isazi Sep 17, 2024
ab9d6b5
Typo.
isazi Sep 17, 2024
e7fd411
Fixing a bug in the correctness check.
isazi Sep 17, 2024
939f0c3
Use the cleaning observer.
isazi Sep 17, 2024
06c6074
Fixing what is (probably) a long standing bug, observers were ignored…
isazi Sep 17, 2024
9dc47a4
Fixing allocation bugs in the Compiler Backend.
isazi Sep 18, 2024
c7bc0c8
Move this trailing comment on the previous empty line.
isazi Sep 19, 2024
ee7432a
Fixing, for good, a bug that prevented cleaning up the output memory …
isazi Sep 19, 2024
e2c6a09
The example should now work.
isazi Sep 19, 2024
fb9033a
Fix the test to use the new method.
isazi Sep 19, 2024
f9808e1
Some refactoring necessary for everything to work. The Compiler backe…
isazi Sep 19, 2024
2333916
Remove old tests.
isazi Sep 19, 2024
aa3cadb
Added test for the compiler memory refresh.
isazi Sep 19, 2024
4587539
Update the test.
isazi Sep 19, 2024
4c77414
Although semantically there is no dtoh copy in the compiler backend, …
isazi Sep 19, 2024
da2fe05
Test fixed.
isazi Sep 19, 2024
47898d9
Added tunable parameters to the example.
isazi Sep 19, 2024
760462c
OpenMP version of the histogram example.
isazi Sep 19, 2024
b207e06
Merge branch 'master' into directives
isazi Nov 28, 2024
69ec5ac
Merge branch 'master' into directives
isazi Dec 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor function.
  • Loading branch information
isazi committed Aug 22, 2024
commit 3d32c4738fd71c3a08de31137e6311ca41a584db
40 changes: 27 additions & 13 deletions kernel_tuner/utils/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,24 +481,38 @@ def wrap_data(code: str, langs: Code, data: dict, preprocessor: list = None, use
for name in data.keys():
if "*" in data[name][0]:
size = parse_size(data[name][1], preprocessor=preprocessor, dimensions=user_dimensions)
temp = None
if is_openacc(langs.directive):
if is_cxx(langs.language):
intro += create_data_directive_openacc_cxx(name, size)
outro += exit_data_directive_openacc_cxx(name, size)
elif is_fortran(langs.language):
intro += create_data_directive_openacc_fortran(name, size)
outro += exit_data_directive_openacc_fortran(name, size)
temp = wrap_data_openacc(name, size)
elif is_openmp(langs.directive):
if is_cxx(langs.language):
intro += create_data_directive_openmp_cxx(name, size)
outro += exit_data_directive_openmp_cxx(name, size)
elif is_fortran(langs.language):
intro += create_data_directive_openmp_fortran(name, size)
outro += exit_data_directive_openmp_fortran(name, size)

temp = wrap_data_openmp(name, size)
intro += temp[0]
outro += temp[1]
return "\n".join([intro, code, outro])


def wrap_data_openacc(name: str, size: int) -> Tuple[str, str]:
"""Create language specific data directives"""
if is_cxx(langs.language):
intro = create_data_directive_openacc_cxx(name, size)
outro = exit_data_directive_openacc_cxx(name, size)
elif is_fortran(langs.language):
intro = create_data_directive_openacc_fortran(name, size)
outro = exit_data_directive_openacc_fortran(name, size)
return intro, outro


def wrap_data_openmp(name: str, size: int) -> Tuple[str, str]:
"""Create language specific data directives"""
if is_cxx(langs.language):
intro += create_data_directive_openmp_cxx(name, size)
outro += exit_data_directive_openmp_cxx(name, size)
elif is_fortran(langs.language):
intro += create_data_directive_openmp_fortran(name, size)
outro += exit_data_directive_openmp_fortran(name, size)
return intro, outro


def extract_directive_code(code: str, langs: Code, kernel_name: str = None) -> dict:
"""Extract explicitly marked directive sections from code"""
if is_cxx(langs.language):
Expand Down
Loading