From 10b0a7f02dfdbe3efac9b7bb38669e866af9eb2d Mon Sep 17 00:00:00 2001 From: "E.S. Rosenberg a.k.a. Keeper of the Keys" Date: Wed, 18 Jun 2025 14:19:24 +0300 Subject: [PATCH 1/2] Switch to C++17 instead of C++11 which is incompatible with tensorflow. Signed-off-by: E.S. Rosenberg a.k.a. Keeper of the Keys --- CMakeLists.txt | 4 ++-- pydiffvg_tensorflow/custom_ops/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 233e4be1..a16e7a3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ if(DIFFVG_CUDA) set(CMAKE_CUDA_STANDARD 11) if(NOT WIN32) # Hack: for some reason the line above doesn't work on some Linux systems. - set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11") + set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++17") #set(CUDA_NVCC_FLAGS_DEBUG "-g -G") endif() else() @@ -118,7 +118,7 @@ elseif(APPLE) set_target_properties(diffvg PROPERTIES INSTALL_RPATH "@loader_path") endif() -set_property(TARGET diffvg PROPERTY CXX_STANDARD 11) +set_property(TARGET diffvg PROPERTY CXX_STANDARD 17) set_target_properties(diffvg PROPERTIES PREFIX "") # Still enable assertion in release mode string( REPLACE "/DNDEBUG" "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") diff --git a/pydiffvg_tensorflow/custom_ops/CMakeLists.txt b/pydiffvg_tensorflow/custom_ops/CMakeLists.txt index e15c953c..ab4c2728 100644 --- a/pydiffvg_tensorflow/custom_ops/CMakeLists.txt +++ b/pydiffvg_tensorflow/custom_ops/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.12) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) project(diffvgTFCustomOp) From 01e67a83ca09df277d184e1980dc5c5a129c206f Mon Sep 17 00:00:00 2001 From: "E.S. Rosenberg a.k.a. Keeper of the Keys" Date: Wed, 18 Jun 2025 14:22:10 +0300 Subject: [PATCH 2/2] Fix status api call, Status::OK() was replaced with Status() Signed-off-by: E.S. Rosenberg a.k.a. Keeper of the Keys --- pydiffvg_tensorflow/custom_ops/data_ptr.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydiffvg_tensorflow/custom_ops/data_ptr.cc b/pydiffvg_tensorflow/custom_ops/data_ptr.cc index cb3caff3..48729ed7 100644 --- a/pydiffvg_tensorflow/custom_ops/data_ptr.cc +++ b/pydiffvg_tensorflow/custom_ops/data_ptr.cc @@ -27,7 +27,7 @@ REGISTER_OP("DataPtr") .Output("output: uint64") // scalar .SetShapeFn([](::tensorflow::shape_inference::InferenceContext* c) { c->set_output(0, {}); // scalar - return Status::OK(); + return Status(); }); template