From 65bcfe89e1fb0e8f385f1fdca59a14a57bc2c4ab Mon Sep 17 00:00:00 2001 From: Pedro Larroy Date: Tue, 20 Nov 2018 14:03:32 +0100 Subject: [PATCH] Add CPU C++ test stage and fix CPU ACTIVATION_PERF.ExecuteBidirectional --- Jenkinsfile | 16 ++++++++++++++-- ci/docker/runtime_functions.sh | 2 +- src/operator/nn/activation-inl.h | 7 +------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fca85395194a..3d93096f5ec8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -747,7 +747,7 @@ core_logic: { ws('workspace/ut-cpp-gpu') { timeout(time: max_time, unit: 'MINUTES') { utils.unpack_and_init('cmake_gpu', mx_cmake_lib, true) - utils.docker_run('ubuntu_gpu', 'unittest_ubuntu_gpu_cpp', true) + utils.docker_run('ubuntu_gpu', 'unittest_cpp', true) utils.publish_test_coverage() } } @@ -758,12 +758,24 @@ core_logic: { ws('workspace/ut-cpp-mkldnn-gpu') { timeout(time: max_time, unit: 'MINUTES') { utils.unpack_and_init('cmake_mkldnn_gpu', mx_cmake_mkldnn_lib, true) - utils.docker_run('ubuntu_gpu', 'unittest_ubuntu_gpu_cpp', true) + utils.docker_run('ubuntu_gpu', 'unittest_cpp', true) utils.publish_test_coverage() } } } }, + 'Cpp: CPU': { + node(NODE_LINUX_GPU) { + ws('workspace/ut-cpp-cpu') { + timeout(time: max_time, unit: 'MINUTES') { + utils.unpack_and_init('ubuntu_cpu', mx_cmake_lib_debug, true) + utils.docker_run('ubuntu_gpu', 'unittest_cpp', true) + utils.publish_test_coverage() + } + } + } + }, + 'R: CPU': { node(NODE_LINUX_CPU) { ws('workspace/ut-r-cpu') { diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index 39631f9dc7e6..6b005479d3ff 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -780,7 +780,7 @@ unittest_ubuntu_cpugpu_perl() { ./perl-package/test.sh } -unittest_ubuntu_gpu_cpp() { +unittest_cpp() { set -ex build/tests/mxnet_unit_tests } diff --git a/src/operator/nn/activation-inl.h b/src/operator/nn/activation-inl.h index 2705177f951d..6baccebd4772 100644 --- a/src/operator/nn/activation-inl.h +++ b/src/operator/nn/activation-inl.h @@ -199,13 +199,8 @@ void ActivationGradCompute(const nnvm::NodeAttrs& attrs, const std::vector& req, const std::vector& outputs) { const ActivationParam& param = nnvm::get(attrs.parsed); -#if (MXNET_USE_CUDNN == 1 || MXNET_USE_MKLDNN == 1) - bool relu = param.act_type == activation::kReLU; + const bool relu = param.act_type == activation::kReLU; CHECK_EQ(inputs.size(), relu ? 2U : 3U); -#else - bool softsign = param.act_type == activation::kSoftSign; - CHECK_EQ(inputs.size(), softsign ? 3U : 2U); -#endif CHECK_EQ(outputs.size(), 1U); CHECK_EQ(req.size(), 1U); ActivationGradComputeImpl(attrs, ctx, inputs, req, outputs);