mirror of
https://github.com/AdaCore/cuda.git
synced 2026-02-12 13:05:54 -08:00
Device-side build artifacts need to be generated before compilation of the host side starts. Before the patch, the Makefile rules failed to meet that requirement, and things only worked when running make with a single job, i.e. with -j1. This patch tweaks the Makefile rules so that make is aware of the fact that the host side should only be compiled after the device side.
17 lines
559 B
Makefile
17 lines
559 B
Makefile
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|
SELF_DIR := $(dir $(mkfile_path))
|
|
|
|
include $(SELF_DIR)Makefile.env
|
|
|
|
CUDA_HOST=x86_64-linux
|
|
|
|
gnatcuda: host
|
|
|
|
host: device
|
|
# gprbuild currently doesn't pass ADA_INCLUDE_PATH to gnatbind. We need to
|
|
# set that manually so that cuda.ads can be found
|
|
export ADA_INCLUDE_PATH="$(SELF_DIR)api/host/cuda_raw_binding:$(SELF_DIR)/api/host/cuda_api:$(SELF_DIR)api/cuda_internal" ; \
|
|
gprbuild -Xcuda_host=$(CUDA_HOST) -P host -largs $(CURDIR)/lib/*.fatbin.o
|
|
|
|
device:
|
|
gprbuild -Xcuda_host=$(CUDA_HOST) -P device
|