Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
redesign-prototype
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nektar
redesign-prototype
Commits
3a602ac0
Commit
3a602ac0
authored
1 year ago
by
Pavol Margitfalvi
Browse files
Options
Downloads
Patches
Plain Diff
add conversion methods to NekArray
parent
c46e3165
No related branches found
Branches containing commit
No related tags found
5 merge requests
!22
Basic implementation of Matrix-free BwdTrans and padding feature in Field
,
!11
Implement CUDA BwdTrans sum-factorization kernels
,
!8
BwdTrans operator in CUDA
,
!3
First naive implementation
,
!2
Implements BwdTrans StdMat operator
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Field.hpp
+21
-0
21 additions, 0 deletions
Field.hpp
with
21 additions
and
0 deletions
Field.hpp
+
21
−
0
View file @
3a602ac0
...
...
@@ -13,6 +13,7 @@
#include
"MemoryRegionCPU.hpp"
#include
<LibUtilities/BasicUtils/ErrorUtil.hpp>
#include
<LibUtilities/BasicUtils/ShapeType.hpp>
#include
<LibUtilities/BasicUtils/SharedArray.hpp>
/**
* @brief Captures the structure of a block of elements of identical shape
...
...
@@ -120,6 +121,20 @@ public:
return
field
;
}
template
<
template
<
typename
>
class
TMemoryRegion
=
MemoryRegionCPU
>
static
Field
<
TType
,
TState
>
fromArray
(
std
::
vector
<
BlockAttributes
>
blocks
,
Nektar
::
Array
<
Nektar
::
OneD
,
TType
>
const
&
array
)
{
auto
field
=
create
<
MemoryRegionCPU
>
(
blocks
);
std
::
copy
(
array
.
begin
(),
array
.
end
(),
field
.
GetStorage
().
GetCPUPtr
());
field
.
template
GetStorage
<
TMemoryRegion
>();
// convert storage to
// TMemoryRegion
return
field
;
}
/**
* @brief Get the underlying storage of the field as the requested type.
* @return MemoryRegion storage converted to the requested type
...
...
@@ -244,6 +259,12 @@ public:
return
component_names
.
size
();
}
Nektar
::
Array
<
Nektar
::
OneD
,
TType
>
toArray
()
const
{
return
Nektar
::
Array
<
Nektar
::
OneD
,
TType
>
(
m_storage
->
size
(),
m_storage
->
GetCPUPtr
());
}
private
:
/**
* @brief Reshapes the current storage interleaving to a non-interleaved
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment