 #include "gpugas.h"
 
 
-struct BFSBase
+//nvcc doesn't like the __device__ variable to be a static member inside BFS
+//so these are both outside.
+int g_iterationCount;
+__device__ __constant__ int g_iterationCountGPU;
+
+
+struct BFS
 {
   struct VertexData
   {

  //run on gpu
  {
    //initialize vertex data
    std::vector<BFSDev::VertexData> vertexData(nVertices);
    for( int i = 0; i < nVertices; ++i )
      vertexData[i].depth = -1; 

    GASEngineGPU<BFSDev> engine;
    engine.setGraph(nVertices, &vertexData[0], srcs.size(), 0, &srcs[0], &dsts[0]);
    engine.setActive(sourceVertex, sourceVertex+1);
    int iter = 0;

};


//struct BFSHost : public BFSBase
//{
//  static bool apply(VertexData* vert, int dist)
//  {
//    if( vert->depth == -1 )
//    {
//      vert->depth = g_iterationCount;
//      return true;
//    }
//    return false;
//  }
//};
//
//
//struct BFSDev : public BFSBase
//{
//  __device__
//  static bool apply(VertexData* vert, int dist)
//  {
//    if( vert->depth == -1 )
//    {
//      vert->depth = g_iterationCountGPU;
//      return true;
//    }
//    return false;
//  }
//};


int main(int argc, char** argv)
