Home | History | Annotate | Download | only in nbperf

Lines Matching refs:state

72 struct state {
82 assign_nodes(struct state *state)
88 for (i = 0; i < state->graph.v; ++i)
89 state->g[i] = 3;
91 for (i = 0; i < state->graph.e; ++i) {
92 j = state->graph.output_order[i];
93 e = &state->graph.edges[j];
94 if (!state->visited[e->vertices[0]]) {
97 } else if (!state->visited[e->vertices[1]]) {
101 if (state->visited[e->vertices[2]])
107 state->visited[t] = 2 + j;
108 if (state->visited[e->vertices[0]] == 0)
109 state->visited[e->vertices[0]] = 1;
110 if (state->visited[e->vertices[1]] == 0)
111 state->visited[e->vertices[1]] = 1;
112 if (state->visited[e->vertices[2]] == 0)
113 state->visited[e->vertices[2]] = 1;
115 state->g[t] = (9 + r - state->g[e->vertices[0]] - state->g[e->vertices[1]]
116 - state->g[e->vertices[2]]) % 3;
120 for (i = 0; i < state->graph.v; ++i) {
122 state->holes64k[i >> 16] = holes;
125 state->holes64[i >> 6] = holes - state->holes64k[i >> 16];
127 if (state->visited[i] > 1) {
128 j = state->visited[i] - 2;
129 state->result_map[j] = i - holes;
132 if (state->g[i] == 3)
138 print_hash(struct nbperf *nbperf, struct state *state)
155 (state->graph.v + 63) / 64);
157 for (i = 0; i < state->graph.v; ++i) {
158 sum |= ((uint64_t)state->g[i] & 1) << (i & 63);
177 (state->graph.v + 63) / 64);
179 for (i = 0; i < state->graph.v; ++i) {
180 sum |= (((uint64_t)state->g[i] & 2) >> 1) << (i & 63);
199 (state->graph.v + 65535) / 65536);
200 for (i = 0; i < state->graph.v; i += 65536)
203 state->holes64k[i >> 16],
209 (state->graph.v + 63) / 64);
210 for (i = 0; i < state->graph.v; i += 64)
213 state->holes64[i >> 6],
224 state->graph.v);
226 state->graph.v);
228 state->graph.v);
230 if (state->graph.hash_fudge & 1)
233 if (state->graph.hash_fudge & 2) {
260 for (i = 0; i < state->graph.e; ++i)
262 state->result_map[i]);
269 struct state state;
290 graph3_setup(&state.graph, v, e);
292 state.holes64k = calloc(sizeof(uint32_t), (v + 65535) / 65536);
293 state.holes64 = calloc(sizeof(uint16_t), (v + 63) / 64 );
294 state.g = calloc(sizeof(uint32_t), v | 63);
295 state.visited = calloc(sizeof(uint32_t), v);
296 state.result_map = calloc(sizeof(uint32_t), e);
298 if (state.holes64k == NULL || state.holes64 == NULL ||
299 state.g == NULL || state.visited == NULL ||
300 state.result_map == NULL)
303 if (SIZED2(_hash)(nbperf, &state.graph))
305 if (SIZED2(_output_order)(&state.graph))
307 assign_nodes(&state);
308 print_hash(nbperf, &state);
313 SIZED2(_free)(&state.graph);
314 free(state.visited);
315 free(state.g);
316 free(state.holes64k);
317 free(state.holes64);
318 free(state.result_map);