1

スラストグラフから簡単な例をコンパイルしようとしています。

現時点では、すべてをコメントアウトしていますmain(void)

私は誰かが喜んで与えてくれるあらゆる方向性を探しています!

私のコンパイルエラーはこれです:

mseil@cuda:~/mseil_CUDA/test$ nvcc Example.cu 
/usr/local/cuda/bin/../include/thrust/detail/device/cuda/reduce_by_keyvalue.inl(90): error: name followed by "::" must be a class or namespace name

/usr/local/cuda/bin/../include/thrust/graph/detail/adjacency_list.inl(141): error: name followed by "::" must be a class or namespace name

/usr/local/cuda/bin/../include/thrust/graph/detail/adjacency_list.inl(213): error: name followed by "::" must be a class or namespace name

/usr/local/cuda/bin/../include/thrust/graph/detail/adjacency_list.inl(344): error: name followed by "::" must be a class or namespace name

4 errors detected in the compilation of "/tmp/tmpxft_00007122_00000000-9_Example.cpp4.ii".

最初のエラーであるinclude/thrust/detail/device/cuda/reduce_by_keyvalue.inlファイルの 90 行目に焦点を合わせましたが、何が問題なのかわかりません。私は C++ を初めて使用します (C は初心者レベルで知っています)。テンプレート ファイルに関してはすべて問題ないように見えます。NVIDIA の担当者が何をしているのかを知らないとショックを受けるでしょう。

90行目あたりのコード:

  typedef typename thrust::iterator_traits<InputIterator1>::difference_type difference_type;

  difference_type n =key_last - key_first;
  difference_type N =result_last - result_first;

  const std::size_t BLOCK_SIZE =512; // number of threads per block
  const std::size_t MAX_BLOCKS =thrust::experimental::arch::max_active_threads() / BLOCK_SIZE;
  const std::size_t NUM_BLOCKS =std::min( MAX_BLOCKS, n + (BLOCK_SIZE - 1) / BLOCK_SIZE);  //offending line.

そして現在、私のメインの唯一のコード: (他のすべてはコメントされています。)

#include <thrust/graph/adjacency_list.hpp>
using namespace thrust;

int main(void){
    typedef adjacency_list<undirectedS, disallow_parallelS> graph_t;

    return 0;
}
4

3 に答える 3

2

スラストグラフライブラリ開発者のdrkkojimaです。0.2RC03にアップデートして問題を解決しました。

于 2011-04-07T08:25:16.120 に答える
1

標準の i/o ファイルを含めることに問題がありますか?

于 2011-02-07T08:50:45.933 に答える
0

問題は明らかにCUDA3.2と推力1.3と推力グラフ0.2RC2の非互換性です。CUDA 3.1と推力グラフ1.2.1にロールバックしましたが、これで問題は大幅に解決しました。(すべてのサンプルファイルは、それぞれ1つを除いてコンパイルされますが、これで問題なく動作できます。)

于 2011-02-25T14:12:28.607 に答える