diff --git a/modules/dnn/src/op_halide.cpp b/modules/dnn/src/op_halide.cpp
index 653de36146cc..db1a72278e70 100644
--- a/modules/dnn/src/op_halide.cpp
+++ b/modules/dnn/src/op_halide.cpp
@@ -14,6 +14,7 @@
 #include "halide_scheduler.hpp"
 
 #include <HalideRuntimeOpenCL.h>
+#include <thread>
 #endif  // HAVE_HALIDE
 
 namespace cv {