我如何在函数中使用boost.com pupute函数,该功能将由推力在GPU上使用
How do I use boost.compute functions in a functor which will be used by Thrust on a GPU?
我正在尝试使用boost.math提供的特殊功能。
基本上,我想做一个转换,就像这样
thrust::device_vector<double> in(1000);
thrust::device_vector<double> out(1000);
thrust::transform(in.begin(), in.end(), out.begin(), myfunctor());
其中 myfunctor()
由
#include <boost/math/special_functions/ellint_1.hpp>
.
.
.
struct myfunctor {
__host__ __device__
double operator()(double k) {
return boost::math::ellint_1(sqrt(k));
}
};
我一直在函数中调用 ellint_1
的线路。
我是在做错事还是boost。
__device__
内部称为__device__
的任何功能也必须是CC_5合格的函数。boost::math::ellint_1()
没有这样的预选赛。
请参阅CUDA编程指南B.1。 - 功能执行空间指定符https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#function-declaration-declaration-pecifiers
和boost :: Math无关以boost ::计算,后者专注于通用的STL样算法和容器。
相关文章:
- C++:函数外部的超时功能
- 我在 C++ 中创建了一个函数来递归反转字符串,但是之后如何使功能打印一个 endl?
- 设计模式,以避免不必要地添加抽象函数以适应新功能
- 当我链接两个静态C++库时,我可以在两个主函数库中有两个主要功能吗?
- 具有C++迭代器参数的多功能函数
- 错误:调用'strcmp'没有匹配函数(尝试设置显示用户信息功能)
- 我有模板功能.通过使用函数std::for_each,用这个容器中的最大数字替换每个正数
- 是否有一个Windows驱动程序函数可以执行Windows文件api SeFileAttributes的等效功能
- 自定义 {fmt} 格式化函数,具有编译时格式字符串检查功能
- 如何在带有初始值设定项的构造函数中使用 vprintf/cstdarg 功能?
- =删除用户定义的成员功能,除了构造函数,分配运算符C 11
- 如何使用结构内的功能指针调用私有函数
- C 函数调用包装器包含类成员功能作为模板参数
- 您如何在与打开窗口的功能的不同函数中使用Draw函数
- 虚拟静态函数功能的解决方法
- 实现 C++11 委派构造函数功能会导致多个警告
- 复制构造函数功能
- C++构造函数功能
- 如何在保持标准c++函数功能的同时绕过它
- c++思维,内联函数功能