Open alobb opened 7 years ago
Some things I have tried to fix this:
Added the following line to iota_view
using value_type = typename std::iterator_traits<iterator>::value_type;
Added the following function to counting_iterator
__AGENCY_ANNOTATION
difference_type operator-(counting_iterator it) const
{
return (operator*()) - (*it);
}
These have reduced the number of errors, but I haven't figured out the errors from trying to create a span
within the nested function calls.
Looking more closely at the span
class (and being very unfamiliar with the code, so take this with a grain of salt), I don't see a clear way to create a span from the interval; it looks like span
holds a pointer to the data, but the interval doesn't actually point to any data, since it is just a begin and end integer.
Thanks for the report and reproducer program. I can reproduce the problem on my system.
I've run into this problem before. I think the root of the problem is issue #305.
The basic problem is the way all()
is called. I'm testing a fix now that seems to compile OK.
The master branch should compile your reproducer program now:
$ cat test.cpp
#include <agency/experimental.hpp>
int main()
{
auto intervals = agency::experimental::interval(0,10);
auto tiles = agency::experimental::tile_evenly(intervals, 2);
return 0;
}
$ g++ -I. -std=c++11 test.cpp
$ ./a.out
Please let me know if this solves the problem with your original program.
That did get the minified example to compile, thanks! Unfortunately, I have a new minified example that fails.
#include <agency/agency.hpp>
#include <agency/experimental.hpp>
int main()
{
return 0;
}
Meta:
84 % git --no-pager log -1
commit 66436cd211824fe40eb9629741e944fd36df742b
Merge: 397e012 076239a
Author: Jared Hoberock <jaredhoberock@gmail.com>
Date: Mon Jan 23 18:24:40 2017 -0600
Merge pull request #335 from jaredhoberock/issue-334
Add counting_iterator::operator-(counting_iterator)
82 % g++ --version
g++ (Gentoo 4.9.4 p1.0, pie-0.6.4) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
83 % g++ -I ../agency/ -std=c++11 main.cpp
Thanks. I also see a problem with g++-4.8
. The error log begins with:
In file included from ./agency/execution/execution_agent.hpp:13:0,
from ./agency/detail/control_structures/agent_shared_parameter_factory_tuple.hpp:6,
from ./agency/detail/control_structures/bulk_invoke_execution_policy.hpp:11,
from ./agency/detail/control_structures/bulk_async_execution_policy.hpp:8,
from ./agency/bulk_async.hpp:8,
from ./agency/agency.hpp:18,
from test.cpp:1:
./agency/detail/memory/resource/arena_resource.hpp:42:57: error: ‘max_align_t’ is not a member of ‘std’
template<std::size_t N, std::size_t alignment = alignof(std::max_align_t)>
^
./agency/detail/memory/resource/arena_resource.hpp:42:57: note: suggested alternative:
In file included from ./agency/detail/integer_sequence.hpp:4:0,
from ./agency/detail/control_structures/bind.hpp:4,
from ./agency/async.hpp:4,
from ./agency/agency.hpp:17,
from test.cpp:1:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stddef.h:425:3: note: ‘max_align_t’
} max_align_t;
...
Does this agree with what you observe? In the meantime, I'll try to get access to g++-4.9
.
I have been using this g++
, which doesn't appear to produce the problems from your new example:
$ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Interestingly, clang-3.7.1 compiles it without errors, so this might be an issue of the compiler being too old. Sorry for not including the error, here is the full text: error.txt
It looks like the error messages from g++-4.9
aren't the same as g++-4.8
.
Thanks for posting the error message. Yes, this is a case where a bug present in an older version of gcc is causing a problem parsing the code. There may be a way to rewrite the code to workaround the issue.
Meta:
When trying to create tiled intervals like in the following code, Agency gives errors for failed template substitutions:
The command to compile this was:
error.txt