Skip to content

Commit

Permalink
Using "restrict" is too compiler specific.
Browse files Browse the repository at this point in the history
  • Loading branch information
isazi committed Sep 5, 2024
1 parent 2fffcf0 commit c0d240a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kernel_tuner/utils/directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def extract_directive_signature(code: str, langs: Code, kernel_name: str = None)
p_type = param[1:-1]
p_type = p_type.split(":")[0]
if "*" in p_type:
p_type = p_type.replace("*", " * restrict")
p_type = p_type.replace("*", " *")
if is_cxx(langs.language):
params.append(f"{p_type} {p_name}")
elif is_fortran(langs.language):
Expand Down
4 changes: 2 additions & 2 deletions test/utils/test_directives.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ def test_extract_directive_signature():
signatures = extract_directive_signature(code, acc_cxx)
assert len(signatures) == 1
assert (
"float vector_add(float * restrict a, float * restrict b, float * restrict c, int size)"
"float vector_add(float * a, float * b, float * c, int size)"
in signatures["vector_add"]
)
signatures = extract_directive_signature(code, acc_cxx, "vector_add")
assert len(signatures) == 1
assert (
"float vector_add(float * restrict a, float * restrict b, float * restrict c, int size)"
"float vector_add(float * a, float * b, float * c, int size)"
in signatures["vector_add"]
)
signatures = extract_directive_signature(code, acc_cxx, "vector_add_ext")
Expand Down

0 comments on commit c0d240a

Please sign in to comment.