You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Ankit Aggarwal (JIRA)" <ji...@apache.org> on 2017/08/21 17:50:00 UTC
[jira] [Commented] (ARROW-1360) [C++] Add Copy virtual method to
arrow::Buffer
[ https://issues.apache.org/jira/browse/ARROW-1360?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16135496#comment-16135496 ]
Ankit Aggarwal commented on ARROW-1360:
---------------------------------------
I think it can be a better implementation if we do something like this
{code:c++}
class DefaultMemcpy{
public:
static void Copy(/**Pass the parameters here **/){
std::cout <<"Default Memcpy " << std::endl;
}
};
class CustomMemcpy {
public:
static void Copy(){
std::cout << "Custom Memcpy " << std::endl;
}
};
class Buffer {
public:
template <typename T = DefaultMemcpy>
void Copy(){
T::Copy() ;
}
};
int main(){
Buffer obj;
obj.Copy<CustomMemcpy>();
return 0;
}
{code}
Just let me know whether it is a feasible design
> [C++] Add Copy virtual method to arrow::Buffer
> ----------------------------------------------
>
> Key: ARROW-1360
> URL: https://issues.apache.org/jira/browse/ARROW-1360
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++
> Reporter: Wes McKinney
>
> Some kinds of buffers (like GPU buffers) may need to use something other than {{memcpy}} (or its parallel variant) to copy memory. It might be useful to provide an abstract API for copying between RAM and some buffer.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)