alpaka-group / vikunja

Vikunja is a performance portable algorithm library that defines functions operating on ranges of elements for a variety of purposes . It supports the execution on multi-core CPUs and various GPUs. Vikunja uses alpaka to implement platform-independent primitives such as reduce or transform.

Home Page:https://vikunja.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vikunja namespaces

SimeonEhrig opened this issue · comments

Currently the vikunja has no clear concept for different namespaces. The main question is, how detailed or flat should be it?

Independent of the namespace question, I want to introduce the concept of host and device:

  • A accelerator fulfill the requirements of a host, if a device of the type accelerator can execute the non-vikunja c++-code. Typical the CPU of a computer.
  • Host memory can be accessible from non-vikunja c++ code without memory copy.
  • device is a subset of host. It can execute non-vikunja c++ code but don't need it.
  • device can be accessible from non-vikunja c++ code without memory copy but it is not required

Note: CUDA virtual memory fulfill the requirements of host memory.

First, I would put every functionality, which is required for the implementation of the vikunja functions and which should normally not used by the user in an extra namespace, like the existing vikunja::operators (but this needs a better name).

In my opinion the vikunja user namespace depends on the namespace of the algorithm, because I think it decides what the namespace vikunja contains. I have three ideas.

To make it easier to understand, I use the algorithm transform.

  1. There is only vikunja::transform. Either vikunja::transform throws an error, if the acc cannot access the memory or it automatically copies the memory to the correct memory type.
  2. There is vikunja::host::transform and vikunja::device::transform. If the acc cannot access the memory, it throws an compile error.
  3. There is vikunja::transform, vikunja::host::transform and vikunja::device::transform. vikunja::host::transform and vikunja::device::transform throws an compile error if the acc cannot access the memory. vikunja::transform is ether an alias of vikunja::device::transform or vikunja::host::transform depending of the acc type or it automatically copies the memory to the correct buffer type.
  • Option1: There is only the flat namespace vikunja and contains all.
  • Option 2: Ether does not provide the flat namespace vikunja or the namespace vikunja contains everything except the algorithm and the implementation details or it contains only function "common", widely used functions.
  • Option3: The namespace vikunja contains everything except the algorithm and the implementation details or it contains only function "common", widely used functions

My personal favorite is Option 3 and the namespace vikunja contains "common" used functions.