Skip to content

Commit 7adc280

Browse files
Do not use blocking kernel in warmup run of measure_cold
See #240
1 parent c463a78 commit 7adc280

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

nvbench/detail/measure_cold.cuh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ struct measure_cold_base::kernel_launch_timer
135135
, m_disable_blocking_kernel{measure.m_disable_blocking_kernel}
136136
{}
137137

138+
explicit kernel_launch_timer(measure_cold_base &measure, bool disable_blocking_kernel)
139+
: m_measure{measure}
140+
, m_disable_blocking_kernel{disable_blocking_kernel}
141+
{}
142+
138143
__forceinline__ void start()
139144
{
140145
m_measure.flush_device_l2();
@@ -206,7 +211,10 @@ private:
206211
return;
207212
}
208213

209-
kernel_launch_timer timer(*this);
214+
// disable use of blocking kernel for warm-up run
215+
// see https://github.com/NVIDIA/nvbench/issues/240
216+
constexpr bool disable_blocking_kernel = true;
217+
kernel_launch_timer timer(*this, disable_blocking_kernel);
210218

211219
this->launch_kernel(timer);
212220
this->check_skip_time(m_cuda_timer.get_duration());

0 commit comments

Comments
 (0)