Skip to content

Commit

Permalink
benchdnn: fix and limit scratchpad check to CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
echeresh committed Jan 23, 2025
1 parent d702ab2 commit 64cc1c9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/benchdnn/dnnl_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1141,13 +1141,15 @@ static int check_total_size(
//
// 0.75 value supposed to be experimental and might be adjusted.
static constexpr float scratch_trh = 0.75f;
if (check_mem_size_args.scratchpad_size
> scratch_trh * total_size_cpu) {
if (is_cpu()
&& check_mem_size_args.scratchpad_size
> scratch_trh * check_mem_size_args.total_size_device) {
BENCHDNN_PRINT(2,
"[CHECK_MEM][%s]: CPU scratchpad size `%zu` exceeded a "
"given threshold `%zu`.\n",
dir_c_str(), check_mem_size_args.scratchpad_size,
(size_t)(scratch_trh * total_size_cpu));
(size_t)(scratch_trh
* check_mem_size_args.total_size_device));
res->state = FAILED;
} else {
res->state = SKIPPED;
Expand Down

0 comments on commit 64cc1c9

Please sign in to comment.