Skip to content

Commit 36ac095

Browse files
malfetpytorchmergebot
authored andcommitted
Migrate PyTorch to C++17 (pytorch#85969)
With CUDA-10.2 gone we can finally do it! This PR mostly contains build system related changes, invasive functional ones are to be followed. Among many expected tweaks to the build system, here are few unexpected ones: - Force onnx_proto project to be updated to C++17 to avoid `duplicate symbols` error when compiled by gcc-7.5.0, as storage rule for `constexpr` changed in C++17, but gcc does not seem to follow it - Do not use `std::apply` on CUDA but rely on the built-in variant, as it results in test failures when CUDA runtime picks host rather than device function when `std::apply` is invoked from CUDA code. - `std::decay_t` -> `::std::decay_t` and `std::move`->`::std::move` as VC++ for some reason claims that `std` symbol is ambigious - Disable use of `std::aligned_alloc` on Android, as its `libc++` does not implement it. Some prerequisites: - pytorch#89297 - pytorch#89605 - pytorch#90228 - pytorch#90389 - pytorch#90379 - pytorch#89570 - facebookincubator/gloo#336 - facebookincubator/gloo#343 - pytorch/builder@919676f Fixes pytorch#56055 Pull Request resolved: pytorch#85969 Approved by: https://github.com/ezyang, https://github.com/kulinseth
1 parent f2d9576 commit 36ac095

File tree

27 files changed

+66
-51
lines changed

27 files changed

+66
-51
lines changed

.circleci/scripts/build_android_gradle.sh

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ do
2020
touch "$file" || true
2121
done < <(find /var/lib/jenkins/.gradle -type f -print0)
2222

23+
# Patch pocketfft (as Android does not have aligned_alloc even if compiled with c++17
24+
if [ -f ~/workspace/third_party/pocketfft/pocketfft_hdronly.h ]; then
25+
sed -i -e "s/#if __cplusplus >= 201703L/#if 0/" ~/workspace/third_party/pocketfft/pocketfft_hdronly.h
26+
fi
27+
2328
export GRADLE_LOCAL_PROPERTIES=~/workspace/android/local.properties
2429
rm -f $GRADLE_LOCAL_PROPERTIES
2530
echo "sdk.dir=/opt/android/sdk" >> $GRADLE_LOCAL_PROPERTIES

CMakeLists.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ string(FIND "${CMAKE_CXX_FLAGS}" "-std=c++" env_cxx_standard)
3131
if(env_cxx_standard GREATER -1)
3232
message(
3333
WARNING "C++ standard version definition detected in environment variable."
34-
"PyTorch requires -std=c++14. Please remove -std=c++ settings in your environment.")
34+
"PyTorch requires -std=c++17. Please remove -std=c++ settings in your environment.")
3535
endif()
36-
set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard whose features are requested to build this target.")
36+
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested to build this target.")
3737
set(CMAKE_C_STANDARD 11 CACHE STRING "The C standard whose features are requested to build this target.")
3838

3939
if(DEFINED GLIBCXX_USE_CXX11_ABI)
@@ -884,7 +884,6 @@ if(NOT MSVC)
884884
append_cxx_flag_if_supported("-Wno-unused-private-field" CMAKE_CXX_FLAGS)
885885
append_cxx_flag_if_supported("-Wno-inconsistent-missing-override" CMAKE_CXX_FLAGS)
886886
append_cxx_flag_if_supported("-Wno-aligned-allocation-unavailable" CMAKE_CXX_FLAGS)
887-
append_cxx_flag_if_supported("-Wno-c++14-extensions" CMAKE_CXX_FLAGS)
888887
append_cxx_flag_if_supported("-Wno-constexpr-not-const" CMAKE_CXX_FLAGS)
889888
append_cxx_flag_if_supported("-Wno-missing-braces" CMAKE_CXX_FLAGS)
890889
append_cxx_flag_if_supported("-Wunused-lambda-capture" CMAKE_CXX_FLAGS)
@@ -989,7 +988,6 @@ if(APPLE)
989988
endif()
990989
append_cxx_flag_if_supported("-Wno-unused-private-field" CMAKE_CXX_FLAGS)
991990
append_cxx_flag_if_supported("-Wno-missing-braces" CMAKE_CXX_FLAGS)
992-
append_cxx_flag_if_supported("-Wno-c++14-extensions" CMAKE_CXX_FLAGS)
993991
append_cxx_flag_if_supported("-Wno-constexpr-not-const" CMAKE_CXX_FLAGS)
994992
endif()
995993

