Skip to content

Instantly share code, notes, and snippets.

@pesterie
pesterie / gist:1386041
Created November 22, 2011 16:16
Fusion error 4.4/1.47
In file included from /home/rmontagne/Travaux/NT2/nt2/modules/core/include/nt2/core/container/dsl.hpp:20,
from /home/rmontagne/Travaux/NT2/nt2/modules/core/include/nt2/core/container/table/table.hpp:12,
from /home/rmontagne/Travaux/NT2/nt2/modules/core/include/nt2/table.hpp:17,
from /home/rmontagne/Travaux/NT2/nt2/modules/core/unit/functions/length.cpp:11:
/home/rmontagne/Travaux/NT2/nt2/modules/core/include/nt2/dsl/functions/container/terminal.hpp: In member function ‘typename Data::type nt2::ext::implement<boost::simd::tag::terminal_(boost::dispatch::meta::ast_<boost::dispatch::meta::table_<boost::dispatch::meta::unspecified_<T>, Size> >, boost::dispatch::meta::fusion_sequence_<State>, boost::dispatch::meta::target_<boost::dispatch::meta::simd_<boost::dispatch::meta::unspecified_<A2>, X> >), boost::dispatch::tag::cpu_, void>::operator()(const A0&, const State&, const Data&) const’:
/home/rmontagne/Travaux/NT2/nt2/modules/core/include/nt2/dsl/functions/container/terminal.hpp:126: error: ‘load’ was not declar
/home/pesterie-lin64/Documents/dev/nt2/metascale/nt2/modules/core/unit/container/dsl/run.cpp:65: instantiated from here
/usr/local/include/boost/mpl/at.hpp:42: error: ‘template<class Sequence, long int N> struct boost::mpl::at_c’ is not a function,
/usr/local/include/boost/fusion/sequence/intrinsic/at.hpp:99: error: conflict with ‘template<int N, class Sequence> typename boost::fusion::result_of::at_c<const Sequence, N>::type boost::fusion::at_c(const Sequence&)’
/home/pesterie-lin64/Documents/dev/nt2/metascale/nt2/modules/core/include/nt2/core/container/meta/loop_nest.hpp:87: error: in call to ‘at_c’
/usr/local/include/boost/mpl/at.hpp:42: error: ‘template<class Sequence, long int N> struct boost::mpl::at_c’ is not a function,
/usr/local/include/boost/fusion/sequence/intrinsic/at.hpp:99: error: conflict with ‘template<int N, class Sequence> typename boost::fusion::result_of::at_c<const Sequence, N>::type boost::fusion::at_c(const Sequence&)’
/home/pesterie-lin64/Documents/dev/nt2/metascale/nt2/module
template<class Iterator>
iterator<typename boost::pointee<Iterator>::value_type>
begin(Iterator p)
{ return iterator<typename boost::pointee<Iterator>::value_type>(p); }
template<class Iterator, std::size_t C>
iterator<typename boost::pointee<Iterator>::value_type,C>
begin(Iterator p)
{ return iterator<typename boost::pointee<Iterator>::value_type,C>(p); }
@pesterie
pesterie / saxpi.cpp
Created January 9, 2012 17:07
Bench problem
//==============================================================================
// Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2011 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
//==============================================================================
#include <cstdlib>
#include <vector>
#include <iostream>
#include <algorithm>
template<int N>
struct unroll
{
template<class InputIterator, class OutputIterator, class Op>
inline static OutputIterator
apply( InputIterator& i, OutputIterator o, Op f)
40734e: 0f 84 93 01 00 00 je 4074e7 <_ZN3nt24unit17perform_benchmarkINS_7example14diffusion_simdIfEEmEEvT_dRNS0_16benchmark_resultIT0_EE+0x3447>
407354: f3 0f 10 8c 24 50 09 movss 0x950(%rsp),%xmm1
40735b: 00 00
40735d: 48 89 c8 mov %rcx,%rax
407360: 31 d2 xor %edx,%edx
407362: 48 f7 b4 24 30 09 00 divq 0x930(%rsp)
407369: 00
40736a: 8b bc 24 d0 08 00 00 mov 0x8d0(%rsp),%edi
407371: 01 d7 add %edx,%edi
407373: 31 d2 xor %edx,%edx
@pesterie
pesterie / functor.cpp
Created July 5, 2012 21:58
register functor
#include <hpx/hpx.hpp>
#include <hpx/hpx_init.hpp>
#include <hpx/runtime/actions/plain_action.hpp>
#include <hpx/components/dataflow/dataflow.hpp>
#include <iostream>
#include <cstdlib>
template<class T>
struct add_
// In a header file
#include <user_main_fwd.hpp>
#define main nt2::user_main
//In a library
#include <...>
int hpx_main(boost::program_options::variables_map& vm)
{
template<typename Tensor>
inline auto moveaxis(Tensor&& t, std::size_t source, std::size_t destination)
{
using size_type = typename std::decay_t<Tensor>::size_type;
if(source >= t.dimension() || destination >= t.dimension())
{
throw std::runtime_error("Cant't move axis, source has not the same length as destination.");
}
namespace xt
{
template<typename Tensor>
inline auto moveaxis(Tensor&& t, std::size_t source, std::size_t destination)
{
using shape_type = typename std::decay_t<Tensor>::shape_type;
if(source >= t.dimension() || destination >= t.dimension())
{
throw std::runtime_error("Cant't move axis, source has not the same length as destination.");