Skip to content

Commit

Permalink
v0.1.1 released
Browse files Browse the repository at this point in the history
  • Loading branch information
kongdd committed May 7, 2024
1 parent e407ace commit 64039d6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ ignore:
- "src/*/temp"
- "ext/*/test"
- "src/*/backup"
- "src/Smooth/Whittaker/WHIT_GPU.jl"
21 changes: 21 additions & 0 deletions src/Smooth/Whittaker/WHIT_GPU.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using CUDA

function WHIT_GPU(y::AbstractVector, w::AbstractVector, x::AbstractVector;
lambda=2.0, d=2, ignore...)
# Move data to GPU
y = CUDA.CuArray(y)
w = CUDA.CuArray(w)
x = CUDA.CuArray(x)

n = length(y)
D = ddmat(x, d)

W = SparseArrays.spdiagm(w)
A = W + lambda * D' * D

# L = cholesky(A).L # Matrix
L = cholesky(A, perm=1:n).L # sparse
z = L' \ (L \ (w .* y))
z
end
# export WHIT, speye, diff, ddmat
2 changes: 1 addition & 1 deletion test/test-curvefit.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test
using JLD2, UnPack, DataFrames
@unpack y, w, t, ylu, dt, nptperyear = load("../data/phenofit-CA_NS6.jld2")
@unpack y, w, t, ylu, dt, nptperyear = load("../data/phenofit_CA-NS6.jld2")

@testset "curvefits" begin
@test_nowarn begin
Expand Down
2 changes: 1 addition & 1 deletion test/test-plot_input.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using JLD2, UnPack


@testset "plot_input" begin
@unpack y, w, t, QC_flag, ylu, dt, nptperyear = load("../data/phenofit-CA_NS6.jld2")
@unpack y, w, t, QC_flag, ylu, dt, nptperyear = load("../data/phenofit_CA-NS6.jld2")
@test_nowarn p = plot_input(t, y, QC_flag)
end

Expand Down

0 comments on commit 64039d6

Please sign in to comment.