Skip to content

Commit 64cc1c9

Browse files
committed
benchdnn: fix and limit scratchpad check to CPU
1 parent d702ab2 commit 64cc1c9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tests/benchdnn/dnnl_common.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -1141,13 +1141,15 @@ static int check_total_size(
11411141
//
11421142
// 0.75 value supposed to be experimental and might be adjusted.
11431143
static constexpr float scratch_trh = 0.75f;
1144-
if (check_mem_size_args.scratchpad_size
1145-
> scratch_trh * total_size_cpu) {
1144+
if (is_cpu()
1145+
&& check_mem_size_args.scratchpad_size
1146+
> scratch_trh * check_mem_size_args.total_size_device) {
11461147
BENCHDNN_PRINT(2,
11471148
"[CHECK_MEM][%s]: CPU scratchpad size `%zu` exceeded a "
11481149
"given threshold `%zu`.\n",
11491150
dir_c_str(), check_mem_size_args.scratchpad_size,
1150-
(size_t)(scratch_trh * total_size_cpu));
1151+
(size_t)(scratch_trh
1152+
* check_mem_size_args.total_size_device));
11511153
res->state = FAILED;
11521154
} else {
11531155
res->state = SKIPPED;

0 commit comments

Comments
 (0)