Skip to content

Commit 6e026cb

Browse files
committed
Added flag -export-dynamic in the host compilation. If the host code is compiled with this flag, the function names are displayed in the profiler time-lines.
1 parent 2ea2403 commit 6e026cb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

posts/nvtx/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ BINARIES=manual_nvtx compiler_inst_nvtx
3333
all: $(BINARIES)
3434

3535
inst_nvtx.o: inst_nvtx.cpp Makefile
36-
g++ -fPIC -I${CUDA_ROOT}/include -c inst_nvtx.cpp
36+
g++ -export-dynamic -fPIC -I${CUDA_ROOT}/include -c inst_nvtx.cpp
3737

3838
manual_nvtx: manual_nvtx.cu Makefile
39-
nvcc -DUSE_NVTX -arch=sm_20 -lnvToolsExt -o manual_nvtx manual_nvtx.cu
39+
nvcc -Xcompiler -export-dynamic -DUSE_NVTX -arch=sm_20 -lnvToolsExt -o manual_nvtx manual_nvtx.cu
4040

41-
compiler_inst_nvtx: compiler_inst_nvtx.cu Makefile inst_nvtx.o
42-
nvcc -Xcompiler -fPIC -Xcompiler -finstrument-functions -arch=sm_20 inst_nvtx.o -ldl -lnvToolsExt -o compiler_inst_nvtx compiler_inst_nvtx.cu
41+
compiler_inst_nvtx: compiler_inst_nvtx1.cu Makefile inst_nvtx.o
42+
nvcc -G -Xcompiler -export-dynamic -Xcompiler -fPIC -Xcompiler -finstrument-functions -arch=sm_20 inst_nvtx.o -ldl -lnvToolsExt -o compiler_inst_nvtx compiler_inst_nvtx1.cu
4343

4444
clean:
4545
rm -f *.o $(BINARIES)

0 commit comments

Comments
 (0)