Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
egparedes committed Oct 25, 2023
1 parent 3d8e93f commit a93e8dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/gt4py/next/program_processors/runners/roundtrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,12 @@ def execute_roundtrip(
return fencil(*args, **new_kwargs)


class RoundtripExecutor(ppi.ProgramExecutor, next_allocators.DefaultCPUAllocator):
class RoundtripExecutor(ppi.ProgramExecutor):
def __call__(self, program: itir.FencilDefinition, *args, **kwargs) -> None:
execute_roundtrip(program, *args, **kwargs)

__gt_device_type__ = next_allocators.DefaultCPUAllocator.__gt_device_type__
__gt_allocate__ = next_allocators.DefaultCPUAllocator.__gt_allocate__


executor = RoundtripExecutor()
4 changes: 2 additions & 2 deletions src/gt4py/storage/cartesian/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def allocate_cpu(
buffer = _CPUBufferAllocator.allocate(
shape,
core_defs.dtype(dtype),
device_id=device.id,
device_id=device.device_id,
layout_map=layout_map,
byte_alignment=alignment_bytes,
aligned_index=aligned_index,
Expand All @@ -235,7 +235,7 @@ def allocate_gpu(
alignment_bytes: int,
aligned_index: Optional[Sequence[int]],
) -> Tuple["cp.ndarray", "cp.ndarray"]:
assert _GPUBufferAllocator is None, "GPU allocation library or device not found"
assert _GPUBufferAllocator is not None, "GPU allocation library or device not found"
device = core_defs.Device( # type: ignore[type-var]
core_defs.DeviceType.ROCM if gt_config.GT4PY_USE_HIP else core_defs.DeviceType.CUDA, 0
)
Expand Down

0 comments on commit a93e8dc

Please sign in to comment.