Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
olegranmo committed Oct 11, 2024
1 parent b9406a3 commit c49e628
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 65 deletions.
4 changes: 2 additions & 2 deletions tmu/clause_bank/cuda/calculate_clause_value_in_patch.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
}
Expand Down
93 changes: 30 additions & 63 deletions tmu/lib/src/ClauseBank.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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) {
Expand Down

0 comments on commit c49e628

Please sign in to comment.