00:09
Nikunj__ has quit [Read error: Connection reset by peer]
00:47
bita_ has quit [Ping timeout: 264 seconds]
02:24
hkaiser has quit [Quit: bye]
02:48
bita_ has joined #ste||ar
03:30
Yorlik has quit [Ping timeout: 264 seconds]
03:57
kale[m] has quit [Ping timeout: 244 seconds]
04:00
kale[m] has joined #ste||ar
05:54
bita_ has quit [Ping timeout: 264 seconds]
06:00
kale[m] has quit [Ping timeout: 244 seconds]
06:03
kale[m] has joined #ste||ar
07:58
kale[m] has quit [Ping timeout: 264 seconds]
07:59
kale[m] has joined #ste||ar
08:09
kale[m] has quit [Ping timeout: 244 seconds]
08:25
kale[m] has joined #ste||ar
11:12
diehlpk__ has quit [Remote host closed the connection]
11:12
diehlpk__ has joined #ste||ar
11:15
diehlpk__ has quit [Remote host closed the connection]
11:15
diehlpk__ has joined #ste||ar
12:14
mcopik has joined #ste||ar
12:14
mcopik has quit [Client Quit]
12:17
kale[m] has quit [Ping timeout: 246 seconds]
12:17
kale[m] has joined #ste||ar
12:33
hkaiser has joined #ste||ar
13:36
<
K-ballo >
michael wong mentions hpx on the latest cppcast
13:38
<
hkaiser >
K-ballo: nice!
13:52
kale[m] has quit [Ping timeout: 256 seconds]
13:52
kale[m] has joined #ste||ar
15:27
Yorlik has joined #ste||ar
16:17
nanmiao11 has joined #ste||ar
17:52
diehlpk__ has quit [Ping timeout: 260 seconds]
18:02
bita_ has joined #ste||ar
18:04
<
gonidelis[m] >
I am trying really hard to find tests for the adapted `for_each`
https://gist.github.com/gonidelis/bcacdec7af2ef079745a26578b94a669 . K-ballo suggested using `iter_sent.hpp` that is to say, the custom sentinel that hkaiser created but I think I need to find other cases too because I am really stuck with the whole adaptation not compiling. (I don't know if the comilation fail comes from the wrong test or the wrongly
18:04
<
gonidelis[m] >
adaptated foreach)
18:04
<
gonidelis[m] >
That's the test I am using thus far
18:09
<
hkaiser >
gonidelis[m]: well, the test can't get any simpler, so I'd assume it's you algorithm implementation
18:12
<
K-ballo >
last I looked the test seemed perfectly fine
18:12
nikunj has quit [Read error: Connection reset by peer]
18:12
<
gonidelis[m] >
thank you both
18:13
nikunj has joined #ste||ar
18:23
<
gonidelis[m] >
I think that the problem is that `std::forward` cannot convert `Sentinel<long int>` to `Iterator<long int>`
18:23
<
gonidelis[m] >
The thing is that I don't think it has to do that
18:23
<
gonidelis[m] >
So I speculate that since the primal declaration of `for_each` is thisQ
18:23
<
gonidelis[m] >
` typename util::detail::algorithm_result<ExPolicy, FwdIterB>::type for_each(
18:23
<
gonidelis[m] >
ExPolicy&& policy, FwdIterB first, FwdIterE last, F&& f,
18:23
<
gonidelis[m] >
Proj&& proj = Proj())`
18:24
<
gonidelis[m] >
and I am calling `hpx::parallel::for_each(hpx::parallel::execution::seq,
18:24
<
gonidelis[m] >
Iterator<std::int64_t>{0}, Sentinel<int64_t>{100}, myfunction);
18:24
nikunj has quit [Ping timeout: 244 seconds]
18:24
<
gonidelis[m] >
It interpretes `Sentinel<int_64>` as my `F&& f` argument??
18:26
nikunj has joined #ste||ar
18:27
<
gonidelis[m] >
ahh... sorry what I said was complete nonsense... Let me look closer
18:36
<
gonidelis[m] >
K-ballo: hkaiser any thoughts?
18:44
<
gonidelis[m] >
and the reason why compiler
*wants* to do this convertion is because `for_each_` (it's where `for_each` dispatches) returns `inline typename util::detail::algorithm_result<ExPolicy, FwdIterB>::type
18:44
<
gonidelis[m] >
` . Does that make sense?
19:02
<
K-ballo >
gonidelis[m]: looks like it is expected to return the iterator, but it is attempting to return the sentinel instead?
19:03
<
K-ballo >
what's the line corresponding to the algorithm_result_impl<>::call ?
19:03
<
K-ballo >
*::get call
19:29
<
gonidelis[m] >
K-ballo: sorry for the late response
19:29
<
gonidelis[m] >
9I don't know wether gists is the best way to share)
19:29
<
K-ballo >
just link to the line in your fork
19:30
<
K-ballo >
putting all of hpx on a gist would take forever
19:30
<
gonidelis[m] >
just my adapted file
19:31
<
K-ballo >
you ought to get familiar with git
19:31
<
K-ballo >
`last` is a sentinel, indeed
19:31
<
gonidelis[m] >
yeah sure
19:31
<
K-ballo >
that shouldn't be returning the sentinel, it should be returning the iterator
19:31
<
K-ballo >
when they were both iterators and they were equal, it could have returned either
19:32
<
gonidelis[m] >
hmmm....
19:32
<
gonidelis[m] >
okkk so just replace last -> first
19:32
<
K-ballo >
you are working on a branch, aren't you? you should, at least
19:32
<
gonidelis[m] >
yes I do
19:32
<
K-ballo >
and you have your own fork from which you file PRs, right?
19:33
<
K-ballo >
yes, I just found it
19:33
<
gonidelis[m] >
I was just thinking that I shouldn't push things that do not work
19:33
<
K-ballo >
as long as it is not a plubic branch, like `master`, you should push early and often
19:33
<
gonidelis[m] >
ok thanks for the advise
19:33
<
K-ballo >
and those are your branches, so you can rework them, rebase them, delete them, whatever
19:34
<
gonidelis[m] >
I get what you are saying
19:34
<
gonidelis[m] >
ok... I will push my local now so we can talk better
19:44
<
gonidelis[m] >
just made the change but now it complains in this line
19:45
<
K-ballo >
that one returns a sentinel, for some reason
19:51
<
hkaiser >
gonidelis[m]: I think we can't return last directly (it's a sentinel, we should return std::next(first, numelements) instead
19:52
<
K-ballo >
ideally without an actual call to std::next
20:01
<
gonidelis[m] >
K-ballo: ahh yeah I missed it. thank you very much
20:01
<
gonidelis[m] >
-1 error
20:03
<
gonidelis[m] >
hkaiser: ok I think I missed you here....
20:03
<
gonidelis[m] >
Why just not return `first`
20:03
<
hkaiser >
gonidelis[m]: because it has to be the end of the input sequence
20:04
<
gonidelis[m] >
But it is `first == last`
20:05
<
K-ballo >
btw it would also help to stop calling the sentinel last (as well as stop calling it an Iter)
20:05
<
gonidelis[m] >
Ok, so what's the suggestion?
20:06
<
K-ballo >
let's call a sentinel a sentienl
20:06
<
K-ballo >
ups, typo, sentinel :)
20:07
<
gonidelis[m] >
haha ok I will change it
20:07
<
gonidelis[m] >
the thing is that `last` or `IterE` could be an iterator too
20:07
<
gonidelis[m] >
Do we consider an `end` iterator as a sentinel?
20:08
<
K-ballo >
an end iterator is a sentinel
20:08
<
gonidelis[m] >
great
20:08
<
K-ballo >
we are not allowed to assume `last` may be an iterator, we have to assume it isn't
20:08
<
K-ballo >
everything should work fine whether it is or isn't
20:08
<
gonidelis[m] >
So sentinel is more of a generalization
20:08
<
gonidelis[m] >
Ok great. "Sentinel" should cover both cases then
20:11
<
gonidelis[m] >
So, back to subject: although the first error was fixes with that last change. I still have an error here
20:11
<
gonidelis[m] >
which is `cannot bind non-const lvalue reference of type ‘void (*&)(int)’ to an rvalue of type ‘void (*)(int)’
20:13
<
K-ballo >
do you have actual compiler output? and preferably matching sources
20:15
<
gonidelis[m] >
Do you want me to redirect the whole compiler output to some gist? Or do you just want more details ?
20:17
<
K-ballo >
some gist should do, there's not nearly enough information to diagnose
20:17
<
K-ballo >
supposedly `void (*&)(int)` is the type of IterE, or IterB assuming you changed that already
20:18
<
K-ballo >
a reference to a function pointer is an odd thing to deduce
20:36
<
K-ballo >
the `f` ?
20:37
<
K-ballo >
that's super odd, it doesn't match the source code
20:38
<
gonidelis[m] >
the output comes when I: `make tests.unit.modules.algorithms.foreach_adapt
20:39
<
K-ballo >
the error does make some sense though... and that decay<> is suspicious
20:40
<
K-ballo >
where's the corresponding test line that triggers this error?
20:41
<
gonidelis[m] >
for the source code matching I updated the output gist
20:41
<
gonidelis[m] >
I ran it again with the test that I have updated on the gist that you have so the lines should match now
20:41
<
gonidelis[m] >
It's test.cpp line 18
20:42
<
gonidelis[m] >
foreach_adapt.cpp *
20:43
<
K-ballo >
I don't get any hits for `foreach_adapt.cpp` using the search option
20:44
<
gonidelis[m] >
you mean on my fork's branch?
20:44
<
K-ballo >
try passing &my_function instead, looks like a pre-existin gbug
20:45
<
gonidelis[m] >
....
20:46
<
K-ballo >
I don't understand, the bug ain't on master
20:46
<
gonidelis[m] >
it worked
20:46
<
gonidelis[m] >
:)))
20:47
<
K-ballo >
file an issue against plain for_each
20:47
<
K-ballo >
caused by e15787bb31917046c814331f40017783e628d97b
20:48
<
gonidelis[m] >
ok could you please explain what's the case with for_each not accepting non-referenced functions ?
20:48
<
gonidelis[m] >
and btw thank you very very much! I am trully amazed
20:51
<
K-ballo >
that decay in invoke_projected is misguided
20:51
<
K-ballo >
decaying a function type gives you a function pointer type
20:51
<
K-ballo >
so it's trying to create a reference
*to a pointer* to function given a reference to function
20:52
<
K-ballo >
the proper thing to do is just `F&`, no decay
21:05
<
gonidelis[m] >
So I am just reading the code
21:05
<
gonidelis[m] >
What's the puprose of `invoke_projected` in the first place?
21:06
<
K-ballo >
hkaiser: ^
21:10
<
gonidelis[m] >
K-ballo: Why would you want to `decay` a function?
21:10
<
gonidelis[m] >
"if T is a function type F or a reference thereto, the member typedef type is std::add_pointer<F>::type"
21:10
<
K-ballo >
I don't know what the intention there was, that's for hkaiser to answer
21:11
<
gonidelis[m] >
No, I am asking about `decay` in general
21:11
<
gonidelis[m] >
Does it convert a &f to a *f?
21:11
<
K-ballo >
if you were to store arguments for later use you'd "decay-copy" them
21:11
<
gonidelis[m] >
or sth
21:11
<
K-ballo >
which is to initialize a decay_t<T> object from it
21:12
<
K-ballo >
it's the kind of transformation you get when you say `auto x = f;`
21:12
<
K-ballo >
auto is as if `decay_t<decltype((f))>` (plus a silly extra rule with initializer_list)
21:15
<
gonidelis[m] >
wow!
21:16
<
gonidelis[m] >
great! Thanks again... I will ask hkaiser about `invoke_projected` on the Friday meeting
21:19
<
gonidelis[m] >
How could I search about e15787bb31917046c814331f40017783e628d97b using git
21:19
<
gonidelis[m] >
i did sth like git log | grep e15787bb31917046c814331f40017783e628d97b but I guess I need some extra lines
21:21
<
hkaiser >
K-ballo: would you mind creating a ticket about invoke_projected?
21:21
<
hkaiser >
I'll forget otherwise
21:21
<
K-ballo >
I deferred to gonidelis[m] already
21:21
<
gonidelis[m] >
Do you want me to try it?
21:21
<
gonidelis[m] >
please
21:21
<
gonidelis[m] >
I would be glad...
21:21
<
hkaiser >
gonidelis[m]: pls go ahead
21:22
<
K-ballo >
gonidelis[m]: on your command line it would be git show e15787bb31917046c814331f40017783e628d97b
21:22
<
gonidelis[m] >
hkaiser: thanks I might need some guidance but that won't be a problem
21:23
<
gonidelis[m] >
K-ballo: thanks... just did it. Great. What about on github?
21:23
<
K-ballo >
on github I just create the link as above
21:23
<
gonidelis[m] >
ahh great....
21:23
<
K-ballo >
the last component is the commit hash
21:23
<
gonidelis[m] >
duh...
21:23
<
gonidelis[m] >
yeah you are right
22:40
nikunj97 has joined #ste||ar
22:43
kale[m] has quit [Ping timeout: 256 seconds]
22:43
kale[m] has joined #ste||ar
23:38
nikunj97 has quit [Ping timeout: 240 seconds]
23:52
kale[m] has quit [Read error: Connection reset by peer]
23:52
kale[m] has joined #ste||ar