I have an af::array for which i want to find the non zero location (2048*2048).
af::timer start1 = af::timer::start();First iteration: elapsed time (ms) : 1.8792 ms
elapsed time (ms) : 0.7094 ms
second iteration elapsed time (ms) : 16.8074 ms
elapsed time (ms) : 0.4738 ms
third iteration elpased time (ms) : 17.3236 ms
elpased time (ms) : 0.4543 ms
why do the time is so inconsistent?
--
You received this message because you are subscribed to the Google Groups "ArrayFire Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to arrayfire-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/arrayfire-users/328eaf96-3128-4f0e-bfd9-b4f24561eebbn%40googlegroups.com.
In the where functionthe first where function is taking more time (4 ms) when compared to second where function(0.5 ms) in all the 100 for iteration.If i print af_print(peak_op.numdims()) before calling the first where function, the time it takes is (0.5 ms)I am not sure where the problem isRegardsR Avinash
That is because `peak_op` is a jit node during the first call to "where" inside any given iteration and the during the second "where" API call, `peak_op` has already been converted to a buffer(memory) from the jit node, so it needs no evaluation.It is not a problem rather a consequence of passing the same `af::array`, which is a JIT node, to "where" twice in a single iteration.
On Tue, Jul 6, 2021 at 6:11 PM Avinash Rangarajan <avi.ranga...@gmail.com> wrote:
In the where functionthe first where function is taking more time (4 ms) when compared to second where function(0.5 ms) in all the 100 for iteration.If i print af_print(peak_op.numdims()) before calling the first where function, the time it takes is (0.5 ms)I am not sure where the problem isRegardsR Avinash
To view this discussion on the web visit https://groups.google.com/d/msgid/arrayfire-users/ad98aed0-9677-4e8b-9229-814229693417n%40googlegroups.com.