thrust

    0热度

    1回答

    我跑的阵列上的推力并行二进制搜索型例程: // array and array2 are raw pointers to device memory thrust::device_ptr<int> array_ptr(array); // Search for first position where 0 could be inserted in array // without viol

    1热度

    1回答

    我有一个由float4数组表示的粒子池,其中w分量是粒子当前的生命周期[0,1]。 我需要根据粒子的寿命以降序对这个数组进行排序,这样我就可以为当前有多少粒子“活跃”(寿命大于0)保留一个精确计数器。我需要这个计数器,因为当我需要激活更多的粒子(随机发生)时,它将允许我索引到阵列中的正确位置。 我的微粒数组存储在设备内存中,似乎我应该能够对数组进行排序而不必将数组传输到主机内存。 我在网上找到例子

    -1热度

    1回答

    我惊呆了。我收获了很多答案,但仍然无法实现。我试着去实现比较过struct point,这将有助于找到阵极小点,这是到目前为止的代码: struct minPointOperator { __device__ __host__ point operator()(const point& x, const point& y) const { return x.val

    0热度

    1回答

    __global__ void HYPER (int tFast, int tFastLenth, int kilo, int lenPrzvFast, double eps, int AF,double *arrINTLighFast, int *arrPrzvFncFst, int dv_ptr) { for(int j = 0;j<(tFast*tFastLenth);j

    0热度

    1回答

    我需要知道每个元素在推力紧凑时映射到什么位置。 例如: arr: 5 2 -1 3 -1 6 -1 7 compacted: 5 2 3 6 7 --------------(remove all -1 element) map Arr: 0 1 -1 2 -1 3 -1 4 映射阵列,这里我指的是数组,指示哪个位置,每个元件被移动到,对不起,我无法想出一个更好的名称来描述这一点,我希

    3热度

    1回答

    我有使用标准CUDA的malloc在CUDA分配一个存储器阵列,它被传递给一个函数,如下所示: void MyClass::run(uchar4 * input_data) 我也有一个类的成员,其是一个推力device_ptr声明为: thrust::device_ptr<uchar4> data = thrust::device_malloc<uchar4(num_pts); 这里num

    1热度

    1回答

    我正试图在CUDA中实现蛮力距离计算算法。 #define VECTOR_DIM 128 thrust::device_vector<float> feature_data_1; feature_data_1.resize(VECTOR_DIM * 1000); // 1000 128 dimensional points thrust::device_vector<float> featu

    -1热度

    1回答

    我将一个数组分成n个组,每个组的大小相等,我想要在每个组中获得n个最大数字。 例如: 我计算组ID为每个线程和一个全局阵列上使用atomicMax。所以当组号小时,性能很差。似乎thrust::reduce_by_key可以做到这一点,但我还没有弄清楚。 有什么更好的点子?

    -2热度

    1回答

    我正试图用arrayfire替换一些推送电话来检查性能。 我不知道我是否正确使用阵列火灾,因为我采取的结果根本不匹配。 所以,例如我使用的推力代码: cudaMalloc((void**) &devRow, N * sizeof(float)); ...//devRow is filled thrust::device_ptr<float> SlBegin(devRow); for (in

    3热度

    1回答

    int data[ 10 ] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; int keys[ 10 ] = { 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 }; thrust::exclusive_scan_by_key(keys, keys + 10, data, data); 通过例子在Thrust Site我预计0,0,1,1,2,2,3,3