changed makefile to build rocm backend (#355)
This commit is contained in:
Родитель
fa53dbdf75
Коммит
fa232720d0
15
Makefile
15
Makefile
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче