我正在尝试使用 cuda 推力对字符串进行排序。
我在此链接上找到了一个示例
https://github.com/bzip2-cuda/bzip2-cuda/blob/master/tst/string_sort_try0.cu
当我尝试编译时,我收到以下错误消息。我能做些什么来修复它?
"Error 1 error : **no instance of overloaded function "thrust::pointer<Element, Tag, Reference, Derived>::operator= [with Element=char, Tag=thrust::device_system_tag, Reference=thrust::device_reference<char>, Derived=thrust::device_ptr<char>]" matches the argument list** C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.5\include\thrust\device_ptr.h 109 1 CharSort "
代码块的一部分是
class device_string
{
public:
int cstr_len;
char* raw;
thrust::device_ptr<char> cstr;
static char* pool_raw;
static thrust::device_ptr<char> pool_cstr;
static thrust::device_ptr<char> pool_top;
// Sets the variables up the first time its used.
__host__ static void init()
{
static bool v = true;
if( v )
{
v = false;
pool_cstr = thrust::device_malloc(POOL_SZ);
pool_raw = (char*)raw_pointer_cast( pool_cstr );
pool_top = pool_cstr;
}
}
// Destructor for device variables used.