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

CUDA #368

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from
Draft

CUDA #368

wants to merge 40 commits into from

Conversation

ajwheeler
Copy link
Owner

Do the line absorption calculations on GPU.

Copy link
Contributor

github-actions bot commented Nov 20, 2024

TODOs found in this PR:

src/synthesize.jl:111:  - use_CUDA TODO
src/synthesize.jl-112-  - `verbose` (default: `false`): Whether or not to print information about progress, etc.
src/synthesize.jl-113-"""
src/synthesize.jl-114-function synthesize(atm::ModelAtmosphere, linelist, A_X::AbstractVector{<:Real},
--
src/line_absorption_cuda.jl:3:using CUDA #TODO only import what you need
src/line_absorption_cuda.jl-4-
src/line_absorption_cuda.jl:5:# TODO make it work with ForwardDiff.Dual
src/line_absorption_cuda.jl-6-struct LineVals
src/line_absorption_cuda.jl-7-    wl::Float64
src/line_absorption_cuda.jl-8-    E_lower::Float64
--
src/line_absorption_cuda.jl:53:  - `verbose` (default: false): NOT ALLOWED TODO
src/line_absorption_cuda.jl-54-"""
src/line_absorption_cuda.jl-55-function line_absorption_cuda!(α, linelist, λs::Wavelengths, temps, nₑ, n_densities,
src/line_absorption_cuda.jl-56-                               partition_fns, ξ, α_cntm; cutoff_threshold=3e-4, verbose=false)
--
src/line_absorption_cuda.jl:117:        α_cntm[1].itp.knots[1].all_wls # TODO don't rely on the internals of Wavelengths?
src/line_absorption_cuda.jl-118-    else
src/line_absorption_cuda.jl-119-        [5000.0]
src/line_absorption_cuda.jl-120-    end
--
src/line_absorption_cuda.jl:187:        #TODO don't do the searchsortedfirst at every layer?
src/line_absorption_cuda.jl-188-        local_α_cntm = α_cntm_d[idx, searchsortedfirst(coarse_λs_d, line.wl)]
src/line_absorption_cuda.jl-189-        ρ_crit = local_α_cntm * cutoff_threshold / amplitude[blk_idx, idx]
src/line_absorption_cuda.jl-190-
--
src/line_absorption_cuda.jl:204:    if lb > ub # TODO test performance
src/line_absorption_cuda.jl-205-        return
src/line_absorption_cuda.jl-206-    end
src/line_absorption_cuda.jl-207-
--
src/line_absorption_cuda.jl:209:        # TODO DON'T BROADCAST
src/line_absorption_cuda.jl-210-        Δα = line_profile.(line.wl, σ[blk_idx, thread_index], γ[blk_idx, thread_index],
src/line_absorption_cuda.jl-211-                           amplitude[blk_idx, thread_index], λs_d[wl_index])
src/line_absorption_cuda.jl-212-        ptr = pointer(α, thread_index + (wl_index - 1) * size(α, 1))

offset ÷= 2
end
return value
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
end
end

@ajwheeler ajwheeler mentioned this pull request Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant