Skip to content

Commit

Permalink
Fix typo and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
huiyuxie committed Aug 8, 2024
1 parent 453c845 commit f94e5d3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

[![Build Status](https://github.com/huiyuxie/TrixiGPU.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/huiyuxie/TrixiGPU.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![GitHub stars](https://img.shields.io/github/stars/huiyuxie/TrixiCUDA.jl.svg?style=social&label=Star&maxAge=2592000)](https://GitHub.com/huiyuxie/TrixiCUDA.jl/stargazers)

Provide GPU support for [Trixi.jl](https://github.com/trixi-framework/Trixi.jl), a high-order numerical simulation framework for hyperbolic PDEs.

Expand Down
21 changes: 10 additions & 11 deletions src/solvers/common.jl
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# Define common functions for all solvers
# fixme: Dispatch different functions for Flaot64 and Float32 to improve performance, maybe exists a better way for Float32
# Define common functions for solvers

# Copy matrices from host to device (Float64)
function copy_to_device!(du::PtrArray{Float64}, u::PtrArray{Float64})
du = CUDA.zeros(size(du))
u = CuArray{Float64}(u)
# Copy matrices from host to device
function copy_to_device!(du::PtrArray, u::PtrArray) # ? PtrArray{Float64}
du = CuArray{Float32}(zero(du))
u = CuArray{Float32}(u)

return (du, u)
end

# Copy matrices from device to host (Float64)
function copy_to_host!(du::CuArray{Float64}, u::CuArray{Float64})
# fixme: maybe direct PtrArray to CuArray conversion is possible
du = PtrArray(Array(du))
u = PtrArray(Array(u))
# Copy matrices from device to host
function copy_to_host!(du::CuArray, u::CuArray) # ? CuArray{Float32}
# ? direct CuArray to PtrArray conversion is possible
du = PtrArray{Float64}(Array(du))
u = PtrArray{Float64}(Array(u))

return (du, u)
end
1 change: 1 addition & 0 deletions src/solvers/dg_1d.jl
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Solver functions for 1D DG methods

2 changes: 1 addition & 1 deletion src/solvers/dg_2d.jl
Original file line number Diff line number Diff line change
@@ -1 +1 @@

# Solver functions for 2D DG methods
1 change: 1 addition & 0 deletions src/solvers/dg_3d.jl
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# Solver functions for 3D DG methods

0 comments on commit f94e5d3

Please sign in to comment.