Skip to content

Commit 659d012

Browse files
authored
Enable AOT tests back for A770 && BMG && WIN (#5049)
The main change is to not create the sycl device like this: `const sycl::device sycl_device;` in global scope (doing this - led to a hang on Windows). --------- Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 0e4e599 commit 659d012

File tree

3 files changed

+12
-26
lines changed

3 files changed

+12
-26
lines changed

scripts/skiplist/a770/tools.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
python/test/unit/tools/test_aot.py::test_launcher_has_no_available_kernel[True]
2-
python/test/unit/tools/test_aot.py::test_launcher_has_no_available_kernel[False]
3-
python/test/unit/tools/test_aot.py::test_compile_link_matmul_no_specialization[True]
4-
python/test/unit/tools/test_aot.py::test_compile_link_matmul_no_specialization[False]
5-
python/test/unit/tools/test_aot.py::test_compile_link_matmul[True]
6-
python/test/unit/tools/test_aot.py::test_compile_link_matmul[False]
7-
python/test/unit/tools/test_aot.py::test_compile_link_autotune_matmul

scripts/skiplist/xe2/tools.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +0,0 @@
1-
python/test/unit/tools/test_aot.py::test_launcher_has_no_available_kernel[True]
2-
python/test/unit/tools/test_aot.py::test_launcher_has_no_available_kernel[False]
3-
python/test/unit/tools/test_aot.py::test_compile_link_matmul_no_specialization[True]
4-
python/test/unit/tools/test_aot.py::test_compile_link_matmul_no_specialization[False]
5-
python/test/unit/tools/test_aot.py::test_compile_link_matmul[True]
6-
python/test/unit/tools/test_aot.py::test_compile_link_matmul[False]
7-
python/test/unit/tools/test_aot.py::test_compile_link_autotune_matmul

third_party/intel/tools/intel/compile.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,6 @@ static inline void gpuAssert(ze_result_t code, const char *file, int line) {{
2929
ze_module_handle_t {kernel_name}_mod = NULL;
3030
ze_kernel_handle_t {kernel_name}_func = NULL;
3131
unsigned char BIN_NAME[{bin_size}] = {{ {bin_data} }};
32-
// sycl globals
33-
const sycl::device sycl_device;
34-
const auto ctx =
35-
#if __SYCL_COMPILER_VERSION >= 20250604
36-
sycl_device.get_platform().khr_get_default_context();
37-
#else
38-
sycl_device.get_platform().ext_oneapi_get_default_context();
39-
#endif
40-
const auto l0_device =
41-
sycl::get_native<sycl::backend::ext_oneapi_level_zero>(sycl_device);
42-
const auto l0_context =
43-
sycl::get_native<sycl::backend::ext_oneapi_level_zero>(ctx);
4432

4533
void unload_{kernel_name}(void) {{
4634
// Not implemeted
@@ -57,6 +45,17 @@ static ze_module_format_t get_module_format(const std::string& format_name) {{
5745
}}
5846

5947
void load_{kernel_name}() {{
48+
static sycl::device sycl_device;
49+
static auto ctx =
50+
#if __SYCL_COMPILER_VERSION >= 20250604
51+
sycl_device.get_platform().khr_get_default_context();
52+
#else
53+
sycl_device.get_platform().ext_oneapi_get_default_context();
54+
#endif
55+
static auto l0_device =
56+
sycl::get_native<sycl::backend::ext_oneapi_level_zero>(sycl_device);
57+
static auto l0_context =
58+
sycl::get_native<sycl::backend::ext_oneapi_level_zero>(ctx);
6059
uint8_t *binary_ptr = (uint8_t *)&BIN_NAME;
6160
size_t binary_size = {bin_size};
6261

@@ -120,6 +119,7 @@ static inline void set_argument(sycl::handler &cgh, int index, const std::string
120119
}}
121120

122121
int32_t {kernel_name}(sycl::queue &stream, {signature}) {{
122+
const auto &ctx = stream.get_context();
123123
auto sycl_mod = sycl::make_kernel_bundle<sycl::backend::ext_oneapi_level_zero,
124124
sycl::bundle_state::executable>(
125125
{{{kernel_name}_mod, sycl::ext::oneapi::level_zero::ownership::transfer}}, ctx);

0 commit comments

Comments
 (0)