hkaiser changed the topic of #ste||ar to: STE||AR: Systems Technology, Emergent Parallelism, and Algorithm Research | stellar-group.org | HPX: A cure for performance impaired parallel applications | github.com/STEllAR-GROUP/hpx | This channel is logged: irclog.cct.lsu.edu
Yorlik_ has joined #ste||ar
Yorlik__ has quit [Ping timeout: 265 seconds]
K-ballo has quit [Ping timeout: 240 seconds]
K-ballo has joined #ste||ar
ShubhamKumar[m] is now known as matrixbot[m]
ms[m]1 is now known as ms[m]
KordeJong[m] has quit [Remote host closed the connection]
strackar has joined #ste||ar
strackar has quit [Ping timeout: 250 seconds]
strackar has joined #ste||ar
Isidoros[m] has joined #ste||ar
tufei__ has joined #ste||ar
tufei_ has quit [Remote host closed the connection]
strackar has quit [Ping timeout: 265 seconds]
<satacker[m]> <satacker[m]> "K-ballo: can you please explain..." <- Just found this out https://stackoverflow.com/questions/31873616/is-the-compiler-allowed-to-optimize-out-heap-memory-allocations/31877074#31877074
HHN93 has joined #ste||ar
HHN93 has quit [Client Quit]
HHN93 has joined #ste||ar
<HHN93> Had a doubt with templates, Here (https://github.com/STEllAR-GROUP/hpx/blob/502adfa0614ca8843c51fe94f400fc86f8a092ab/libs/core/algorithms/include/hpx/parallel/util/transfer.hpp#L349) we initialise the struct with only one template argument but it uses this struct
<HHN93> so what excatly is the 2nd enable argument?
<HHN93> that gets called if its trivially copyable right?
<HHN93> so how does the Enable template argument help?
<satacker[m]> So if it;s a trivially_copyable_pointer_tag the copy_memmove is done and otherwise the custom one
<satacker[m]> As already mentioned in the comment above the definition it is a CPO
<HHN93> can I ask why it's there?
<HHN93> shouldn't this (https://godbolt.org/z/M938Poe8d) work too?
<HHN93> ok
<satacker[m]> It defaults Enable to void
<satacker[m]> or the second arg
<HHN93> yes, but I don't understand how the 2nd argument helps
<HHN93> we need only 1 argument (category) to realise which function to call
<satacker[m]> My example does not really showcase the CPO stuff
<HHN93> oh ok
<satacker[m]> But these are the right questions i think
<K-ballo> a CPO doesn't need to depend on any trait
<satacker[m]> tags?
<K-ballo> it doesn't need to depend on anything
<satacker[m]> In our case?
<K-ballo> which case is that?
<K-ballo> a CPO is a customization point (interface, documentation) which happens to be an object
<gnikunj[m]> satacker: it’s template specialization.
<K-ballo> those are unlikely to be customization points, they're in a detail namespace
<K-ballo> plus they're not objects as far as I can tell
<K-ballo> am I looking at the right place?
<HHN93> I had a doubt on why we use 2 template arguments
<HHN93> when one suffices
<satacker[m]> gnikunj[m]: I agree
<satacker[m]> K-ballo: yeah, my whole concept is in shambles
<K-ballo> HHN93: https://en.cppreference.com/w/cpp/types/enable_if look at the last examples
<K-ballo> one does not suffice, both are needed, the second one will either be void or a "deduction failure"
<satacker[m]> K-ballo: any references for CPOs (cannot remember the paper numbers)
<K-ballo> there's a paper by eric on customizatoin point design
<K-ballo> don't konw the number
<gonidelis[m]> satacker: have you seen hartmut's lecture?
<satacker[m]> gonidelis[m]: Ofc
<satacker[m]> The names "tag" and the comment "Customization point for optimizing copy_n operations" made me believe that it is a CPO.
<satacker[m]> Now I need to investigate and make my information correct as to why it is not a CPO
<K-ballo> the O part is easy :)
<gonidelis[m]> pretty sure it's tag dispatching
<K-ballo> tag dispatching doesn't involve sfinae, it'd be weird to mix it with Enable
<gonidelis[m]> huh
<satacker[m]> tag dispatching is just overloading iirc?
<K-ballo> you can have type based tag dispatching too
<K-ballo> where the tag is used to select some specific specialization
<gonidelis[m]> that's the only tag dispatching that i know
<K-ballo> void impl(some_tag); / template struct impl<some_tag> {...};
<K-ballo> template <>
<K-ballo> the tag is usde to pick which impl to use
<gonidelis[m]> yes
<gonidelis[m]> not what you are referring to?
<gonidelis[m]> " type based tag dispatching ". tag is a type
<K-ballo> only one of those two is overloading
<gonidelis[m]> meta tag dispatching
<K-ballo> void impl is a function, struct impl is a type
<gonidelis[m]> whynot
<gonidelis[m]> ah
<HHN93> `HHN93: https://en.cppreference.com/w/cpp/types/enable_if look at the last examples`
<HHN93> K-ballo wouldn't simple doing this (https://godbolt.org/z/M938Poe8d) work?
<satacker[m]> <satacker[m]> "Now I need to investigate and..." <- Just plain SFINAE
<K-ballo> HHN93: yes, but that's notthe problem being solved by he class A example
<K-ballo> class A has a specialization for all floating point types, known and unknown, and a base implementatoin for everything else
<K-ballo> some_name has a specialization for just one well known type
<HHN93> did we just follow what's customary ?
<K-ballo> something is wrong there's no line 388 in that link
<HHN93> or is there any specific reason?
<satacker[m]> The file is of 351 lines?
<HHN93> my bad got link from local copy of file
<K-ballo> if it truly is a customization point (sure is an odd one), it is expected to be specialized from outside the file
<K-ballo> enabling sfinae on customization points is just good practice (pre concepts at least)
<K-ballo> since the customizatoin may need to sfinae
<K-ballo> these types in particular look very confused about themselves
<satacker[m]> <K-ballo> "if it truly is a customization..." <- If?
<K-ballo> for those to reasonably be customization points, the set of pointer category tags would have to be open
<K-ballo> that sounds highly unlikely
<K-ballo> customization points come into play when the types involved are user defined
<K-ballo> can there reasonably be a user defined pointer category tag?
<K-ballo> if the set of tags is closed, those are just type-based tag dispatching with confused sfinae support
strackar has joined #ste||ar
strackar has quit [Client Quit]
HHN93 has quit [Quit: Client closed]
HHN93 has joined #ste||ar
HHN93 has quit [Client Quit]
tufei__ has quit [Remote host closed the connection]
tufei__ has joined #ste||ar
<gnikunj[m]> Already loving "Deducing this" addition to C++23 (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0847r7.html)