Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0447023
Add support for factorization in create_new_algorithm.sh
Oct 21, 2019
cda40b6
fix sellp read
yhmtsai Oct 29, 2019
932fbe1
fix ell error on small mtx and flexble warp_size
yhmtsai Oct 30, 2019
ec4a3ab
Fix small typo in the stencil examples
upsj Nov 13, 2019
4db298c
Improve CSR strategies
Nov 12, 2019
db622a9
Review update
Nov 12, 2019
a942a89
Review update and additional fixes
Nov 13, 2019
29bda33
Review update
Nov 13, 2019
638db8c
Fix GKO_NOT_SUPPORTED, so it behaves as expected
Nov 13, 2019
f0d8e2d
Review update: fix doxygen comment for GKO_NOT_SUPPORTED
Nov 13, 2019
9fe7165
Add `GKO_ASSERT_EQ` assertion.
Nov 27, 2019
6e88654
Throw ValueMismatch instead of BadDimension for `GKO_ASSERT_EQ`.
Nov 27, 2019
2f671da
replace GKO_ENSURE_IN_BOUNDS by GKO_ASSERT_EQ
upsj Nov 18, 2019
8f3c8cb
add tests for GKO_ASSERT_EQ
upsj Nov 18, 2019
65ec1ae
fix dense bounds check
upsj Nov 19, 2019
de97319
revert bounds check changes for dense.hpp
upsj Nov 19, 2019
e308255
Improve update_header script so it does not stop `make`
Nov 15, 2019
89949c7
Further improve the update_ginkgo_header.sh script
Nov 18, 2019
bbcd2e4
Review Update
Nov 18, 2019
ba452f1
update git-cmake-format source repository
upsj Nov 25, 2019
6fce256
Update all versions to v1.1.1.
Nov 27, 2019
cf678b1
Add Changelog
Nov 27, 2019
784aa6e
Create a new macro `GKO_VERSION_STR` to facilitate version bumping.
Nov 27, 2019
d4afd1b
Install Ginkgo and launch `test_install` for all jobs.
Nov 28, 2019
10da811
Fix missing `}` for `SparsityCsr` in `test_install`.
Nov 28, 2019
8f70a7c
Fix some issues pointed by sonarqube.
Nov 28, 2019
2b75262
Fix test_install with PAPI.
Nov 28, 2019
1dbcef9
Fix documentation issues and add a Jacobi documentation group.
Nov 29, 2019
c8ec186
Update changelog with the recent changes done for this PR.
Nov 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ stages:
- |
(( $(ctest -N | tail -1 | sed 's/Total Tests: //') != 0 )) || exit 1
- ctest -V
- make install
- make test_install
dependencies: []
except:
- schedules
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ commits. For a comprehensive list, use the following command:
git log --first-parent
```

## Version 1.1.1
This version of Ginkgo provides a few fixes in Ginkgo's core routines. The
supported systems and requirements are unchanged from version 1.1.0.

### Fixes
+ Improve Ginkgo's installation and fix the `test_install` step ([#406](https://github.com/ginkgo-project/ginkgo/pull/406)),
+ Fix some documentation issues ([#406](https://github.com/ginkgo-project/ginkgo/pull/406)),
+ Fix multiple code issues reported by sonarqube ([#406](https://github.com/ginkgo-project/ginkgo/pull/406)),
+ Update the git-cmake-format repository ([#399](https://github.com/ginkgo-project/ginkgo/pull/399)),
+ Improve the global update header script ([#390](https://github.com/ginkgo-project/ginkgo/pull/390)),
+ Fix broken bounds checks ([#388](https://github.com/ginkgo-project/ginkgo/pull/388)),
+ Fix CSR strategies and improve performance ([#379](https://github.com/ginkgo-project/ginkgo/pull/379)),
+ Fix a small typo in the stencil examples ([#381](https://github.com/ginkgo-project/ginkgo/pull/381)),
+ Fix ELL error on small matrices ([#375](https://github.com/ginkgo-project/ginkgo/pull/375)),
+ Fix SellP read function ([#374](https://github.com/ginkgo-project/ginkgo/pull/374)),
+ Add factorization support in `create_new_algorithm.sh` ([#371](https://github.com/ginkgo-project/ginkgo/pull/371))

## Version 1.1.0

The Ginkgo team is proud to announce the new minor release of Ginkgo version
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.9)

project(Ginkgo LANGUAGES C CXX VERSION 1.1.0 DESCRIPTION "A numerical linear algebra library targeting many-core architectures")
project(Ginkgo LANGUAGES C CXX VERSION 1.1.1 DESCRIPTION "A numerical linear algebra library targeting many-core architectures")
set(Ginkgo_VERSION_TAG "master")
set(PROJECT_VERSION_TAG ${Ginkgo_VERSION_TAG})

Expand Down Expand Up @@ -160,8 +160,9 @@ if(GINKGO_DEVEL_TOOLS)
endif()

# Generate the global `ginkgo/ginkgo.hpp` header with every call of make
# when bash is present and the developer tools are enabled
find_program(BASH bash)
if(NOT "${BASH}" STREQUAL "BASH-NOTFOUND")
if(NOT "${BASH}" STREQUAL "BASH-NOTFOUND" AND GINKGO_DEVEL_TOOLS)
add_custom_target(generate_ginkgo_header ALL
COMMAND ${Ginkgo_SOURCE_DIR}/dev_tools/scripts/update_ginkgo_header.sh
WORKING_DIRECTORY ${Ginkgo_SOURCE_DIR})
Expand All @@ -187,6 +188,7 @@ add_custom_target(test_install
COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} -H${Ginkgo_SOURCE_DIR}/test_install
-B${Ginkgo_BINARY_DIR}/test_install
-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}/${GINKGO_INSTALL_CONFIG_DIR}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
COMMAND ${CMAKE_COMMAND} --build ${Ginkgo_BINARY_DIR}/test_install
COMMAND ${Ginkgo_BINARY_DIR}/test_install/test_install
COMMENT "Running a test on the installed binaries. This requires running `(sudo) make install` first.")
Expand Down
15 changes: 11 additions & 4 deletions cmake/GinkgoConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ set(GINKGO_JACOBI_FULL_OPTIMIZATIONS @GINKGO_JACOBI_FULL_OPTIMIZATIONS@)
set(GINKGO_CUDA_ARCHITECTURES @GINKGO_CUDA_ARCHITECTURES@)
set(GINKGO_CUDA_HOST_COMPILER @CMAKE_CUDA_HOST_COMPILER@)

set(GINKGO_HAVE_PAPI_SDE @GINKGO_HAVE_PAPI_SDE@)

# Ginkgo external package variables
set(GINKGO_USE_EXTERNAL_CAS "@GINKGO_USE_EXTERNAL_CAS@")
set(GINKGO_USE_EXTERNAL_GTEST "@GINKGO_USE_EXTERNAL_GTEST@")
Expand All @@ -80,10 +82,13 @@ set(TPL_RAPIDJSON_INCLUDE_DIRS "@TPL_RAPIDJSON_INCLUDE_DIRS@")
# Ginkgo installation configuration
set(GINKGO_CONFIG_FILE_PATH "${CMAKE_CURRENT_LIST_DIR}")
string(REPLACE "@GINKGO_INSTALL_CONFIG_DIR@" "" GINKGO_INSTALL_PREFIX "${GINKGO_CONFIG_FILE_PATH}")
set(GINKGO_INSTALL_INCLUDE_DIR "@GINKGO_INSTALL_INCLUDE_DIR@")
set(GINKGO_INSTALL_LIBRARY_DIR "@GINKGO_INSTALL_LIBRARY_DIR@")
set(GINKGO_INSTALL_PKGCONFIG_DIR "@GINKGO_INSTALL_PKGCONFIG_DIR@")
set(GINKGO_INSTALL_CONFIG_DIR "@GINKGO_INSTALL_CONFIG_DIR@")
set(GINKGO_INSTALL_INCLUDE_DIR "${GINKGO_INSTALL_PREFIX}/@GINKGO_INSTALL_INCLUDE_DIR@")
set(GINKGO_INSTALL_LIBRARY_DIR "${GINKGO_INSTALL_PREFIX}/@GINKGO_INSTALL_LIBRARY_DIR@")
set(GINKGO_INSTALL_PKGCONFIG_DIR "${GINKGO_INSTALL_PREFIX}/@GINKGO_INSTALL_PKGCONFIG_DIR@")
set(GINKGO_INSTALL_CONFIG_DIR "${GINKGO_INSTALL_PREFIX}/@GINKGO_INSTALL_CONFIG_DIR@")
set(GINKGO_INSTALL_MODULE_DIR "${GINKGO_INSTALL_PREFIX}/@GINKGO_INSTALL_MODULE_DIR@")
set(CMAKE_MODULE_PATH "${GINKGO_INSTALL_MODULE_DIR}")


set(GINKGO_INTERFACE_LINK_LIBRARIES "@GINKGO_INTERFACE_LINK_LIBRARIES@")
set(GINKGO_INTERFACE_LINK_FLAGS "@GINKGO_INTERFACE_LINK_FLAGS@")
Expand Down Expand Up @@ -111,6 +116,8 @@ set(GINKGO_OPENMP_LIBRARIES @OpenMP_CXX_LIBRARIES@)

set(GINKGO_OPENMP_FLAGS "@OpenMP_CXX_FLAGS@")

# Modulepath configuration

# NOTE: we do not export benchmarks, examples, tests or devel tools
# so `third_party` libraries are currently unneeded.

Expand Down
47 changes: 24 additions & 23 deletions cmake/Modules/FindPAPI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,31 @@ if(PAPI_INCLUDE_DIR)

if (PAPI_LIBRARY)
# find the components
foreach(component IN LISTS PAPI_FIND_COMPONENTS)
file(WRITE "${CMAKE_BINARY_DIR}/papi_${component}_detect.c"
"
#include <papi.h>
int main() {
int retval;
retval = PAPI_library_init(PAPI_VER_CURRENT);
if (retval != PAPI_VER_CURRENT && retval > 0)
return -1;
if (PAPI_get_component_index(\"${component}\") < 0)
return 0;
return 1;
}
")
try_run(PAPI_${component}_FOUND
gko_result_unused
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/papi_${component}_detect.c"
LINK_LIBRARIES ${PAPI_LIBRARY}
)
enable_language(C)
foreach(component IN LISTS PAPI_FIND_COMPONENTS)
file(WRITE "${CMAKE_BINARY_DIR}/papi_${component}_detect.c"
"
#include <papi.h>
int main() {
int retval;
retval = PAPI_library_init(PAPI_VER_CURRENT);
if (retval != PAPI_VER_CURRENT && retval > 0)
return -1;
if (PAPI_get_component_index(\"${component}\") < 0)
return 0;
return 1;
}"
)
try_run(PAPI_${component}_FOUND
gko_result_unused
"${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/papi_${component}_detect.c"
LINK_LIBRARIES ${PAPI_LIBRARY}
)

if (NOT PAPI_${component}_FOUND EQUAL 1)
unset(PAPI_${component}_FOUND)
endif()
if (NOT PAPI_${component}_FOUND EQUAL 1)
unset(PAPI_${component}_FOUND)
endif()
endforeach()
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion cmake/build_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ endmacro()

macro(ginkgo_switch_to_windows_dynamic lang)
ginkgo_switch_windows_link(${lang} "MT" "MD")
endmacro()
endmacro()
4 changes: 4 additions & 0 deletions cmake/install_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set(GINKGO_INSTALL_INCLUDE_DIR "include")
set(GINKGO_INSTALL_LIBRARY_DIR "lib")
set(GINKGO_INSTALL_PKGCONFIG_DIR "lib/pkgconfig")
set(GINKGO_INSTALL_CONFIG_DIR "lib/cmake/Ginkgo")
set(GINKGO_INSTALL_MODULE_DIR "lib/cmake/Ginkgo/Modules")

function(ginkgo_install_library name subdir)
# install .so and .a files
Expand Down Expand Up @@ -33,6 +34,9 @@ function(ginkgo_install)
install(FILES "${Ginkgo_SOURCE_DIR}/third_party/papi_sde/papi_sde_interface.h"
DESTINATION "${GINKGO_INSTALL_INCLUDE_DIR}/third_party/papi_sde"
)
install(FILES "${Ginkgo_SOURCE_DIR}/cmake/Modules/FindPAPI.cmake"
DESTINATION "${GINKGO_INSTALL_MODULE_DIR}/"
)
endif()

# export targets
Expand Down
6 changes: 3 additions & 3 deletions core/device_hooks/cuda_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ namespace gko {

version version_info::get_cuda_version() noexcept
{
// We just return 1.1.0 with a special "not compiled" tag in placeholder
// modules.
return {1, 1, 0, "not compiled"};
// We just return the version with a special "not compiled" tag in
// placeholder modules.
return {GKO_VERSION_STR, "not compiled"};
}


Expand Down
6 changes: 3 additions & 3 deletions core/device_hooks/omp_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ namespace gko {

version version_info::get_omp_version() noexcept
{
// We just return 1.1.0 with a special "not compiled" tag in placeholder
// modules.
return {1, 1, 0, "not compiled"};
// We just return the version with a special "not compiled" tag in
// placeholder modules.
return {GKO_VERSION_STR, "not compiled"};
}


Expand Down
6 changes: 3 additions & 3 deletions core/device_hooks/reference_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ namespace gko {

version version_info::get_reference_version() noexcept
{
// We just return 1.1.0 with a special "not compiled" tag in placeholder
// modules.
return {1, 1, 0, "not compiled"};
// We just return the version with a special "not compiled" tag in
// placeholder modules.
return {GKO_VERSION_STR, "not compiled"};
}


Expand Down
2 changes: 1 addition & 1 deletion core/devices/cuda/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ std::shared_ptr<const Executor> CudaExecutor::get_master() const noexcept
}


int CudaExecutor::num_execs[max_devices];
unsigned CudaExecutor::num_execs[max_devices];


std::mutex CudaExecutor::mutex[max_devices];
Expand Down
10 changes: 8 additions & 2 deletions core/matrix/coo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ void Coo<ValueType, IndexType>::convert_to(
Csr<ValueType, IndexType> *result) const
{
auto exec = this->get_executor();
auto tmp = Csr<ValueType, IndexType>::create(exec, this->get_size());
auto tmp = Csr<ValueType, IndexType>::create(
exec, this->get_size(), this->get_num_stored_elements(),
result->get_strategy());
tmp->values_ = this->values_;
tmp->col_idxs_ = this->col_idxs_;
exec->run(coo::make_convert_to_csr(tmp.get(), this));
tmp->make_srow();
tmp->move_to(result);
}

Expand All @@ -120,10 +123,13 @@ template <typename ValueType, typename IndexType>
void Coo<ValueType, IndexType>::move_to(Csr<ValueType, IndexType> *result)
{
auto exec = this->get_executor();
auto tmp = Csr<ValueType, IndexType>::create(exec, this->get_size());
auto tmp = Csr<ValueType, IndexType>::create(
exec, this->get_size(), this->get_num_stored_elements(),
result->get_strategy());
tmp->values_ = std::move(this->values_);
tmp->col_idxs_ = std::move(this->col_idxs_);
exec->run(coo::make_convert_to_csr(tmp.get(), this));
tmp->make_srow();
tmp->move_to(result);
}

Expand Down
21 changes: 15 additions & 6 deletions core/matrix/dense.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,21 @@ inline void conversion_helper(Csr<ValueType, IndexType> *result,
{
auto exec = source->get_executor();

size_type num_stored_nonzeros = 0;
exec->run(dense::make_count_nonzeros(source, &num_stored_nonzeros));
auto tmp = Csr<ValueType, IndexType>::create(
exec, source->get_size(), num_stored_nonzeros, result->get_strategy());
exec->run(op(tmp.get(), source));
tmp->move_to(result);
if (source->get_size()) {
size_type num_stored_nonzeros = 0;
exec->run(dense::make_count_nonzeros(source, &num_stored_nonzeros));
auto tmp = Csr<ValueType, IndexType>::create(exec, source->get_size(),
num_stored_nonzeros,
result->get_strategy());
exec->run(op(tmp.get(), source));
tmp->move_to(result);
}
// If source is empty, there is no need to copy data or to call kernels
else {
auto tmp =
Csr<ValueType, IndexType>::create(exec, result->get_strategy());
tmp->move_to(result);
}
}


Expand Down
5 changes: 3 additions & 2 deletions core/matrix/ell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,11 @@ void Ell<ValueType, IndexType>::convert_to(
size_type num_stored_elements = 0;
exec->run(ell::make_count_nonzeros(this, &num_stored_elements));

auto tmp = Csr<ValueType, IndexType>::create(exec, this->get_size(),
num_stored_elements);
auto tmp = Csr<ValueType, IndexType>::create(
exec, this->get_size(), num_stored_elements, result->get_strategy());
exec->run(ell::make_convert_to_csr(tmp.get(), this));

tmp->make_srow();
tmp->move_to(result);
}

Expand Down
10 changes: 6 additions & 4 deletions core/matrix/hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ void Hybrid<ValueType, IndexType>::convert_to(
size_type num_stored_elements = 0;
exec->run(hybrid::make_count_nonzeros(this, &num_stored_elements));

auto tmp = Csr<ValueType, IndexType>::create(exec, this->get_size(),
num_stored_elements);
auto tmp = Csr<ValueType, IndexType>::create(
exec, this->get_size(), num_stored_elements, result->get_strategy());
exec->run(hybrid::make_convert_to_csr(tmp.get(), this));

tmp->make_srow();
tmp->move_to(result);
}

Expand All @@ -161,8 +162,9 @@ void Hybrid<ValueType, IndexType>::read(const mat_data &data)
get_each_row_nnz(data, row_nnz);
strategy_->compute_hybrid_config(row_nnz, &ell_lim, &coo_lim);

auto tmp = Hybrid::create(this->get_executor()->get_master(), data.size,
ell_lim, data.size[0], coo_lim);
auto tmp =
Hybrid::create(this->get_executor()->get_master(), data.size, ell_lim,
data.size[0], coo_lim, this->get_strategy());

// Get values and column indexes.
size_type ind = 0;
Expand Down
17 changes: 9 additions & 8 deletions core/matrix/sellp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ size_type calculate_total_cols(const matrix_data<ValueType, IndexType> &data,
IndexType current_slice = 0;
size_type total_cols = 0;
for (const auto &elem : data.nonzeros) {
if (elem.row != current_row) {
current_row = elem.row;
slice_lengths[current_slice] =
max(slice_lengths[current_slice], nonzeros_per_row);
nonzeros_per_row = 0;
}
if (elem.row / slice_size != current_slice) {
slice_lengths[current_slice] =
stride_factor *
ceildiv(slice_lengths[current_slice], stride_factor);
total_cols += slice_lengths[current_slice];
current_slice = elem.row / slice_size;
}
if (elem.row != current_row) {
current_row = elem.row;
slice_lengths[current_slice] =
max(slice_lengths[current_slice], nonzeros_per_row);
nonzeros_per_row = 0;
}
nonzeros_per_row += (elem.value != zero<ValueType>());
}
slice_lengths[current_slice] =
Expand Down Expand Up @@ -147,9 +147,10 @@ void Sellp<ValueType, IndexType>::convert_to(

size_type num_stored_nonzeros = 0;
exec->run(sellp::make_count_nonzeros(this, &num_stored_nonzeros));
auto tmp = Csr<ValueType, IndexType>::create(exec, this->get_size(),
num_stored_nonzeros);
auto tmp = Csr<ValueType, IndexType>::create(
exec, this->get_size(), num_stored_nonzeros, result->get_strategy());
exec->run(sellp::make_convert_to_csr(tmp.get(), this));
tmp->make_srow();
tmp->move_to(result);
}

Expand Down
14 changes: 13 additions & 1 deletion core/test/base/exception_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ TEST(NotCompiled, ThrowsWhenUsed)
}


void does_not_support_int() { throw GKO_NOT_SUPPORTED(int); }
void does_not_support_int() { GKO_NOT_SUPPORTED(int); }

TEST(NotSupported, ReturnsNotSupportedException)
{
Expand Down Expand Up @@ -131,6 +131,18 @@ TEST(AssertConformant, ThrowsWhenNotConformant)
}


TEST(AssertEqual, DoesNotThrowWhenEqual)
{
ASSERT_NO_THROW(GKO_ASSERT_EQ(1, 1));
}


TEST(AssertEqual, ThrowsWhenNotEqual)
{
ASSERT_THROW(GKO_ASSERT_EQ(0, 1), gko::ValueMismatch);
}


TEST(AssertEqualRows, DoesNotThrowWhenEqualRowSize)
{
ASSERT_NO_THROW(
Expand Down
Loading