CUDA: enable option for F16 with LLAMA_HIPBLAS

This commit is contained in:
Aaryaman Vasishta 2023-09-09 04:30:12 +09:00
parent ec2a24fedf
commit 89595ff4e5
2 changed files with 7 additions and 0 deletions

View file

@ -392,6 +392,10 @@ if (LLAMA_HIPBLAS)
set_source_files_properties(ggml-cuda.cu PROPERTIES LANGUAGE CXX)
target_link_libraries(ggml-rocm PRIVATE hip::device PUBLIC hip::host roc::rocblas roc::hipblas)
if (LLAMA_CUDA_F16)
add_compile_definitions(GGML_CUDA_F16)
endif()
if (LLAMA_STATIC)
message(FATAL_ERROR "Static linking not supported for HIP/ROCm")
endif()

View file

@ -412,6 +412,9 @@ ifdef LLAMA_HIPBLAS
ifdef LLAMA_CUDA_FORCE_DMMV
HIPFLAGS += -DGGML_CUDA_FORCE_DMMV
endif # LLAMA_CUDA_FORCE_DMMV
ifdef LLAMA_CUDA_F16
HIPFLAGS += -DGGML_CUDA_F16
endif # LLAMA_CUDA_F16
OBJS += ggml-cuda.o
ggml-cuda.o: ggml-cuda.cu ggml-cuda.h
$(HIPCC) $(CXXFLAGS) $(HIPFLAGS) -x hip -c -o $@ $<