android/pytorch_android/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ endif()
1414

1515
include(GNUInstallDirs)
1616

17-
set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard whose features are requested to build this target.")
17+
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested to build this target.")
1818
set(CMAKE_VERBOSE_MAKEFILE ON)
1919
message(STATUS "ANDROID_STL:${ANDROID_STL}")
2020

android/pytorch_android_torchvision/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.4.1)
22
project(pytorch_vision_jni CXX)
3-
set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard whose features are requested to build this target.")
3+
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested to build this target.")
44
set(CMAKE_VERBOSE_MAKEFILE ON)
55

66
set(pytorch_vision_cpp_DIR ${CMAKE_CURRENT_LIST_DIR}/src/main/cpp)

android/test_app/app/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.4.1)
22
set(PROJECT_NAME pytorch_testapp_jni)
33
project(${PROJECT_NAME} CXX)
4-
set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard whose features are requested to build this target.")
4+
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested to build this target.")
55
set(CMAKE_VERBOSE_MAKEFILE ON)
66

77
set(build_DIR ${CMAKE_SOURCE_DIR}/build)

aten/src/ATen/core/boxing/impl/make_boxed_from_unboxed_functor.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -577,14 +577,16 @@ namespace impl {
577577
// Decay ReturnType to ReturnType_ so that if a reference gets returned, we actually store it by value
578578
// and don't get a dangling reference. This is only required because some kernels still return `Tensor&`.
579579
#ifdef __cpp_if_constexpr
580-
using ReturnType_ = std::decay_t<ReturnType>;
580+
// [Note: VC++ and 'std': ambiguous symbol]
581+
using ReturnType_ = ::std::decay_t<ReturnType>;
581582
ReturnType_ output = call_functor_with_args_from_stack<KernelFunctor, AllowDeprecatedTypes>(functor, dispatchKeySet, stack);
582583
#else
583584
using ReturnType_ = std::decay_t<typename decltype(delay_check)::template type_identity<ReturnType>>;
584585
ReturnType_ output = call_functor_with_args_from_stack<KernelFunctor, AllowDeprecatedTypes>(functor, dispatchKeySet, delay_check(stack));
585586
#endif
586587
torch::jit::drop(*stack, num_inputs);
587-
push_outputs<ReturnType_, AllowDeprecatedTypes>::call(std::move(output), stack);
588+
// See note [ VC++ and 'std': ambiguous symbol]
589+
push_outputs<ReturnType_, AllowDeprecatedTypes>::call(::std::move(output), stack);
588590
#ifdef __cpp_if_constexpr
589591
} else {
590592
#else

aten/src/ATen/native/cpu/GridSamplerKernel.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,8 @@ struct ApplyGridSample<scalar_t, 2, GridSamplerInterpolation::Bilinear,
511511
auto sw = n * e;
512512
auto se = n * w;
513513

514-
auto i_x_w = convert_to_int_of_same_size(x_w);
515-
auto i_y_n = convert_to_int_of_same_size(y_n);
514+
auto i_x_w = convert_to_int_of_same_size<scalar_t>(x_w);
515+
auto i_y_n = convert_to_int_of_same_size<scalar_t>(y_n);
516516
auto i_x_e = i_x_w + iVec(1);
517517
auto i_y_s = i_y_n + iVec(1);
518518

aten/src/ATen/native/cuda/jit_utils.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ NvrtcFunction jit_pwise_function(
15321532
&program, code.c_str(), nullptr, 0, nullptr, nullptr));
15331533

15341534
#ifdef USE_ROCM
1535-
std::vector<const char*> args = {"--std=c++14"};
1535+
std::vector<const char*> args = {"--std=c++17"};
15361536
#else
15371537
// Constructs nvrtc build arguments
15381538
// CUDA 11.1 allows going directly to SASS (sm_) instead of PTX (compute_)
@@ -1547,7 +1547,7 @@ NvrtcFunction jit_pwise_function(
15471547
std::to_string(cuda_minor);
15481548
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
15491549
std::vector<const char*> args = {
1550-
"--std=c++14", compute.c_str(), "-default-device"};
1550+
"--std=c++17", compute.c_str(), "-default-device"};
15511551
#endif
15521552

15531553
#ifndef NDEBUG

c10/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
22
project(c10 CXX)
33

4-
set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard whose features are requested to build this target.")
4+
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested to build this target.")
55
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
66

77
# Main build file for the C10 library.

c10/util/C++17.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ using void_t = typename make_void<Ts...>::type;
140140
#define CUDA_HOST_DEVICE C10_HOST_DEVICE
141141
#endif
142142

143-
#ifdef __cpp_lib_apply
143+
#if defined(__cpp_lib_apply) && !defined(__CUDA_ARCH__)
144144

145145
template <class F, class Tuple>
146146
CUDA_HOST_DEVICE inline constexpr decltype(auto) apply(F&& f, Tuple&& t) {

cmake/Dependencies.cmake

+5-2
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ if(USE_ROCM)
13211321
list(APPEND HIP_CXX_FLAGS -Wno-implicit-int-float-conversion)
13221322
list(APPEND HIP_CXX_FLAGS -DCAFFE2_USE_MIOPEN)
13231323
list(APPEND HIP_CXX_FLAGS -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_HIP)
1324-
list(APPEND HIP_CXX_FLAGS -std=c++14)
1324+
list(APPEND HIP_CXX_FLAGS -std=c++17)
13251325
add_definitions(-DROCM_VERSION=${ROCM_VERSION_DEV_INT})
13261326
add_definitions(-DTORCH_HIP_VERSION=${TORCH_HIP_VERSION})
13271327
message("TORCH_HIP_VERSION=${TORCH_HIP_VERSION} is added as a compiler defines")
@@ -1585,6 +1585,9 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO AND NOT INTERN_DISABLE_ONNX)
15851585
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../caffe2/onnx/torch_ops")
15861586
if(NOT USE_SYSTEM_ONNX)
15871587
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/onnx EXCLUDE_FROM_ALL)
1588+
if(NOT MSVC)
1589+
set_target_properties(onnx_proto PROPERTIES CXX_STANDARD 17)
1590+
endif()
15881591
endif()
15891592
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../third_party/foxi EXCLUDE_FROM_ALL)
15901593

@@ -1687,7 +1690,7 @@ if(NOT INTERN_BUILD_MOBILE)
16871690
string(APPEND CMAKE_CUDA_FLAGS " -Wno-deprecated-gpu-targets --expt-extended-lambda")
16881691

16891692
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
1690-
set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard whose features are requested to build this target.")
1693+
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested to build this target.")
16911694
endif()
16921695

16931696
# use cub in a safe manner, see:

cmake/ProtoBufPatch.cmake

+8-6
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ if(NOT SYSTEM_PROTOBUF)
3131
# https://github.com/protocolbuffers/protobuf/commit/0400cca3236de1ca303af38bf81eab332d042b7c
3232
# changes PROTOBUF_CONSTEXPR to constexpr, which breaks windows
3333
# build.
34-
string(
35-
REGEX REPLACE
36-
"static constexpr ([^ ]+) ([^ ]+) ="
37-
"static \\1 const \\2 ="
38-
content
39-
"${content}")
34+
if(MSVC)
35+
string(
36+
REGEX REPLACE
37+
"static constexpr ([^ ]+) ([^ ]+) ="
38+
"static \\1 const \\2 ="
39+
content
40+
"${content}")
41+
endif()
4042

4143
foreach(ns ${NAMESPACES})
4244
# Insert "const ::std::string& GetEmptyStringAlreadyInited();" within

cmake/public/utils.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ endmacro()
407407
# Usage:
408408
# torch_compile_options(lib_name)
409409
function(torch_compile_options libname)
410-
set_property(TARGET ${libname} PROPERTY CXX_STANDARD 14)
410+
set_property(TARGET ${libname} PROPERTY CXX_STANDARD 17)
411411
set(private_compile_options "")
412412

