提交 171d6915 编写于 作者: M Megvii Engine Team

fix(fp16): fix midout build issue when hit fp16 trace

GitOrigin-RevId: cf2c5184cd922c17e8b5905b8a3442d8d579e225
上级 127870a9
......@@ -185,6 +185,18 @@ class HeaderGen:
).stdout.decode('utf-8')
self._fout.write('// midout \n')
self._fout.write(cvt)
if cvt.find(" half,"):
change = open(self._fout.name).read().replace(" half,", " __fp16,")
with open("fix_fp16_bin_reduce.h", "w") as fix_fp16:
fix_fp16.write(change)
msg = (
"WARNING:\n"
"hit half in trace, try use fix_fp16_bin_reduce.h when build failed with bin_reduce.h\n"
"which caused by LLVM mangle issue on __fp16 dtype, if you find msg 'error: use of undeclared identifier 'half'\n"
"then try use fix_fp16_bin_reduce.h, if build failed again, submit a issue to Engine team!!!"
)
print(msg)
def main():
parser = argparse.ArgumentParser(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册