From b85a676379f57b5b7bed4913e14203093939f3c7 Mon Sep 17 00:00:00 2001
From: Frederik Hennig <frederik.hennig@fau.de>
Date: Thu, 16 May 2024 18:21:19 +0200
Subject: [PATCH] fix sycl function translation

---
 src/pystencils/backend/platforms/sycl.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/pystencils/backend/platforms/sycl.py b/src/pystencils/backend/platforms/sycl.py
index 52f61a924..4cbd186c0 100644
--- a/src/pystencils/backend/platforms/sycl.py
+++ b/src/pystencils/backend/platforms/sycl.py
@@ -36,6 +36,7 @@ class SyclPlatform(Platform):
         self, math_function: PsMathFunction, dtype: PsType
     ) -> CFunction:
         func = math_function.func
+        arg_types = (dtype,) * func.num_args
         if isinstance(dtype, PsIeeeFloatType) and dtype.width in (16, 32, 64):
             match func:
                 case (
@@ -45,9 +46,9 @@ class SyclPlatform(Platform):
                     | MathFunctions.Tan
                     | MathFunctions.Pow
                 ):
-                    return CFunction(f"sycl::{func.function_name}", func.num_args)
+                    return CFunction(f"sycl::{func.function_name}", arg_types, dtype)
                 case MathFunctions.Abs | MathFunctions.Min | MathFunctions.Max:
-                    return CFunction(f"sycl::f{func.function_name}", func.num_args)
+                    return CFunction(f"sycl::f{func.function_name}", arg_types, dtype)
 
         raise MaterializationError(
             f"No implementation available for function {math_function} on data type {dtype}"
-- 
GitLab