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/ | GSoC2018: https://wp.me/p4pxJf-k1
kisaacs has quit [Ping timeout: 245 seconds]
parsa has joined #ste||ar
kisaacs has joined #ste||ar
hkaiser[[m]] has joined #ste||ar
hkaiser[[m]] has quit [Remote host closed the connection]
hkaiser[m] has quit [Ping timeout: 260 seconds]
diehlpk has quit [Ping timeout: 240 seconds]
eschnett has joined #ste||ar
kisaacs has quit [Ping timeout: 252 seconds]
kisaacs has joined #ste||ar
hkaiser has quit [Quit: bye]
kisaacs has quit [Ping timeout: 260 seconds]
K-ballo has quit [Quit: K-ballo]
kisaacs has joined #ste||ar
nanashi55 has quit [Ping timeout: 240 seconds]
nanashi55 has joined #ste||ar
kisaacs has quit [Ping timeout: 256 seconds]
kisaacs has joined #ste||ar
mcopik has quit [Ping timeout: 260 seconds]
galabc has quit [Read error: Connection reset by peer]
anushi has quit [Remote host closed the connection]
<jakub_golinowski>
, with an argument list composed as described below.
<jakub_golinowski>
oh well copy paste from pdf was not a great idea :/
<jakub_golinowski>
but the way I was using this parallel_for loop before was passing either pointer to a function (&do_sth) or writing an inline lambda function
<jakub_golinowski>
and it worked as described in documentation
<hkaiser>
show me your code
<jakub_golinowski>
So this is the part in which the abstract class ParallelLoopBody is defined and the mechanism to handle calls to parallel_for_ with both lambda and by inheriting from ParallelLoobBody
<jakub_golinowski>
I am resending my message because I am not sure if they reached you
<jakub_golinowski>
(They are not on the log)
<jakub_golinowski>
So this is the part in which the abstract class ParallelLoopBody is defined and the mechanism to handle calls to parallel_for_ with both lambda and by inheriting from ParallelLoobBody
<jakub_golinowski>
K-ballo, so the Question is what to put in commented out ?WHAT_HERE?
<K-ballo>
`PLBW`?
<jakub_golinowski>
you are right it work
nikunj97 has joined #ste||ar
<jakub_golinowski>
works, so now why it does not work in the more complicated example :/
<jakub_golinowski>
let me look at it again
nikunj has quit [Ping timeout: 264 seconds]
<jakub_golinowski>
Now I get this error:
<jakub_golinowski>
part_iterations<const cv::ParallelLoopBody&, int>::f_’ to be of abstract type ‘cv::ParallelLoopBody’
<jakub_golinowski>
So one lesson was learnt from the simple example: if we deal with functor then one simply passes the functor object
<jakub_golinowski>
to the for_loop_strided
<jakub_golinowski>
And from the error:
<jakub_golinowski>
error: cannot declare field ‘hpx::parallel::v2::detail::part_iterations<const cv::ParallelLoopBody&, int>::f_’ to be of abstract type ‘cv::ParallelLoopBody’
<K-ballo>
function objects are generally required to be copyable (and cheaply as well)
<K-ballo>
were you passing a reference of base type before?
nikunj97 has quit [Remote host closed the connection]
nikunj97 has joined #ste||ar
<jakub_golinowski>
I was trying to pass a pointer
<K-ballo>
unlikely, that would not correspond to the error message above
<jakub_golinowski>
now I am not longer passing a pointer
<K-ballo>
since you are doing classic old style OOP you are probably interested in maintaining identity of the function object
<K-ballo>
for those cases one usually wraps the function object in std::ref and passes that to algorithms
<K-ballo>
then it is the std::reference_wrapper that it is copied, not the target function object
<jakub_golinowski>
Ok I understand the idea
<jakub_golinowski>
So what I have access to at the point when I want to call the parallel_for is: