[ADOL-C] : memcpy
Antoine Falisse
antoinefalisse at gmail.com
Wed Aug 16 15:07:15 EDT 2017
Hi all,
We are currently trying to bring adolc to a code that has a custom Vector
class that internally holds a C array of doubles (actually, the Vector
class is templated on the scalar type) and whose copy constructor performs
the copy using std::memcpy(). We have seen that memcpy does not work with
adoubles, since this will copy the location in the tape and results in a
shallow copy rather than a deep copy. Is there any clever way to handle
memcpy with a C array of adoubles to achieve a deep copy? As a temporary
fix, we looped over the array and therefore skipped using memcpy. However,
there are cases where this fix could be harder to implement. Also, we think
this may decrease the computational efficiency of the code.
Thank you for your help,
Antoine Falisse
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/adol-c/attachments/20170816/39ca42cb/attachment.html>
More information about the ADOL-C
mailing list