为什么 "cpu" 加速器为 supports_double_precision 数据成员报告 "No"?

Why does the "cpu" accelerator report "No" for the supports_double_precision data member?

如果您使用 MS C++ AMP 检查 "cpu" 加速器,您将获得 supports_double_precision 的 "no"。现在,我的印象是 CPU 比 GPU 具有更好的精度......这仅仅是因为 MSVC++ 的数学库不够精确吗?

获取输出的示例代码:

#include <iostream>

#include <amp.h>

int main()
{
  std::vector<accelerator> accelerators = accelerator::get_all();
  for(const auto& accelerator : accelerators)
  {
    std::wcout << accelerator.description << "\n";
    std::wcout << (accs[i].supports_double_precision ? 
        "double precision: true" : "double precision: false") << "\n";
    std::wcout << (accs[i].supports_limited_double_precision ? 
        "limited double precision: true" : "limited double precision: false") << "\n";
  }
}

cpu 加速器不是您应该用来执行代码的加速器。所以支持(或不支持)双精度并不是真正有用的信息。

accelerator::cpu_accelerator Data Member : You can use this accelerator for setting up staging arrays. It cannot execute C++ AMP code. For more information, see the Staging Arrays in C++ AMP post on the Parallel Programming in Native Code blog.

https://msdn.microsoft.com/en-us/library/hh873132.aspx

如果您想了解有关使用 CPU 加速器创建临时阵列的更多信息,请访问 MSDN 页面链接到博客 post,其中包含更多信息。

http://blogs.msdn.com/b/nativeconcurrency/archive/2011/11/10/staging-arrays-in-c-amp.aspx