tools/amd_build/pyHIPIFY/hipify-python.py
def disable_module(input_file):
    """Disable a module entirely except for header includes."""
    with openf(input_file, "r+") as f:
        txt = f.read()
        last = list(re.finditer(r"#include .*\n", txt))[-1]
        end = last.end()

        disabled = "{0}#if !defined(__HIP_PLATFORM_HCC__)\n{1}\n#endif".format(txt[0:end], txt[end:])

        f.seek(0)
        f.write(disabled)
        f.truncate()
Disable a module entirely except for header includes.
Disable a module entirely except for header includes.
Disable a module entirely except for header includes .
def disable_module(input_file):
    with openf(input_file, "r+") as f:
        txt = f.read()
        last = list(re.finditer(r"#include .*\n", txt))[-1]
        end = last.end()
        disabled = "{0}#if !defined(__HIP_PLATFORM_HCC__)\n{1}\n#endif".format(txt[0:end], txt[end:])
        f.seek(0)
        f.write(disabled)
        f.truncate()
def disable_module ( input_file ) : with openf ( input_file , "r+" ) as f : txt = f . read ( ) last = list ( re . finditer ( r"#include .*\n" , txt ) ) [ - 1 ] end = last . end ( ) disabled = "{0}#if !defined(__HIP_PLATFORM_HCC__)\n{1}\n#endif" . format ( txt [ 0 : end ] , txt [ end : ] ) f . seek ( 0 ) f . write ( disabled ) f . truncate ( )
Disable a module entirely except for header includes.
Disable a module entirely except for header includes .
"""Disable a module entirely except for header includes."""
input_file