本文整理汇总了C++中TObject::get_mem方法的典型用法代码示例。如果您正苦于以下问题:C++ TObject::get_mem方法的具体用法?C++ TObject::get_mem怎么用?C++ TObject::get_mem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TObject
的用法示例。
在下文中一共展示了TObject::get_mem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: upload
static void upload( TObject const & handle,
std::vector < typename TObject::value_type > const& input,
context const& ctx,
bool synchronous = true)
{
assert ( ( input.size() / TObject::value_elements ) == handle.get_count() );
ctx.transfer_to_buffer(handle.get_mem(), &input.front(), handle.value_entry_size * handle.get_count());
}
示例2: uploadScalar
static void uploadScalar( TObject const & handle,
typename TObject::value_type const& input,
context const& ctx,
bool synchronous = true)
{
assert ( handle.get_count() == 1 );
ctx.transfer_to_buffer(handle.get_mem(), &input, handle.value_entry_size);
}
示例3: createScalar
static void createScalar(
TObject & handle,
typename TObject::value_type const& initialValue,
context const & ctx)
{
// create buffer
create ( handle, 1, ctx );
ctx.transfer_to_buffer(handle.get_mem(), &initialValue, handle.value_entry_size);
//std::cout << "Buffer written" << std::endl;
}
示例4: create
static void create(
TObject & handle,
std::vector < typename TObject::value_type > const& input,
size_t count,
context const & ctx)
{
// create buffer
create ( handle, count, ctx );
ctx.transfer_to_buffer(handle.get_mem(), &input.front(), handle.value_entry_size * count);
//std::cout << "Buffer written" << std::endl;
}
示例5: downloadScalar
static void downloadScalar( TObject const & handle,
typename TObject::value_type & out,
context const& ctx,
bool synchronous = true,
uint offset = 0,
uint lengthWaitList = 0,
const cl_event * waitList = NULL)
{
assert ( handle.get_count() >= offset );
offset = offset * handle.value_entry_size;
ctx.transfer_from_buffer(handle.get_mem(), &out, handle.value_entry_size, lengthWaitList, waitList, offset);
}