Skip to content

Commit

Permalink
Fix some style problems and call LinOp::operator=.
Browse files Browse the repository at this point in the history
  • Loading branch information
tcojean committed May 15, 2019
1 parent 31ce5f3 commit c5b9d1f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions benchmark/spmv/cuda_linops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GKO_BENCHMARK_SPMV_CUDA_LINOPS_HPP_
#define GKO_BENCHMARK_SPMV_CUDA_LINOPS_HPP_


#include <ginkgo/ginkgo.hpp>


Expand Down Expand Up @@ -74,6 +75,7 @@ class CuspBase : public gko::LinOp {

CuspBase &operator=(const CuspBase &other)
{
gko::LinOp::operator=(other);
this->gpu_exec_ = std::dynamic_pointer_cast<const gko::CudaExecutor>(
other.get_executor());
this->initialize_descr();
Expand Down Expand Up @@ -300,6 +302,11 @@ class CuspCsrEx
this->set_size(gko::dim<2>{csr_->get_size()});
}

gko::size_type get_num_stored_elements() const noexcept
{
return csr_->get_num_stored_elements();
}

~CuspCsrEx() override
{
const auto id = this->get_gpu_exec()->get_device_id();
Expand Down Expand Up @@ -358,11 +365,6 @@ class CuspCsrEx
}


gko::size_type get_num_stored_elements() const noexcept
{
return csr_->get_num_stored_elements();
}

CuspCsrEx(std::shared_ptr<const gko::Executor> exec,
const gko::dim<2> &size = gko::dim<2>{})
: gko::EnableLinOp<CuspCsrEx, CuspBase>(exec, size),
Expand Down

0 comments on commit c5b9d1f

Please sign in to comment.