Skip to content

Commit bd08aa7

Browse files
committed
Enforce headers inclusion order
1 parent a40c643 commit bd08aa7

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

source/adapters/level_zero/device.hpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,21 @@
1818
#include <unordered_map>
1919
#include <vector>
2020

21-
#include <level_zero/include/ze_intel_gpu.h>
2221
#include <ur/ur.hpp>
2322
#include <ur_ddi.h>
23+
// Make sure that we don't reorder these includes during formatting. Across the
24+
// codebase we include <ze_api.h> (not <level_zero/ze_api.h>) which guarantees
25+
// that we use up-to-date fetched Level Zero headers and not some headers from
26+
// the system (which might be out-of-date). ze_intel_gpu.h includes
27+
// <level_zero/ze_api.h>, so if we include it first then it is possible that we
28+
// mistakenly use the headers insalled in the system.
29+
// clang-format off
2430
#include <ze_api.h>
25-
#include <zes_api.h>
26-
31+
#include <level_zero/include/ze_intel_gpu.h>
32+
// clang-format on
2733
#include "adapters/level_zero/platform.hpp"
2834
#include "common.hpp"
35+
#include <zes_api.h>
2936

3037
enum EventsScope {
3138
// All events are created host-visible.

0 commit comments

Comments
 (0)