hkaiser 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/
ct-clmsn has quit [Ping timeout: 250 seconds]
<Yorlik> Allright back ..
<Yorlik> Couldn't sleep - too many templates in my head
<Yorlik> hkaiser: Thanks for that constexpr trick. Unfortunately a core problem still isn't solved, and that is the enforcement of the proper order of inheritance such, that A is always before B and B is always before C
<Yorlik> I think I might have to fallback to some template recursion to solve that
<hkaiser> Yorlik: why would you need to enforce that?
<Yorlik> Because swapping them by error would generate a new type and a new storage pool for that type
<Yorlik> OFC I could leave it to the programmers
<hkaiser> but you could easily check for this
<Yorlik> But since I am learning the advantages of static checks I wanted to implement it
<Yorlik> How would I do that at compile time?
<Yorlik> I didn'zt find out how to contruct a static assert for that
<hkaiser> it's a simple recursive template that compares the id of the current type with the next one
<hkaiser> let me see what I can do
<Yorlik> Yes, that's what I guessed
<Yorlik> I still have to better understand and learn how this template recursion works
<Yorlik> This line gives me a syntax error: static constexpr uint64_t flags = ( Ts::id | ... | 0 );
<Yorlik> It's complaining about the ellipsis
<Yorlik> lemme check - m,aybe something stupid on my side
<hkaiser> Yorlik: yah, this is c++17
<Yorlik> I have 17 switched on
<Yorlik> in my cmake: target_compile_features(testcompile PUBLIC cxx_std_17)
<hkaiser> Yorlik: see: https://godbolt.org/z/GUCapg
<hkaiser> Yorlik: in cmake do: set_target_properties(FooTarget PROPERTIES CXX_STANDARD 17)
<Yorlik> Woops? .. moment
<hkaiser> or target_compile_features(FooTarget PRIVATE cxx_std_17)
<hkaiser> yah, your cmake stuff should work
<Yorlik> The compile line has -std:c++17 in it
<hkaiser> then it should compile
<hkaiser> what compiler do you use?
<Yorlik> cl
<hkaiser> the option should be -std=c++17, btw
<hkaiser> ahh
<Yorlik> I could try clang really quick
<hkaiser> yah msvc can't handle that
<hkaiser> the same can be done with another recursice template
<hkaiser> sec
<Yorlik> I'm not yet at the recursion. The constexpr doing the fag accumulation is not working yet
K-ballo has quit [Quit: K-ballo]
<Yorlik> Allright - clang manages - so - there is a real issue
<Yorlik> Had to do some minor hack to switch really quick
<Yorlik> Now the recursion
<Yorlik> I stopped using clang on windows because boost was such a pain
<Yorlik> But I should go back to it - we want to use it on Linux and its better to have the same compiler everywhere
<hkaiser> Yorlik: no need, see above link
<Yorlik> I'm working on it
<hkaiser> I had nothing but trouble using clang on windows
<Yorlik> I'm not just copypasting but mixing it into my code and looking over it - after all I want to learn and not just use a recipe
<Yorlik> IC
<Yorlik> Boost + Clang = pure evilness
<hkaiser> might have become better, though - have not tried in a while
<Yorlik> I have 7.0.1
<Yorlik> Nice ! The assert works. Lovely !
<Yorlik> Now I have to sudy it a bit closer
<Yorlik> I like having as much stuff checked as possible at compile time. Totally thrilled about the power of templates
<Yorlik> This whole generic programming / metaprogramming thing feels so mad - but i think that's the case when you face something totally new and everything is weird
<Yorlik> I'm totally amazed what you can do with it and want to learn it
<Yorlik> Barely scratched the surface so far.
<Yorlik> now I can just do : auto X = entity< container, physics, body > ( );
<Yorlik> love it.
<Yorlik> And noone can mess up the order of template params
<Yorlik> hkaiser: Do you have a reading recomendation for a systematic learning of generic programming? I was reading in this book you recommended (A.Alexandrescu) but I think concerning advanced templates there might be better resources.
<hkaiser> Yorlik: there aren't any for modern c++, afaik
<hkaiser> there is an older book about boost mpl
<Yorlik> So it's mostly grabbing whats on the net and asking people?
<hkaiser> yah, and reading good code
<Yorlik> I believe it's totally worth it. though I'm betting a know in my brain from it
<Yorlik> getting a knot ...
<Yorlik> sry - my typing is horrible again
<hkaiser> lol
<hkaiser> indeed, there is always a chance of that
<Yorlik> I must admit I have a hard time understanding your gist
<hkaiser> ask away
<Yorlik> I htink I'll chew a bit on it andf ask you if its too hard later
<Yorlik> I feel I need to do some grokking work first
<Yorlik> :)
<hkaiser> Yorlik: there are some basic things you have to know
<hkaiser> template types in metaprogramming are the equivalent to function invocations in normal code
<hkaiser> template instantiation is like function invocation
<hkaiser> template specialization like function overloading
<hkaiser> the embedded value 'value' is the 'return value' of a template instantiation
<Yorlik> I was shocked how fast you slapped all this together - you should write a book about it :)
<hkaiser> no this is the declaration of the template, which does not need an implementation in this case as there is a full set of specializations
<Yorlik> Never saw that notation you used before
<hkaiser> one specialization for no types left, and one for the general case (at least one type left)
<Yorlik> It reminds me of induction proofs in math
<hkaiser> yes, it's very much the same
<Yorlik> recursion
<hkaiser> the compiler pattern matches the template parameters against all specializations and choses the best match
<Yorlik> You implement for a stopper case and for a n+1 case
<hkaiser> right
<hkaiser> and Ts... represent zero or more parameters
<Yorlik> I was wondering you wrote all parameters in the template<... even above your specializations - at least some of them
<Yorlik> I always only saw template<>
<hkaiser> what do you mean?
<Yorlik> when people were specializing
<hkaiser> ahh
<hkaiser> you can partially specialize as well
<Yorlik> I know - but you had all parm in it
<hkaiser> that one separates the first type from the parameter pack
<Yorlik> Actually it was a dissection of typename ... Ts into T1, typeneam ... Ts
<hkaiser> yes
<Yorlik> Allright
<Yorlik> So - the final constexpr goes int your seert
<Yorlik> assert
<hkaiser> yes
<Yorlik> I like how the detail ns is hiding all the nitty gritty details from the user
<Yorlik> because thats what i want in the end
<Yorlik> I'll never forget this iconic phrase from Scott Meyers about whats the most important design principle: Making Interfaces easy to use correct and hard to use wrong
<Yorlik> It kind sticks and I always see how easy I fail at it
<hkaiser> lol
<hkaiser> who doesn't
<Yorlik> I see that when I have to use my own old code and how easy or hard it is
eschnett_ has joined #ste||ar
eschnett_ has quit [Quit: eschnett_]
<Yorlik> Does MSVC have issues with std::literals::chrono_literals ? I have a hard time using it here.
<Yorlik> intellisense seems to be oblivious of it
eschnett_ has joined #ste||ar
<hkaiser> Yorlik: no idea
hkaiser has quit [Quit: bye]
eschnett_ has quit [Quit: eschnett_]
mdiers_ has quit [Ping timeout: 268 seconds]
mdiers_ has joined #ste||ar
mdiers_1 has joined #ste||ar
mdiers_ has quit [Ping timeout: 245 seconds]
mdiers_1 is now known as mdiers_
heller_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
heller_ has joined #ste||ar
K-ballo has joined #ste||ar
hkaiser has joined #ste||ar
<Yorlik> hkaiser: I think I finally understood that template code you wrote. Thanks a lot for thze instructions yesterday - helped a lot in understanding.
<zao> Deep magic, eh? :)
<Yorlik> Its heavy but digestible.
<Yorlik> And yes - black wizardry too :)
<Yorlik> Not that black anymore since yesterday
aserio has joined #ste||ar
eschnett_ has joined #ste||ar
bibek has joined #ste||ar
<hkaiser> Yorlik: most welcome
<Yorlik> :)
<Yorlik> It's a bit annoying MSVC bails on the folding expression - it's too nice to have
<Yorlik> I hope they will fix that soonish.
<hkaiser> yah
<Yorlik> Maybe they are afraid C++ will kill F# ;)
<Yorlik> C++ Templates as the next functional programming language ...
<Yorlik> Do we have concurrent queues in HPX?
<hkaiser> Yorlik: what for?
<hkaiser> the HPX thread-scheduler relies on one
<Yorlik> my internal messaging system passing requests to the processors working on vectors will be a multiple producer single consumer schema
<K-ballo> Yorlik: what's the problematic folding expression?
bita has quit [Read error: Connection reset by peer]
<Yorlik> K-ballo MSVC didn't like this: = ( Ts::id | ... | 0 );
<K-ballo> a simple test works here
<Yorlik> Line 31 exploded on my side.
<Yorlik> 21
<K-ballo> that one reproduces
<Yorlik> You can compile it in MSVC?
<K-ballo> this works though:
<K-ballo> static constexpr int fun() { return (Ts::id | ... | 0); }
<K-ballo> static constexpr int mask = fun();
<K-ballo> reproduces -> reproduces the error
<Yorlik> Ah - OK
<Yorlik> It worked in Clang-cl
<K-ballo> sure, clang-cl is not msvc
<Yorlik> Breaking he 100% compatibility ... ;)
<K-ballo> lol, that never meant bug-compatible
<K-ballo> it means anything that works on msvc will work on clang-cl
<Yorlik> I'm just pulling your legs a little ;)
aserio has quit [Quit: aserio]
aserio has joined #ste||ar
<aserio> hkaiser: yt?
<hkaiser> aserio: here
<aserio> hkaiser: are you planning to come to LSU today?
<aserio> How would you like to meet with Chuanqiu at 2pm?
<hkaiser> aserio: I'll be there for the 2pm meeting
<aserio> ok, see you then :)
bita has joined #ste||ar
<hkaiser> bitayt?
<hkaiser> bita: yt?
<bita> hkaiser, yes, hi
<hkaiser> hey
<hkaiser> question wrt hylanx #805
<hkaiser> what is K.variable(...) supposed to do?
<bita> K.variable just hold the variable and show the value when eval is called on it
<hkaiser> k
<bita> K.placeholder allocates memory for a variable and does not know the value before runtime
<hkaiser> so def variable(value): return phylanx.execution_tree.var(value) doesn't work?
<bita> no, this is the error I get `RuntimeError: C:\Repos\keras\keras\backend\phylanx_backend.py(49, 11): shape:: primitive_argument_type does not hold a numeric value type (type held: 'phylanx::execution_tree::primitive'): HPX(bad_parameter)`
<hkaiser> bita: could you construct a small reproducing test case and attach it to the ticket?
<hkaiser> should be easy enough to fix
<bita> sure, just a question: phylanx.execution_tree.var is merged, right? because I am working on lazy_eval branch
<hkaiser> yes, this is the overload that should be chosen in your case: https://github.com/STEllAR-GROUP/phylanx/blob/master/python/src/bindings/execution_tree.cpp#L101-L112
<hkaiser> we might need an overload that takes a primitive instance, though
<bita> Okay, thanks
nikunj has joined #ste||ar
<hkaiser> ita: ^^
<hkaiser> bita: ^^
<hkaiser> sorry bibek :/
<bita> got it :)
<hkaiser> too many bi<tab>'s ;-)
<bibek> :)
aserio has quit [Quit: aserio]
aserio has joined #ste||ar
nikunj has quit [Read error: Connection reset by peer]
nikunj has joined #ste||ar
eschnett_ has quit [Quit: eschnett_]
eschnett_ has joined #ste||ar
aserio has quit [Ping timeout: 240 seconds]
<hkaiser> bita: thanks
hkaiser has quit [Quit: bye]
eschnett_ has quit [Quit: eschnett_]
aserio has joined #ste||ar
eschnett has joined #ste||ar
bibek has quit [Quit: Konversation terminated!]
quaz0r has quit [Ping timeout: 272 seconds]
eschnett has quit [Ping timeout: 255 seconds]
quaz0r has joined #ste||ar
eschnett has joined #ste||ar
eschnett has quit [Read error: Connection reset by peer]
eschnett has joined #ste||ar
eschnett has quit [Client Quit]
aserio has quit [Quit: aserio]
<Yorlik> hkaiser: I like the readability of "using mtype = com::pli::cated::type;" much better than "typedef com::pli::cated::type mtype;". Apart from readability - is there any important side effect of changing it?
<K-ballo> they are equivalent
<K-ballo> oh sorry, you asked hkaiser
<K-ballo> irc choose a gray color for his nick today
<Yorlik> woops
<Yorlik> Thanks K-ballo
<Yorlik> I just asked him because i saw him chaning a bunch of typedefs in hpx to usings
<Yorlik> It makes stuff much nicer to read.