-
Notifications
You must be signed in to change notification settings - Fork 268
Open
Labels
reactant ∇all day I dream about MLIRall day I dream about MLIR
Description
_compute_source_term! with FFTBasedPossionSolver throws an error whenever I try to raise it with Reactant. I think this is because rhs is Complex64 array but active * δ is Real64.
@kernel function _compute_source_term!(rhs, grid, Ũ)
i, j, k = @index(Global, NTuple)
active = !inactive_cell(i, j, k, grid)
u, v, w = Ũ
δ = divᶜᶜᶜ(i, j, k, grid, u, v, w)
@inbounds rhs[i, j, k] = active * δ
endHere is a MWE for this issue
using Oceananigans
using Oceananigans.Architectures: ReactantState
using Oceananigans.Models.NonhydrostaticModels: compute_source_term!
using Reactant
using CUDA
Reactant.set_default_backend("cpu")
grid = RectilinearGrid(ReactantState(); size=(4, 4), extent=(1, 1),
halo=(3, 3), topology=(Periodic, Periodic, Flat))
model = NonhydrostaticModel(grid; timestepper=:QuasiAdamsBashforth2)
solver = model.pressure_solver
Ũ = model.velocities
Δt = 1.0
function go!(solver, Ũ)
compute_source_term!(solver, nothing, Ũ, Δt)
return nothing
end
Reactant.@compile raise=true sync=true go!(solver, Ũ)loc(callsite(fused<#llvm.di_subprogram<id = distinct[0]<>, compileUnit = <id = distinct[1]<>, sourceLanguage = DW_LANG_Julia, file = <"julia" in ".">, producer = "julia", isOptimized = true, emissionKind = None, nameTableKind = None>, scope = #llvm.di_file<"/Users/danielkz/.julia/packages/LLVM/fEIbx/src/interop/base.jl" in ".">, name = "macro expansion;", linkageName = "macro expansion", file = <"/Users/danielkz/.julia/packages/LLVM/fEIbx/src/interop/base.jl" in ".">, subprogramFlags = "Definition|Optimized", type = <>>>["/Users/danielkz/.julia/packages/LLVM/fEIbx/src/interop/base.jl":39:0] at callsite(fused<#llvm.di_subprogram<id = distinct[2]<>, compileUnit = <id = distinct[1]<>, sourceLanguage = DW_LANG_Julia, file = <"julia" in ".">, producer = "julia", isOptimized = true, emissionKind = None, nameTableKind = None>, scope = #llvm.di_file<"none" in ".">, name = "macro expansion;", linkageName = "macro expansion", file = <"none" in ".">, subprogramFlags = "Definition|Optimized", type = <>>>["none":0:0] at callsite(fused<#llvm.di_subprogram<id = distinct[3]<>, compileUnit = <id = distinct[1]<>, sourceLanguage = DW_LANG_Julia, file = <"julia" in ".">, producer = "julia", isOptimized = true, emissionKind = None, nameTableKind = None>, scope = #llvm.di_file<"none" in ".">, name = "pointerset;", linkageName = "pointerset", file = <"none" in ".">, subprogramFlags = "Definition|Optimized", type = <>>>["none":0:0] at callsite(fused<#llvm.di_subprogram<id = distinct[4]<>, compileUnit = <id = distinct[1]<>, sourceLanguage = DW_LANG_Julia, file = <"julia" in ".">, producer = "julia", isOptimized = true, emissionKind = None, nameTableKind = None>, scope = #llvm.di_file<"/Users/danielkz/.julia/packages/LLVM/fEIbx/src/interop/pointer.jl" in ".">, name = "unsafe_store!;", linkageName = "unsafe_store!", file = <"/Users/danielkz/.julia/packages/LLVM/fEIbx/src/interop/pointer.jl" in ".">, subprogramFlags = "Definition|Optimized", type = <>>>["/Users/danielkz/.julia/packages/LLVM/fEIbx/src/interop/pointer.jl":88:0] at callsite(fused<#llvm.di_subprogram<id = distinct[5]<>, compileUnit = <id = distinct[1]<>, sourceLanguage = DW_LANG_Julia, file = <"julia" in ".">, producer = "julia", isOptimized = true, emissionKind = None, nameTableKind = None>, scope = #llvm.di_file<"/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl" in ".">, name = "arrayset_bits;", linkageName = "arrayset_bits", file = <"/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl" in ".">, subprogramFlags = "Definition|Optimized", type = <>>>["/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl":356:0] at callsite(fused<#llvm.di_subprogram<id = distinct[6]<>, compileUnit = <id = distinct[1]<>, sourceLanguage = DW_LANG_Julia, file = <"julia" in ".">, producer = "julia", isOptimized = true, emissionKind = None, nameTableKind = None>, scope = #llvm.di_file<"/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl" in ".">, name = "#arrayset;", linkageName = "#arrayset", file = <"/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl" in ".">, subprogramFlags = "Definition|Optimized", type = <>>>["/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl":349:0] at callsite(fused<#llvm.di_subprogram<id = distinct[7]<>, compileUnit = <id = distinct[1]<>, sourceLanguage = DW_LANG_Julia, file = <"julia" in ".">, producer = "julia", isOptimized = true, emissionKind = None, nameTableKind = None>, scope = #llvm.di_file<"/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl" in ".">, name = "setindex!;", linkageName = "setindex!", file = <"/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl" in ".">, subprogramFlags = "Definition|Optimized", type = <>>>["/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl":391:0] at callsite(fused<#llvm.di_subprogram<id = distinct[7]<>, compileUnit = <id = distinct[1]<>, sourceLanguage = DW_LANG_Julia, file = <"julia" in ".">, producer = "julia", isOptimized = true, emissionKind = None, nameTableKind = None>, scope = #llvm.di_file<"/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl" in ".">, name = "setindex!;", linkageName = "setindex!", file = <"/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl" in ".">, subprogramFlags = "Definition|Optimized", type = <>>>["/Users/danielkz/.julia/packages/Reactant/vZMtU/ext/ReactantCUDAExt.jl":403:0] at callsite(fused<#llvm.di_subprogram<id = distinct[8]<>, compileUnit = <id = distinct[1]<>, sourceLanguage = DW_LANG_Julia, file = <"julia" in ".">, producer = "julia", isOptimized = true, emissionKind = None, nameTableKind = None>, scope = #llvm.di_file<"/Users/danielkz/Aeolus2/Oceananigans.jl/src/Models/NonhydrostaticModels/solve_for_pressure.jl" in ".">, name = "macro expansion;", linkageName = "macro expansion", file = <"/Users/danielkz/Aeolus2/Oceananigans.jl/src/Models/NonhydrostaticModels/solve_for_pressure.jl" in ".">, subprogramFlags = "Definition|Optimized", type = <>>>["/Users/danielkz/Aeolus2/Oceananigans.jl/src/Models/NonhydrostaticModels/solve_for_pressure.jl":17:0] at callsite(fused<#llvm.di_subprogram<id = distinct[9]<>, compileUnit = <id = distinct[1]<>, sourceLanguage = DW_LANG_Julia, file = <"julia" in ".">, producer = "julia", isOptimized = true, emissionKind = None, nameTableKind = None>, scope = #llvm.di_file<"/Users/danielkz/.julia/packages/KernelAbstractions/X5fk1/src/macros.jl" in ".">, name = "gpu__compute_source_term!;", linkageName = "gpu__compute_source_term!", file = <"/Users/danielkz/.julia/packages/KernelAbstractions/X5fk1/src/macros.jl" in ".">, subprogramFlags = "Definition|Optimized", type = <>>>["/Users/danielkz/.julia/packages/KernelAbstractions/X5fk1/src/macros.jl":332:0] at fused<#llvm.di_subprogram<id = distinct[10]<>, compileUnit = <id = distinct[1]<>, sourceLanguage = DW_LANG_Julia, file = <"julia" in ".">, producer = "julia", isOptimized = true, emissionKind = None, nameTableKind = None>, name = "gpu__compute_source_term!", linkageName = "julia_gpu__compute_source_term!_78855", file = <"none" in ".">, subprogramFlags = "Definition|Optimized", type = <>>>["none":0:0]))))))))))): error: 'affine.store' op value to store must have the same type as memref element typeReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
reactant ∇all day I dream about MLIRall day I dream about MLIR