本文整理汇总了C++中accelerator::get_description方法的典型用法代码示例。如果您正苦于以下问题:C++ accelerator::get_description方法的具体用法?C++ accelerator::get_description怎么用?C++ accelerator::get_description使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类accelerator
的用法示例。
在下文中一共展示了accelerator::get_description方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例3: setDefaultAccelerator
/**
********************************************************************************
* @fn setDefaultAccelerator
* @brief Set a default accelerator
*******************************************************************************/
int setDefaultAccelerator()
{
std::vector<accelerator> allAccl = accelerator::get_all();
/**************************************************************************
* if deviceID is not set, the default accelerator is AMD Readon *
**************************************************************************/
if(!enableDeviceId)
{
for (unsigned i = 0; i < allAccl.size(); ++i)
{
if (allAccl[i].get_description().find(L"AMD Radeon") != std::wstring::npos ||
allAccl[i].get_description().find(L"ATI Radeon") != std::wstring::npos )
{
deviceAccl = allAccl[i];
break;
}
}
}
else
{
deviceAccl = allAccl[deviceId];
}
accelerator::set_default(deviceAccl.device_path);
std::wcout << L"Selected accelerator : " << deviceAccl.get_description()
<< std::endl;
if (deviceAccl == accelerator(accelerator::direct3d_ref))
{
std::cout << "WARNING!! Running on very slow emulator!" << std::endl;
}
if(deviceAccl == accelerator(accelerator::cpu_accelerator))
{
std::cout << "There is no need to run on single CPU !"<<std::endl;
return SDK_FAILURE;
}
return SDK_SUCCESS;
}