@@ -102,19 +102,16 @@ def kernel(C, A, B, M, N, K,
102102def 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
120117def 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
0 commit comments