From c49e6283a50745493ff0d1a774b779d32dff57b7 Mon Sep 17 00:00:00 2001 From: Ole-Christoffer Granmo Date: Fri, 11 Oct 2024 10:55:37 +0200 Subject: [PATCH] Update --- .../cuda/calculate_clause_value_in_patch.cu | 4 +- tmu/lib/src/ClauseBank.c | 93 ++++++------------- 2 files changed, 32 insertions(+), 65 deletions(-) diff --git a/tmu/clause_bank/cuda/calculate_clause_value_in_patch.cu b/tmu/clause_bank/cuda/calculate_clause_value_in_patch.cu index 2df9e62b..e20311c2 100644 --- a/tmu/clause_bank/cuda/calculate_clause_value_in_patch.cu +++ b/tmu/clause_bank/cuda/calculate_clause_value_in_patch.cu @@ -70,7 +70,7 @@ extern "C" unsigned int *ta_state = &global_ta_state[clause*number_of_ta_chunks*number_of_state_bits]; - if (clause == 0) { + if (0 && clause == 0) { printf("*"); for (int k = 0; k < number_of_literals; ++k) { int literal_chunk = k / 32; @@ -108,7 +108,7 @@ extern "C" clause_node_output &= ~(1 << node_pos); } - if (clause == 0 && node == 0) { + if (0 && clause == 0 && node == 0) { printf("V: %d\n", clause_node_output & (1 << node_pos)); } } diff --git a/tmu/lib/src/ClauseBank.c b/tmu/lib/src/ClauseBank.c index 0269133f..e8b9bd97 100644 --- a/tmu/lib/src/ClauseBank.c +++ b/tmu/lib/src/ClauseBank.c @@ -1580,37 +1580,37 @@ void cb_calculate_spatio_temporal_features( filter, attention, Xi, - 1 + 0 ); - printf("-"); - for (int k = 0; k < number_of_literals; ++k) { - int literal_chunk = k / 32; - int literal_pos = k % 32; - - if (ta_state[literal_chunk*number_of_state_bits + number_of_state_bits - 1] & (1 << literal_pos)) { - printf(" %d", k); - } - } - printf("\n"); - - printf("+"); - for (int k = 0; k < number_of_literals; ++k) { - int literal_chunk = k / 32; - int literal_pos = k % 32; - - if (Xi[literal_chunk] & (1 << literal_pos)) { - printf(" %d", k); - } - } - printf("\n"); - - - if (((clause_node_output[0] & 1) > 0) != clause_value) { - printf("ERROR %d %d\n", (clause_node_output[0] & 1) > 0, clause_value); - } else { - printf("CORRECT\n"); - } + // printf("-"); + // for (int k = 0; k < number_of_literals; ++k) { + // int literal_chunk = k / 32; + // int literal_pos = k % 32; + + // if (ta_state[literal_chunk*number_of_state_bits + number_of_state_bits - 1] & (1 << literal_pos)) { + // printf(" %d", k); + // } + // } + // printf("\n"); + + // printf("+"); + // for (int k = 0; k < number_of_literals; ++k) { + // int literal_chunk = k / 32; + // int literal_pos = k % 32; + + // if (Xi[literal_chunk] & (1 << literal_pos)) { + // printf(" %d", k); + // } + // } + // printf("\n"); + + + // if (((clause_node_output[0] & 1) > 0) != clause_value) { + // printf("ERROR %d %d\n", (clause_node_output[0] & 1) > 0, clause_value); + // } else { + // printf("CORRECT\n"); + // } for (int d = 0; d < 0; ++d) { for (int j = 0; j < number_of_clauses; j++) { @@ -1625,41 +1625,8 @@ void cb_calculate_spatio_temporal_features( filter, attention, &Xi[patch*number_of_ta_chunks], - (j == 0) && (d == 0) && (patch == 0) + 0 ); - - if (d == 0 && j == 0 && patch == 0) { - printf("-"); - for (int k = 0; k < number_of_literals; ++k) { - int literal_chunk = k / 32; - int literal_pos = k % 32; - - if (ta_state[clause_pos + literal_chunk*number_of_state_bits + number_of_state_bits - 1] & (1 << literal_pos)) { - printf(" %d", k); - } - } - printf("\n"); - - printf("+"); - for (int k = 0; k < number_of_literals; ++k) { - int literal_chunk = k / 32; - int literal_pos = k % 32; - - if (Xi[literal_chunk] & (1 << literal_pos)) { - printf(" %d", k); - } - } - printf("\n"); - - unsigned int patch_chunk = patch / 32; - unsigned int patch_pos = patch % 32; - - if (((clause_node_output[j*number_of_patch_chunks + patch_chunk] & (1 << patch_pos)) > 0) != clause_value_in_patch[patch] ) { - printf("ERROR %d %d %d %d %d %d\n", j, patch, patch_chunk, patch_pos, (clause_node_output[j*number_of_patch_chunks + patch_chunk] & (1 << patch_pos)) > 0, clause_value_in_patch[patch]); - } else { - printf("CORRECT\n"); - } - } } for (int patch = 0; patch < number_of_patches; ++patch) {