在c++ AMP限制(direct3d)代码中使用int索引,其中double是预期的
Using int index where double is expected in C++ AMP retrict(direct3d) code
谷歌没有帮助,有人使用AMP吗?
在下面的代码片段中,从整型转换为双型(双型v = idx.x)会导致" Failed to create shader "运行时错误。我认为限制(direct3d)会提醒我GPU在编译期间无法处理的事情。是否有pow()的替代方法-或者我必须编写一个循环来完成它?
concurrency::array_view<double,1> prices = …
concurrency::parallel_for_each(
prices.grid, [=](index<1> idx) mutable restrict(direct3d) {
double v = idx.x;
prices[idx] = concurrency::pow(u, v);
…
请参阅我们对Windows上gpu双支持的解释,以及c++ AMP数学库http://blogs.msdn.com/b/nativeconcurrency/archive/2012/02/08/math-library-for-c-amp.aspxhttp://blogs.msdn.com/b/nativeconcurrency/archive/2012/02/07/double-precision-support-in-c-amp.aspx
如果你还有问题,请随时回复。此外,请用c++amp标记您的问题,以便我们有更好的机会找到它们。
相关文章:
- 数组索引的值没有增加
- 芬威克树(BIT).找到具有给定累积频率的最小索引,单位为 O(logN)
- 查找最接近的大于当前数字的数字的索引
- 在C++中调整向量中的索引
- 重载元组索引运算符-C++
- 给定一个向量,如何找到该向量的所有子集和的原始索引
- 为std::string的某个索引赋值
- 并行用于C++17中数组索引范围内的循环
- 当我在其中一个线程执行中(在activemq-cpp中)捕获到特定值时,我如何终止/停止所有其他线程
- 修改链表主函数代码,用户将在其中输入节点的索引和数据以及正确的消息
- 特征获取索引数组,其中向量中的值为真(不需要循环)
- 查找数组的第一个和最后一个索引,其中 from 和 to 元素的顺序总和最大
- 将循环(以及其中的条件)替换为按索引直接访问
- 找到两个相关索引,其中两个元素等于目标值
- 如何创建一个 std::tuple,其中包含由索引元组指定的向量中的成员
- 数组索引表示法,其中 std::shared_ptr 到数组
- 如何获取向量的这些元素,其中另一个向量在相应的索引处具有'1
- 一个多索引,其中一个索引是整个集合的子集
- 是否有一个 c++ 矩阵库,我可以在其中索引具有非连续向量的矩阵,如 R 中的矩阵
- 在c++ AMP限制(direct3d)代码中使用int索引,其中double是预期的