-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
# Solver functions for 1D DG methods | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
|
||
# Solver functions for 2D DG methods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
# Solver functions for 3D DG methods | ||
|