Skip to content

Commit

Permalink
Check work buffer size for dyna-bench
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmroberts authored Aug 27, 2024
1 parent 6321f69 commit 5ad0a84
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions clients/bench/dyna-bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,14 +498,6 @@ int main(int argc, char* argv[])
return EXIT_SUCCESS;
}

const auto vram_footprint = params.vram_footprint();
if(!vram_fits_problem(vram_footprint, free))
{
std::cout << "SKIPPED: Problem size (" << vram_footprint
<< ") raw data too large for device.\n";
return EXIT_SUCCESS;
}

// GPU input buffer:
auto ibuffer_sizes = params.ibuffer_sizes();
std::vector<gpubuf> ibuffer(ibuffer_sizes.size());
Expand Down Expand Up @@ -643,6 +635,15 @@ int main(int argc, char* argv[])
}

std::cout << "Work buffer size: " << wbuffer_size << std::endl;

if(!vram_fits_problem(raw_vram_footprint + wbuffer_size, free))
{
std::cout << "SKIPPED: Problem size (" << raw_vram_footprint << " + " << +wbuffer_size
<< " = " << raw_vram_footprint + wbuffer_size
<< " ) data too large for device.\n";
return EXIT_SUCCESS;
}

gpubuf wbuffer;
if(wbuffer_size)
{
Expand Down

0 comments on commit 5ad0a84

Please sign in to comment.