PointCloudLibrary / PointCloudLibrary/pcl

[GPU::DeviceArray] Expand the API of the DeviceArray to ease data transfer and allocations

Open
#4,689 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind: request status: triage
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

I was thinking of expanding the API of the DeviceArray class by two functions. Firstly, a member function to download only part of the device data to the host. Secondly, a function to resize the DeviceArray. Expanding the API is motivated by a performance analysis (#4677) we made and to bring the API of the device array in line with STL semantics.

In more detail, the signature of the download function could be:

DeviceArray<T>::download(const T* const device_begin, const T* const device_end, T* host_ptr);

One would pass the two points on the device array from which data should be downloaded and copied and a pointer to the host array at which location data is inserted. At the moment we only have two download functions

/** \brief Downloads data from internal buffer to CPU memory
* \param host_ptr pointer to buffer to download               
* */
void download(T *host_ptr) const;

/** \brief Downloads data from internal buffer to CPU memory
* \param data  host vector to download to                 
* */
template<typename A>
void download(std::vector<T, A>& data) const;

download function that downloads all the data which can be more than necessary.

The resize function is simply:

DeviceArray<T>::resize(int N);

I think implementing a resize function is more involved as it also requires adding another member variable. Currently, the size and capacity of the device array are equal. I think they would have to be different for a resize function to work. What do other people think about this? Does this seem to be a good idea? How could the proposal be improved, and what else do we need to think about? I'd be happy to implement this, but wanted to discuss it first.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the DeviceArray class and its existing download overloads, which are the entry points named in the issue. Review how size and capacity are currently represented before evaluating partial downloads and resize semantics. Done requires an agreed API design and implementation scope; no specific files or tests are identified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-vision
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.