--- Log opened Tue Apr 23 12:02:57 2019 | ||
-!- shogun-toolbox [~shogun@7nn.de] has joined #shogun | 12:02 | |
-!- Irssi: #shogun: Total of 14 nicks [3 ops, 0 halfops, 0 voices, 11 normal] | 12:02 | |
-!- Irssi: Join to #shogun was synced in 7 secs | 12:02 | |
-!- sonney2k [~shogun@7nn.de] has joined #shogun | 12:33 | |
-!- HeikoS [~heiko@174.pool85-48-187.static.orange.es] has quit [Ping timeout: 245 seconds] | 12:36 | |
-!- wiking_ [~wiking@2001:67c:10ec:5784:8000::3ff] has joined #shogun | 13:21 | |
wiking_ | gf712: pingu | 13:21 |
---|---|---|
gf712 | wiking_: ping | 13:23 |
wiking_ | gf712: ok so i've got to the level of modelselection :) | 13:25 |
wiking_ | (if you ls src/shogun) | 13:25 |
gf712 | yup | 13:26 |
wiking_ | 889 files changed, 8888 insertions(+), 9562 deletions(-) | 13:26 |
wiking_ | but SG_REF and SG_UNREF are removed... but not the lines | 13:27 |
wiking_ | clang rewriter is weird | 13:27 |
wiking_ | :) | 13:27 |
gf712 | oh is that for all the refs? | 13:27 |
gf712 | nice | 13:27 |
wiking_ | yes | 13:27 |
wiking_ | idk if i'm too stupid | 13:27 |
wiking_ | but sometimes the whole rewriter | 13:27 |
gf712 | you can always replace with ASDF and then regex | 13:28 |
wiking_ | makes quite a lot of erros | 13:28 |
gf712 | hmmm | 13:28 |
wiking_ | meaning how it replaces stuff | 13:28 |
wiking_ | sometimes replacing explicit casts works fine | 13:28 |
gf712 | you mean with lib tool? | 13:28 |
wiking_ | but then sometimes the parenthesis is fucked up | 13:28 |
wiking_ | yes | 13:28 |
wiking_ | hence it's not like running the 'script' and done | 13:28 |
wiking_ | :) | 13:28 |
gf712 | how weird, because you should be replacing a node right? | 13:28 |
wiking_ | well | 13:28 |
wiking_ | it's not that easy | 13:29 |
wiking_ | :DDDD | 13:29 |
wiking_ | you get declarations etc | 13:29 |
wiking_ | and then you traverse there stuff | 13:29 |
wiking_ | i'll give u the code | 13:29 |
wiking_ | once i'm done with this | 13:29 |
gf712 | ok, thanks | 13:29 |
wiking_ | and i wanna write a script | 13:29 |
wiking_ | that basically does | 13:29 |
gf712 | I watched a talk on it to get started, was pretty good | 13:29 |
wiking_ | isSameOrDerived("CSGObject") -> replace C with "" | 13:29 |
wiking_ | so to drop the C prefix | 13:30 |
wiking_ | i dont see the point of it anymore | 13:30 |
wiking_ | gf712: that is actually a pretty easy task | 13:30 |
wiking_ | if u wanna give it a go | 13:30 |
wiking_ | here's the matcher for it | 13:30 |
gf712 | why was there a C in the first place? | 13:30 |
gf712 | yea, I can try it out | 13:30 |
wiking_ | imo to makr | 13:30 |
wiking_ | *mark that it's a SGObject like | 13:30 |
wiking_ | so that it needs SGref/unref | 13:31 |
wiking_ | cxxRecordDecl( | 13:31 |
wiking_ | isSameOrDerivedFrom("CSGObject") | 13:31 |
wiking_ | ) | 13:31 |
wiking_ | use clang-query | 13:31 |
wiking_ | to test your ideas | 13:31 |
gf712 | btw have you used the python interface? | 13:31 |
wiking_ | no | 13:31 |
wiking_ | why would i ? :) | 13:31 |
gf712 | quick prototyping | 13:31 |
wiking_ | mmm | 13:31 |
wiking_ | clang-query | 13:31 |
gf712 | I haven't tried it | 13:31 |
wiking_ | ;) | 13:31 |
wiking_ | that'll give you the matches | 13:32 |
wiking_ | in REPL mode | 13:32 |
wiking_ | so the one above will give you the record decl for cxx classes | 13:32 |
wiking_ | that inherit from SGObject | 13:32 |
wiking_ | and then basically there you need a rewrite | 13:32 |
wiking_ | you can bind to this | 13:32 |
wiking_ | and then you should go everywhere where this decl is being used | 13:32 |
gf712 | ok, I just need to get it on my mac | 13:33 |
gf712 | brew llvm ? | 13:33 |
gf712 | can't find it clang-query in my path | 13:34 |
wiking_ | brew install llvm | 13:34 |
wiking_ | and then | 13:34 |
wiking_ | /usr/local/Cellar/llvm/8.0.0/bin/clang-query -extra-arg-before="-v" -extra-arg-before="-I/usr/local/Cellar/llvm/8.0.0/lib/clang/8.0.0/include" -p ~/shogun/bdauto ~/shogun/src/shogun/features/BinnedDotFeatures.cpp | 13:35 |
wiking_ | and of course | 13:35 |
wiking_ | in ~/shogun/bdauto | 13:35 |
wiking_ | i did this | 13:35 |
wiking_ | cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_TESTING=ON .. | 13:35 |
wiking_ | that'll generate you a json | 13:35 |
wiking_ | that clang needs | 13:35 |
wiking_ | ok i've tried a matcher for template | 13:36 |
wiking_ | mmmm | 13:36 |
wiking_ | :) | 13:36 |
wiking_ | maaaybe a regex will b faster :) | 13:36 |
wiking_ | this gives you all the variable declarations | 13:37 |
wiking_ | where sgobject like pointers are used | 13:37 |
wiking_ | varDecl(hasType(pointsTo(cxxRecordDecl(isSameOrDerivedFrom("CSGObject"))))) | 13:37 |
wiking_ | varDecl(hasType(pointsTo(cxxRecordDecl(isSameOrDerivedFrom("CSGObject")).bind("decl")))) | 13:38 |
wiking_ | you wanna have bind on the record decl | 13:38 |
wiking_ | so that you can easily do there there replacement | 13:38 |
wiking_ | for casts explicitCastExpr(hasType(pointsTo(cxxRecordDecl(isSameOrDerivedFrom("CSGObject"))))) | 13:39 |
wiking_ | :) | 13:39 |
wiking_ | etc etc | 13:39 |
gf712 | ok, let me see | 13:40 |
gf712 | why -extra-arg-before="-I/usr/local/Cellar/llvm/8.0.0/lib/clang/8.0.0/include" ? | 13:40 |
gf712 | is that to get stdlib.h? | 13:40 |
wiking_ | otherwise compilation error | 13:41 |
wiking_ | :) | 13:41 |
gf712 | aight | 13:42 |
gf712 | so in the repl just paste those commands? | 13:42 |
wiking_ | m matcher | 13:43 |
wiking_ | so for example | 13:43 |
wiking_ | m varDecl(hasType(pointsTo(cxxRecordDecl(isSameOrDerivedFrom("CSGObject")).bind("decl")))) | 13:43 |
gf712 | so the result is from traversing the ast of BinnedDotFeatures.cpp tu ? | 13:44 |
wiking_ | yeah and the headers | 13:45 |
gf712 | and follows the nodes for each CSGObject in there? | 13:45 |
gf712 | ah ok | 13:45 |
gf712 | those are coming from the headers | 13:45 |
wiking_ | yes | 13:45 |
wiking_ | as the code is actually compiled | 13:45 |
wiking_ | :) | 13:45 |
gf712 | so could you have main.cpp that includes all the shogun headers | 13:46 |
gf712 | and go from there? | 13:46 |
wiking_ | mmm no | 13:48 |
wiking_ | because implementations are still would miss | 13:48 |
wiking_ | right? :) | 13:48 |
wiking_ | header wise yes | 13:48 |
gf712 | yea, so thats what I was wondering, how do you replace stuff in the tu? | 13:51 |
wiking_ | tu? | 13:51 |
gf712 | translation unit | 13:51 |
wiking_ | #include "clang/Rewrite/Core/Rewriter.h" | 13:51 |
gf712 | im coining the abbreviation :p | 13:51 |
wiking_ | rewrite_.InsertTextBefore(sr.getBegin(), "FOOBAR"); | 13:52 |
wiking_ | get the source range | 13:52 |
wiking_ | when it's matched | 13:52 |
wiking_ | p->getSourceRange(); | 13:52 |
wiking_ | but this i only did via libtooling | 13:52 |
wiking_ | dunno if clang-query supports stuff like this | 13:52 |
gf712 | hmm ok I see | 13:52 |
gf712 | and the bind I didn't quite get | 13:53 |
gf712 | is that to bind it to a group? | 13:53 |
wiking_ | yes | 13:53 |
wiking_ | coz in this case | 13:53 |
wiking_ | you not only wanna replace the record declaration | 13:53 |
wiking_ | but where it is being used in var decl | 13:53 |
wiking_ | this way if you bind the record decl matcher | 13:53 |
wiking_ | later you can get your clang cursor there with a simple get | 13:53 |
gf712 | ah ok ok | 13:54 |
gf712 | and that you do using lib tooling ? | 13:54 |
wiking_ | yes | 13:54 |
wiking_ | if(const ParmVarDecl* p = result.Nodes.getNodeAs<ParmVarDecl>(BIND_NAME)) | 13:54 |
wiking_ | for example | 13:55 |
wiking_ | if you know that BIND_NAME is binding to a ParmVarDecl | 13:55 |
gf712 | ah I see | 13:55 |
wiking_ | now shit starts to hit the fan | 13:56 |
wiking_ | model selection fw | 13:56 |
wiking_ | is based on m_param | 13:56 |
wiking_ | aaaaand | 13:56 |
wiking_ | std::shared_ptr<WHATEVER> | 13:56 |
wiking_ | is foo bar :) | 13:56 |
gf712 | well, m_param should be gone soon | 13:56 |
gf712 | it depends on whether we remove it | 13:57 |
wiking_ | error: cannot take the address of an rvalue of type 'std::__1::shared_ptr<shogun::CSGObject>::element_type *' (aka 'shogun::CSGObject *') | 13:57 |
wiking_ | p->add(&(m_sgobject.get()), m_node_name); | 13:57 |
gf712 | and then replace late on | 13:57 |
wiking_ | std::forward makes it lvalue | 13:57 |
wiking_ | or? | 13:57 |
gf712 | you need to derefence no? | 13:59 |
gf712 | dereference | 13:59 |
wiking_ | noupo | 13:59 |
wiking_ | yes | 13:59 |
gf712 | you got ref to pointer | 13:59 |
wiking_ | i mean no | 13:59 |
wiking_ | so .get() gives me an rvalue | 13:59 |
wiking_ | of CSGObject* | 13:59 |
wiking_ | basically CSGObject*&& | 13:59 |
wiking_ | but i need lvalue of that shiatz | 14:00 |
wiking_ | maybe i just comment out this line | 14:00 |
wiking_ | and model selection wont work | 14:00 |
wiking_ | as for sure we are not adding shared_ptr support | 14:00 |
wiking_ | to old param fw | 14:00 |
gf712 | wiking_: pretty sure it should be &(*m_sgobject.get()) | 14:04 |
gf712 | but yea | 14:05 |
gf712 | the old param is going away soon | 14:05 |
wiking_ | holly cow | 14:06 |
gf712 | I just don't know if Heiko wants to wait until the new framework is in place | 14:06 |
wiking_ | DynArray<DynArray<Parameter*>*> param_sets; | 14:06 |
wiking_ | :( | 14:06 |
gf712 | and then replace | 14:06 |
gf712 | or wait delete now and replace later | 14:06 |
wiking_ | replace what? | 14:06 |
gf712 | old model selection stuff | 14:06 |
wiking_ | down in the drain | 14:06 |
wiking_ | :) | 14:06 |
wiking_ | it's develop | 14:06 |
gf712 | DynArray<DynArray<Parameter*>*> is quite a beast | 14:06 |
gf712 | but then should release first | 14:07 |
gf712 | and then remove? | 14:07 |
-!- geektoni [5d2045c3@gateway/web/freenode/ip.93.32.69.195] has quit [Quit: Page closed] | 14:07 | |
wiking_ | nono | 14:08 |
wiking_ | no point in reelasing anymore | 14:08 |
wiking_ | sooo many abi changes already | 14:08 |
-!- gf712 [9052083f@gateway/web/freenode/ip.144.82.8.63] has quit [Ping timeout: 256 seconds] | 14:12 | |
-!- HeikoS [~heiko@106.pool85-48-187.static.orange.es] has joined #shogun | 14:55 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 14:55 | |
-!- geektoni [5d2045c3@gateway/web/freenode/ip.93.32.69.195] has joined #shogun | 15:31 | |
@HeikoS | geektoni: yo | 15:31 |
geektoni | HeikoS: hello hello | 15:31 |
@HeikoS | how are things? | 15:32 |
@HeikoS | saw the email with ahmed? | 15:32 |
geektoni | HeikoS: everything is okay. I saw the email :) | 15:33 |
@HeikoS | cool, so maybe we have a solution to these problems soon, let's see | 15:34 |
geektoni | HeikoS: yup, hopefully | 15:35 |
@HeikoS | geektoni: anything I can have a look at while I am here? | 15:38 |
geektoni | HeikoS: I'm working at the blog post and LARS, but there is still nothing reviewable atm | 15:39 |
@HeikoS | ok no worries | 15:39 |
@HeikoS | share early though :) | 15:39 |
geektoni | I would also like to fix that sg_dispatch thing | 15:39 |
geektoni | sure sure | 15:39 |
geektoni | mmh I can't see Gil around | 15:40 |
@HeikoS | ah yeah | 15:41 |
@HeikoS | just email him | 15:41 |
@HeikoS | you have his address? | 15:41 |
@HeikoS | well I sent it | 15:42 |
@HeikoS | I have to run now. Talk to you later! | 15:42 |
geektoni | see you! | 15:43 |
-!- HeikoS [~heiko@106.pool85-48-187.static.orange.es] has quit [Ping timeout: 258 seconds] | 15:47 | |
-!- gf712 [9052083f@gateway/web/freenode/ip.144.82.8.63] has joined #shogun | 15:50 | |
gf712 | wiking_: is there a meeting today? | 15:59 |
geektoni | ping gf712 | 16:02 |
gf712 | geektoni: hey | 16:03 |
geektoni | gf712: hey! I have a quick question about your sg_any_dispatch | 16:03 |
geektoni | do you have a couple of minutes? :) | 16:03 |
gf712 | yup, go ahead :) | 16:04 |
geektoni | great! so | 16:04 |
geektoni | gf712: have a look at this line here https://github.com/shogun-toolbox/shogun/pull/4615/files#diff-f4e4aac153f6345d89d18867208beb3dR42 | 16:05 |
geektoni | I'm trying to use a lambda and sg_any_dispatch to print the content of a SGVector/SGMatrix | 16:06 |
gf712 | yup | 16:07 |
gf712 | is it not working? | 16:07 |
geektoni | so I've written the needed code inside the lambda which should be used when the any is matched to a SGVector | 16:07 |
geektoni | extactly :) even if v is declared auto, if I call v.to_string() the compiler complains | 16:07 |
gf712 | what error do you get? | 16:08 |
geektoni | it basically tells me that "v is of type int" | 16:08 |
geektoni | let me find you the complete error | 16:09 |
gf712 | mhhh thats very odd | 16:10 |
geektoni | gf712: here you are https://pastebin.com/ZFgnB8Sg | 16:14 |
geektoni | it is quite massive | 16:14 |
gf712 | yea, because it tries out lots of types it creates this huge trace | 16:15 |
gf712 | but let me have a look! | 16:15 |
geektoni | at line 49 you can see the error message it gives me | 16:15 |
geektoni | thank you :) | 16:15 |
geektoni | maybe I'm missing something trivial | 16:15 |
gf712 | geektoni: its a bug | 16:24 |
gf712 | in my code | 16:24 |
gf712 | I fixed it in a pr that hasn't been merged yet | 16:24 |
gf712 | basically the pr is unrelated but I had the same issue | 16:24 |
gf712 | geektoni: I will create a pr with just the fix now | 16:25 |
geektoni | that's perfect! Thank you very much :) | 16:25 |
gf712 | geektoni: this should fix your issue https://github.com/shogun-toolbox/shogun/pull/4617 | 16:29 |
geektoni | gf712: \o/ I'll let you know how it goes | 16:31 |
gf712 | ok! | 16:31 |
-!- besser82 [~besser82@fedora/besser82] has quit [Quit: Freedom, Friends, Features, First [fedoraproject.org]] | 17:38 | |
-!- besser82 [~besser82@fedora/besser82] has joined #shogun | 17:39 | |
-!- mode/#shogun [+o besser82] by ChanServ | 17:39 | |
-!- wiking_ [~wiking@2001:67c:10ec:5784:8000::3ff] has quit [Remote host closed the connection] | 17:45 | |
-!- gf712 [9052083f@gateway/web/freenode/ip.144.82.8.63] has quit [Ping timeout: 256 seconds] | 18:07 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun | 18:47 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has quit [Remote host closed the connection] | 19:32 | |
-!- wiking [~wiking@c-185-45-237-122.customer.ggaweb.ch] has joined #shogun | 19:36 | |
-!- geektoni [5d2045c3@gateway/web/freenode/ip.93.32.69.195] has quit [Quit: Page closed] | 19:38 | |
-!- braceletboy [67157d53@gateway/web/cgi-irc/kiwiirc.com/ip.103.21.125.83] has quit [Ping timeout: 276 seconds] | 23:18 | |
--- Log closed Wed Apr 24 00:00:46 2019 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!