JuliaGPU / JuliaGPU/KernelAbstractions.jl

Stencil example

Open
#49 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
523
Forks
88
Avg merge
1d 11h
Merged PRs (30d)
25

Description

@dpsanders

using KernelAbstractions
using OffsetArrays

@kernel function update!(A, @Const(B))
  i, j = @index(Global, NTuple)
         
  acc = zero(eltype(A))
  for m in -1:1
    for n in -1:1
      acc += B[i+m, j+n]
    end
  end
  A[i, j] = acc
end

N = 64
B = OffsetArray(ones(N+2, N+2), 0:N+1, 0:N+1)
A = OffsetArray(ones(N+2, N+2), 0:N+1, 0:N+1)

kernel = update!(CPU(), (4,4), (N,N))
wait(kernel(A, B))

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides only a Julia stencil example using KernelAbstractions and OffsetArrays; begin by reproducing the snippet and inspecting the update! kernel entry point. No file, test, or requested outcome is identified, so confirm the intended change and define what a completed example should demonstrate before editing.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
hpc
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.