2016-08-31 13:56:07 -05:00
|
|
|
HIP_PATH?= $(wildcard /opt/rocm/hip)
|
|
|
|
|
ifeq (,$(HIP_PATH))
|
|
|
|
|
HIP_PATH=../../..
|
|
|
|
|
endif
|
|
|
|
|
HIPCC=$(HIP_PATH)/bin/hipcc
|
2016-09-02 12:47:25 -05:00
|
|
|
OPT=
|
2016-09-01 15:11:12 +05:30
|
|
|
HIP_PLATFORM=$(shell $(HIP_PATH)/bin/hipconfig --compiler)
|
2016-08-31 13:56:07 -05:00
|
|
|
|
2016-09-04 12:35:08 +05:30
|
|
|
all: vcpy_kernel.compile runKernel.hip.out
|
|
|
|
|
|
|
|
|
|
runKernel.hip.out: runKernel.cpp
|
|
|
|
|
$(HIPCC) $(OPT) runKernel.cpp -o runKernel.hip.out
|
2016-09-01 10:39:14 -05:00
|
|
|
|
2016-09-04 12:35:08 +05:30
|
|
|
ifeq (${HIP_PLATFORM}, hcc)
|
2016-09-02 12:47:25 -05:00
|
|
|
|
2016-09-02 13:17:17 -05:00
|
|
|
vcpy_kernel.compile: vcpy_kernel.cpp
|
2016-09-04 12:35:08 +05:30
|
|
|
$(HIPCC) --genco --target-isa=fiji vcpy_kernel.cpp -o vcpy_kernel.co
|
2016-09-01 10:39:14 -05:00
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
rm -f *.co *.out
|
|
|
|
|
|
2016-09-01 15:11:12 +05:30
|
|
|
endif
|
2016-08-31 13:56:07 -05:00
|
|
|
|
2016-09-01 10:39:14 -05:00
|
|
|
ifeq (${HIP_PLATFORM}, nvcc)
|
2016-08-31 13:56:07 -05:00
|
|
|
|
2016-09-04 12:35:08 +05:30
|
|
|
vcpy_kernel.compile: vcpy_kernel.cpp
|
|
|
|
|
$(HIPCC) --genco vcpy_kernel.cpp -o vcpy_kernel.ptx
|
2016-09-01 10:39:14 -05:00
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
rm -f *.ptx *.out
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|