Commit fa346094 authored by root's avatar root

g++-6 support

parent d73c5c2c
......@@ -2723,9 +2723,8 @@ namespace bxx {
template<device D, bool Capture, typename F, typename... T>
struct lambda_kernel : public kernel<D, lambda_kernel<D, Capture, F, T...> > {
typedef void(*ftype)(T..., F*);
static void fw(T... args, F* func){ (*func)(args...); delete func; }
static constexpr ftype c = &fw;
static void c(T... args, F* func){ (*func)(args...); delete func; }
using ftype = decltype( &c );
template<typename L, typename... Args>
static void dispatch(L& func, Args&& ... values){
......@@ -2735,9 +2734,8 @@ namespace bxx {
template<device D, typename F, typename... T>
struct lambda_kernel<D, false, F, T...> : public kernel<D, lambda_kernel<D, false, F, T...> > {
typedef void(*ftype)(T..., F&);
static void fw(T... args, F& func){ func(args...); }
static constexpr ftype c = &fw;
static void c(T... args, F& func){ func(args...); }
using ftype = decltype( &c );
template<typename L, typename... Args>
static void dispatch(L& func, Args&& ... values){
......
#include "utils/bind.hpp"
#include <unordered_map>
#include <mutex>
#include <numeric>
// {{{ helper traits
namespace std {
......
......@@ -32,9 +32,8 @@ namespace bxx {
template<device D, bool Capture, typename F, typename... T>
struct lambda_kernel : public kernel<D, lambda_kernel<D, Capture, F, T...> > {
typedef void(*ftype)(T..., F*);
static void fw(T... args, F* func){ (*func)(args...); delete func; }
static constexpr ftype c = &fw;
static void c(T... args, F* func){ (*func)(args...); delete func; }
using ftype = decltype( &c );
template<typename L, typename... Args>
static void dispatch(L& func, Args&& ... values){
......@@ -44,9 +43,8 @@ namespace bxx {
template<device D, typename F, typename... T>
struct lambda_kernel<D, false, F, T...> : public kernel<D, lambda_kernel<D, false, F, T...> > {
typedef void(*ftype)(T..., F&);
static void fw(T... args, F& func){ func(args...); }
static constexpr ftype c = &fw;
static void c(T... args, F& func){ func(args...); }
using ftype = decltype( &c );
template<typename L, typename... Args>
static void dispatch(L& func, Args&& ... values){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment