Skip to content

Commit 29246e9

Browse files
authored
Update create_op.md
Update to C++14 (needed for TensorFlow 2.7) from c++11
1 parent 629c0f2 commit 29246e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

site/en/guide/create_op.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ to compile your op into a dynamic library.
354354
```bash
355355
TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') )
356356
TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') )
357-
g++ -std=c++11 -shared zero_out.cc -o zero_out.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2
357+
g++ -std=c++14 -shared zero_out.cc -o zero_out.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2
358358
```
359359

360360
On macOS, the additional flag "-undefined dynamic_lookup" is required when
@@ -1285,10 +1285,10 @@ and
12851285
into a single dynamically loadable library:
12861286
12871287
```bash
1288-
nvcc -std=c++11 -c -o cuda_op_kernel.cu.o cuda_op_kernel.cu.cc \
1288+
nvcc -std=c++14 -c -o cuda_op_kernel.cu.o cuda_op_kernel.cu.cc \
12891289
${TF_CFLAGS[@]} -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC
12901290
1291-
g++ -std=c++11 -shared -o cuda_op_kernel.so cuda_op_kernel.cc \
1291+
g++ -std=c++14 -shared -o cuda_op_kernel.so cuda_op_kernel.cc \
12921292
cuda_op_kernel.cu.o ${TF_CFLAGS[@]} -fPIC -lcudart ${TF_LFLAGS[@]}
12931293
```
12941294

0 commit comments

Comments
 (0)