Skip to content
Snippets Groups Projects
Commit b85a6763 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

fix sycl function translation

parent 10df2868
Branches
Tags
1 merge request!384Fundamental GPU Support
Pipeline #65946 passed
...@@ -36,6 +36,7 @@ class SyclPlatform(Platform): ...@@ -36,6 +36,7 @@ class SyclPlatform(Platform):
self, math_function: PsMathFunction, dtype: PsType self, math_function: PsMathFunction, dtype: PsType
) -> CFunction: ) -> CFunction:
func = math_function.func func = math_function.func
arg_types = (dtype,) * func.num_args
if isinstance(dtype, PsIeeeFloatType) and dtype.width in (16, 32, 64): if isinstance(dtype, PsIeeeFloatType) and dtype.width in (16, 32, 64):
match func: match func:
case ( case (
...@@ -45,9 +46,9 @@ class SyclPlatform(Platform): ...@@ -45,9 +46,9 @@ class SyclPlatform(Platform):
| MathFunctions.Tan | MathFunctions.Tan
| MathFunctions.Pow | 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: 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( raise MaterializationError(
f"No implementation available for function {math_function} on data type {dtype}" f"No implementation available for function {math_function} on data type {dtype}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment