Hi! I try to apply SPHKernels.jl for GPU kernel but for performance purpose it important to get only result of kernel function, and make multiplication kernel.norm * h_inv after summation.
function kernel_value(kernel::WendlandC2_1D{T}, u::Real, h_inv::Real) where {T}
if u < 1
n = kernel.norm * h_inv
t1 = 1 - u
t3 = t1 * t1 * t1
return (t3 * (1 + 3u)) * n |> T
else
return 0 |> T
end
end
is it possible to make method like that?:
function kernel_value(kernel::WendlandC2_1D{T}, u::Real, h_inv::Real, norm::Bool = true) where {T}
if u < 1
t1 = 1 - u
t3 = t1 * t1 * t1
val = t3 * (1 + 3u)
ifelse(norm, return val * kernel.norm * h_inv, return val) |> T # `|> T` this is potential issue for ForwardDiff and have few sense
end
return zero(T)
end
so actually need method to get normalization constant for each function.
Hi! I try to apply SPHKernels.jl for GPU kernel but for performance purpose it important to get only result of kernel function, and make multiplication
kernel.norm * h_inv
after summation.is it possible to make method like that?:
so actually need method to get normalization constant for each function.