Galois::has_deterministic_local_state< T > Struct Template Reference

Indicates the operator has a member type that encapsulates state that is passed between the suspension and resumpsion of an operator during deterministic scheduling. More...

#include <TypeTraits.h>


Detailed Description

template<typename T>
struct Galois::has_deterministic_local_state< T >

Indicates the operator has a member type that encapsulates state that is passed between the suspension and resumpsion of an operator during deterministic scheduling.

The type conforms to the following:

  struct T {
    struct GaloisDeteministicLocalState {
      int x, y, z; // Local state
      GaloisDeterministicLocalState(T& self, Galois::PerIterAllocTy& alloc) {
        // initialize local state
      }
    };

    void operator()(const A& item, Galois::UserContext<A>&) { 
      // An example of using local state
      typedef GaloisDeterministicLocalState LS;
      bool used;
      LS* p = (LS*) ctx.getLocalState(used);
      if (used) {
        // operator is being resumed; use p
      } else {
        // operator hasn't been suspended yet; execute normally
        // save state into p to be used when operator resumes
      }
    }
  };

The documentation for this struct was generated from the following file:

Generated on 2 Nov 2013 for Galois by  doxygen 1.6.1