From 9e9f0c77c6c2ddc41097fa7a5f20ee3040ec9830 Mon Sep 17 00:00:00 2001 From: Terry Cojean Date: Mon, 31 Aug 2020 12:09:47 +0200 Subject: [PATCH 0001/1008] Update the published JOSS information. --- CITING.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CITING.md b/CITING.md index 02fcec9cf13..da08593eafe 100644 --- a/CITING.md +++ b/CITING.md @@ -23,11 +23,14 @@ The Ginkgo software itself was reviewed and has a paper published in the Journal of Open Source Software, which can be cited with the following reference: ```bibtex -@article{Joss2020, - doi = {10.21105.joss.02260}, +@article{GinkgoJoss2020, + doi = {10.21105/joss.02260}, url = {https://doi.org/10.21105/joss.02260}, year = {2020}, publisher = {The Open Journal}, + volume = {5}, + number = {52}, + pages = {2260}, author = {Hartwig Anzt and Terry Cojean and Yen-Chen Chen and Goran Flegar and Fritz G\"{o}bel and Thomas Gr\"{u}tzmacher and Pratik Nayak and Tobias Ribizel and Yu-Hsiang Tsai}, title = {Ginkgo: A high performance numerical linear algebra library}, journal = {Journal of Open Source Software} From ab7543d35c909e133470dc1bcd3c805be049d538 Mon Sep 17 00:00:00 2001 From: Terry Cojean Date: Mon, 31 Aug 2020 12:14:04 +0200 Subject: [PATCH 0002/1008] Add A100 performance paper. --- CITING.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/CITING.md b/CITING.md index da08593eafe..1ccaf82fdef 100644 --- a/CITING.md +++ b/CITING.md @@ -71,7 +71,7 @@ series = {PASC ’19} } ``` -### On SpMV performance +### On SpMV or solvers performance ``` bibtex @InProceedings{tsai2020amdspmv, @@ -92,7 +92,6 @@ abstract="Efficiently processing sparse matrices is a central and performance-cr isbn="978-3-030-50743-5" } - @article{anzt2020spmv, author = {Anzt, Hartwig and Cojean, Terry and Yen-Chen, Chen and Dongarra, Jack and Flegar, Goran and Nayak, Pratik and Tomov, Stanimire and Tsai, Yuhsiang M. and Wang, Weichung}, title = {Load-Balancing Sparse Matrix Vector Product Kernels on GPUs}, @@ -112,3 +111,14 @@ numpages = {26}, keywords = {irregular matrices, GPUs, Sparse Matrix Vector Product (SpMV)} } ``` + +```bibtex +@misc{tsai2020evaluating, + title={Evaluating the Performance of NVIDIA's A100 Ampere GPU for Sparse Linear Algebra Computations}, + author={Yuhsiang Mike Tsai and Terry Cojean and Hartwig Anzt}, + year={2020}, + eprint={2008.08478}, + archivePrefix={arXiv}, + primaryClass={cs.MS} +} +``` From 6a1075b25182542b2a45fc9255dde75a95c199df Mon Sep 17 00:00:00 2001 From: Terry Cojean Date: Tue, 1 Sep 2020 09:04:41 +0200 Subject: [PATCH 0003/1008] Add a badge for the JOSS paper. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a545ef04def..9e54903a92e 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ [![Documentation](https://img.shields.io/badge/Documentation-latest-blue.svg)](https://ginkgo-project.github.io/ginkgo/doc/master/) [![License](https://img.shields.io/github/license/ginkgo-project/ginkgo.svg)](./LICENSE) [![c++ standard](https://img.shields.io/badge/c%2B%2B-14-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) +[![DOI](https://joss.theoj.org/papers/10.21105/joss.02260/status.svg)](https://doi.org/10.21105/joss.02260) Ginkgo is a high-performance linear algebra library for manycore systems, with a focus on sparse solution of linear systems. It is implemented using modern C++ From 2017daddca62fabc5347d0b88400b625f86b5f22 Mon Sep 17 00:00:00 2001 From: Tobias Ribizel Date: Mon, 14 Sep 2020 15:17:44 +0200 Subject: [PATCH 0004/1008] fix add_subdirectory builds for Ginkgo Currently, we often use CMAKE_SOURCE_DIR instead of the preferred PROJECT_SOURCE_DIR (relative to the last project() call) or CMAKE_CURRENT_SOURCE_DIR (relative to the current CMakeLists.txt) This causes issues when Ginkgo is built as a subdirectory instead of installing it. --- CMakeLists.txt | 6 +++--- cmake/Modules/FindPAPI.cmake | 6 +++--- cmake/get_info.cmake | 6 +++--- core/test/CMakeLists.txt | 2 +- cuda/test/CMakeLists.txt | 2 +- doc/conf/Doxyfile.in | 2 +- doc/examples/CMakeLists.txt | 40 +++++++++++++++++------------------ doc/helpers.cmake | 6 +++--- hip/test/CMakeLists.txt | 2 +- omp/test/CMakeLists.txt | 2 +- reference/test/CMakeLists.txt | 2 +- 11 files changed, 38 insertions(+), 38 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e75f7d61fcc..7462fe9f766 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,7 @@ if(GINKGO_WITH_IWYU) find_program(GINKGO_IWYU_PATH iwyu) endif() -list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules/") +list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/Modules/") # Find important header files, store the definitions in include/ginkgo/config.h.in # For details, see https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/How-To-Write-Platform-Checks @@ -311,8 +311,8 @@ include(CPack) # And finally, print the configuration to screen: # if(GINKGO_CONFIG_LOG_DETAILED) - FILE(READ ${CMAKE_BINARY_DIR}/detailed.log GINKGO_LOG_SUMMARY) + FILE(READ ${PROJECT_BINARY_DIR}/detailed.log GINKGO_LOG_SUMMARY) else() - FILE(READ ${CMAKE_BINARY_DIR}/minimal.log GINKGO_LOG_SUMMARY) + FILE(READ ${PROJECT_BINARY_DIR}/minimal.log GINKGO_LOG_SUMMARY) endif() MESSAGE("${GINKGO_LOG_SUMMARY}") diff --git a/cmake/Modules/FindPAPI.cmake b/cmake/Modules/FindPAPI.cmake index 3e16af2e125..c2648c252fb 100644 --- a/cmake/Modules/FindPAPI.cmake +++ b/cmake/Modules/FindPAPI.cmake @@ -70,7 +70,7 @@ if(PAPI_INCLUDE_DIR) # find the components enable_language(C) foreach(component IN LISTS PAPI_FIND_COMPONENTS) - file(WRITE "${CMAKE_BINARY_DIR}/papi_${component}_detect.c" + file(WRITE "${PROJECT_BINARY_DIR}/papi_${component}_detect.c" " #include int main() { @@ -85,8 +85,8 @@ if(PAPI_INCLUDE_DIR) ) try_run(PAPI_${component}_FOUND gko_result_unused - "${CMAKE_BINARY_DIR}" - "${CMAKE_BINARY_DIR}/papi_${component}_detect.c" + "${PROJECT_BINARY_DIR}" + "${PROJECT_BINARY_DIR}/papi_${component}_detect.c" LINK_LIBRARIES ${PAPI_LIBRARY} ) diff --git a/cmake/get_info.cmake b/cmake/get_info.cmake index 0860d5c03e9..f4773be50bd 100644 --- a/cmake/get_info.cmake +++ b/cmake/get_info.cmake @@ -1,5 +1,5 @@ -SET(detailed_log "${CMAKE_BINARY_DIR}/detailed.log") -SET(minimal_log "${CMAKE_BINARY_DIR}/minimal.log") +SET(detailed_log "${PROJECT_BINARY_DIR}/detailed.log") +SET(minimal_log "${PROJECT_BINARY_DIR}/minimal.log") FILE(REMOVE ${detailed_log} ${minimal_log}) MACRO(_both) @@ -89,7 +89,7 @@ set(log_types "detailed_log;minimal_log") foreach(log_type ${log_types}) ginkgo_print_module_footer(${${log_type}} "Ginkgo configuration:") set(print_var - "CMAKE_BUILD_TYPE;BUILD_SHARED_LIBS;CMAKE_INSTALL_PREFIX;CMAKE_SOURCE_DIR;CMAKE_BINARY_DIR" + "CMAKE_BUILD_TYPE;BUILD_SHARED_LIBS;CMAKE_INSTALL_PREFIX;PROJECT_SOURCE_DIR;PROJECT_BINARY_DIR" ) foreach(var ${print_var}) ginkgo_print_variable(${${log_type}} ${var} ) diff --git a/core/test/CMakeLists.txt b/core/test/CMakeLists.txt index f0e39d5c568..473d7005d27 100644 --- a/core/test/CMakeLists.txt +++ b/core/test/CMakeLists.txt @@ -1,4 +1,4 @@ -include(${CMAKE_SOURCE_DIR}/cmake/create_test.cmake) +include(${PROJECT_SOURCE_DIR}/cmake/create_test.cmake) add_subdirectory(base) add_subdirectory(factorization) diff --git a/cuda/test/CMakeLists.txt b/cuda/test/CMakeLists.txt index 5b180f32c11..af845cb4c2a 100644 --- a/cuda/test/CMakeLists.txt +++ b/cuda/test/CMakeLists.txt @@ -1,4 +1,4 @@ -include(${CMAKE_SOURCE_DIR}/cmake/create_test.cmake) +include(${PROJECT_SOURCE_DIR}/cmake/create_test.cmake) add_subdirectory(base) add_subdirectory(components) diff --git a/doc/conf/Doxyfile.in b/doc/conf/Doxyfile.in index d3442212a21..4ec815c0164 100644 --- a/doc/conf/Doxyfile.in +++ b/doc/conf/Doxyfile.in @@ -12,7 +12,7 @@ INPUT = INCLUDE_PATH = @DIR_BASE@/include @DIR_BASE@ OUTPUT_DIRECTORY = @DIR_OUT@ -EXAMPLE_PATH = @CMAKE_BINARY_DIR@/doc/examples +EXAMPLE_PATH = @PROJECT_BINARY_DIR@/doc/examples RECURSIVE = YES EXAMPLE_RECURSIVE = NO FILE_PATTERNS = *.cpp *.cu *.hpp *.cuh *.md diff --git a/doc/examples/CMakeLists.txt b/doc/examples/CMakeLists.txt index bc256aac6c6..0bc282197b5 100644 --- a/doc/examples/CMakeLists.txt +++ b/doc/examples/CMakeLists.txt @@ -1,32 +1,32 @@ # Collect all of the directory names for the examples programs FILE(GLOB _ginkgo_examples - ${CMAKE_SOURCE_DIR}/examples/* + ${PROJECT_SOURCE_DIR}/examples/* ) -LIST(REMOVE_ITEM _ginkgo_examples "${CMAKE_SOURCE_DIR}/examples/CMakeLists.txt" "${CMAKE_SOURCE_DIR}/examples/build-setup.sh") +LIST(REMOVE_ITEM _ginkgo_examples "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt" "${PROJECT_SOURCE_DIR}/examples/build-setup.sh") ADD_CUSTOM_TARGET(examples) file(GLOB _ginkgo_examples_tooltip - ${CMAKE_SOURCE_DIR}/examples/*/doc/tooltip + ${PROJECT_SOURCE_DIR}/examples/*/doc/tooltip ) file(GLOB _ginkgo_examples_kind - ${CMAKE_SOURCE_DIR}/examples/*/doc/kind + ${PROJECT_SOURCE_DIR}/examples/*/doc/kind ) file(GLOB _ginkgo_examples_buildson - ${CMAKE_SOURCE_DIR}/examples/*/doc/builds-on + ${PROJECT_SOURCE_DIR}/examples/*/doc/builds-on ) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/examples.hpp COMMAND ${PERL_EXECUTABLE} ARGS - ${CMAKE_SOURCE_DIR}/doc/scripts/examples.pl + ${PROJECT_SOURCE_DIR}/doc/scripts/examples.pl ${CMAKE_CURRENT_SOURCE_DIR}/examples.hpp.in ${_ginkgo_examples} > ${CMAKE_CURRENT_BINARY_DIR}/examples.hpp DEPENDS - ${CMAKE_SOURCE_DIR}/doc/scripts/examples.pl + ${PROJECT_SOURCE_DIR}/doc/scripts/examples.pl ${CMAKE_CURRENT_SOURCE_DIR}/examples.hpp.in ${_ginkgo_examples_tooltip} ${_ginkgo_examples_kind} @@ -49,12 +49,12 @@ FOREACH(example ${_ginkgo_examples}) OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${example}.cpp COMMAND ${PERL_EXECUTABLE} ARGS - ${CMAKE_SOURCE_DIR}/doc/scripts/program2plain - < ${CMAKE_SOURCE_DIR}/examples/${example}/${example}.cpp + ${PROJECT_SOURCE_DIR}/doc/scripts/program2plain + < ${PROJECT_SOURCE_DIR}/examples/${example}/${example}.cpp > ${CMAKE_CURRENT_BINARY_DIR}/${example}.cpp DEPENDS - ${CMAKE_SOURCE_DIR}/doc/scripts/program2plain - ${CMAKE_SOURCE_DIR}/examples/${example}/${example}.cpp + ${PROJECT_SOURCE_DIR}/doc/scripts/program2plain + ${PROJECT_SOURCE_DIR}/examples/${example}/${example}.cpp VERBATIM ) @@ -62,19 +62,19 @@ FOREACH(example ${_ginkgo_examples}) OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${example}.hpp COMMAND ${PERL_EXECUTABLE} ARGS - ${CMAKE_SOURCE_DIR}/doc/scripts/make_example.pl - ${example} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} + ${PROJECT_SOURCE_DIR}/doc/scripts/make_example.pl + ${example} ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR} > ${CMAKE_CURRENT_BINARY_DIR}/${example}.hpp WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DEPENDS - ${CMAKE_SOURCE_DIR}/doc/scripts/make_example.pl - ${CMAKE_SOURCE_DIR}/doc/scripts/intro2toc - ${CMAKE_SOURCE_DIR}/doc/scripts/create_anchors - ${CMAKE_SOURCE_DIR}/doc/scripts/program2doxygen - ${CMAKE_SOURCE_DIR}/examples/${example}/${example}.cpp - ${CMAKE_SOURCE_DIR}/examples/${example}/doc/intro.dox - ${CMAKE_SOURCE_DIR}/examples/${example}/doc/results.dox + ${PROJECT_SOURCE_DIR}/doc/scripts/make_example.pl + ${PROJECT_SOURCE_DIR}/doc/scripts/intro2toc + ${PROJECT_SOURCE_DIR}/doc/scripts/create_anchors + ${PROJECT_SOURCE_DIR}/doc/scripts/program2doxygen + ${PROJECT_SOURCE_DIR}/examples/${example}/${example}.cpp + ${PROJECT_SOURCE_DIR}/examples/${example}/doc/intro.dox + ${PROJECT_SOURCE_DIR}/examples/${example}/doc/results.dox ) ADD_CUSTOM_TARGET(examples_${example} diff --git a/doc/helpers.cmake b/doc/helpers.cmake index 8d284019d07..f2a89f7eb09 100644 --- a/doc/helpers.cmake +++ b/doc/helpers.cmake @@ -39,7 +39,7 @@ endfunction() # generates the documentation named with the additional # config file in format function(ginkgo_doc_gen name in pdf mainpage-in) - set(DIR_BASE "${CMAKE_SOURCE_DIR}") + set(DIR_BASE "${PROJECT_SOURCE_DIR}") set(DOC_BASE "${CMAKE_CURRENT_SOURCE_DIR}") set(DIR_SCRIPT "${DOC_BASE}/scripts") set(DIR_OUT "${CMAKE_CURRENT_BINARY_DIR}/${name}") @@ -53,7 +53,7 @@ function(ginkgo_doc_gen name in pdf mainpage-in) "${DOC_BASE}/headers/" ) list(APPEND doxygen_base_input - ${CMAKE_BINARY_DIR}/include/ginkgo/config.hpp + ${PROJECT_BINARY_DIR}/include/ginkgo/config.hpp ${DIR_BASE}/include ${MAINPAGE} ) @@ -77,7 +77,7 @@ function(ginkgo_doc_gen name in pdf mainpage-in) ${DIR_BASE}/include/ginkgo/**/*.hpp ) list(APPEND doxygen_depend - ${CMAKE_BINARY_DIR}/include/ginkgo/config.hpp + ${PROJECT_BINARY_DIR}/include/ginkgo/config.hpp ) if(GINKGO_DOC_GENERATE_EXAMPLES) list(APPEND doxygen_depend diff --git a/hip/test/CMakeLists.txt b/hip/test/CMakeLists.txt index fd1fa2941d8..9c8e39ca4ab 100644 --- a/hip/test/CMakeLists.txt +++ b/hip/test/CMakeLists.txt @@ -1,4 +1,4 @@ -include(${CMAKE_SOURCE_DIR}/cmake/create_test.cmake) +include(${PROJECT_SOURCE_DIR}/cmake/create_test.cmake) add_subdirectory(base) add_subdirectory(components) diff --git a/omp/test/CMakeLists.txt b/omp/test/CMakeLists.txt index d746413f53f..d8257d9087c 100644 --- a/omp/test/CMakeLists.txt +++ b/omp/test/CMakeLists.txt @@ -1,4 +1,4 @@ -include(${CMAKE_SOURCE_DIR}/cmake/create_test.cmake) +include(${PROJECT_SOURCE_DIR}/cmake/create_test.cmake) add_subdirectory(components) add_subdirectory(factorization) diff --git a/reference/test/CMakeLists.txt b/reference/test/CMakeLists.txt index b359d8146ed..44da92b0bd9 100644 --- a/reference/test/CMakeLists.txt +++ b/reference/test/CMakeLists.txt @@ -1,4 +1,4 @@ -include(${CMAKE_SOURCE_DIR}/cmake/create_test.cmake) +include(${PROJECT_SOURCE_DIR}/cmake/create_test.cmake) add_subdirectory(base) add_subdirectory(components) From ba0509cf4e1f2376e699fafc8b76e229b9d12ff2 Mon Sep 17 00:00:00 2001 From: Tobias Ribizel Date: Tue, 15 Sep 2020 12:49:17 +0200 Subject: [PATCH 0005/1008] fix documentation build --- doc/examples/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/examples/CMakeLists.txt b/doc/examples/CMakeLists.txt index 0bc282197b5..9363ea5e1dd 100644 --- a/doc/examples/CMakeLists.txt +++ b/doc/examples/CMakeLists.txt @@ -2,7 +2,7 @@ FILE(GLOB _ginkgo_examples ${PROJECT_SOURCE_DIR}/examples/* ) -LIST(REMOVE_ITEM _ginkgo_examples "${CMAKE_CURRENT_SOURCE_DIR}/examples/CMakeLists.txt" "${PROJECT_SOURCE_DIR}/examples/build-setup.sh") +LIST(REMOVE_ITEM _ginkgo_examples "${PROJECT_SOURCE_DIR}/examples/CMakeLists.txt" "${PROJECT_SOURCE_DIR}/examples/build-setup.sh") ADD_CUSTOM_TARGET(examples) From 42ae32297623ba39829d7b50e06c429709eb12f1 Mon Sep 17 00:00:00 2001 From: Tobias Ribizel Date: Tue, 15 Sep 2020 14:12:22 +0200 Subject: [PATCH 0006/1008] add subdir build test --- .gitlab-ci.yml | 27 +++++++++++++++++++++++++-- test_subdir/CMakeLists.txt | 9 +++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 test_subdir/CMakeLists.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c2ab6d813a1..d8870d192b3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,6 +25,7 @@ stages: CONFIG_LOG: "ON" CXX_FLAGS: "" EXTRA_CMAKE_FLAGS: "" + CI_PROJECT_DIR_SUFFIX: "" .before_script_template: &default_before_script - export NUM_CORES=${CI_PARALLELISM} @@ -50,7 +51,7 @@ stages: CUDA_ARCH_STR=-DGINKGO_CUDA_ARCHITECTURES=${CUDA_ARCH}; CUDA_HOST_STR=-DCMAKE_CUDA_HOST_COMPILER=$(which ${CXX_COMPILER}); fi - - cmake ${CI_PROJECT_DIR} + - cmake ${CI_PROJECT_DIR}${CI_PROJECT_DIR_SUFFIX} -GNinja -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} -DCMAKE_CUDA_COMPILER=${CUDA_COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} @@ -76,7 +77,7 @@ stages: CUDA_ARCH_STR=-DGINKGO_CUDA_ARCHITECTURES=${CUDA_ARCH}; CUDA_HOST_STR=-DCMAKE_CUDA_HOST_COMPILER=$(which ${CXX_COMPILER}); fi - - cmake ${CI_PROJECT_DIR} + - cmake ${CI_PROJECT_DIR}${CI_PROJECT_DIR_SUFFIX} -GNinja -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} -DCMAKE_CUDA_COMPILER=${CUDA_COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} @@ -675,6 +676,28 @@ no-circular-deps: - cuda - gpu +# Ensure Ginkgo builds from a subdirectory +subdir-build: + <<: *default_build + stage: code_quality + image: localhost:5000/gko-cuda101-gnu8-llvm7-intel2019 + variables: + <<: *default_variables + BUILD_OMP: "ON" + BUILD_CUDA: "ON" + BUILD_HIP: "ON" + EXTRA_CMAKE_FLAGS: "-DGINKGO_BUILD_DOC=ON" + CI_PROJECT_PATH_SUFFIX: "/test_subdir" + only: + variables: + - $RUN_CI_TAG + dependencies: [] + allow_failure: no + tags: + - private_ci + - cuda + - gpu + # Run clang-tidy and iwyu clang-tidy: <<: *default_build diff --git a/test_subdir/CMakeLists.txt b/test_subdir/CMakeLists.txt new file mode 100644 index 00000000000..8596cc9a3d6 --- /dev/null +++ b/test_subdir/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.14) +project(GinkgoSubdirTest LANGUAGES CXX) +file(CREATE_LINK "${CMAKE_CURRENT_SOURCE_DIR}/.." "${CMAKE_CURRENT_BINARY_DIR}/ginkgo" SYMBOLIC) + +add_subdirectory("${CMAKE_CURRENT_BINARY_DIR}/ginkgo") + +add_executable(test_subdir ../test_install/test_install.cpp) +target_compile_features(test_subdir PUBLIC cxx_std_14) +target_link_libraries(test_subdir PRIVATE Ginkgo::ginkgo) From df22908deabf44bf7ec3d2a939d5388fe37787fc Mon Sep 17 00:00:00 2001 From: Tobias Ribizel Date: Tue, 15 Sep 2020 14:32:18 +0200 Subject: [PATCH 0007/1008] remove documentation from subdir build --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d8870d192b3..a2d229f67a1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -686,7 +686,6 @@ subdir-build: BUILD_OMP: "ON" BUILD_CUDA: "ON" BUILD_HIP: "ON" - EXTRA_CMAKE_FLAGS: "-DGINKGO_BUILD_DOC=ON" CI_PROJECT_PATH_SUFFIX: "/test_subdir" only: variables: From f56b2e8a24bb5c47f8f1844ffd1b2ddccb8a1d00 Mon Sep 17 00:00:00 2001 From: Tobias Ribizel Date: Wed, 16 Sep 2020 12:24:12 +0200 Subject: [PATCH 0008/1008] remove 27pt stencil from example overview --- doc/examples/examples.hpp.in | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/examples/examples.hpp.in b/doc/examples/examples.hpp.in index cf0b01f9a04..8c47be53d89 100644 --- a/doc/examples/examples.hpp.in +++ b/doc/examples/examples.hpp.in @@ -127,12 +127,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * * - * @ref twentyseven_pt_stencil_solver - * Using a twentyseven point 3D stencil to solve the poisson equation - * with array views. - * - * - * * @ref external_lib_interfacing * Using Ginkgo's solver with the external library deal.II. * @@ -228,7 +222,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * @ref poisson_solver, * @ref three_pt_stencil_solver, * @ref nine_pt_stencil_solver, - * @ref twentyseven_pt_stencil_solver, * @ref custom_matrix_format * * From 4f93da9f852fb6d481175b6a2f19fcf5bb717ad7 Mon Sep 17 00:00:00 2001 From: "Yuhsiang M. Tsai" Date: Tue, 1 Sep 2020 17:07:06 +0200 Subject: [PATCH 0009/1008] add template_convertor and remove_complex for class --- common/base/math.hpp.inc | 6 +- core/test/base/math.cpp | 40 +++++++++++ include/ginkgo/core/base/math.hpp | 109 +++++++++++++++++++++++++++--- 3 files changed, 146 insertions(+), 9 deletions(-) diff --git a/common/base/math.hpp.inc b/common/base/math.hpp.inc index 3ba49b585c3..576ab32859c 100644 --- a/common/base/math.hpp.inc +++ b/common/base/math.hpp.inc @@ -54,10 +54,14 @@ struct is_complex_impl> : public std::integral_constant {}; +template +struct is_complex_or_scalar_impl> : std::is_scalar {}; + + template struct truncate_type_impl> { using type = thrust::complex::type>; }; -} // namespace detail \ No newline at end of file +} // namespace detail diff --git a/core/test/base/math.cpp b/core/test/base/math.cpp index c63cd4ae8e9..0e54c87f788 100644 --- a/core/test/base/math.cpp +++ b/core/test/base/math.cpp @@ -53,6 +53,10 @@ static_assert( "imag must return a real type"); +template +class DummyClass {}; + + template void test_real_is_finite() { @@ -135,4 +139,40 @@ TEST(Conjugate, DoubleComplex) } +TEST(RemoveComplexClass, Float) +{ + using origin = DummyClass; + using expect = DummyClass; + bool check = std::is_same>::value; + ASSERT_TRUE(check); +} + + +TEST(RemoveComplexClass, Double) +{ + using origin = DummyClass; + using expect = DummyClass; + bool check = std::is_same>::value; + ASSERT_TRUE(check); +} + + +TEST(RemoveComplexClass, FloatComplex) +{ + using origin = DummyClass, int>; + using expect = DummyClass; + bool check = std::is_same>::value; + ASSERT_TRUE(check); +} + + +TEST(RemoveComplexClass, DoubleComplex) +{ + using origin = DummyClass, int>; + using expect = DummyClass; + bool check = std::is_same>::value; + ASSERT_TRUE(check); +} + + } // namespace diff --git a/include/ginkgo/core/base/math.hpp b/include/ginkgo/core/base/math.hpp index 9f9dabb8f75..564635556cf 100644 --- a/include/ginkgo/core/base/math.hpp +++ b/include/ginkgo/core/base/math.hpp @@ -141,6 +141,65 @@ struct is_complex_impl> : public std::integral_constant {}; +template +struct is_complex_or_scalar_impl : std::is_scalar {}; + +template +struct is_complex_or_scalar_impl> : std::is_scalar {}; + + +/** + * template_convertor is converting the template parameters of a class by + * convertor. + * + * @tparam convertor which convert one type to another type + * @tparam T type + */ +template