

#
#     Copyright (c) 2017, NVIDIA CORPORATION.  All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto.  Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
#

#
# just typing 'make' prints out this help message
#

.PHONY : step0 step1 step2 step3 step4 step5

help:
	@echo "To build and run a specific step, do the following:"
	@echo "    "
	@echo "make [NPROCS=n] [NTHREADS=n] step0   : Step 0: Evaluation"
	@echo "make [NPROCS=n] step1                : Step 1: Adding Setup Code"
	@echo "make [NPROCS=n] step2                : Step 2: Adding Compute Regions"
	@echo "make [NPROCS=n] step3                : Step 3: Adding Data Regions"
	@echo "make [NPROCS=n] step4                : Step 4: Optimizing Data Transfers"
	@echo "make [NPROCS=n] step5                : Step 5: Loop Schedule Tuning"
	@echo "    "
	@echo "NPROCS defaults to 2, NTHREADS defaults to 1"

NTHREADS=1
NPROCS=2

step0:
	cd step0; make build; make NPROCS=$(NPROCS) NTHREADS=$(NTHREADS) run; make verify; make clean

step1:
	cd step1; make build; make NPROCS=$(NPROCS) run; make verify; make clean

step2:
	cd step2; make build; make NPROCS=$(NPROCS) run; make verify; make clean

step3:
	cd step3; make build; make NPROCS=$(NPROCS) run; make verify; make clean

step4:
	cd step4; make build; make NPROCS=$(NPROCS) run; make verify; make clean

step5:
	cd step5; make build; make NPROCS=$(NPROCS) run; make verify; make clean

