Skip to content

Commit

Permalink
cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Applencourt authored and Thomas Applencourt committed Oct 22, 2024
1 parent 41ee67a commit fc422c9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 33 deletions.
52 changes: 20 additions & 32 deletions cuda/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -280,46 +280,34 @@ libcudarttracepoints_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/i
libcudarttracepoints_la_CFLAGS = $(LTTNG_UST_CFLAGS)
libcudarttracepoints_la_LDFLAGS = $(LTTNG_UST_LIBS)

lib_LTLIBRARIES = libTracerCUDA.la libTracerCUDART.la libCUDAInterval.la
cudadir = $(pkglibdir)/cuda
cuda_LTLIBRARIES = libcuda.la

nodist_libTracerCUDA_la_SOURCES = \
cudartdir = $(pkglibdir)/cudart
cudart_LTLIBRARIES = libcudart.la

bt2dir = $(pkglibdir)/bt2
bt2_LTLIBRARIES = libCUDAInterval.la

nodist_libcuda_la_SOURCES = \
$(CUDA_PROBES_INCL) \
tracer_cuda.c

libTracerCUDA_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(top_srcdir)/sampling -I$(srcdir)/include -I./
libTracerCUDA_la_CFLAGS = -Wall -Wextra $(WERROR) $(LIBFFI_CFLAGS) $(LTTNG_UST_CFLAGS)
libTracerCUDA_la_LDFLAGS = $(LTTNG_UST_LIBS) -ldl -lpthread $(LIBFFI_LIBS) ../sampling/libThapiSampling.la
libTracerCUDA_la_LDFLAGS += -version-info 1:0:0
libTracerCUDA_la_LIBADD = libcudatracepoints.la
libcuda_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(top_srcdir)/sampling -I$(srcdir)/include -I./
libcuda_la_CFLAGS = -Wall -Wextra $(WERROR) $(LIBFFI_CFLAGS) $(LTTNG_UST_CFLAGS)
libcuda_la_LDFLAGS = $(LTTNG_UST_LIBS) -ldl -lpthread $(LIBFFI_LIBS) ../sampling/libThapiSampling.la
libcuda_la_LDFLAGS += -version-info 1:0:0
libcuda_la_LIBADD = libcudatracepoints.la

nodist_libTracerCUDART_la_SOURCES = \
nodist_libcudart_la_SOURCES = \
$(CUDART_PROBES_INCL) \
tracer_cudart.c

libTracerCUDART_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(top_srcdir)/sampling -I$(srcdir)/include -I./
libTracerCUDART_la_CFLAGS = -Wall -Wextra $(WERROR) $(LIBFFI_CFLAGS) $(LTTNG_UST_CFLAGS)
libTracerCUDART_la_LDFLAGS = $(LTTNG_UST_LIBS) -ldl -lpthread $(LIBFFI_LIBS) ../sampling/libThapiSampling.la
libTracerCUDART_la_LDFLAGS += -version-number 12:1:55 -Wl,--version-script,tracer_cudart.map
libTracerCUDART_la_LIBADD = libcudarttracepoints.la

install-exec-hook:
$(MKDIR_P) $(DESTDIR)$(pkglibdir)/cudart
$(MKDIR_P) $(DESTDIR)$(pkglibdir)/cuda
$(LN_S) -f $(DESTDIR)$(libdir)/libTracerCUDART.so.12.1.55 $(DESTDIR)$(pkglibdir)/cudart/libcudart.so.12
$(LN_S) -f $(DESTDIR)$(pkglibdir)/cudart/libcudart.so.12 $(DESTDIR)$(pkglibdir)/cudart/libcudart.so
$(LN_S) -f $(DESTDIR)$(libdir)/libTracerCUDA.so.1.0.0 $(DESTDIR)$(pkglibdir)/cuda/libcuda.so.1
$(LN_S) -f $(DESTDIR)$(pkglibdir)/cuda/libcuda.so.1 $(DESTDIR)$(pkglibdir)/cuda/libcuda.so
$(MKDIR_P) $(DESTDIR)$(pkglibdir)/bt2
$(LN) -f $(DESTDIR)$(libdir)/libCUDAInterval.so $(DESTDIR)$(pkglibdir)/bt2/libCUDAInterval.so


uninstall-hook:
$(RM) -f $(DESTDIR)$(pkglibdir)/cudart/libcudart.so.12 $(DESTDIR)$(pkglibdir)/cudart/libcudart.so
$(RM) -f $(DESTDIR)$(pkglibdir)/cuda/libcuda.so.1 $(DESTDIR)$(pkglibdir)/cuda/libcuda.so
-rmdir $(DESTDIR)$(pkglibdir)/cudart
-rmdir $(DESTDIR)$(pkglibdir)/cuda
$(RM) -f $(DESTDIR)$(pkglibdir)/bt2/libCUDAInterval.so
-rmdir $(DESTDIR)$(pkglibdir)/bt2
libcudart_la_CPPFLAGS = -I$(top_srcdir)/utils -I$(top_srcdir)/utils/include -I$(top_srcdir)/sampling -I$(srcdir)/include -I./
libcudart_la_CFLAGS = -Wall -Wextra $(WERROR) $(LIBFFI_CFLAGS) $(LTTNG_UST_CFLAGS)
libcudart_la_LDFLAGS = $(LTTNG_UST_LIBS) -ldl -lpthread $(LIBFFI_LIBS) ../sampling/libThapiSampling.la
libcudart_la_LDFLAGS += -version-number 12:1:55 -Wl,--version-script,tracer_cudart.map
libcudart_la_LIBADD = libcudarttracepoints.la

tmplibdir = $(libdir)/tmp
install-data-hook:
Expand Down
2 changes: 1 addition & 1 deletion xprof/xprof.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def env_tracers

[%w[opencl cl libOpenCL] + [File.join(LIBDIR,'libTracerOpenCL.so')],
%w[ze ze libze_loader] + [File.join(PKGLIBDIR,'ze','libze_loader.so')],
%w[cuda cuda libcud] + [File.join(LIBDIR,'libTracerCUDA.so')],
%w[cuda cuda libcud] + [File.join(PKGLIBDIR,'cuda','libcuda.so')],
%w[hip hip libamdhip64] + [File.join(LIBDIR,'libTracerHIP.so')],
%w[mpi mpi libmpi] + [File.join(LIBDIR,'libTracerMPI.so')]].each do |name, bt_name, lib, libtracer|
# Backend requested, skip omp. It will be handled in a custom case bellow
Expand Down

0 comments on commit fc422c9

Please sign in to comment.