Skip to content

Commit

Permalink
Work - switched to my new workflow library
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias.maier2 committed Aug 7, 2019
1 parent e2cfda7 commit 50ef538
Show file tree
Hide file tree
Showing 19 changed files with 734 additions and 907 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Expand Up @@ -13,3 +13,6 @@
[submodule "misc/submodules/libcuckoo"]
path = misc/submodules/libcuckoo
url = https://github.com/efficient/libcuckoo.git
[submodule "utils"]
path = utils
url = https://github.com/TooBiased/utils_tm.git
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -71,7 +71,7 @@ set (OLD_FLAGS ${CMAKE_CXX_FLAGS})
# set (CMAKE_CXX_FLAGS
# "${CMAKE_CXX_FLAGS} -std=c++1y -g -msse4.2 -mcx16 -Wall -Wextra -O3")

set (FLAGS "-std=c++1y -g -msse4.2 -mcx16 -Wall -Wextra -O3")
set (FLAGS "-std=c++17 -g -msse4.2 -mcx16 -Wall -Wextra -O3")

include_directories(.)

Expand Down
3 changes: 2 additions & 1 deletion data-structures/base_circular.h
Expand Up @@ -18,13 +18,14 @@
#include <atomic>
#include <stdexcept>

#include "utils/default_hash.hpp"
#include "data-structures/returnelement.h"
#include "data-structures/base_iterator.h"
#include "example/update_fcts.h"

namespace growt {

template<class E, class HashFct = std::hash<typename E::key_type>,
template<class E, class HashFct = utils_tm::hash_tm::default_hash,
class A = std::allocator<E>>
class BaseCircular
{
Expand Down
4 changes: 0 additions & 4 deletions data-structures/grow_table.h
Expand Up @@ -19,12 +19,10 @@

#include <atomic>
#include <memory>
//#include <iostream>

#include "data-structures/returnelement.h"
#include "data-structures/grow_iterator.h"
#include "example/update_fcts.h"
#include "utils/concurrentptrarray.h"

namespace growt {

Expand Down Expand Up @@ -149,8 +147,6 @@ class GrowTableData
mutable typename ExclusionStrat_t::global_data_t _global_exclusion;
mutable typename WorkerStrat_t ::global_data_t _global_worker;

// mutable ConcurrentPtrArray<Handle> handle_ptr;

// APPROXIMATE COUNTS
alignas(64) std::atomic_int _elements;
alignas(64) std::atomic_int _dummies;
Expand Down
5 changes: 3 additions & 2 deletions data-structures/seqcircular.h
Expand Up @@ -15,6 +15,7 @@
#ifndef SEQCIRCULAR
#define SEQCIRCULAR

#include "utils/default_hash.hpp"
#include "data-structures/base_circular.h"

namespace growt {
Expand Down Expand Up @@ -100,9 +101,9 @@ class SeqIterator
};


template<class E, class HashFct = std::hash<typename E::key_type>,
template<class E, class HashFct = utils_tm::hash_tm::default_hash,
class A = std::allocator<E>>
class SeqCircular : public BaseCircular<E, HashFct>
class SeqCircular : public BaseCircular<E, HashFct, A>
{
private:
using This_t = SeqCircular<E,HashFct,A>;
Expand Down
2 changes: 1 addition & 1 deletion data-structures/strategy/wstrat_pool.h
Expand Up @@ -13,7 +13,7 @@
#ifndef WSTRAT_POOL_H
#define WSTRAT_POOL_H

#include "utils/counting_wait.h"
#include "allocator/counting_wait.h"

#include <atomic>
#include <thread>
Expand Down
2 changes: 1 addition & 1 deletion data-structures/tsx_definitions.h
@@ -1,4 +1,4 @@
/*******************************************************************************
q/*******************************************************************************
* data-structures/definitions.h
*
* Convenience file that defines some often used hash table variants.
Expand Down
14 changes: 8 additions & 6 deletions example/example.cpp
Expand Up @@ -2,15 +2,17 @@
#include <thread>
#include <random>

#define MURMUR2
#include "utils/hashfct.h"
#include "utils/hash/murmur2_hash.h"
#include "allocator/alignedallocator.h"

#include "utils/alignedallocator.h"
using murmur2_hash = utils_tm::hash_tm::murmur2_hash;

//////////////////////////////////////////////////////////////
// USING definitions.h (possibly slower compilation)
#include "data-structures/definitions.h"
using Table_t = growt::uaGrow<murmur2_hasher, growt::AlignedAllocator<> >;

using Table_t = growt::uaGrow<murmur2_hash,
growt::AlignedAllocator<> >;

//////////////////////////////////////////////////////////////
// EQUAL RESULT without definitions.h (possibly faster compilation)
Expand All @@ -21,7 +23,7 @@ using Table_t = growt::uaGrow<murmur2_hasher, growt::AlignedAllocator<> >;
// #include "data-structures/strategy/estrat_async.h"
// #include "data-structures/growtable.h"
// using Table_t = growt::GrowTable<growt::Circular<growt::MarkableElement,
// murmur2_hasher,
// murmur2_hash,
// growt::AlignedAllocator<> >,
// growt::WStratUser,
// growt::EStratAsync>
Expand Down Expand Up @@ -63,7 +65,7 @@ void search_n_and_mean(Table_t& table, size_t n)

size_t count = 0;
size_t sum = 0;
murmur2_hasher randomizer{};
murmur2_hash randomizer{};

for (size_t i = 0; i < n; ++i)
{
Expand Down
9 changes: 4 additions & 5 deletions example/range_example.cpp
Expand Up @@ -3,15 +3,14 @@
#include <random>
#include <cmath>

#define MURMUR2
#include "utils/hashfct.h"

#include "utils/alignedallocator.h"
#include "utils/hash/murmur2_hash.h"
#include "allocator/alignedallocator.h"
using murmur2_hash = utils_tm::hash_tm::murmur2_hash;

//////////////////////////////////////////////////////////////
// USING definitions.h (possibly slower compilation)
#include "data-structures/definitions.h"
using Table_t = growt::uaGrow<murmur2_hasher, growt::AlignedAllocator<> >;
using Table_t = growt::uaGrow<murmur2_hash, growt::AlignedAllocator<> >;

static std::atomic_size_t aggregator_static {0};
static std::atomic_size_t aggregator_dynamic{0};
Expand Down

0 comments on commit 50ef538

Please sign in to comment.