Skip to content

Instantly share code, notes, and snippets.

View mgaunard's full-sized avatar

Mathias Gaunard mgaunard

  • Crypto startup
  • London
View GitHub Profile
#!/bin/bash
echo ${1-1000} functions
echo ${2-10} overloads per function
echo ${3-50} depth of hierarchy
echo ${4-5} arity
echo $'\nWith one dispatching function...'
./generate.py 1 $@ > test.cpp
time g++ -fsyntax-only test.cpp
get_property(DEFINITIONS DIRECTORY PROPERTY DEFINITIONS)
if(DEFINITIONS MATCHES "-fexceptions")
string(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS_${build_type_U} ${CMAKE_CXX_FLAGS_${build_type_U}})
endif()
#include <iostream>
#include <typeinfo>
#include <cxxabi.h>
template<class F, class Args>
struct expr
{
Args args;
};
#include <iostream>
#include <typeinfo>
template<class T>
void print_type(T)
{
std::cout << __PRETTY_FUNCTION__ << std::endl;
std::cout << typeid(T).name() << std::endl;
}
@mgaunard
mgaunard / ipa.js
Last active August 29, 2015 14:00 — forked from tantalor/ipa.js
// This work is licensed under the Creative Commons Attribution 3.0 United States License. To view
// a copy of this license, visit http://creativecommons.org/licenses/by/3.0/us/ or send a letter
// to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
// Copyright 2009 John Tantalo <[email protected]>
// Copyright 2014 Mathias Gaunard <[email protected]>
(function () {
// get selection
var selection = window.getSelection ? window.getSelection() :

Test :

  • a
  • b
\begin{variations}
x & \mI & & -1 & & \sqrt2 & & 3 & \\
\filet
f’(x) & \ga- & \z & + & \z & \dr+ & \bd \\
\filet
\m{f(x)} & \h1 & \d & 0 & \cb & \m{\frac{1}{4}} & \ch & \h\pI & \bd \\
\end{variations}
template<class T, class X>
struct soa_proxy
{
BOOST_FORCEINLINE soa_proxy(native<T, X>& data_, std::size_t index_) : data(data_), index(index_)
{
}
BOOST_FORCEINLINE soa_proxy& operator=(T const& other) const
{
typename dispatch::make_functor<tag::insert_, T>::type()(other, data, index);
//==============================================================================
// Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//==============================================================================
#ifndef BOOST_SIMD_SDK_SIMD_PACK_DOMAIN_HPP_INCLUDED
#define BOOST_SIMD_SDK_SIMD_PACK_DOMAIN_HPP_INCLUDED
@mgaunard
mgaunard / gist:5685444
Last active December 17, 2015 22:58 — forked from anonymous/gist:5685297
//==============================================================================
// Copyright 2003 - 2012 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2012 LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//==============================================================================
#define NT2_UNIT_MODULE "nt2 arithmetic toolbox - abs/simd Mode"