Skip to content

Commit

Permalink
Fix gtfn gpu backend and executor definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
egparedes committed Nov 14, 2023
1 parent bf9caa0 commit 7756a8e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/gt4py/next/allocators.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def __gt_allocate__(
shape = domain.shape
layout_map = self.layout_mapper(domain.dims)
# TODO(egparedes): add support for non-empty aligned index values
assert aligned_index is None
assert aligned_index is None

return core_allocators.NDArrayBufferAllocator(self.device_type, self.array_ns).allocate(
shape, dtype, device_id, layout_map, self.byte_alignment, aligned_index
Expand Down
18 changes: 16 additions & 2 deletions src/gt4py/next/program_processors/runners/gtfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,22 @@ def compilation_hash(otf_closure: stages.ProgramCall) -> int:
allocator=next_allocators.StandardCPUFieldBufferAllocator(),
)


gtfn_gpu_executor = otf_compile_executor.OTFCompileExecutor(
name="run_gtfn_gpu", otf_workflow=GTFN_GPU_WORKFLOW
)
run_gtfn_gpu = otf_compile_executor.OTFBackend(
executor=gtfn_cached_executor,
executor=gtfn_gpu_executor,
allocator=next_allocators.StandardGPUFieldBufferAllocator(),
)


gtfn_gpu_cached_executor = otf_compile_executor.CachedOTFCompileExecutor(
name="run_gtfn_gpu_cached",
otf_workflow=workflow.CachedStep(
step=gtfn_gpu_executor.otf_workflow, hash_function=compilation_hash
),
)
run_gtfn_gpu_cached = otf_compile_executor.OTFBackend(
executor=gtfn_gpu_cached_executor,
allocator=next_allocators.StandardCPUFieldBufferAllocator(),
)

0 comments on commit 7756a8e

Please sign in to comment.