From f94e5d33bd4978a4d05ea9b33dd2d21f75099253 Mon Sep 17 00:00:00 2001 From: huiyuxie Date: Wed, 7 Aug 2024 16:47:37 -1000 Subject: [PATCH] Fix typo and comment --- README.md | 1 - src/solvers/common.jl | 21 ++++++++++----------- src/solvers/dg_1d.jl | 1 + src/solvers/dg_2d.jl | 2 +- src/solvers/dg_3d.jl | 1 + 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 4ca29b1..a84021f 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/src/solvers/common.jl b/src/solvers/common.jl index b4d6eac..3cd7762 100644 --- a/src/solvers/common.jl +++ b/src/solvers/common.jl @@ -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 diff --git a/src/solvers/dg_1d.jl b/src/solvers/dg_1d.jl index 8b13789..eae5265 100644 --- a/src/solvers/dg_1d.jl +++ b/src/solvers/dg_1d.jl @@ -1 +1,2 @@ +# Solver functions for 1D DG methods diff --git a/src/solvers/dg_2d.jl b/src/solvers/dg_2d.jl index 8b13789..51433d9 100644 --- a/src/solvers/dg_2d.jl +++ b/src/solvers/dg_2d.jl @@ -1 +1 @@ - +# Solver functions for 2D DG methods diff --git a/src/solvers/dg_3d.jl b/src/solvers/dg_3d.jl index 8b13789..6213d7b 100644 --- a/src/solvers/dg_3d.jl +++ b/src/solvers/dg_3d.jl @@ -1 +1,2 @@ +# Solver functions for 3D DG methods