#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 | MAX(a, b) ((a) < (b) ? (b) : (a)) |
#define | MIN(a, b) ((a) > (b) ? (b) : (a)) |
#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, MTA, 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 81 of file common.hpp.
#define AUTO_CONSTRUCTOR | ( | className, | |
members | |||
) | AUTO_CONSTRUCTOR_DETAIL(className, members) |
Definition at line 296 of file common.hpp.
#define AUTO_CONSTRUCTOR_DETAIL | ( | className, | |
members | |||
) |
Definition at line 289 of file common.hpp.
Definition at line 286 of file common.hpp.
Definition at line 280 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 299 of file common.hpp.
#define BILLION (1000ULL * MILLION) |
Definition at line 71 of file common.hpp.
#define CACHE_LINE_SIZE (64ULL) |
Definition at line 67 of file common.hpp.
#define CAT_EACH | ( | r, | |
data, | |||
elem | |||
) | BOOST_PP_CAT(elem, data) |
Definition at line 278 of file common.hpp.
Definition at line 283 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 157 of file common.hpp.
#define FUNCTOR | ( | name, | |
members | |||
) |
Definition at line 306 of file common.hpp.
#define GET_NAME | ( | member | ) | BOOST_PP_TUPLE_ELEM(2,1,member) |
Definition at line 276 of file common.hpp.
#define GET_TYPE | ( | member | ) | BOOST_PP_TUPLE_ELEM(2,0,member) |
Definition at line 274 of file common.hpp.
#define GIGA (1024ULL * MEGA) |
Definition at line 64 of file common.hpp.
#define GRAPPA_DEPRECATED __attribute__((deprecated)) |
Use to deprecate old APIs.
Definition at line 87 of file common.hpp.
#define GRAPPA_TIME | ( | var, | |
block | |||
) |
Definition at line 123 of file common.hpp.
#define GRAPPA_TIME_LOG | ( | name | ) |
Definition at line 135 of file common.hpp.
#define GRAPPA_TIME_REGION | ( | var | ) |
Definition at line 144 of file common.hpp.
#define GRAPPA_TIME_VLOG | ( | level, | |
name, | |||
indent | |||
) |
Definition at line 139 of file common.hpp.
#define GRAPPA_TIMER | ( | var | ) |
Definition at line 130 of file common.hpp.
#define KILO (1024ULL * ONE) |
Definition at line 62 of file common.hpp.
#define MAX | ( | a, | |
b | |||
) | ((a) < (b) ? (b) : (a)) |
Definition at line 74 of file common.hpp.
#define MEGA (1024ULL * KILO) |
Definition at line 63 of file common.hpp.
#define MILLION (1000ULL * THOUSAND) |
Definition at line 70 of file common.hpp.
#define MIN | ( | a, | |
b | |||
) | ((a) > (b) ? (b) : (a)) |
Definition at line 77 of file common.hpp.
#define ONE (1ULL) |
Definition at line 61 of file common.hpp.
#define PETA (1024ULL * TERA) |
Definition at line 66 of file common.hpp.
#define rdtscll | ( | val | ) |
Read 64-bit timestamp counter.
Definition at line 188 of file common.hpp.
#define SIZE_OF_CACHE (MEGA * 64ULL) |
Definition at line 68 of file common.hpp.
#define TERA (1024ULL * GIGA) |
Definition at line 65 of file common.hpp.
#define THOUSAND (1000ULL * ONE) |
Definition at line 69 of file common.hpp.
range for block distribution
Definition at line 240 of file common.hpp.
|
inline |
Definition at line 248 of file common.hpp.
|
inline |
Definition at line 322 of file common.hpp.
|
inline |
Definition at line 319 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 204 of file common.hpp.
|
inline |
Definition at line 260 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 45 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 210 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 216 of file common.hpp.
T min_element | ( | Range< T > | r, |
Comparator | cmp | ||
) |
Helper for invoking 'std::min_element' on a Range.
Definition at line 229 of file common.hpp.
Definition at line 243 of file common.hpp.