Files
rocm-systems/samples/2_Cookbook/15_static_library/device_functions/Makefile
T
ansurya dc06edf44d SWDEV-287830 - Remove hardcoding of /opt/rocm path from hip samples (#2391)
Change-Id: I4ffcb4d5afe329377aca63ae0a962c1dc567bfd8
2021-11-25 15:10:15 +05:30

33 строки
674 B
Makefile

ROCM_PATH?= $(wildcard /opt/rocm/)
HIP_PATH?= $(wildcard $(ROCM_PATH)/hip)
ifeq (,$(HIP_PATH))
HIP_PATH=../../..
endif
HIPCC=$(HIP_PATH)/bin/hipcc
.PHONY: test
all: $(RDC_EXE) test
STATIC_LIB_SRC=hipDevice.cpp
STATIC_LIB=./libHipDevice.a
STATIC_MAIN_SRC=hipMain2.cpp
RDC_EXE=./test_device_static.out
$(STATIC_LIB):
$(HIPCC) $(STATIC_LIB_SRC) -c -fgpu-rdc -fPIC -o hipDevice.o
ar rcsD $@ hipDevice.o
# Compiles hipMain2 with hipcc and links with libHipDevice.a which contains device function.
$(RDC_EXE): $(STATIC_LIB)
$(HIPCC) $(STATIC_LIB) $(STATIC_MAIN_SRC) -fgpu-rdc -o $@
test: $(RDC_EXE)
$(RDC_EXE)
clean:
rm -f $(RDC_EXE)
rm -f $(STATIC_LIB)
rm -f *.o