Skip to content
Snippets Groups Projects
Commit a196534a authored by Jonathan Mace's avatar Jonathan Mace
Browse files

Fix synchronization bug in check_model executable

parent 53dfedab
No related branches found
No related tags found
No related merge requests found
...@@ -74,11 +74,15 @@ void check_model(int page_size, std::string model_path) { ...@@ -74,11 +74,15 @@ void check_model(int page_size, std::string model_path) {
for (int i = 0; i < warmups; i++) { for (int i = 0; i < warmups; i++) {
model->call(batch_size, weights->page_pointers, io_memory, workspace_memory, util::Stream()); model->call(batch_size, weights->page_pointers, io_memory, workspace_memory, util::Stream());
} }
auto before = util::now(); status = cudaStreamSynchronize(util::Stream());
int iterations = 100; CHECK(status == cudaSuccess);
auto before = util::now();
int iterations = 100;
for (int i = 0; i < iterations; i++) { for (int i = 0; i < iterations; i++) {
model->call(batch_size, weights->page_pointers, io_memory, workspace_memory, util::Stream()); model->call(batch_size, weights->page_pointers, io_memory, workspace_memory, util::Stream());
} }
status = cudaStreamSynchronize(util::Stream());
CHECK(status == cudaSuccess);
auto after = util::now(); auto after = util::now();
printf(" b%d: %.2f ms per call\n", batch_size, ((float) (after-before)) / (iterations * 1000000.0)); printf(" b%d: %.2f ms per call\n", batch_size, ((float) (after-before)) / (iterations * 1000000.0));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment