Pergunta

I'm trying to compile a simple example from thrust graph.

At the moment I have everything commented out in main(void)

I'm looking for ANY direction someone is willing to give!

My compilation error is this:

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".

I zeroed in on the very first error, line 90 of the include/thrust/detail/device/cuda/reduce_by_keyvalue.inl file and I can't see what the problem is. I'm new to C++ (and I know C at a beginner's level). Everything looks fine in regards to a template file, and I'd be shocked if the guys at NVIDIA don't know what they're doing--so it must be me.

The code around line 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.

And currently the only code in my main: (Everything else is commented.)

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

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

    return 0;
}
Foi útil?

Solução

I am thrust graph lib developer, drkkojima. I updated to 0.2RC03 and solved the problems.

Outras dicas

Problem with including the standard i/o files ?

The problem is apparently an incompatibility of CUDA 3.2, AND thrust 1.3 with thrust-graph 0.2RC2. We rolled back to CUDA 3.1, and thrust-graph 1.2.1 and this has largely solved the problem. (all example files compile except one on each; but we can live with this.)

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top