Skip to content

Commit

Permalink
speed up GPU tests by avoiding device reset
Browse files Browse the repository at this point in the history
  • Loading branch information
upsj committed Mar 2, 2020
1 parent be79c28 commit 62e630f
Show file tree
Hide file tree
Showing 56 changed files with 215 additions and 14 deletions.
3 changes: 3 additions & 0 deletions cuda/test/base/cuda_executor.cu
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/exception_helpers.hpp>


#include "cuda/test/noreset.hpp"


namespace {


Expand Down
1 change: 1 addition & 0 deletions cuda/test/base/math.cu
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "cuda/base/math.hpp"
#include "cuda/base/types.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions cuda/test/components/cooperative_groups.cu
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "cuda/base/config.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions cuda/test/components/merging.cu
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "cuda/components/cooperative_groups.cuh"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
3 changes: 3 additions & 0 deletions cuda/test/components/prefix_sum.cu
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/array.hpp>


#include "cuda/test/noreset.hpp"


namespace {


Expand Down
1 change: 1 addition & 0 deletions cuda/test/components/searching.cu
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "cuda/components/cooperative_groups.cuh"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
3 changes: 3 additions & 0 deletions cuda/test/components/sorting.cu
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/executor.hpp>


#include "cuda/test/noreset.hpp"


namespace {


Expand Down
1 change: 1 addition & 0 deletions cuda/test/factorization/par_ilu_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"
#include "matrices/config.hpp"


Expand Down
1 change: 1 addition & 0 deletions cuda/test/matrix/coo_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions cuda/test/matrix/csr_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions cuda/test/matrix/dense_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
3 changes: 2 additions & 1 deletion cuda/test/matrix/ell_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <gtest/gtest.h>


#include <core/test/utils.hpp>
#include <ginkgo/core/base/exception.hpp>
#include <ginkgo/core/base/exception_helpers.hpp>
#include <ginkgo/core/base/executor.hpp>
Expand All @@ -48,6 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "core/matrix/ell_kernels.hpp"
#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
5 changes: 4 additions & 1 deletion cuda/test/matrix/hybrid_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <gtest/gtest.h>


#include <core/test/utils.hpp>
#include <ginkgo/core/base/exception.hpp>
#include <ginkgo/core/base/exception_helpers.hpp>
#include <ginkgo/core/base/executor.hpp>
#include <ginkgo/core/matrix/dense.hpp>
#include <ginkgo/core/matrix/hybrid.hpp>


#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {


Expand Down
3 changes: 2 additions & 1 deletion cuda/test/matrix/sellp_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <gtest/gtest.h>


#include <core/test/utils.hpp>
#include <ginkgo/core/base/exception.hpp>
#include <ginkgo/core/base/exception_helpers.hpp>
#include <ginkgo/core/base/executor.hpp>
Expand All @@ -48,6 +47,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "core/matrix/sellp_kernels.hpp"
#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
50 changes: 50 additions & 0 deletions cuda/test/noreset.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*******************************<GINKGO LICENSE>******************************
Copyright (c) 2017-2020, the Ginkgo authors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
******************************<GINKGO LICENSE>*******************************/

#ifndef GKO_CUDA_TEST_NORESET_HPP_
#define GKO_CUDA_TEST_NORESET_HPP_

#include <ginkgo/core/base/executor.hpp>


namespace {


// prevent device reset after each test
auto no_reset_exec =
gko::CudaExecutor::create(0, gko::ReferenceExecutor::create());


} // namespace


#endif // GKO_CUDA_TEST_NORESET_HPP_
5 changes: 4 additions & 1 deletion cuda/test/preconditioner/jacobi_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <random>


#include <core/test/utils.hpp>
#include <ginkgo/core/matrix/csr.hpp>
#include <ginkgo/core/matrix/dense.hpp>


#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {


Expand Down
1 change: 1 addition & 0 deletions cuda/test/solver/bicg_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "core/solver/bicg_kernels.hpp"
#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"
#include "matrices/config.hpp"


Expand Down
1 change: 1 addition & 0 deletions cuda/test/solver/bicgstab_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "core/solver/bicgstab_kernels.hpp"
#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions cuda/test/solver/cg_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "core/solver/cg_kernels.hpp"
#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions cuda/test/solver/cgs_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "core/solver/cgs_kernels.hpp"
#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions cuda/test/solver/fcg_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "core/solver/fcg_kernels.hpp"
#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions cuda/test/solver/gmres_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "core/solver/gmres_kernels.hpp"
#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions cuda/test/solver/ir_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "core/solver/ir_kernels.hpp"
#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions cuda/test/solver/lower_trs_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "core/solver/lower_trs_kernels.hpp"
#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions cuda/test/solver/upper_trs_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "core/solver/upper_trs_kernels.hpp"
#include "core/test/utils.hpp"
#include "cuda/test/noreset.hpp"


namespace {
Expand Down
3 changes: 3 additions & 0 deletions cuda/test/stop/criterion_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <gtest/gtest.h>


#include "cuda/test/noreset.hpp"


namespace {


Expand Down
3 changes: 3 additions & 0 deletions cuda/test/stop/residual_norm_reduction_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <gtest/gtest.h>


#include "cuda/test/noreset.hpp"


namespace {


Expand Down
3 changes: 3 additions & 0 deletions cuda/test/utils/assertions_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/matrix/dense.hpp>


#include "cuda/test/noreset.hpp"


namespace {


Expand Down
3 changes: 3 additions & 0 deletions hip/test/base/hip_executor.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/exception_helpers.hpp>


#include "hip/test/noreset.hip.hpp"


namespace {


Expand Down
1 change: 1 addition & 0 deletions hip/test/base/math.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "hip/base/math.hip.hpp"
#include "hip/base/types.hip.hpp"
#include "hip/test/noreset.hip.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions hip/test/components/cooperative_groups.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include "core/test/utils.hpp"
#include "hip/base/types.hip.hpp"
#include "hip/test/noreset.hip.hpp"


namespace {
Expand Down
1 change: 1 addition & 0 deletions hip/test/components/merging.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "hip/components/cooperative_groups.hip.hpp"
#include "hip/test/noreset.hip.hpp"


namespace {
Expand Down
3 changes: 3 additions & 0 deletions hip/test/components/prefix_sum.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/array.hpp>


#include "hip/test/noreset.hip.hpp"


namespace {


Expand Down
1 change: 1 addition & 0 deletions hip/test/components/searching.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "hip/components/cooperative_groups.hip.hpp"
#include "hip/test/noreset.hip.hpp"


namespace {
Expand Down
3 changes: 3 additions & 0 deletions hip/test/components/sorting.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/base/executor.hpp>


#include "hip/test/noreset.hip.hpp"


namespace {


Expand Down
1 change: 1 addition & 0 deletions hip/test/factorization/par_ilu_kernels.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "core/test/utils.hpp"
#include "hip/test/noreset.hip.hpp"
#include "matrices/config.hpp"


Expand Down
1 change: 1 addition & 0 deletions hip/test/matrix/coo_kernels.hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#include "core/test/utils.hpp"
#include "hip/test/noreset.hip.hpp"


namespace {
Expand Down
Loading

0 comments on commit 62e630f

Please sign in to comment.