From 846fede414c0db8dc8e738719cbf5eba30cf9594 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 23 Aug 2024 15:01:56 -0500 Subject: [PATCH] Ensure that the invoker name is an identifier Closes gh-777 --- pyopencl/invoker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyopencl/invoker.py b/pyopencl/invoker.py index 6673646ed..a90a121ee 100644 --- a/pyopencl/invoker.py +++ b/pyopencl/invoker.py @@ -259,7 +259,8 @@ def gen_arg_setting(in_enqueue): # {{{ generate _enqueue - enqueue_name = "enqueue_knl_%s" % function_name + from pytools import to_identifier + enqueue_name = f"enqueue_knl_{to_identifier(function_name)}" gen("def %s(%s):" % (enqueue_name, ", ".join([