Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize PS inside __init__() #163

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions ext/JustPICAMDGPUExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ module _2D
using MuladdMacro, ParallelStencil, CellArrays, CellArraysIndexing, StaticArrays
using JustPIC

@init_parallel_stencil(AMDGPU, Float64, 2)
function __init__()
@init_parallel_stencil(AMDGPU, Float64, 2)
return nothing
end


import JustPIC: Euler, RungeKutta2, AbstractAdvectionIntegrator
import JustPIC._2D.CA
import JustPIC: Particles, PassiveMarkers
Expand Down Expand Up @@ -324,8 +326,10 @@ module _3D
using MuladdMacro, ParallelStencil, CellArrays, CellArraysIndexing, StaticArrays
using JustPIC

@init_parallel_stencil(AMDGPU, Float64, 3)

function __init__()
@init_parallel_stencil(AMDGPU, Float64, 3)
return nothing
end

import JustPIC:
Euler, RungeKutta2, AbstractAdvectionIntegrator, Particles, PassiveMarkers
Expand Down
12 changes: 8 additions & 4 deletions ext/JustPICCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ module _2D
using MuladdMacro, ParallelStencil, CellArrays, CellArraysIndexing, StaticArrays
using JustPIC

@init_parallel_stencil(CUDA, Float64, 2)
function __init__()
@init_parallel_stencil(CUDA, Float64, 2)
return nothing
end


import JustPIC: Euler, RungeKutta2, AbstractAdvectionIntegrator
import JustPIC._2D.CA
import JustPIC: Particles, PassiveMarkers
Expand Down Expand Up @@ -321,8 +323,10 @@ module _3D
using MuladdMacro, ParallelStencil, CellArrays, CellArraysIndexing, StaticArrays
using JustPIC

@init_parallel_stencil(CUDA, Float64, 3)

function __init__()
@init_parallel_stencil(CUDA, Float64, 3)
return nothing
end

macro myatomic(expr)
return esc(
Expand Down
10 changes: 8 additions & 2 deletions src/JustPIC_CPU.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ using ..JustPIC

import ..JustPIC: AbstractBackend, CPUBackend

@init_parallel_stencil(Threads, Float64, 2)
function __init__()
@init_parallel_stencil(Threads, Float64, 2)
return nothing
end

export CA

Expand Down Expand Up @@ -37,7 +40,10 @@ using ..JustPIC

import ..JustPIC: AbstractBackend, CPUBackend

@init_parallel_stencil(Threads, Float64, 3)
function __init__()
@init_parallel_stencil(Threads, Float64, 3)
return nothing
end

export CA

Expand Down