我正在尝试在 __global__ 函数中使用数学函数(pow),但出现此错误:
calling a __host__ function("std::pow<float, double> ") from a __global__ function is not allowed
我试图检查项目属性->构建->设置->工具设置->优化下的“使用快速数学库”复选框,但没有运气。
我检查了 pow 函数中的类型,它们都是浮点数,我还包含了这些头文件:
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <math.h>
#include <sys/times.h>
#include <sys/resource.h>
#include <limits.h>
#include <unistd.h>
#include <time.h>
#include <string.h>
#include "utils.h"
也没有 using namespace std
有想法该怎么解决这个吗?