diff --git a/src/pystencils/backend/platforms/cuda.py b/src/pystencils/backend/platforms/cuda.py
index b5b3478e4267e451bf6628dcc04829ea99666635..7a5074677433830133fef4c2f0f31761b9014284 100644
--- a/src/pystencils/backend/platforms/cuda.py
+++ b/src/pystencils/backend/platforms/cuda.py
@@ -2,7 +2,8 @@ from __future__ import annotations
 
 from .generic_gpu import GenericGpu
 from ..ast.expressions import PsExpression, PsLiteralExpr
-from ..functions import PsFunction, NumericLimitsFunctions
+from ..exceptions import MaterializationError
+from ..functions import NumericLimitsFunctions
 from ..literals import PsLiteral
 from ...types import PsType, PsIeeeFloatType
 
@@ -16,7 +17,7 @@ class CudaPlatform(GenericGpu):
             '"npp.h"',
         }
 
-    def resolve_numeric_limits(self, func: PsMathFunction, dtype: PsType) -> PsExpression:
+    def resolve_numeric_limits(self, func: NumericLimitsFunctions, dtype: PsType) -> PsExpression:
         assert isinstance(dtype, PsIeeeFloatType)
 
         match func:
diff --git a/src/pystencils/backend/platforms/generic_gpu.py b/src/pystencils/backend/platforms/generic_gpu.py
index 787b390fe0fcb66a4696eaf73c55f618027847d2..8b7eead8dc276e8935f9a07c7b80b008a8ae9ca6 100644
--- a/src/pystencils/backend/platforms/generic_gpu.py
+++ b/src/pystencils/backend/platforms/generic_gpu.py
@@ -206,7 +206,7 @@ class GenericGpu(Platform):
         }
 
     @abstractmethod
-    def resolve_numeric_limits(self, func: PsMathFunction, dtype: PsType) -> PsExpression:
+    def resolve_numeric_limits(self, func: NumericLimitsFunctions, dtype: PsType) -> PsExpression:
         pass
 
     def __init__(
@@ -371,7 +371,7 @@ class GenericGpu(Platform):
         dtype = call.get_dtype()
         arg_types = (dtype,) * func.num_args
 
-        if isinstance(dtype, PsScalarType) and func in NumericLimitsFunctions:
+        if isinstance(dtype, PsScalarType) and isinstance(func, NumericLimitsFunctions):
             return self.resolve_numeric_limits(func, dtype)
 
         if isinstance(dtype, PsIeeeFloatType) and func in MathFunctions:
diff --git a/src/pystencils/backend/platforms/hip.py b/src/pystencils/backend/platforms/hip.py
index 60e249aebeffeaafc35ad61254606391f16639d6..45d60452bf9b560d1c55230f7c11906026db164b 100644
--- a/src/pystencils/backend/platforms/hip.py
+++ b/src/pystencils/backend/platforms/hip.py
@@ -2,7 +2,7 @@ from __future__ import annotations
 
 from .generic_gpu import GenericGpu
 from ..ast.expressions import PsExpression, PsLiteralExpr
-from ..functions import PsMathFunction
+from ..functions import NumericLimitsFunctions
 from ..literals import PsLiteral
 from ...types import PsType, PsIeeeFloatType
 
@@ -17,7 +17,7 @@ class HipPlatform(GenericGpu):
             "<limits>"
         }
 
-    def resolve_numeric_limits(self, func: PsMathFunction, dtype: PsType) -> PsExpression:
+    def resolve_numeric_limits(self, func: NumericLimitsFunctions, dtype: PsType) -> PsExpression:
         assert isinstance(dtype, PsIeeeFloatType)
 
         return PsLiteralExpr(