Skip to content

Commit 53af3d9

Browse files
jgmelberclaude
andcommitted
Reset cmake/modulesXilinx submodule to match main
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5286ec4 commit 53af3d9

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

test/python/npu-xrt/test_jit_extern_functions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,16 @@ def test_include_directories():
272272
# Create a header file
273273
header_file = os.path.join(temp_dir, "math_ops.h")
274274
with open(header_file, "w") as f:
275-
f.write("""
275+
f.write(
276+
"""
276277
#ifndef MATH_OPS_H
277278
#define MATH_OPS_H
278279
279280
#define ADD_VALUE 42
280281
281282
#endif
282-
""")
283+
"""
284+
)
283285

284286
# Create input and output tensors
285287
input_tensor = iron.randint(0, 100, (1024,), dtype=np.int32, device="npu")

test/python/npu-xrt/test_jit_extern_functions_inside_jit.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,15 @@ def transform_with_internal_func_from_file(input, output):
107107

108108
# Create a temporary file with the source code inside the function
109109
with tempfile.NamedTemporaryFile(mode="w", suffix=".cc", delete=False) as f:
110-
f.write("""extern "C" {
110+
f.write(
111+
"""extern "C" {
111112
void internal_add_from_file(int* input, int* output, int tile_size) {
112113
for (int i = 0; i < tile_size; i++) {
113114
output[i] = input[i] + 42;
114115
}
115116
}
116-
}""")
117+
}"""
118+
)
117119
temp_file_path = f.name
118120

119121
# Create ExternalFunction inside the transform from a file

test/python/npu-xrt/test_jit_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,13 @@ def test_compile_external_kernel_source_file(npu_target_arch):
185185
):
186186
src = os.path.join(src_dir, "my_kernel.cc")
187187
with open(src, "w") as f:
188-
f.write("""extern "C" {
188+
f.write(
189+
"""extern "C" {
189190
void my_kernel(int* a, int* b, int n) {
190191
for (int i = 0; i < n; i++) b[i] = a[i] + 1;
191192
}
192-
}""")
193+
}"""
194+
)
193195

194196
func = ExternalFunction("my_kernel", source_file=src)
195197
compile_external_kernel(func, kernel_dir, target_arch=npu_target_arch)

0 commit comments

Comments
 (0)