From b316e44a46c97eca10c71932f607106e9ff2a2e3 Mon Sep 17 00:00:00 2001 From: Johannes M Dieterich Date: Fri, 14 Dec 2018 14:14:09 -0800 Subject: [PATCH] Remove __forceinline__ hipification step. (#15229) Summary: The HIP definition now correctly contains the inline attribute. Pull Request resolved: https://github.com/pytorch/pytorch/pull/15229 Differential Revision: D13470962 Pulled By: bddppq fbshipit-source-id: 34f8361bda5f3dce20a2eeb530c3a25d1b1bdd06 --- tools/amd_build/pyHIPIFY/hipify_python.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tools/amd_build/pyHIPIFY/hipify_python.py b/tools/amd_build/pyHIPIFY/hipify_python.py index 34c93fe..cc8e74e 100755 --- a/tools/amd_build/pyHIPIFY/hipify_python.py +++ b/tools/amd_build/pyHIPIFY/hipify_python.py @@ -505,15 +505,6 @@ def disable_asserts(input_string): return output_string -def replace_forceinline(input_string): - """__forceinline__'d methods can cause 'symbol multiply defined' errors in HIP. - Adding 'static' to all such methods leads to compilation errors, so - replacing '__forceinline__' with 'inline' as a workaround - https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_faq.md#what-if-hip-generates-error-of-symbol-multiply-defined-only-on-amd-machine - """ - return input_string.replace("__forceinline__", "inline") - - def replace_math_functions(input_string): """ FIXME: Temporarily replace std:: invocations of math functions with non-std:: versions to prevent linker errors NOTE: This can lead to correctness issues when running tests, since the correct version of the math function (exp/expf) might not get called. @@ -937,9 +928,6 @@ def preprocessor(output_directory, filepath, stats): if filepath.endswith(".cu") or filepath.endswith(".cuh"): output_source = replace_math_functions(output_source) - # Replace __forceinline__ with inline - output_source = replace_forceinline(output_source) - # Include header if device code is contained. output_source = hip_header_magic(output_source) -- 2.7.4