本文整理汇总了C++中accelerator::get_default_view方法的典型用法代码示例。如果您正苦于以下问题:C++ accelerator::get_default_view方法的具体用法?C++ accelerator::get_default_view怎么用?C++ accelerator::get_default_view使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类accelerator
的用法示例。
在下文中一共展示了accelerator::get_default_view方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool GpuAccView1ToGpuAccView2()
{
accelerator_view cpu_av1 = cpu_acc.get_default_view();
accelerator_view stg_arr_av1 = gpu_acc.get_default_view();
accelerator_view cpu_av2 = cpu_acc.get_default_view();
accelerator_view stg_arr_av2 = gpu_acc.create_view();
return CopyAndVerifyFromStagingArrayToStagingArray<DATA_TYPE, RANK>(cpu_av1, stg_arr_av1, cpu_av2, stg_arr_av2);
}
示例2:
runall_result test10(accelerator& device)
{
array<int, 1> arr1(64, device.get_default_view(), ACCESS_TYPE);
array<int, 2> arr2(64, 64, device.get_default_view(), ACCESS_TYPE);
array<int, 3> arr3(64, 64, 64, device.get_default_view(), ACCESS_TYPE);
runall_result res;
res &= REPORT_RESULT(VerifyCpuAccessType(arr1, ACCESS_TYPE));
res &= REPORT_RESULT(VerifyCpuAccessType(arr2, ACCESS_TYPE));
res &= REPORT_RESULT(VerifyCpuAccessType(arr3, ACCESS_TYPE));
return res;
}
示例3:
runall_result Gpu1AccViewToGpu2AccView()
{
accelerator_view gpu_av1 = gpu_acc1.get_default_view();
accelerator_view gpu_av2 = gpu_acc2.get_default_view();
runall_result res;
for(auto a_t_tuple : access_types_vec)
{
print_access_type_tuple(a_t_tuple);
res &= CopyAndVerifyFromArrayToNonContiguousArrayView<DATA_TYPE, RANK>(gpu_av1, gpu_av2, std::get<0>(a_t_tuple), std::get<1>(a_t_tuple), std::get<0>(a_t_tuple));
}
return res;
}
示例4: CpuAccViewToGpuAccView
runall_result CpuAccViewToGpuAccView()
{
accelerator_view cpu_av = cpu_acc.get_default_view();
accelerator_view gpu_av = gpu_acc.get_default_view();
runall_result res;
for(auto a_t_tuple : access_types_vec)
{
print_access_type_tuple(a_t_tuple);
res &= CopyAndVerifyFromNonContigArrayViewConstToArray<DATA_TYPE, RANK>(cpu_av, gpu_av, std::get<0>(a_t_tuple), std::get<1>(a_t_tuple));
}
return res;
}
示例5: REPORT_RESULT
runall_result test9(accelerator& device)
{
extent<2> arr_extent = CreateRandomExtent<2>(64);
array<float, 2> arr(arr_extent, device.get_default_view(), ACCESS_TYPE);
return REPORT_RESULT(VerifyCpuAccessType(arr, ACCESS_TYPE));
}