413413
# ---[ Check if warnings should be errors.

functorch/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.12)
22
project(functorch)
3-
set(CMAKE_CXX_STANDARD 14)
3+
set(CMAKE_CXX_STANDARD 17)
44

55
include(GNUInstallDirs)
66
include(CMakePackageConfigHelpers)

ios/TestApp/TestApp.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
ALWAYS_SEARCH_USER_PATHS = NO;
254254
CLANG_ANALYZER_NONNULL = YES;
255255
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
256-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
256+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
257257
CLANG_CXX_LIBRARY = "libc++";
258258
CLANG_ENABLE_MODULES = YES;
259259
CLANG_ENABLE_OBJC_ARC = YES;
@@ -312,7 +312,7 @@
312312
ALWAYS_SEARCH_USER_PATHS = NO;
313313
CLANG_ANALYZER_NONNULL = YES;
314314
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
315-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
315+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
316316
CLANG_CXX_LIBRARY = "libc++";
317317
CLANG_ENABLE_MODULES = YES;
318318
CLANG_ENABLE_OBJC_ARC = YES;

scripts/build_android.sh

+5
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ fi
165165
# Use-specified CMake arguments go last to allow overridding defaults
166166
CMAKE_ARGS+=($@)
167167

168+
# Patch pocketfft (as Android does not have aligned_alloc even if compiled with c++17
169+
if [ -f third_party/pocketfft/pocketfft_hdronly.h ]; then
170+
sed -i -e "s/#if __cplusplus >= 201703L/#if 0/" third_party/pocketfft/pocketfft_hdronly.h
171+
fi
172+
168173
# Now, actually build the Android target.
169174
BUILD_ROOT=${BUILD_ROOT:-"$CAFFE2_ROOT/build_android"}
170175
INSTALL_PREFIX=${BUILD_ROOT}/install

test/custom_backend/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ endif()
99
find_package(Torch REQUIRED)
1010

1111
add_library(custom_backend SHARED custom_backend.cpp)
12-
set_property(TARGET custom_backend PROPERTY CXX_STANDARD 14)
12+
set_property(TARGET custom_backend PROPERTY CXX_STANDARD 17)
1313
target_link_libraries(custom_backend "${TORCH_LIBRARIES}")
1414

1515
add_executable(test_custom_backend test_custom_backend.cpp)
16-
set_property(TARGET test_custom_backend PROPERTY CXX_STANDARD 14)
16+
set_property(TARGET test_custom_backend PROPERTY CXX_STANDARD 17)
1717
target_link_libraries(test_custom_backend custom_backend)

test/custom_operator/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ endif()
99
find_package(Torch REQUIRED)
1010

1111
add_library(custom_ops SHARED op.cpp)
12-
set_property(TARGET custom_ops PROPERTY CXX_STANDARD 14)
12+
set_property(TARGET custom_ops PROPERTY CXX_STANDARD 17)
1313

1414
target_compile_features(custom_ops PUBLIC cxx_range_for)
1515
target_link_libraries(custom_ops "${TORCH_LIBRARIES}")
1616
target_compile_definitions(custom_ops PRIVATE custom_ops_EXPORTS)
1717

1818
add_executable(test_custom_ops test_custom_ops.cpp)
19-
set_property(TARGET test_custom_ops PROPERTY CXX_STANDARD 14)
19+
set_property(TARGET test_custom_ops PROPERTY CXX_STANDARD 17)
2020
target_link_libraries(test_custom_ops custom_ops)

test/jit_hooks/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ endif()
99
find_package(Torch REQUIRED)
1010

1111
add_executable(test_jit_hooks test_jit_hooks.cpp)
12-
set_property(TARGET test_jit_hooks PROPERTY CXX_STANDARD 14)
12+
set_property(TARGET test_jit_hooks PROPERTY CXX_STANDARD 17)
1313
target_link_libraries(test_jit_hooks "${TORCH_LIBRARIES}")

test/mobile/custom_build/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1)
22

33
project(custom_build_project)
44

5-
set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ standard whose features are requested to build this target.")
5+
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The C++ standard whose features are requested to build this target.")
66

77
# Find torch library
88
find_package(Torch REQUIRED)

