1

デバイスベクターで単純な throw::inclusive スキャンコールを使用しています。デバッグ ビルドでは、これはエラーなしで実行されます。ただし、リリース ビルドを使用して実行すると、エラーが発生します。

また、これは Thrust::device<> ベクトルにのみ影響するようですか?

'thrust::system::system_error' what() のインスタンスをスローした後に呼び出された終了: 未指定の起動失敗

私は eclipse nsight を使用して、デバッグおよびリリース ビルドを実行しています。

#include <iostream>
using namespace std;

#include <thrust/scan.h>
#include <thrust/device_vector.h>

int main(void) {

    cout << "hello\n";

    int data[6] = {1, 0, 2, 2, 1, 3};

    thrust::inclusive_scan(data, data + 6, data); // in-place scan

    for(int i=0;i<6;i++) cout<< data[i] << "\n";

    cout << "inclusive scan on a device vector\n";

    thrust::device_vector<int> d_C_0(6);

    d_C_0[0] = 1;
    d_C_0[1] = 0;
    d_C_0[2] = 2;
    d_C_0[3] = 2;
    d_C_0[4] = 1;
    d_C_0[5] = 3;

    thrust::inclusive_scan(d_C_0.begin(), d_C_0.begin() + 6, d_C_0.begin()); // in-place scan

    for(int i=0;i<6;i++) cout<< d_C_0[i] << "\n";

    return 0;
}
4

1 に答える 1