diff --git a/src/Makefile b/src/Makefile index a170f29c..39d3f188 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,7 +1,7 @@ ################################################################################ # HARPtools by Chad D. Kersey, Summer 2011 # ################################################################################ -CXXFLAGS ?= -fPIC -O3 # -g -DUSE_DEBUG=3 +CXXFLAGS ?= -fPIC -O3 # -g -DUSE_DEBUG=3 -DPRINT_ACTIVE_THREADS LDLIBS ?= -pthread PREFIX ?= /usr/local diff --git a/src/core.cpp b/src/core.cpp index 1589f22b..daf640a5 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -46,13 +46,26 @@ bool Core::interrupt(Word r0) { void Core::step() { ++steps; + #ifdef PRINT_ACTIVE_THREADS + cout << endl << "Threads:"; + #endif + for (unsigned i = 0; i < w.size(); ++i) { if (w[i].activeThreads) { D(3, "Core step stepping warp " << i << '[' << w[i].activeThreads << ']'); w[i].step(); D(3, "Now " << w[i].activeThreads << " active threads in " << i); } + + #ifdef PRINT_ACTIVE_THREADSx + for (unsigned j = 0; j < w[i].tmask.size(); ++j) { + if (w[i].activeThreads > j && w[i].tmask[j]) cout << " 1"; + else cout << " 0"; + if (j != w[i].tmask.size()-1 || i != w.size()-1) cout << ','; + } + #endif } + cout << endl; } bool Core::running() const {