Skip to content

Commit

Permalink
Demo works -- initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dpetrisko committed Jan 23, 2023
1 parent e0348a1 commit d82e875
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions examples/cuda/test_host_stream/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
* This test streams data through circular buffers on the host through the manycore
* in a chain, then streams back to the host. Validation is that the data received
* matches the data pattern sent.
*
* This test demonstrates how host can be run concurrently with manycore code in a
* streaming or cooperative manner.
*/

int kernel_host_stream(int argc, char **argv) {
Expand Down Expand Up @@ -143,16 +146,16 @@ int kernel_host_stream(int argc, char **argv) {
}
}

//int timeout = hb_mc_device_pod_wait_for_tile_group_finish_any(device, pod, 1);
hb_mc_request_packet_t rqst;
int rc = hb_mc_manycore_request_rx(device->mc, &rqst, 1);
// Check for finish
hb_mc_device_pod_wait_for_tile_group_finish_any(device, pod, 1);
} while (packets_recv < NUM_PACKETS);

/*****************************************************************************************************************
* Freeze the tiles and memory manager cleanup.
******************************************************************************************************************/
BSG_CUDA_CALL(hb_mc_device_finish(device));

// Fail if data is not expected
if (mismatch) {
return HB_MC_FAIL;
}
Expand Down
3 changes: 1 addition & 2 deletions libraries/bsg_manycore_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,7 @@ int hb_mc_device_podv_wait_for_tile_group_finish_any(hb_mc_device_t *device,
while (1) {
hb_mc_request_packet_t rqst;

// perform a blocking read from the request fifo
// perform a read from the request fifo
int rc;
if ((rc = hb_mc_manycore_request_rx(device->mc, &rqst, timeout)) != HB_MC_SUCCESS)
return rc;
Expand Down Expand Up @@ -1881,7 +1881,6 @@ int hb_mc_device_podv_wait_for_tile_group_finish_any(hb_mc_device_t *device,
"value but no matching tile-group",
__func__);
}
return HB_MC_TIMEOUT;
}

/**
Expand Down

0 comments on commit d82e875

Please sign in to comment.