Skip to content
Snippets Groups Projects
Commit c31d4074 authored by Richard Angersbach's avatar Richard Angersbach
Browse files

Try fixing required headers for cuda and hip for reductions

parent 6a6e57f0
No related branches found
No related tags found
1 merge request!438Reduction Support
Pipeline #76878 failed
...@@ -8,6 +8,4 @@ class CudaPlatform(GenericGpu): ...@@ -8,6 +8,4 @@ class CudaPlatform(GenericGpu):
@property @property
def required_headers(self) -> set[str]: def required_headers(self) -> set[str]:
return { return super().required_headers
'"gpu_atomics.h"',
}
...@@ -198,6 +198,14 @@ class GenericGpu(Platform): ...@@ -198,6 +198,14 @@ class GenericGpu(Platform):
thread_mapping: Callback object which defines the mapping of thread indices onto iteration space points thread_mapping: Callback object which defines the mapping of thread indices onto iteration space points
""" """
@property
@abstractmethod
def required_headers(self) -> set[str]:
return {
'"gpu_atomics.h"',
"<cmath>",
}
def __init__( def __init__(
self, self,
ctx: KernelCreationContext, ctx: KernelCreationContext,
...@@ -365,9 +373,9 @@ class GenericGpu(Platform): ...@@ -365,9 +373,9 @@ class GenericGpu(Platform):
match func: match func:
case NumericLimitsFunctions.Min: case NumericLimitsFunctions.Min:
define = "NEG_INFINITY" define = "-INFINITY"
case NumericLimitsFunctions.Max: case NumericLimitsFunctions.Max:
define = "POS_INFINITY" define = "INFINITY"
case _: case _:
raise MaterializationError( raise MaterializationError(
f"Cannot materialize call to function {func}" f"Cannot materialize call to function {func}"
......
...@@ -8,7 +8,6 @@ class HipPlatform(GenericGpu): ...@@ -8,7 +8,6 @@ class HipPlatform(GenericGpu):
@property @property
def required_headers(self) -> set[str]: def required_headers(self) -> set[str]:
return { return super().required_headers | {
'"gpu_atomics.h"',
'"pystencils_runtime/hip.h"', '"pystencils_runtime/hip.h"',
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment