forked from termi-official/Thunderbolt.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
d4d3bab
commit 23f5413
Showing
13 changed files
with
305 additions
and
291 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
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
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
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 |
---|---|---|
|
@@ -17,3 +17,4 @@ function Adapt.adapt_structure(to, cv::CellValues) | |
return StaticCellValues(fv, gm, weights) | ||
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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# in subdofhandlers and in grid there are some vectors that incorporate many objects of different types but they | ||
# only share the same abstract type. | ||
# one way to solve this (not the optimal way memory wise) is to convert the vector to a vector of Union types if | ||
# there are multiple concrete types in the vector , otherwise convert the vector to a vector of the concrete type. | ||
function convert_vec_to_concrete(vec::Vector) | ||
# Get all unique concrete types in the vector | ||
Ts = unique(typeof.(vec)) | ||
|
||
if length(Ts) == 1 | ||
# All elements are the same concrete type | ||
T = Ts[1] | ||
return collect(T, vec) | ||
else | ||
# Create a union of all observed concrete types | ||
U = Union{Ts...} | ||
return collect(U, vec) | ||
end | ||
end | ||
|
||
|
||
####################### | ||
## Assembly Strategy ## | ||
####################### | ||
abstract type AbstractAssemblyStrategy end | ||
|
||
# encompass the all the required data types that needs to be worked with on the GPU | ||
struct CudaAssemblyStrategy <: AbstractAssemblyStrategy | ||
floattype::Type | ||
inttype::Type | ||
end | ||
|
||
floattype(strategy::CudaAssemblyStrategy) = strategy.floattype | ||
inttype(strategy::CudaAssemblyStrategy) = strategy.inttype | ||
|
||
CudaDefaultAssemblyStrategy() = CudaAssemblyStrategy(Float32, Int32) | ||
|
||
|
||
|
||
function Adapt.adapt_structure(::AbstractAssemblyStrategy, dh::DofHandler) | ||
error("GPU specific implementation for `adapt_structure(to,dh::DofHandler)` is not implemented yet") | ||
end |
Oops, something went wrong.