File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
third_party/intel/backend Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -288,6 +288,10 @@ def format_of(ty):
288288 if ty [0 ] == "*"
289289 ]
290290 params = [f"&arg{ i } " for i , ty in signature .items () if ty != "constexpr" ]
291+ num_params = len (params )
292+ params_decl = ""
293+ if num_params :
294+ params_decl = f"void *params[] = {{ { ', ' .join (params )} }};"
291295 src = f"""
292296#include <cstddef>
293297#include <string>
@@ -392,8 +396,8 @@ def format_of(ty):
392396 std::string kernel_name = kernel_ptr.get_info<sycl::info::kernel::function_name>();
393397 { 'RECORD_FUNCTION("XPU Triton kernel:" + kernel_name, {});' if COMPILATION_HELPER .inject_pytorch_dep else "" }
394398
395- void *params[] = {{ { ', ' . join ( params ) } } };
396- uint32_t num_params = sizeof(params)/sizeof(params[0]) ;
399+ { params_decl } ;
400+ uint32_t num_params = { num_params } ;
397401 uint32_t expected_num_params = kernel_ptr.get_info<sycl::info::kernel::num_args>();
398402 size_t global_range_x = gridX*threads_per_warp*num_warps;
399403 size_t global_range_y = gridY;
You can’t perform that action at this time.
0 commit comments