Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Review update and additional fixes
- GKO_NOT_SUPPORTED is the only macro that does not include the
  `throw`. This was not only a problem in this code, but also in
  unrelated code, which is also fixed within this commit
- An Empty Dense matrix can now be converted to a CSR matrix
- Moved the `GKO_NOT_SUPPORTED` to the cuda kernel, so empty matrices
  do not throw when applying a strategy.
  • Loading branch information
Thomas Grützmacher authored and Terry Cojean committed Nov 27, 2019
commit a942a897b1e1e55b5d3c31ebe9c0aa02f96db2ee
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
2 changes: 1 addition & 1 deletion core/stop/residual_norm_reduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ bool ResidualNormReduction<ValueType>::check_impl(
dense_r->compute_norm2(u_dense_tau_.get());
dense_tau = u_dense_tau_.get();
} else {
GKO_NOT_SUPPORTED(nullptr);
throw GKO_NOT_SUPPORTED(nullptr);
}
bool all_converged = true;

Expand Down
2 changes: 2 additions & 0 deletions cuda/matrix/csr_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,8 @@ void spmv(std::shared_ptr<const CudaExecutor> exec,
as_cuda_type(b->get_const_values()),
as_cuda_type(b->get_stride()), as_cuda_type(c->get_values()),
as_cuda_type(c->get_stride()));
} else {
throw GKO_NOT_SUPPORTED(nwarps);
}
} else if (a->get_strategy()->get_name() == "merge_path") {
int items_per_thread =
Expand Down
2 changes: 0 additions & 2 deletions include/ginkgo/core/matrix/csr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ class Csr : public EnableLinOp<Csr<ValueType, IndexType>>,
if (!is_srow_on_host) {
*mtx_srow = srow_host;
}
} else {
GKO_NOT_SUPPORTED(nwarps);
}
}

Expand Down
5 changes: 2 additions & 3 deletions include/ginkgo/core/preconditioner/jacobi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,8 @@ class Jacobi : public EnableLinOp<Jacobi<ValueType, IndexType>>,
parameters_.block_pointers.get_num_elems() - 1)),
conditioning_(factory->get_executor())
{
if (parameters_.max_block_size >= 32 ||
parameters_.max_block_size < 1) {
GKO_NOT_SUPPORTED(this);
if (parameters_.max_block_size > 32 || parameters_.max_block_size < 1) {
throw GKO_NOT_SUPPORTED(this);
}
parameters_.block_pointers.set_executor(this->get_executor());
parameters_.storage_optimization.block_wise.set_executor(
Expand Down
2 changes: 1 addition & 1 deletion include/ginkgo/core/stop/combined.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ std::shared_ptr<const CriterionFactory> combine(FactoryContainer &&factories)
{
switch (factories.size()) {
case 0:
GKO_NOT_SUPPORTED(nullptr);
throw GKO_NOT_SUPPORTED(nullptr);
return nullptr;
case 1:
return factories[0];
Expand Down
2 changes: 1 addition & 1 deletion include/ginkgo/core/stop/residual_norm_reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ResidualNormReduction
device_storage_{factory->get_executor(), 2}
{
if (args.initial_residual == nullptr) {
GKO_NOT_SUPPORTED(nullptr);
throw GKO_NOT_SUPPORTED(nullptr);
}

auto exec = factory->get_executor();
Expand Down
13 changes: 13 additions & 0 deletions reference/test/matrix/csr_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,19 @@ class Csr : public ::testing::Test {
};


TEST_F(Csr, CopyEmptyMatrix)
{
auto strategy = std::make_shared<Mtx::load_balance>(0);
auto from_mtx = gko::matrix::Dense<>::create(exec, gko::dim<2>(0, 0));
auto to_mtx =
gko::matrix::Csr<>::create(exec, gko::dim<2>{0, 0}, 0, strategy);

from_mtx->convert_to(to_mtx.get());

ASSERT_FALSE(to_mtx->get_size());
}


TEST_F(Csr, AppliesToDenseVector)
{
auto x = gko::initialize<Vec>({2.0, 1.0, 4.0}, exec);
Expand Down