This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef POLICY_BASE_HPP_ | |
#define POLICY_BASE_HPP_ | |
#include <cstdio> | |
#include "meta.hpp" | |
// Policy base | |
enum class Policy { seq, openmp, target_openmp }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find_package(Clang REQUIRED) | |
set(CLANG_LIBRARIES clangAST clangASTMatchers clangAnalysis clangBasic clangDriver clangEdit clangFrontend clangFrontendTool clangLex clangParse clangSema clangEdit clangRewrite clangRewriteFrontend clangStaticAnalyzerFrontend clangStaticAnalyzerCheckers clangStaticAnalyzerCore clangSerialization clangToolingCore clangTooling clangFormat) | |
macro(add_clang_plugin _name) | |
add_library(${_name} SHARED "") | |
set_target_properties(${_name} | |
PROPERTIES | |
CXX_STANDARD 11 | |
CXX_STANDARD_REQUIRED On |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdarg.h> | |
static void d̰̞ͅi̜̣̣̤̪s͎̬̙p̫̞͕̹̣͉̙a̘̞̼͕̲ͅt̰̳c͚̟̳͎̻̘ͅh̻͠(const char* f̢̬͉̥̮͈̦̤m̨t̴̝̳, ...) | |
{ | |
va_list a̢͍͉̪͝p̨̙͎͙̳; | |
va_start(a̢͍͉̪͝p̨̙͎͙̳, f̢̬͉̥̮͈̦̤m̨t̴̝̳); | |
vfprintf(stderr, f̢̬͉̥̮͈̦̤m̨t̴̝̳, a̢͍͉̪͝p̨̙͎͙̳); | |
va_end(a̢͍͉̪͝p̨̙͎͙̳); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "json.hpp" | |
namespace json { | |
Wrapper::Wrapper(Value const &value) : v{value} {} | |
Wrapper::Wrapper(Value &value) : v{value} {} | |
Wrapper::operator Value &() { return v; } | |
Wrapper::operator Value const &() const { return v; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <type_traits> | |
#include <utility> | |
namespace detail { | |
template <typename Seq, std::size_t Idx, typename T, T Val, T DefaultVal> | |
struct make_list_with_index_value; | |
template <std::size_t Idx, typename T, T Val, T DefaultVal, std::size_t ... Ids> | |
struct make_list_with_index_value<std::index_sequence<Ids...>, Idx, T, Val, DefaultVal> { | |
using type = std::integer_sequence<T, ((Idx == Ids) ? Val : DefaultVal)...>; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace impl { | |
template <template <class ...> class L, class = L<>, class = L<>, class ...> | |
struct concat_ { | |
using type = L<>; | |
}; | |
template <template <class ...> class L, | |
template <class ...> class L1, class ... T1> | |
struct concat_<L, L1<T1...>> { | |
using type = L<T1...>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <type_traits> | |
template <typename T, typename Tag> | |
struct StrongType { | |
T value; | |
explicit StrongType(T v) : value(v) {} | |
StrongType() = default; | |
StrongType(StrongType const &) = default; | |
StrongType(StrongType &&) = default; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// use C++11 to compile | |
#include <array> | |
#include <limits> | |
#include <numeric> | |
#include <type_traits> | |
#ifdef _OPENMP | |
#include <omp.h> | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Expressive Pi | |
// ------------- | |
// | |
// Fluent C++ Blog Post: The Pi Day Challenge for Expressive Code | |
// http://www.fluentcpp.com/2017/03/02/the-pi-day-challenge-for-expressive-code-in-c/ | |
// | |
// Author: William Killian | |
// Email: [email protected] | |
// Github: http://www.github.com/willkill07 | |
// Website: https://www.eecis.udel.edu/~wkillian |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BasedOnStyle: Mozilla | |
AlignAfterOpenBracket: Align | |
AlignEscapedNewlinesLeft: 'true' | |
AlignOperands: 'true' | |
AlignTrailingComments: 'true' | |
AllowAllParametersOfDeclarationOnNextLine: 'false' | |
AllowShortBlocksOnASingleLine: 'false' | |
AllowShortCaseLabelsOnASingleLine: 'false' | |
AllowShortFunctionsOnASingleLine: None | |
AllowShortIfStatementsOnASingleLine: 'false' |