Skip to content

Use generator directly in loop as by review #26

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

Merged
merged 1 commit into from
Jul 10, 2018
Merged
Changes from all commits
Commits
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
6 changes: 2 additions & 4 deletions tools/amd_build/pyHIPIFY/hipify-python.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,8 @@ def get_kernel_template_params(the_file, KernelDictionary):
KernelDictionary[kernel_name] = {"kernel_with_template": kernel_with_template, "arg_types": formatted_args}

# Extract generated kernels
get_generated_kernels = [k for k in re.finditer(r"GENERATE_KERNEL([1-9])\((.*)\)", string)]
# curandStateMtgp32 *state, int size, T *result, ARG1
for kernel in get_generated_kernels:
for kernel in re.finditer(r"GENERATE_KERNEL([1-9])\((.*)\)", string):
kernel_gen_type = int(kernel.group(1))
kernel_name = kernel.group(2).split(",")[0]
kernel_params = kernel.group(2).split(",")[1:]
Expand Down Expand Up @@ -720,8 +719,7 @@ def add_static_casts(directory, extensions, KernelTemplateParams):
with openf(filepath, "r+") as fileobj:
input_source = fileobj.read()
new_output_source = input_source
get_kernel_definitions = [k for k in re.finditer("hipLaunchKernelGGL\(", input_source)]
for kernel in get_kernel_definitions:
for kernel in re.finditer("hipLaunchKernelGGL\(", input_source):
arguments = extract_arguments(kernel.end() - 1, input_source)

# Check if we have templating + static_cast information
Expand Down