Skip to content

Commit a1bcfe4

Browse files
committed
Use gxx
1 parent 5362bde commit a1bcfe4

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

python/test/unit/tools/test_aot.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,16 @@ def kernel(C, A, B, M, N, K,
102102
def gen_kernel_library_xpu(dir, libname):
103103
cpp_files = glob.glob(os.path.join(dir, "*.cpp"))
104104
subprocess.run(
105-
["icpx"] + cpp_files + ["-I", COMPILATION_HELPER.include_dir[0], "-c", "-fsycl", "-fPIC"],
105+
["g++"] + cpp_files + ["-I" + include_dir for include_dir in COMPILATION_HELPER.include_dir] +
106+
["-L", COMPILATION_HELPER.libsycl_dir, "-c", "-lsycl", "-fPIC"],
106107
check=True,
107108
cwd=dir,
108109
)
109110
o_files = glob.glob(os.path.join(dir, "*.o"))
110111

111-
command = ["icpx", "-fsycl", "-lze_loader", *o_files, "-shared", "-o", libname]
112-
for lib_dir in COMPILATION_HELPER.library_dir:
113-
command.extend(["-L", lib_dir])
114-
if COMPILATION_HELPER.libsycl_dir:
115-
for lib_dir in COMPILATION_HELPER.libsycl_dir:
116-
command.extend(["-L", lib_dir])
117-
subprocess.run(command, check=True, cwd=dir)
112+
subprocess.run(["g++"] + [*o_files, "-shared", "-o", libname] +
113+
["-L" + library_dir for library_dir in COMPILATION_HELPER.library_dir] +
114+
["-L", COMPILATION_HELPER.libsycl_dir, "-lsycl", "-lze_loader"], check=True, cwd=dir)
118115

119116

120117
def gen_kernel_library(dir, libname):
@@ -297,15 +294,15 @@ def gen_test_bin(dir, M, N, K, exe="test", algo_id=0):
297294
command.extend(["-l", "cuda", "-L", dir, "-l", "kernel", "-o", exe])
298295

299296
if is_xpu():
300-
command = ["icpx", "test.cpp"]
297+
command = ["g++", "test.cpp"]
301298
for inc_dir in COMPILATION_HELPER.include_dir:
302299
command.extend(["-I", inc_dir])
303300
for lib_dir in COMPILATION_HELPER.library_dir:
304301
command.extend(["-L", lib_dir])
305302
if COMPILATION_HELPER.libsycl_dir:
306303
for lib_dir in COMPILATION_HELPER.libsycl_dir:
307304
command.extend(["-L", lib_dir])
308-
command.extend(["-fsycl", "-lze_loader", "-L", dir, "-l", "kernel", "-o", exe])
305+
command.extend(["-lsycl", "-lze_loader", "-L", dir, "-l", "kernel", "-o", exe])
309306
subprocess.run(command, check=True, cwd=dir)
310307

311308

@@ -584,3 +581,4 @@ def test_ttgir_to_spv():
584581
spv = k.asm['spvdis']
585582
assert "OpCapability KernelAttributesINTEL" in spv
586583
assert "SubgroupSize 32" in spv
584+

0 commit comments

Comments
 (0)