thrust

    1热度

    1回答

    我需要一个类迭代器,像这样 https://github.com/thrust/thrust/blob/master/examples/strided_range.cu 但这一新的迭代器做下一个序列 [k * size_stride, k * size_stride+1, ...,k * size_stride+size_chunk-1,...] 与 k = 0,1,...,N 例如: s

    0热度

    1回答

    我正在寻找一种快速方法来减少排列为大向量的等长度的多个块 。 我有N个排列成一个大阵列的子阵列(连续元素)。每个子阵列都有一个固定的大小:k。 所以整个阵列的大小是:N * K 我正在做的是调用内核N次。每次在它计算子阵如下还原: 我会遍历包含在大矢量的所有子阵列: for(i=0;i<N;i++){ thrust::device_vector<float> Vec(subarray,

    0热度

    1回答

    在我的代码中,我使用了来自推力库的复数数组,并且我想使用cublasZgeam()来转置数组。 使用cuComplex.h中的复数不是一个可取的选择,因为我在数组上做了很多算术运算,cuComplex没有定义运算符,如* + =。 我这是怎么定义的数组,我要转 thrust::complex<float> u[xmax][xmax]; 我发现这个https://github.com/jtrav

    0热度

    1回答

    如何用多种类型的binary_functions使用推力减小?在我的情况下,我有一个结构FaceUV,它有一个'距离'成员。我想计算所有FaceUV的距离!= 0.我该怎么做? 我认为这是这一点,但它并不能编译: struct FaceHasUVCmp : public thrust::binary_function<FaceUV, uint32_t, uint32_t> { __dev

    0热度

    1回答

    我正在使用可分离编译的CUDA C++项目,并且在编译推力函数时遇到了一些问题。 直到下面的函数调用被添加,项目才会没有问题。 thrust::device_ptr<float> max_int = thrust::max_element( thrust::device_ptr<float>(dev_temp_intensity_buffer), thrust::device_p

    0热度

    1回答

    考虑下面的代码: #include <time.h> // --- time #include <stdlib.h> // --- srand, rand #include<fstream> #include <thrust\host_vector.h> #include <thrust\device_vector.h> #include <thrust\sort.h> #inc

    0热度

    1回答

    我试图插入一个值到第三的位置,使用推力host_vector。 static thrust::host_vector <int *> bins; int * p; bins.insert(3, 1, p); 但我得到的错误: error: no instance of overloaded function "thrust::host_vector<T, Alloc>::insert [with

    0热度

    1回答

    #include <stdio.h> #include <stdlib.h> #include <cuda.h> #include <thrust/device_vector.h> #include <thrust/host_vector.h> #include <thrust/scan.h> #include <thrust/execution_policy.h> #include

    3热度

    1回答

    我在MATLAB MEX代码中使用CUDA Thrust库时遇到了问题。 我有一个外部运行良好的例子,但是如果我编译并运行它作为MEX文件,它会在运行时产生“丢失符号”错误。 它似乎特定于推力库。如果不是thrust::device_vector我使用cudaMalloc与cudaMemcpy或cublasSetVector然后一切都很好。 最小示例 thrustDemo.cu: #ifdef M

    0热度

    1回答

    我在thrust :: transform_reduce中使用了一个函数中的thrust :: reduce。情况看起来像一个嵌套推力算法。编译会成功,但它的错误运行:作为跟随 terminate called after throwing an instance of 'thrust::system::system_error' what(): cudaEventSynchronize