Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better allocator support #2

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# YAML 1.2
# Metadata for citation of this software according to the CFF format (https://citation-file-format.github.io/)
cff-version: 1.0.3
message: If you use this software, please cite it using these metadata.
title: 'Hashinator: A hybrid hashmap designed for heterogeneous computing.'
doi: 10.5281/zenodo.11396297
authors:
- given-names: Kostis
family-names: Papadakis
affiliation: University of Helsinki
- given-names: Markus
family-names: Battarbee
affiliation: University of Helsinki
- given-names: René
family-names: Widera
affiliation:
version: 1.0.1
date-released: 2024-05-30
repository-code: https://github.com/fmihpc/hashinator
license: cc-by-4.0
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ No installation required. Just include  "hashinator.h" . However, if you plan

## Run the tests
```
meson wrap install gtest # skip if you have gtest installed system wide and pkg-config can find it.
meson setup build --buildtype=release
cd hashinator
mkdir subprojects
meson wrap install gtest
meson setup build --buildtype=release
meson compile -C build --jobs=8
meson test -C build
```
kstppd marked this conversation as resolved.
Show resolved Hide resolved

Expand Down Expand Up @@ -150,6 +153,45 @@ int main()
hmap.insert(src.data(),src.size());
}
```
### Hashinator and SplitVector can also be used with external allocators

```c++
#include "splitvec.h"
//main.cu
using vector = split::SplitVector<int,std::allocator<int>>;


int main()
{
vector* vec = new vector{1,2,3,4,5};
vec->reserve(128);
std::cout<<vec[3]<<std::endl;
delete vec;
}
```

```c++
//main.cpp
#include "hashinator.h"

int main()
{

   Hashmap<uint32_t,uint32_t,std::allocator<uint32_t>> hmap;

   //Write
   for (uint32_t i=0 ; i<64; ++i){
      hmap[i]=rand()%10000;
   }

   //Read
   for (const auto& i:hmap){
      std::cout<<"["<<i.first<<" "<<i.second<<"] ";
   }
   std::cout<<std::endl;
}
```

`nvcc main.cu -std=c++17 --expt-relaxed-constexpr --expt-extended-lambda -gencode arch=compute_80,code=sm_80 -o example`

You can have a look in the Doxygen for a more feature-rich explanation of the methods and tools included!
Expand Down
Loading