Skip to content

Commit 7353c57

Browse files
authored
Merge pull request #172 from Jorghi12/master
Suspicion is that there's an off by 1 error here.
2 parents 9853dbc + c3f796b commit 7353c57

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/amd_build/pyHIPIFY/hipify-python.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,12 +291,12 @@ def add_dim3(kernel_string, cuda_kernel):
291291
elif c == ")":
292292
closure -= 1
293293
elif (c == "," or ind == len(kernel_string) - 1) and closure == 0:
294-
arg_locs[count]['end'] = ind
294+
arg_locs[count]['end'] = ind + (c != ",")
295295
count += 1
296296
if count < 2:
297297
arg_locs[count]['start'] = ind + 1
298298

299-
first_arg_raw = kernel_string[arg_locs[0]['start']:arg_locs[0]['end'] + 1]
299+
first_arg_raw = kernel_string[arg_locs[0]['start']:arg_locs[0]['end']]
300300
second_arg_raw = kernel_string[arg_locs[1]['start']:arg_locs[1]['end']]
301301

302302
first_arg_clean = kernel_string[arg_locs[0]['start']:arg_locs[0]['end']].replace("\n", "").strip(" ")

0 commit comments

Comments
 (0)