Skip to content

Commit

Permalink
[software] Cross-out defines for Banshee Monte-Carlo simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
mbertuletti committed Dec 19, 2024
1 parent ef75e96 commit 7a7c32e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 53 deletions.
26 changes: 0 additions & 26 deletions software/apps/baremetal/mimo_mmse_f16/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,34 +89,18 @@ __fp16 l1_x[2 * N_TX * N_ITR]
int main() {

uint32_t core_id = mempool_get_core_id();
#ifndef BANSHEE
uint32_t num_cores = mempool_get_core_count();
mempool_barrier_init(core_id); // Initialize barrier and synchronize
uint32_t time_init, time_end;
#endif

/* Initialize matrices */
if (core_id == 0) {
#ifdef BANSHEE
for (uint32_t i = 0; i < N_RX * N_TX * N_ITR; i++) {
(*(uint32_t *)&l1_H[2 * i]) = *(uint32_t *)&l2_H[2 * i];
}
for (uint32_t i = 0; i < N_RX * N_ITR; i++) {
(*(uint32_t *)&l1_y[2 * i]) = *(uint32_t *)&l2_y[2 * i];
}
for (uint32_t i = 0; i < N_TX * N_ITR; i++) {
(*(uint32_t *)&l1_S[2 * i]) = *(uint32_t *)&l2_S[2 * i];
}
#else
dma_memcpy_blocking(l1_H, l2_H, 2 * N_TX * N_RX * N_ITR * sizeof(int16_t));
dma_memcpy_blocking(l1_y, l2_y, 2 * N_RX * N_ITR * sizeof(int16_t));
dma_memcpy_blocking(l1_S, l2_S, 2 * N_TX * N_ITR * sizeof(int16_t));
#endif
printf("Data transferred\n");
}
#ifndef BANSHEE
mempool_barrier(num_cores);
#endif

#ifdef SINGLE
/* Benchmark */
Expand Down Expand Up @@ -194,21 +178,11 @@ int main() {
mempool_stop_benchmark();
#endif

#ifdef BANSHEE
// Check the result
if (core_id == 0) {
for (uint32_t i = 0; i < 2 * N_TX * N_ITR; i++) {
uint32_t x = (*(uint32_t *)&l1_x[i]) & 0x0000FFFF;
printf("RES=%04x\n", x);
}
}
#else
if (core_id == 0) {
printf("Runtime: %d\n", time_end - time_init);
}
mempool_check_f16(l1_x, l2_x, 2 * N_RX * N_TX, 0.01f, 0);
mempool_barrier(num_cores);
#endif

return 0;
}
Expand Down
27 changes: 0 additions & 27 deletions software/apps/baremetal/mimo_mmse_f8/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,33 +66,17 @@ __fp16 l1_x[2 * N_TX * N_ITR]
int main() {

uint32_t core_id = mempool_get_core_id();
#ifndef BANSHEE
uint32_t num_cores = mempool_get_core_count();
mempool_barrier_init(core_id); // Initialize barrier and synchronize
#endif

/* Initialize matrices */
if (core_id == 0) {
#ifdef BANSHEE
for (uint32_t i = 0; i < 2 * N_RX * N_TX * N_ITR; i++) {
l1_H[i] = l2_H[i];
}
for (uint32_t i = 0; i < 2 * N_RX * N_ITR; i++) {
l1_y[i] = l2_y[i];
}
for (uint32_t i = 0; i < 2 * N_TX * N_ITR; i++) {
l1_S[i] = l2_S[i];
}
#else
dma_memcpy_blocking(l1_H, l2_H, 2 * N_TX * N_RX * N_ITR * sizeof(int8_t));
dma_memcpy_blocking(l1_y, l2_y, 2 * N_RX * N_ITR * sizeof(int8_t));
dma_memcpy_blocking(l1_S, l2_S, 2 * N_TX * N_ITR * sizeof(int16_t));
#endif
printf("Data transferred\n");
}
#ifndef BANSHEE
mempool_barrier(num_cores);
#endif

#ifdef SINGLE
/* Benchmark */
Expand Down Expand Up @@ -173,20 +157,9 @@ int main() {
mempool_stop_benchmark();
#endif

#ifdef BANSHEE
// Check the result
if (core_id == 0) {
for (uint32_t i = 0; i < 2 * N_TX * N_ITR; i++) {
uint32_t x = (*(uint32_t *)&l1_x[i]) & 0x0000FFFF;
printf("RES=%04x\n", x);
}
}
#else
if (core_id == 0) {
printf("Runtime: %d\n", time_end - time_init);
}
mempool_barrier(num_cores);
#endif

return 0;
}

0 comments on commit 7a7c32e

Please sign in to comment.