Skip to content

Commit

Permalink
squash! Update build scripts to always run tests for all MXNet engine…
Browse files Browse the repository at this point in the history
… types
  • Loading branch information
joseph-wakeling-sociomantic committed Jun 21, 2018
1 parent 62e2506 commit 201fe10
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
32 changes: 22 additions & 10 deletions Build.mak
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,34 @@ download-mnist: $C/script/download-mnist
# helper function to run tests
run_test = $(call exec,MXNET_ENGINE_TYPE=$2 $1,$1,$2)

# helper template to define targets for per-engine test runs
define run_test_with_engine
$(1).stamp: $(1)-$(2).stamp

$(1)-$(2).stamp: $1
$(call exec,MXNET_ENGINE_TYPE=$2 $1,$1,$2)
endef

# helper function to generate targets for per-engine test runs
test_with_engines = $(foreach engine,$2,\
$(eval $(call run_test_with_engine,$1,$(engine))))

# extra build dependencies for integration tests
$O/test-mxnet: override LDFLAGS += -lz
$O/test-mxnet: override DFLAGS += -debug=MXNetHandleManualFree

# run integration tests with all specified engines
$(eval $(call test_with_engines,$O/test-mxnet,$(TEST_MXNET_ENGINES)))

# extra runtime dependencies for integration tests
$O/test-mxnet.stamp: override ITFLAGS += $(MNIST_DATA_DIR)
$O/test-mxnet.stamp: $O/test-mxnet download-mnist
$(call run_test,$<,NaiveEngine)
$(call run_test,$<,ThreadedEngine)
$(call run_test,$<,ThreadedEnginePerDevice)
$Vtouch $@
$O/test-mxnet.stamp: download-mnist
$Vtouch $@ # override default implementation

$O/%unittests: override LDFLAGS += -lz

$O/allunittests.stamp: $O/allunittests
$(call run_test,$<,NaiveEngine)
$(call run_test,$<,ThreadedEngine)
$(call run_test,$<,ThreadedEnginePerDevice)
$Vtouch $@
# run unittests with all specified engines
$(eval $(call test_with_engines,$O/allunittests,$(TEST_MXNET_ENGINES)))

$O/allunittests.stamp:
$Vtouch $@ # override default implementation
2 changes: 2 additions & 0 deletions Config.mak
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
INTEGRATIONTEST := integrationtest

TEST_MXNET_ENGINES ?= NaiveEngine ThreadedEngine ThreadedEnginePerDevice

MXNET_ENGINE_TYPE ?= NaiveEngine
export MXNET_ENGINE_TYPE

Expand Down

0 comments on commit 201fe10

Please sign in to comment.