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]
bita has quit [Ping timeout: 250 seconds]
jejune has joined #ste||ar
jehelset has quit [Ping timeout: 252 seconds]
shubham has joined #ste||ar
jejune has quit [Quit: "Everything that has a beginning, has and ending...neo."]
shubham has quit [Quit: Connection closed for inactivity]
K-ballo has joined #ste||ar
hkaiser has joined #ste||ar
<gonidelis[m]> K-ballo:
<gonidelis[m]> this is crazy
<gonidelis[m]> wouldn't it be more wise, for mechanisms who support pipelinined op's to actually keep the intermediate results (i read about `views::cache1`) just in case they actually need the result?
<gonidelis[m]> sounds to me like we lose the benefits of laziness
<gonidelis[m]> we were supposed not to compute things when not needed and we ended up computing things twice
<K-ballo> you can't in general cache any T, you could for trivially copyable things, it could even potentially make sense for small trivially copyable things but it is tied to the cost of the computation
<gonidelis[m]> ahh ok. yeah, the type matters
<gonidelis[m]> K-ballo: but is Nicol Bolas's accpted answer relevant?
<gonidelis[m]> he is talking about the distinction of moving and dereferencing a pointer
<K-ballo> that answer explains why it needs to be called twice
<gonidelis[m]> i don't understand why. i 've read it like 6 times
<K-ballo> you don't understand ++ and * being different operations?
<gonidelis[m]> what does `++` have to do with passing the calculated values to the next "pipelined" op?
<K-ballo> consider how you'd implement each, for a filter view
<gonidelis[m]> no i do understandt the distinction
<K-ballo> there isn't actually a next pipelined op
<K-ballo> filter is the last pipelined op in the chain
<gonidelis[m]> yes
<gonidelis[m]> so what does "to whoever is after it" mean?
<K-ballo> no idea
<K-ballo> where's that from?
<gonidelis[m]> bocara's talk on cppcon 2020
<gonidelis[m]> boccara*
<K-ballo> never seen it
<gonidelis[m]> it doesn't matter
<gonidelis[m]> you said the answer responds fully to the question
<K-ballo> did I?
<K-ballo> I said the answer explains why it needs to be called twice, no?
<gonidelis[m]> yes, since the question is why are the elements accessed twice
<gonidelis[m]> from my prepspective, they are accessed twice becaue ranges::views pull data and lazily compute things
<gonidelis[m]> <K-ballo "I said the answer explains why i"> yy
<gonidelis[m]> what does being called twice have to do with the op distinction
<K-ballo> it's about non-owning, rather than laziness, but they are related
<gonidelis[m]> "But that access cannot be communicated to the caller of ++ because that caller only asked to position the iterator, not to get its value."
<K-ballo> indeed
<gonidelis[m]> where is ++ needed in this example
<K-ballo> in the range-based for-loop
<gonidelis[m]> >>>>:(((
<K-ballo> what's the surprise? whenever you walk a range there's ++ behind it
<gonidelis[m]> when i ++, does the filter operation take place?
<K-ballo> what is "the filter operation"?
mdiers[m] has quit [Ping timeout: 245 seconds]
rori has quit [Ping timeout: 245 seconds]
mdiers[m] has joined #ste||ar
rori has joined #ste||ar
<gonidelis[m]> filter view
<gonidelis[m]> K-ballo: when I do `++` I mean
<K-ballo> what is "the filter view operation"?
<gonidelis[m]> the filtering
<K-ballo> when you do ++ on the filter view's iterator, it advances to the next element
<gonidelis[m]> exactly
<K-ballo> good
<gonidelis[m]> so the problem is not that we have two distinct operations
<gonidelis[m]> rather than we need to dereference twice
<gonidelis[m]> or do we?
bita has joined #ste||ar
<gonidelis[m]> K-ballo: i think the question is simple: why doesn't views::filter just output the result of the first transform+filter calculation
<K-ballo> dereference what?
<gonidelis[m]> the iterator
<K-ballo> ...how could it possibly?
<gonidelis[m]> here's how:
<K-ballo> maybe you should try to implement a filter view?
<gonidelis[m]> you take inputs[1] you transform it you check whether it satisfies the filter pred
<gonidelis[m]> if yes -> you ouput it
<gonidelis[m]> if no -> you go to inputs[2] and so on...
<K-ballo> inputs[0] hopefully :)
<gonidelis[m]> sorry
<gonidelis[m]> yes
<gonidelis[m]> goddamit
<gonidelis[m]> i was going to fix it right now
<K-ballo> you'd have to do that during derefence
<gonidelis[m]> do what
<gonidelis[m]> ?
<K-ballo> that process you suggest
<gonidelis[m]> why?
<K-ballo> because it's the only place with an "output"
<gonidelis[m]> since i calculated the thing already
<gonidelis[m]> what place is the only placE?
<K-ballo> dereference
<K-ballo> filter_view's iterator needs to implement ++ and *, how would you do it?
<gonidelis[m]> let me try it
<gonidelis[m]> sth like this
<K-ballo> .... hehe
<K-ballo> what's that supposed to be?
<gonidelis[m]> is it so trash?
<K-ballo> yeah, bad
<K-ballo> where's the filtering even happening?
<gonidelis[m]> i forgot to mention that i am talking about an iter
<gonidelis[m]> i just implemented the operations
<K-ballo> not to mention that iterator advancing increments the element, not the iterator
<gonidelis[m]> ahhhhhhhh
<K-ballo> I have no idea what you think goes in an iterator... let me write you some proper pseudo code for what a filter iterator would actually do
<K-ballo> you should spend some more time with iterators btw, try implement a bunch of them in your free time
<gonidelis[m]> with a talk pending in 1 week and only 3 slides completed, free time is not athing
<gonidelis[m]> i will do it now though
<K-ballo> you need to understand iterators if you plan to talk about them
<gonidelis[m]> they are pointers
<gonidelis[m]> i understand pointers
<gonidelis[m]> i think i also undestand iterators
<gonidelis[m]> give me one more chance
<K-ballo> they are _based_ on pointers
<gonidelis[m]> yy
<K-ballo> for pointers this whole thing is moot
<gonidelis[m]> ..........
<K-ballo> this only shows up because these things aren't actually pointers
<gonidelis[m]> that makes everything better
<K-ballo> you do get the ++ and * from iterators being based on pointers, which is also the crux of the matter here
<K-ballo> in other non-pointer-based iteration models you have a single combined advance and dereference operation
<K-ballo> in those models this doesn't happen either
<K-ballo> there's going to be a talk on that very subject on cppnow
<gonidelis[m]> what talk?
<gonidelis[m]> w8 are you attending?
<K-ballo> barry's talk, I'm not attending
<K-ballo> we've been discussing this subject for months now, I'm sure the talk will be valuable
<gonidelis[m]> it's after mine, so I might need to mess things up first ;p
<gonidelis[m]> this guy is very serious in SO
<gonidelis[m]> is he your successor or sth?
<gonidelis[m]> ........................................................... K-ballo i just deleted the tab i wrote my whole code
<gonidelis[m]> accidentaly
<gonidelis[m]> ll*
<K-ballo> you should be more careful
<K-ballo> it should be.. about 15 lines or so, maybe? not a major loss
<gonidelis[m]> yes
<gonidelis[m]> hkaiser: thanks i will take a look right now
<K-ballo> what's that? it's not an iterator
<gonidelis[m]> oh it's from the same guy
<gonidelis[m]> it does dereferencing and incrementing
<gonidelis[m]> no?
<gonidelis[m]> do you want me to implement the whole iter functionallity?
<K-ballo> no, just advancing and dereferencing for a start
<gonidelis[m]> functionality^^
<K-ballo> your view isn't a view
<gonidelis[m]> becuase of the copying
<gonidelis[m]> i guess
<gonidelis[m]> i should put a ton of refs
<K-ballo> precisely
<K-ballo> try it
<gonidelis[m]> try it, as in try it and run it?
<K-ballo> no, as in try to put a ton of refs and see what changes
<gonidelis[m]> becaues this thing is far from compilable
<gonidelis[m]> ok
<K-ballo> it won't make a difference, but at least you'll get a clear understanding of why
<K-ballo> for what it is worth, this op() thing is not something views have
<gonidelis[m]> what is wrong with my iter class?
<K-ballo> your iter class is mostly fine, it's just not implemented
<gonidelis[m]> ?
<gonidelis[m]> i don't know what to do with my temp
<gonidelis[m]> i put a ref and all of a suddent my view owns things
<K-ballo> there's nothing you can possibly do with it
<gonidelis[m]> i don't put a ref
<gonidelis[m]> and it both owns and copies things
<gonidelis[m]> https://wandbox.org/permlink/fvukZHxWAIJN7fpF I ref Rng and then my filter_view could easily take the `transform` result and chose whether to "filter" it or no. ahhhhhhhhh
<gonidelis[m]> is the trick that I changed the contents of the range even if i didn't filter a given element?
<gonidelis[m]> no i didn't
<gonidelis[m]> it seems like this filter_view could do the seqeunce i suggested earlier
<gonidelis[m]> so what was the point/
<gonidelis[m]> ?
<K-ballo> again, op() isn't a view thing
<K-ballo> a view is a range with O(1) copy
<K-ballo> a range is something with begin/end
<K-ballo> that's why the important stuff goes into the view's iterator ++ and *, which you don't have
<gonidelis[m]> a right
<gonidelis[m]> indeed
<gonidelis[m]> i don't thing i will tame that beast today
<K-ballo> that's the crux of the matter, the "filter operation" implementation is split into the iterator ++ and *
<K-ballo> here's a very simplistic filter view implementation: https://wandbox.org/permlink/XS0GcJ0HIc9EwEIt
<K-ballo> you can clearly see how and why both ++ and * need to dereference the base iterator
jehelset has joined #ste||ar
jehelset has quit [Read error: Connection reset by peer]
mdiers[m] has quit [*.net *.split]
prahitha[m] has quit [*.net *.split]
HaimantikaMitra[ has quit [*.net *.split]
AbanoubAsaad[m] has quit [*.net *.split]
ms[m] has quit [*.net *.split]
jaafar has quit [*.net *.split]
bita has quit [*.net *.split]
wash[m] has quit [*.net *.split]
tarzeau_ has quit [*.net *.split]
Vir has quit [*.net *.split]
diehlpk_work has quit [*.net *.split]
sivoais has quit [*.net *.split]
nanmiao has quit [*.net *.split]
CynthiaPeter[m] has quit [*.net *.split]
k-ballo[m] has quit [*.net *.split]
pedro_barbosa[m] has quit [*.net *.split]
gdaiss[m] has quit [*.net *.split]
rori has quit [*.net *.split]
RosheenNaeem[m]1 has quit [*.net *.split]
srinivasyadav227 has quit [*.net *.split]
klaus[m] has quit [*.net *.split]
sestro[m] has quit [*.net *.split]
itn[m] has quit [*.net *.split]
parsa has quit [*.net *.split]
dashohoxha[m] has quit [*.net *.split]
zao has quit [*.net *.split]
gnikunj[m] has quit [*.net *.split]
jbjnr has quit [*.net *.split]
old_man[m] has quit [*.net *.split]
jedi18[m] has quit [*.net *.split]
K-ballo has quit [*.net *.split]
SagarB[m] has quit [*.net *.split]
bering[m] has quit [*.net *.split]
gonidelis[m] has quit [*.net *.split]
rachitt_shah[m] has quit [*.net *.split]
bobakk3r_ has quit [*.net *.split]
gdaiss[m] has joined #ste||ar
dashohoxha[m] has joined #ste||ar
bita has joined #ste||ar
k-ballo[m] has joined #ste||ar
Vir has joined #ste||ar
sivoais has joined #ste||ar
pedro_barbosa[m] has joined #ste||ar
CynthiaPeter[m] has joined #ste||ar
mdiers[m] has joined #ste||ar
jaafar has joined #ste||ar
prahitha[m] has joined #ste||ar
nanmiao has joined #ste||ar
wash[m] has joined #ste||ar
AbanoubAsaad[m] has joined #ste||ar
tarzeau_ has joined #ste||ar
diehlpk_work has joined #ste||ar
ms[m] has joined #ste||ar
HaimantikaMitra[ has joined #ste||ar
jbjnr has joined #ste||ar
K-ballo has joined #ste||ar
gnikunj[m] has joined #ste||ar
jedi18[m] has joined #ste||ar
bobakk3r_ has joined #ste||ar
old_man[m] has joined #ste||ar
bering[m] has joined #ste||ar
zao has joined #ste||ar
SagarB[m] has joined #ste||ar
rori has joined #ste||ar
itn[m] has joined #ste||ar
klaus[m] has joined #ste||ar
RosheenNaeem[m]1 has joined #ste||ar
srinivasyadav227 has joined #ste||ar
sestro[m] has joined #ste||ar
mdiers[m] has quit [Ping timeout: 258 seconds]
SagarB[m] has quit [Ping timeout: 267 seconds]
bering[m] has quit [Ping timeout: 267 seconds]
dashohoxha[m] has quit [Ping timeout: 248 seconds]
gnikunj[m] has quit [Ping timeout: 248 seconds]
jbjnr has quit [Ping timeout: 248 seconds]
jedi18[m] has quit [Ping timeout: 248 seconds]
prahitha[m] has quit [Ping timeout: 258 seconds]
HaimantikaMitra[ has quit [Ping timeout: 258 seconds]
ms[m] has quit [Ping timeout: 258 seconds]
rori has quit [Ping timeout: 272 seconds]
RosheenNaeem[m]1 has quit [Ping timeout: 272 seconds]
srinivasyadav227 has quit [Ping timeout: 272 seconds]
klaus[m] has quit [Ping timeout: 272 seconds]
itn[m] has quit [Ping timeout: 272 seconds]
sestro[m] has quit [Ping timeout: 272 seconds]
AbanoubAsaad[m] has quit [Ping timeout: 258 seconds]
parsa has joined #ste||ar
CynthiaPeter[m] has quit [Ping timeout: 276 seconds]
k-ballo[m] has quit [Ping timeout: 276 seconds]
pedro_barbosa[m] has quit [Ping timeout: 276 seconds]
gdaiss[m] has quit [Ping timeout: 276 seconds]
parsa has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
old_man[m] has quit [Ping timeout: 248 seconds]
gdaiss[m] has joined #ste||ar
AbanoubAsaad[m] has joined #ste||ar
rachitt_shah[m] has joined #ste||ar
rori has joined #ste||ar
srinivasyadav227 has joined #ste||ar
gonidelis[m] has joined #ste||ar
old_man[m] has joined #ste||ar
jedi18[m] has joined #ste||ar
k-ballo[m] has joined #ste||ar
ms[m] has joined #ste||ar
dashohoxha[m] has joined #ste||ar
jbjnr has joined #ste||ar
sestro[m] has joined #ste||ar
gnikunj[m] has joined #ste||ar
mdiers[m] has joined #ste||ar
SagarB[m] has joined #ste||ar
itn[m] has joined #ste||ar
bering[m] has joined #ste||ar
CynthiaPeter[m] has joined #ste||ar
heller1 has joined #ste||ar
pedro_barbosa[m] has joined #ste||ar
HaimantikaMitra[ has joined #ste||ar
prahitha[m] has joined #ste||ar
RosheenNaeem[m] has joined #ste||ar
klaus[m] has joined #ste||ar
parsa has joined #ste||ar
hkaiser has quit [Quit: bye]