Skip to content

Commit 9a6b9dc

Browse files
generatedunixname89002005287564facebook-github-bot
authored andcommitted
gloo
Reviewed By: jermenkoo Differential Revision: D63971820 fbshipit-source-id: fccf221defb437dd8a39f2de4c0fc3cca1fd1094
1 parent a5c386a commit 9a6b9dc

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

tools/amd_build/build_amd.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env python3
22

3-
from __future__ import absolute_import, division, print_function
43

54
import argparse
65
import os

tools/amd_build/pyHIPIFY/hipify_python.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
# THE SOFTWARE.
2525
"""
2626

27-
from __future__ import absolute_import, division, print_function
2827

2928
import fnmatch
3029
import os
@@ -37,7 +36,7 @@ class InputError(Exception):
3736
# Exception raised for errors in the input.
3837

3938
def __init__(self, message):
40-
super(InputError, self).__init__(message)
39+
super().__init__(message)
4140
self.message = message
4241

4342
def __str__(self):
@@ -128,8 +127,8 @@ def add_dim3(kernel_string, cuda_kernel):
128127
.strip(" ")
129128
)
130129

131-
first_arg_dim3 = "dim3({})".format(first_arg_clean)
132-
second_arg_dim3 = "dim3({})".format(second_arg_clean)
130+
first_arg_dim3 = f"dim3({first_arg_clean})"
131+
second_arg_dim3 = f"dim3({second_arg_clean})"
133132

134133
first_arg_raw_dim3 = first_arg_raw.replace(first_arg_clean, first_arg_dim3)
135134
second_arg_raw_dim3 = second_arg_raw.replace(second_arg_clean, second_arg_dim3)
@@ -145,9 +144,7 @@ def add_dim3(kernel_string, cuda_kernel):
145144
def processKernelLaunches(string):
146145
"""Replace the CUDA style Kernel launches with the HIP style kernel launches."""
147146
# Concat the namespace with the kernel names. (Find cleaner way of doing this later).
148-
string = RE_KERNEL_LAUNCH.sub(
149-
lambda inp: "{0}{1}::".format(inp.group(1), inp.group(2)), string
150-
)
147+
string = RE_KERNEL_LAUNCH.sub(lambda inp: f"{inp.group(1)}{inp.group(2)}::", string)
151148

152149
def grab_method_and_template(in_kernel):
153150
# The positions for relevant kernel components.
@@ -388,7 +385,7 @@ def sub_repl(m):
388385
def preprocessor(project_directory, output_directory, filepath):
389386
"""Executes the CUDA -> HIP conversion on the specified file."""
390387
fin_path = os.path.join(project_directory, filepath)
391-
with open(fin_path, "r") as fin:
388+
with open(fin_path) as fin:
392389
output_source = fin.read()
393390

394391
fout_path = os.path.join(output_directory, get_hip_file_path(filepath))

0 commit comments

Comments
 (0)