K-ballo changed the topic of #ste||ar to: STE||AR: Systems Technology, Emergent Parallelism, and Algorithm Research | stellar.cct.lsu.edu | HPX: A cure for performance impaired parallel applications | github.com/STEllAR-GROUP/hpx | Buildbot: http://rostam.cct.lsu.edu/ | Log: http://irclog.cct.lsu.edu/
K-ballo has quit [Quit: K-ballo]
hkaiser has quit [Quit: bye]
jehelset has joined #ste||ar
diehlpk_work_ has joined #ste||ar
diehlpk_work has quit [Ping timeout: 240 seconds]
K-ballo has joined #ste||ar
<jedi18[m]1> Hi! So I'm trying to debug and understand the tag_fallback_invoke, could someone please give me an example of a cpo for the adjacent_find function? What should be the function signature of the friend function inside the struct? I've tried a couple of times but it dosen't compile
<jedi18[m]1> Do I have hpx::adjacent_find_t as the first parameter?
<jedi18[m]1> Nvm, I got it :D
<jedi18[m]1> Ok no I dindt
<K-ballo> the tag-invoke paper should explain the logic behind the mechanism, have you had a chance to look at it?
<jedi18[m]1> No I haven't read the whole thing, ok I
<jedi18[m]1> I'll read it. If I have any questions about the paper I can ask here?
<K-ballo> sure
<K-ballo> "the whole thing" is probably too much of it, but there should be an explanation of how things work and why
<jedi18[m]1> Yeah I'll just skip to the proposal details because it goes over a lot of other stuff too
hkaiser has joined #ste||ar
<srinivasyadav227> jedi18: even I am trying to understand the same, but found this example https://github.com/srinivasyadav18/hpx/blob/master/libs/core/functional/include/hpx/functional/tag_fallback_invoke.hpp#L43, might help :)
<jedi18[m]1> Thanks yeah I've seen the example and understand how to use it, I'm trying to understand how it works.
<srinivasyadav227> jedi18: the first argument is cpo, in the code you showed above first argument is hpx::adjacent_find_t fn or hpx::adjacent_find_t_fn? (did you miss an underscore?)
<srinivasyadav227> jedi18: ok cool!
<jedi18[m]1> Nope, hpx::adjacent_find_t works for me
<srinivasyadav227> ok :)
<jedi18[m]1> Ok so the paper is a bit too much so I tried debugging and seeing how the execution takes place to try and understand
<jedi18[m]1> I have doubt, so when the execution reaches this spot https://github.com/STEllAR-GROUP/hpx/blob/d027517a25b11c0f430e5a3bd4231454ad6bdd19/libs/core/functional/include/hpx/functional/tag_fallback_invoke.hpp#L131 and I've passed in a cpo (`hpx::adjacent_find(test_cpo {}, v1.begin(), v1.end());`), the tag is adjacent_find_t and the first parameter is my test_cpo
<hkaiser> jedi18[m]1, srinivasyadav227: you might want to read up on the C++ rules of function overloading and argument dependent lookup (ADL)
<srinivasyadav227> jedi18: I understood in an abstract manner, if you have any example could please you share?
<jedi18[m]1> So ADL should see both the friend overloads right?
<jedi18[m]1> Why does it choose the test_cpo overload?
<hkaiser> you might want also look at CRTP (Curiosly Recurring Template Pattern), and how function objects work (hint: operator()())
<hkaiser> in general, you might want to fully understand how templates work (template functions in this case)
<hkaiser> the tag_invoke stuff is a combination of techniques, all referenced in wg21.link/p1895
<srinivasyadav227> hkaiser: could you please share any references, I tried searching in different talks and blogs, but couldn't really get a clear idea of what's happening inside
<hkaiser> I know it's a tough read, but it has everything
<hkaiser> there is also the duck invoke implementation (https://www.bfgroup.xyz/duck_invoke/) that I'd suggest you study
<jedi18[m]1> hkaiser: Thanks! I do have some idea about those topics but yeah I'll read up on those again to get a solid understanding about those concepts.
<jedi18[m]1> Ohh ok I'll read the paper properly then
<hkaiser> in the end everyting is easy, create a small example for yourself and use a debugger to step through the code
<jedi18[m]1> You mean see the code of duck_invoke or it's docs/how to use it?
<hkaiser> jedi18[m]1: reading code is the best way of learning how to progra,
<srinivasyadav227> hkaiser: Thanks, Yeah, I would take some time and give it a hard try again and understand it
<jedi18[m]1> Ohh ok thanks, I'll check that out too
<hkaiser> this is probably worth recording another lecture for the c++ series...
<jedi18[m]1> Haha yeah, your c++ series was great! Hope you record more videos
<srinivasyadav227> hkaiser: yea very much helpful. I am new to ADL, CPOs and stuff, just started to understand them slowly now, and lecture would be great for new one`s.
<srinivasyadav227> hkaiser: is this (https://github.com/STEllAR-GROUP/hpx/wiki/Google-Summer-of-Code-(GSoC)-2021#working-on-blaze-tensor) still an active project for GSoC?
mdiers[m] has quit [Quit: Idle for 30+ days]
<gnikunj[m]> hkaiser: yt?
<gnikunj[m]> srinivasyadav227: iirc some operations are yet to be implemented, so yes it is an active project for GSoC 2021. For our TODO list on blaze tensor, see: https://github.com/STEllAR-GROUP/blaze_tensor/issues/2
<srinivasyadav227> gnikunj[m]: ok, I will check them out, what's iirc?
<gnikunj[m]> If I remember correctly ;)
<srinivasyadav227> haha,,ok, thanks :)
<hkaiser> srinivasyadav227: yes
<gnikunj[m]> hkaiser: you have a few minutes to spare for a call?
<hkaiser> gnikunj[m]: sorry, not right now - have roofers running around my house ;-)
<gnikunj[m]> better handle them not breaking your ceiling then ;)
<hkaiser> right
<gonidelis[m]> They are there probably for some seminar running by hkaiser
nanmiao has quit [Quit: Ping timeout (120 seconds)]
diehlpk_work_ has quit [Quit: Leaving]
diehlpk_work has joined #ste||ar
<gonidelis[m]> hkaiser: yt?
<hkaiser> here
<gonidelis[m]> i am very hard trying to understand why hpx::parallel::v1::remove() cannot see hpx::remove_if
<gonidelis[m]> which is implemented through the CPO
<gonidelis[m]> is this normal/
<gonidelis[m]> ?
<hkaiser> gonidelis[m]: I don't think it's a good idea to call a top-level algorithm from inside the implementation of another algorithm
<gonidelis[m]> ok good... i fell uncomfortable too
<gonidelis[m]> but since parallel::remove calls parallel::remove_if we get a depr warning
<gonidelis[m]> and you said i change that so it calls the new version
<gonidelis[m]> i cannot find a way where that is accomplished without calling the top level algo
<hkaiser> gonidelis[m]: show me the code that causes the deprecation, I'll have another look
<gonidelis[m]> sec
<gonidelis[m]> i don't know if you saw my discussion with K-ballo
<gonidelis[m]> it's this exact line
<gonidelis[m]> augustin suggested it's a bug
<K-ballo> what did the other compilers say?
<gonidelis[m]> K-ballo: same
<K-ballo> which gcc version are you using?
<gonidelis[m]> 10
<gonidelis[m]> 10.2
<hkaiser> gonidelis[m]: you're calling a function from inside a deprecated (outer) function, so no wonder you're seeing a deprecation whenever you call the outer one
<K-ballo> ?
<K-ballo> the claim was that remove_if isn't actually deprecated
<K-ballo> the deprecation complains about the function itself
<K-ballo> gonidelis[m]: did you sort out your lookup issues?
<gonidelis[m]> K-ballo: what do you mean?
<K-ballo> you were getting errors when qualifying some identifier
<gonidelis[m]> (i am trying clang once again, i think i forgot to clean my build previously)
<gonidelis[m]> K-ballo: yeah that's what i just asked hartmut
<gonidelis[m]> he is suggesting (and i aggree) that is not a good idea to call the top level hpx::remove_if from inside the source ipmlementation of hpx::parallel::remove
<K-ballo> definitely
<gonidelis[m]> i don't know why it cannot find it, but i know that it does not feel right
<gonidelis[m]> ahh you're good K-ballo
<gonidelis[m]> clang++ is ok :/
<gonidelis[m]> darn
parsa has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
parsa has joined #ste||ar
<K-ballo> bogus warning is bogus
<gonidelis[m]> wow... that feels strange
<gonidelis[m]> streching gcc to its limits i mean
<K-ballo> hardly
<K-ballo> can't really reproduce here https://wandbox.org/permlink/NBSM2glfs8Dzcuzs
<gonidelis[m]> hm
<gonidelis[m]> what's tis error there?
<gonidelis[m]> `/usr/lib/x86_64-linux-gnu/crt1.o: In function `_start':........etc`
<gonidelis[m]> ?
<hkaiser> gonidelis[m]: linker error?
<gonidelis[m]> yeah i don't know how K-ballo managed to run it without certain includes ?
<K-ballo> I haven't ran it, no need to run stuff to see compilation diagnostics, but there are no includes required either
<K-ballo> just add an entrypoint (main), and run it
<gonidelis[m]> how do you just copmile it?
<K-ballo> same as you do
<gonidelis[m]> i run it
<gonidelis[m]> i press "Run"
<gonidelis[m]> literally
<K-ballo> that "run" button compiles, links, then executes
<K-ballo> you are seeing a linker error, that means compilation succeeded
<K-ballo> no need for anything extra to reproduce your warning
<gonidelis[m]> cool
<K-ballo> have you tried decoupling the predicate yet? that's good for other reasons besides workarounding a compiler bug
jaafar_ has quit [Ping timeout: 264 seconds]
<gonidelis[m]> the only think i thought was creating a pred = <predicate> and then forwarding that
jaafar_ has joined #ste||ar
<gonidelis[m]> hkaiser: so we are suggesting that this is wrong?
<gonidelis[m]> this too ?
<hkaiser> gonidelis[m]: not actually wrong, but it goes across abstraction levels
<gonidelis[m]> ok i don't know if you saw it, i just pushed #5211 which settles these cases