From 81158bd9ff330290ac6fabae103ffabc18cbb229 Mon Sep 17 00:00:00 2001 From: yanbing-j Date: Tue, 6 Jun 2023 15:49:20 +0800 Subject: [PATCH 1/2] Update c++17 for pytorch 2.1.0 --- CMakeLists.txt | 1 + pytorch_binding/setup.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c570e0..61942de 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ ELSE() cmake_minimum_required(VERSION 2.8) ENDIF() +set(CMAKE_CXX_STANDARD 17) project(rnnt_release) IF (NOT APPLE) diff --git a/pytorch_binding/setup.py b/pytorch_binding/setup.py index ad960ea..2894824 100644 --- a/pytorch_binding/setup.py +++ b/pytorch_binding/setup.py @@ -8,10 +8,10 @@ extra_compile_args = ['-fPIC'] -if LooseVersion(torch.__version__) >= LooseVersion("1.5.0"): - extra_compile_args += ['-std=c++14'] +if LooseVersion(torch.__version__) >= LooseVersion("2.1.0"): + extra_compile_args += ['-std=c++17'] else: - extra_compile_args += ['-std=c++11'] + extra_compile_args += ['-std=c++14'] warp_rnnt_path = "../build" if torch.cuda.is_available() or "CUDA_HOME" in os.environ: From 55a1e2e0f0d0678502baffd675c260da5c8f4bb8 Mon Sep 17 00:00:00 2001 From: yanbing-j Date: Wed, 7 Jun 2023 13:30:31 +0800 Subject: [PATCH 2/2] Remove version check --- pytorch_binding/setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pytorch_binding/setup.py b/pytorch_binding/setup.py index 2894824..0fc23f3 100644 --- a/pytorch_binding/setup.py +++ b/pytorch_binding/setup.py @@ -8,10 +8,7 @@ extra_compile_args = ['-fPIC'] -if LooseVersion(torch.__version__) >= LooseVersion("2.1.0"): - extra_compile_args += ['-std=c++17'] -else: - extra_compile_args += ['-std=c++14'] +extra_compile_args += ['-std=c++17'] warp_rnnt_path = "../build" if torch.cuda.is_available() or "CUDA_HOME" in os.environ: