ginkgo icon indicating copy to clipboard operation
ginkgo copied to clipboard

Deprecating `gko::range`

Open upsj opened this issue 2 years ago • 2 comments

I think we should deprecate our range implementation and the surrounding code in favor of the accessor interface. The reasons are

  1. they are nothing but a thin wrapper over an accessor
  2. we don't use them anywhere except for the CPU ISAI implementation, where they are easy to replace by an accessor
  3. the implementation of its pointwise operations are very complex, but at the same time cannot provide good performance in parallel contexts
  4. the value semantics of gko::range mean that any time you assign a range to another range, the contents get copied. This is completely different from what a range normally means in C++ land.

upsj avatar Sep 09 '22 17:09 upsj

I fully agree, I also dislike the copy semantic that the current gko::range has. My plan was to deprecate the whole gko::range and everything in the namespace gko::accessor and replace it with the current accessor interface in gko::acc. In the CPU ISAI implementation, we should easily be able to replace it with gko::acc::range (and gko::acc::row_major), as this should have mostly the same interface (but without the copy mechanic). I do have some ideas on how to improve the current accessor interface further (I mean the gko::acc interface), but was occupied with other projects and did not act on it yet.

thoasm avatar Sep 09 '22 18:09 thoasm

I definitively volunteer to do this, but it might take a couple of months until I am ready to do it.

thoasm avatar Sep 09 '22 18:09 thoasm