本文整理汇总了C++中accelerator::set_default_cpu_access_type方法的典型用法代码示例。如果您正苦于以下问题:C++ accelerator::set_default_cpu_access_type方法的具体用法?C++ accelerator::set_default_cpu_access_type怎么用?C++ accelerator::set_default_cpu_access_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类accelerator
的用法示例。
在下文中一共展示了accelerator::set_default_cpu_access_type方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: accelerator
StagingArrayToArrayTests()
{
cpu_acc = accelerator(accelerator::cpu_accelerator);
gpu_acc1 = require_device_for<DATA_TYPE>();
gpu_acc2 = require_device_for<DATA_TYPE>(gpu_acc1);
if(gpu_acc1.get_supports_cpu_shared_memory())
{
WLog() << "Accelerator " << gpu_acc1.get_description() << " supports zero copy" << std::endl;
// Set the default cpu access type for this accelerator
gpu_acc1.set_default_cpu_access_type(DEF_ACCESS_TYPE1);
access_types_vec.push_back(std::make_tuple(access_type_none));
access_types_vec.push_back(std::make_tuple(access_type_read));
access_types_vec.push_back(std::make_tuple(access_type_write));
access_types_vec.push_back(std::make_tuple(access_type_read_write));
}
else
{
access_types_vec.push_back(std::make_tuple(access_type_auto));
}
if(gpu_acc2.get_supports_cpu_shared_memory())
{
WLog() << "Accelerator " << gpu_acc2.get_description() << " supports zero copy" << std::endl;
// Set the default cpu access type for this accelerator
gpu_acc2.set_default_cpu_access_type(DEF_ACCESS_TYPE2);
}
}
示例2: accelerator
StagingArrayToStagingArrayTests()
{
cpu_acc = accelerator(accelerator::cpu_accelerator);
gpu_acc = require_device_for<DATA_TYPE>();
if(gpu_acc.get_supports_cpu_shared_memory())
{
WLog() << "Accelerator " << gpu_acc.get_description() << " supports zero copy" << std::endl;
// Set the default cpu access type for this accelerator
gpu_acc.set_default_cpu_access_type(DEF_ACCESS_TYPE);
}
}