Hello,
Now that I'm back to some C++ coding, I want to finish the integration of
viennacl::op_reduce<>.
I've noticed a lot of different operator overloads for
viennacl::scalar_expression<>, with basically different implicit
conversions to raw scalar. I'm a bit skeptical here :)
This allows to handle the (imho unpractical) cases such as :
cpu_scal = inner_prod(x1,x2)*5.0
or
cpu_scal = (vcl_scal1 + vcl_scal2)*5.0
I think that such expressions should be forbidden. I think that every
conversion involving host<->device data movement should be explicit, since
they trigger a flush of the scheduler's queue. Furthermore, we are heading
towards multi-devices computations, and these implicit conversions will
then become even more troublesome : an implicit inner_prod<->scalar
conversion would then need to sum the results obtained for each device...
Basically, I think that we should forbid any other implicit conversions
than the viennacl::scalar<T> <=> T one... Do you agree?
This would force to rewrite the examples above :
gpu_scal = (vcl_scal1 + vcl_scal2)*5.0;
cpu_scal = gpu_scal;
Which is I think more explicit and efficient than the previous approach :)
Philippe
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel