Commit fa232720 by Aditya Atluri Committed by Tianqi Chen

changed makefile to build rocm backend (#355)

parent fa53dbdf
......@@ -27,6 +27,7 @@ CC_SRC = $(filter-out src/contrib/%.cc src/runtime/%.cc,\
$(wildcard src/*/*.cc src/*/*/*.cc))
METAL_SRC = $(wildcard src/runtime/metal/*.mm)
CUDA_SRC = $(wildcard src/runtime/cuda/*.cc)
ROCM_SRC = $(wildcard src/runtime/rocm/*.cc)
OPENCL_SRC = $(wildcard src/runtime/opencl/*.cc)
RPC_SRC = $(wildcard src/runtime/rpc/*.cc)
RUNTIME_SRC = $(wildcard src/runtime/*.cc)
......@@ -34,6 +35,7 @@ RUNTIME_SRC = $(wildcard src/runtime/*.cc)
# Objectives
METAL_OBJ = $(patsubst src/%.mm, build/%.o, $(METAL_SRC))
CUDA_OBJ = $(patsubst src/%.cc, build/%.o, $(CUDA_SRC))
ROCM_OBJ = $(patsubst src/%.cc, build/%.o, $(ROCM_SRC))
OPENCL_OBJ = $(patsubst src/%.cc, build/%.o, $(OPENCL_SRC))
RPC_OBJ = $(patsubst src/%.cc, build/%.o, $(RPC_SRC))
CC_OBJ = $(patsubst src/%.cc, build/%.o, $(CC_SRC))
......@@ -71,6 +73,19 @@ else
CFLAGS += -DTVM_CUDA_RUNTIME=0
endif
ifdef ROCM_PATH
CFLAGS += -I$(ROCM_PATH)/hip/include
LDFLAGS += -L$(ROCM_PATH)/hip/lib
endif
ifeq ($(USE_ROCM), 1)
CFLAGS += -DTVM_ROCM_RUNTIME=1
LDFLAGS += -lhip_hcc
RUNTIME_DEP += $(ROCM_OBJ)
else
CFLAGS += -DTVM_ROCM_RUNTIME=0
endif
ifeq ($(USE_OPENCL), 1)
CFLAGS += -DTVM_OPENCL_RUNTIME=1
ifeq ($(UNAME_S), Darwin)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment