da27fd2b09
1.Combine libamdhip64_static_base.a and libamdvdi_static.a into libamdhip64_static.a. 2.Let hipcc use -use-staticlib to link libamdhip64_static.a. 3.Add some samples for static lib. 4.Fix compiling failure of code object. Change-Id: Ic8c95228eb139058da8b5d66ba8439486154ca6f
28 строки
563 B
Makefile
28 строки
563 B
Makefile
HIP_PATH?= $(wildcard /opt/rocm/hip)
|
|
ifeq (,$(HIP_PATH))
|
|
HIP_PATH=../../..
|
|
endif
|
|
HIP_PLATFORM=$(shell $(HIP_PATH)/bin/hipconfig --platform)
|
|
HIPCC=$(HIP_PATH)/bin/hipcc
|
|
|
|
ifeq (${HIP_PLATFORM}, nvcc)
|
|
SOURCES=square.cu
|
|
else
|
|
SOURCES=square.cpp
|
|
endif
|
|
|
|
all: square.out square.out.static
|
|
|
|
# Step
|
|
square.cpp: square.cu
|
|
$(HIP_PATH)/bin/hipify-perl square.cu > square.cpp
|
|
|
|
square.out: $(SOURCES)
|
|
$(HIPCC) $(CXXFLAGS) $(SOURCES) -o $@
|
|
|
|
square.out.static: $(SOURCES)
|
|
$(HIPCC) -use-staticlib $(CXXFLAGS) $(SOURCES) -o $@
|
|
|
|
clean:
|
|
rm -f *.o *.out *.out.static square.cpp
|