#include <stdint.h>
#include <iostream>
#include <glog/logging.h>
#include <memory>
#include <algorithm>
#include <cstddef>
#include <time.h>
Go to the source code of this file.
Classes | |
struct | Range< T > |
Range type that represents the values [start,end) . More... | |
struct | block_offset_t |
struct | Functor |
Namespaces | |
Grappa | |
this core's base pointer | |
bittwiddle | |
Macros | |
#define | ONE (1ULL) |
#define | KILO (1024ULL * ONE) |
#define | MEGA (1024ULL * KILO) |
#define | GIGA (1024ULL * MEGA) |
#define | TERA (1024ULL * GIGA) |
#define | PETA (1024ULL * TERA) |
#define | CACHE_LINE_SIZE (64ULL) |
#define | SIZE_OF_CACHE (MEGA * 64ULL) |
#define | THOUSAND (1000ULL * ONE) |
#define | MILLION (1000ULL * THOUSAND) |
#define | BILLION (1000ULL * MILLION) |
#define | ALIGN_UP(x, y) |
#define | GRAPPA_DEPRECATED __attribute__((deprecated)) |
Use to deprecate old APIs. More... | |
#define | GRAPPA_TIME(var, block) |
#define | GRAPPA_TIMER(var) |
#define | GRAPPA_TIME_LOG(name) |
#define | GRAPPA_TIME_VLOG(level, name, indent) |
#define | GRAPPA_TIME_REGION(var) |
#define | DISALLOW_COPY_AND_ASSIGN(Name) |
Disable copy constructor and assignment operator. More... | |
#define | rdtscll(val) |
Read 64-bit timestamp counter. More... | |
#define | GET_TYPE(member) BOOST_PP_TUPLE_ELEM(2,0,member) |
#define | GET_NAME(member) BOOST_PP_TUPLE_ELEM(2,1,member) |
#define | CAT_EACH(r, data, elem) BOOST_PP_CAT(elem, data) |
#define | AUTO_CONSTRUCTOR_DETAIL_PARAM(r, data, member) GET_TYPE(member) GET_NAME(member) |
#define | DECL_W_TYPE(r, data, member) GET_TYPE(member) GET_NAME(member); |
#define | AUTO_CONSTRUCTOR_DETAIL_INIT(r, data, member) GET_NAME(member) ( GET_NAME(member) ) |
#define | AUTO_CONSTRUCTOR_DETAIL(className, members) |
#define | AUTO_CONSTRUCTOR(className, members) AUTO_CONSTRUCTOR_DETAIL(className, members) |
#define | AUTO_DECLS(members) BOOST_PP_SEQ_FOR_EACH(CAT_EACH, ,BOOST_PP_SEQ_TRANSFORM(DECL_W_TYPE, BOOST_PP_EMPTY, members)) |
#define | FUNCTOR(name, members) |
#define | CHECK_NULL(val) Grappa::impl::CheckNull(__FILE__, __LINE__, "'" #val "' Must be non NULL", (val)) |
#define | DCHECK_NULL(val) ; |
#define | MPI_CHECK(mpi_call) |
Typedefs | |
using | range_t = Range< int64_t > |
range for block distribution More... | |
Enumerations | |
enum | Grappa::TaskMode { Grappa::TaskMode::Bound, Grappa::TaskMode::Unbound } |
Specify whether tasks are bound to the core they're spawned on, or if they can be load-balanced (via work-stealing). More... | |
enum | Grappa::SyncMode { Grappa::SyncMode::Blocking, Grappa::SyncMode::Async } |
Specify whether an operation blocks until complete, or returns "immediately". More... | |
Functions | |
template<typename T , typename... Args> | |
std::unique_ptr< T > | make_unique (Args &&...args) |
Construct unique_ptr more easily. More... | |
double | Grappa::walltime (void) |
"Universal" wallclock time (works at least for Mac, and most Linux) More... | |
template<typename T , unsigned B> | |
T | bittwiddle::signextend (const T x) |
Sign extension. More... | |
unsigned int | bittwiddle::log2 (unsigned int v) |
Base 2 log of 32-bit number. More... | |
template<typename T > | |
T * | Grappa_magic_identity_function (T *t) |
OMGWTFBBQ Grappa magic identity function Use this to get a pointer to a template function inside a template function, etc. More... | |
template<typename Container , typename Comparator > | |
auto | min_element (const Container &c, Comparator cmp) -> decltype(*c.begin()) |
Helper for invoking 'std::min_element' on containers. More... | |
template<typename Container , typename Comparator > | |
auto | min_element (const Container &c0, const Container &c1, Comparator cmp) -> decltype(*c0.begin()) |
Helper for invoking 'std::min_element' on containers. More... | |
template<typename T , typename Comparator > | |
T | min_element (Range< T > r, Comparator cmp) |
Helper for invoking 'std::min_element' on a Range. More... | |
std::ostream & | operator<< (std::ostream &o, const range_t &r) |
range_t | blockDist (int64_t start, int64_t end, int64_t rank, int64_t numBlocks) |
block_offset_t | indexToBlock (int64_t index, int64_t numElements, int64_t numBlocks) |
void | fast_srand (int seed) |
int | fast_rand () |
template<typename T > | |
const char * | Grappa::typename_of () |
Get string containing name of type. More... | |
template<typename T > | |
const char * | Grappa::typename_of (const T &unused) |
Get string containing name of type. More... | |
#define ALIGN_UP | ( | x, | |
y | |||
) |
Definition at line 82 of file common.hpp.
#define AUTO_CONSTRUCTOR | ( | className, | |
members | |||
) | AUTO_CONSTRUCTOR_DETAIL(className, members) |
Definition at line 295 of file common.hpp.
#define AUTO_CONSTRUCTOR_DETAIL | ( | className, | |
members | |||
) |
Definition at line 288 of file common.hpp.
Definition at line 285 of file common.hpp.
Definition at line 279 of file common.hpp.
#define AUTO_DECLS | ( | members | ) | BOOST_PP_SEQ_FOR_EACH(CAT_EACH, ,BOOST_PP_SEQ_TRANSFORM(DECL_W_TYPE, BOOST_PP_EMPTY, members)) |
Definition at line 298 of file common.hpp.
#define BILLION (1000ULL * MILLION) |
Definition at line 79 of file common.hpp.
#define CACHE_LINE_SIZE (64ULL) |
Definition at line 75 of file common.hpp.
#define CAT_EACH | ( | r, | |
data, | |||
elem | |||
) | BOOST_PP_CAT(elem, data) |
Definition at line 277 of file common.hpp.
Definition at line 282 of file common.hpp.
#define DISALLOW_COPY_AND_ASSIGN | ( | Name | ) |
Disable copy constructor and assignment operator.
Put this in your class' private declarations. (from google public C++ coding standards)
Definition at line 156 of file common.hpp.
#define FUNCTOR | ( | name, | |
members | |||
) |
Definition at line 305 of file common.hpp.
#define GET_NAME | ( | member | ) | BOOST_PP_TUPLE_ELEM(2,1,member) |
Definition at line 275 of file common.hpp.
#define GET_TYPE | ( | member | ) | BOOST_PP_TUPLE_ELEM(2,0,member) |
Definition at line 273 of file common.hpp.
#define GIGA (1024ULL * MEGA) |
Definition at line 72 of file common.hpp.
#define GRAPPA_DEPRECATED __attribute__((deprecated)) |
Use to deprecate old APIs.
Definition at line 88 of file common.hpp.
#define GRAPPA_TIME | ( | var, | |
block | |||
) |
Definition at line 122 of file common.hpp.
#define GRAPPA_TIME_LOG | ( | name | ) |
Definition at line 134 of file common.hpp.
#define GRAPPA_TIME_REGION | ( | var | ) |
Definition at line 143 of file common.hpp.
#define GRAPPA_TIME_VLOG | ( | level, | |
name, | |||
indent | |||
) |
Definition at line 138 of file common.hpp.
#define GRAPPA_TIMER | ( | var | ) |
Definition at line 129 of file common.hpp.
#define KILO (1024ULL * ONE) |
Definition at line 70 of file common.hpp.
#define MEGA (1024ULL * KILO) |
Definition at line 71 of file common.hpp.
#define MILLION (1000ULL * THOUSAND) |
Definition at line 78 of file common.hpp.
#define ONE (1ULL) |
Definition at line 69 of file common.hpp.
#define PETA (1024ULL * TERA) |
Definition at line 74 of file common.hpp.
#define rdtscll | ( | val | ) |
Read 64-bit timestamp counter.
Definition at line 187 of file common.hpp.
#define SIZE_OF_CACHE (MEGA * 64ULL) |
Definition at line 76 of file common.hpp.
#define TERA (1024ULL * GIGA) |
Definition at line 73 of file common.hpp.
#define THOUSAND (1000ULL * ONE) |
Definition at line 77 of file common.hpp.
range for block distribution
Definition at line 239 of file common.hpp.
|
inline |
Definition at line 247 of file common.hpp.
|
inline |
Definition at line 321 of file common.hpp.
|
inline |
Definition at line 318 of file common.hpp.
T* Grappa_magic_identity_function | ( | T * | t | ) |
OMGWTFBBQ Grappa magic identity function Use this to get a pointer to a template function inside a template function, etc.
Definition at line 203 of file common.hpp.
|
inline |
Definition at line 259 of file common.hpp.
std::unique_ptr<T> make_unique | ( | Args &&... | args | ) |
Construct unique_ptr more easily.
(to be included in C++1y)
Definition at line 56 of file common.hpp.
auto min_element | ( | const Container & | c, |
Comparator | cmp | ||
) | -> decltype(*c.begin()) |
Helper for invoking 'std::min_element' on containers.
Definition at line 209 of file common.hpp.
auto min_element | ( | const Container & | c0, |
const Container & | c1, | ||
Comparator | cmp | ||
) | -> decltype(*c0.begin()) |
Helper for invoking 'std::min_element' on containers.
Definition at line 215 of file common.hpp.
T min_element | ( | Range< T > | r, |
Comparator | cmp | ||
) |
Helper for invoking 'std::min_element' on a Range.
Definition at line 228 of file common.hpp.
|
inline |
Definition at line 242 of file common.hpp.