Skip to content

Commit

Permalink
fixup DeviceTensor's move ctor/assignment to avoid use of copying bta…
Browse files Browse the repository at this point in the history
…s::Tensor ops
  • Loading branch information
evaleev committed Jul 24, 2024
1 parent 36a309e commit e620b53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/spmm/spmm_cuda.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ struct DeviceTensor : public ttg::TTValue<DeviceTensor<_T, _Range, _Storage>>
/// move constructor
DeviceTensor(tensor_type&& x) noexcept
: ttvalue_type()
, tensor_type(std::move(x))
, tensor_type(static_cast<tensor_type&&>(x))
, b(this->size() ? this->data() : nullptr, this->size())
{
//std::cout << "DeviceTensor tensor_type move ctor" << std::endl;
Expand Down Expand Up @@ -237,7 +237,7 @@ struct DeviceTensor : public ttg::TTValue<DeviceTensor<_T, _Range, _Storage>>
/// move assignment operator
DeviceTensor& operator=(DeviceTensor&& x) noexcept {
ttvalue_type::operator=(std::move(x));
tensor_type::operator=(std::move(x));
tensor_type::operator=(static_cast<tensor_type&&>(x));
if (this->size() == 0 || this->data() == x.b.host_ptr()){
b = std::move(x.b);
} else {
Expand Down

0 comments on commit e620b53

Please sign in to comment.