Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bcumming/vector

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

138 Commits
138 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vector

Prototype simple vector storage with ranges and support for seamless CPU-GPU interopability.

Starts with concept of an array, which is a wrapper around a pointer and a length:

template <class T, class Coordinator>
class ArrayView {
    ...
    size_t size_;
    T* pointer_;
}

which are coupled with a stateless Coordinator type, which performs memory operations like allocation, copy, and so on. This sounds like an allocator, and indeed Coordinators take an allocator type as a template parameter. Coordinators can be specialized with allocators that allocate memory in "incompatible" memory spaces, for example GPU device memory or HDF5 storage.

Coordinators are used to copy memory from one memory space to another, and dispatching execution on the data according to where it is located (launch a CUDA version of a kernel if the data is on a GPU, or a host version if on the host)

The ArrayView type binds the (pointer,size) tupple with a memory space. The Array type derives from this, adding constructor and desctructor that use Coordinator to allocate and free memory.

ArrayView <- Array

The concept of simple ranges are also supported:

class Range {
    size_t begin_;
    size_t end_;
}

which can be used to get an ArrayView of an Array or ArrayView's sub-range.

todo

  • range splitting
  • implement copying between different coordinator types
  • types for coordinating asynchronous dispatch of memory transfers

About

prototype vector storage class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.