torch/_inductor/codecache.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def get_warning_all_flag(warning_all=True):
329329

330330

331331
def cpp_flags():
332-
return "-std=c++14 -Wno-unused-variable"
332+
return "-std=c++17 -Wno-unused-variable"
333333

334334

335335
def optimization_flags():

torch/csrc/jit/codegen/cuda/executor_utils.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ std::pair<NvrtcFunction, std::string> nvrtcCompile(
10091009
});
10101010

10111011
#ifdef USE_ROCM
1012-
std::vector<const char*> args = {"--std=c++14"};
1012+
std::vector<const char*> args = {"--std=c++17"};
10131013
#if ROCM_VERSION >= 40200
10141014
args.push_back("-hip-pch");
10151015
#endif
@@ -1036,7 +1036,7 @@ std::pair<NvrtcFunction, std::string> nvrtcCompile(
10361036
std::to_string(minor);
10371037
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
10381038
std::vector<const char*> args = {
1039-
"--std=c++14", compute.c_str(), "-default-device"};
1039+
"--std=c++17", compute.c_str(), "-default-device"};
10401040
#endif
10411041

10421042
const bool disable_fma = isOptionDisabled(DisableOption::Fma);

torch/csrc/jit/codegen/fuser/cpu/fused_kernel.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static const std::string compile_string =
263263
#ifndef __PPC64__
264264
// "-march=native "
265265
#endif
266-
"-std=c++14 -fPIC ${fopenmp} -shared \"${cpp_file}\" -o \"${so_file}\" -lm";
266+
"-std=c++17 -fPIC ${fopenmp} -shared \"${cpp_file}\" -o \"${so_file}\" -lm";
267267
#endif
268268
static void runCompiler(
269269
const std::string& cpp_file,

torch/csrc/jit/codegen/fuser/cuda/fused_kernel.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ FusedKernelCUDA::FusedKernelCUDA(
127127
&program, code_.c_str(), nullptr, 0, nullptr, nullptr));
128128

129129
#if defined(USE_ROCM)
130-
std::vector<const char*> args = {"--std=c++14"};
130+
std::vector<const char*> args = {"--std=c++17"};
131131
#if ROCM_VERSION >= 40200
132132
args.push_back("-hip-pch");
133133
#endif
@@ -148,7 +148,7 @@ FusedKernelCUDA::FusedKernelCUDA(
148148
std::to_string(major) + std::to_string(minor);
149149
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
150150
const std::vector<const char*> args = {
151-
"--std=c++14", compute.c_str(), "-default-device"};
151+
"--std=c++17", compute.c_str(), "-default-device"};
152152
#endif
153153
const auto result =
154154
nvrtc().nvrtcCompileProgram(program, args.size(), args.data());

torch/csrc/jit/tensorexpr/cuda_codegen.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ void CudaCodeGen::CompileToNVRTC(
13141314
&program, code.c_str(), nullptr, 0, nullptr, nullptr));
13151315

13161316
#if defined(USE_ROCM)
1317-
std::vector<const char*> args = {"--std=c++14"};
1317+
std::vector<const char*> args = {"--std=c++17"};
13181318
#if ROCM_VERSION >= 40200
13191319
args.push_back("-hip-pch");
13201320
#endif
@@ -1335,7 +1335,7 @@ void CudaCodeGen::CompileToNVRTC(
13351335
std::to_string(major) + std::to_string(minor);
13361336
// NOLINTNEXTLINE(cppcoreguidelines-init-variables)
13371337
const std::vector<const char*> args = {
1338-
"--std=c++14", compute.c_str(), "-default-device"};
1338+
"--std=c++17", compute.c_str(), "-default-device"};
13391339
#endif
13401340

13411341
auto result = nvrtc().nvrtcCompileProgram(program, args.size(), args.data());

torch/lib/libshm/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ target_include_directories(shm PUBLIC
2929
set_target_properties(shm PROPERTIES
3030
PREFIX "lib"
3131
IMPORT_PREFIX "lib"
32-
CXX_STANDARD 14)
32+
CXX_STANDARD 17)
3333
target_link_libraries(shm PUBLIC torch)
3434

3535
if(UNIX AND NOT APPLE)

0 commit comments

Comments
 (0)