how to pass/return Vc::Vector arguments to a function?
Tijskens Engelbert
[please enable javascript to see the address]
Tue Nov 8 10:11:51 CET 2016
Dear all,
I am working on a molecular dynamics code using Vc for vectorisation - obviously.
the core of the problem is an outer loop (over all atoms), and an inner loop over all neighbours of the atom of the outer loop. The inner loop is vectorised (using Vc) and computes a force from a potential. The potential varies, depending on the nature of the problem, but the inner loop is always the same. I want to obtain a generic code for the outer and inner loop in which the potential can be passed in as a pointer to a (vectorised) function (or functor) or a template parameter for that function. how should i pass the vector arguments to a function?
by value?
inline
Vc::Vector<float,Abi>
lj_force_factor2
( Vc::Vector<float,Abi> r2 // squared distance
) {…}
by const value?
inline
Vc::Vector<float,Abi>
lj_force_factor2
( Vc::Vector<float,Abi> r2 // squared distance
) {…}
by reference?
inlined
Vc::Vector<float,Abi>
lj_force_factor2
( Vc::Vector<float,Abi>& r2 // squared distance
) {…}
by reference?
inlined
Vc::Vector<float,Abi>
lj_force_factor2
( Vc::Vector<float,Abi> const& r2 // squared distance
) {…}
thanks for your advice in advance and kindest regards,
Dr [Engel]bert Tijskens
HPC Analyst/Consultant
Flemish Supercomputer Center vscentrum.be<http://vscentrum.be>
HPC core facility CalcUA uantwerp.be/calcua<http://uantwerp.be/calcua>
Computational mathematics www.uantwerpen.be/en/rg/cma<http://www.uantwerpen.be/en/rg/cma>
University of Antwerp
Middelheimlaan1 G.309, B-2020 Antwerp, Belgium
[please enable javascript to see the address][please enable javascript to see the address]>
++32 3 265 3879
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://compeng.uni-frankfurt.de/pipermail/vc/attachments/20161108/7f4c2751/attachment.html>
More information about the Vc
mailing list