Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
0f8452da
There was an error fetching the commit references. Please try again later.
Commit
0f8452da
authored
8 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Fixed mesh traverser for CUDA
parent
bf51a8ee
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TNL/Meshes/MeshDetails/Traverser_impl.h
+14
-14
14 additions, 14 deletions
src/TNL/Meshes/MeshDetails/Traverser_impl.h
with
14 additions
and
14 deletions
src/TNL/Meshes/MeshDetails/Traverser_impl.h
+
14
−
14
View file @
0f8452da
...
@@ -87,7 +87,7 @@ template< int EntitiesDimension,
...
@@ -87,7 +87,7 @@ template< int EntitiesDimension,
typename
Mesh
,
typename
Mesh
,
typename
UserData
>
typename
UserData
>
__global__
void
__global__
void
MeshTraverserBoundaryEntitiesKernel
(
Mesh
*
mesh
,
MeshTraverserBoundaryEntitiesKernel
(
const
Mesh
*
mesh
,
UserData
*
userData
,
UserData
*
userData
,
typename
Mesh
::
GlobalIndexType
entitiesCount
)
typename
Mesh
::
GlobalIndexType
entitiesCount
)
{
{
...
@@ -95,10 +95,10 @@ MeshTraverserBoundaryEntitiesKernel( Mesh* mesh,
...
@@ -95,10 +95,10 @@ MeshTraverserBoundaryEntitiesKernel( Mesh* mesh,
i
<
entitiesCount
;
i
<
entitiesCount
;
i
+=
blockDim
.
x
*
gridDim
.
x
)
i
+=
blockDim
.
x
*
gridDim
.
x
)
{
{
const
auto
entityIndex
=
mesh
.
template
getBoundaryEntityIndex
<
EntitiesDimension
>(
i
);
const
auto
entityIndex
=
mesh
->
template
getBoundaryEntityIndex
<
EntitiesDimension
>(
i
);
auto
&
entity
=
mesh
.
template
getEntity
<
EntitiesDimension
>(
entityIndex
);
auto
&
entity
=
mesh
->
template
getEntity
<
EntitiesDimension
>(
entityIndex
);
// TODO: if the Mesh::IdType is void, then we should also pass the entityIndex
// TODO: if the Mesh::IdType is void, then we should also pass the entityIndex
EntitiesProcessor
::
processEntity
(
mesh
,
userData
,
entity
);
EntitiesProcessor
::
processEntity
(
*
mesh
,
*
userData
,
entity
);
}
}
}
}
...
@@ -107,7 +107,7 @@ template< int EntitiesDimension,
...
@@ -107,7 +107,7 @@ template< int EntitiesDimension,
typename
Mesh
,
typename
Mesh
,
typename
UserData
>
typename
UserData
>
__global__
void
__global__
void
MeshTraverserInteriorEntitiesKernel
(
Mesh
*
mesh
,
MeshTraverserInteriorEntitiesKernel
(
const
Mesh
*
mesh
,
UserData
*
userData
,
UserData
*
userData
,
typename
Mesh
::
GlobalIndexType
entitiesCount
)
typename
Mesh
::
GlobalIndexType
entitiesCount
)
{
{
...
@@ -115,10 +115,10 @@ MeshTraverserInteriorEntitiesKernel( Mesh* mesh,
...
@@ -115,10 +115,10 @@ MeshTraverserInteriorEntitiesKernel( Mesh* mesh,
i
<
entitiesCount
;
i
<
entitiesCount
;
i
+=
blockDim
.
x
*
gridDim
.
x
)
i
+=
blockDim
.
x
*
gridDim
.
x
)
{
{
const
auto
entityIndex
=
mesh
.
template
getInteriorEntityIndex
<
EntitiesDimension
>(
i
);
const
auto
entityIndex
=
mesh
->
template
getInteriorEntityIndex
<
EntitiesDimension
>(
i
);
auto
&
entity
=
mesh
.
template
getEntity
<
EntitiesDimension
>(
entityIndex
);
auto
&
entity
=
mesh
->
template
getEntity
<
EntitiesDimension
>(
entityIndex
);
// TODO: if the Mesh::IdType is void, then we should also pass the entityIndex
// TODO: if the Mesh::IdType is void, then we should also pass the entityIndex
EntitiesProcessor
::
processEntity
(
mesh
,
userData
,
entity
);
EntitiesProcessor
::
processEntity
(
*
mesh
,
*
userData
,
entity
);
}
}
}
}
...
@@ -127,7 +127,7 @@ template< int EntitiesDimension,
...
@@ -127,7 +127,7 @@ template< int EntitiesDimension,
typename
Mesh
,
typename
Mesh
,
typename
UserData
>
typename
UserData
>
__global__
void
__global__
void
MeshTraverserAllEntitiesKernel
(
Mesh
*
mesh
,
MeshTraverserAllEntitiesKernel
(
const
Mesh
*
mesh
,
UserData
*
userData
,
UserData
*
userData
,
typename
Mesh
::
GlobalIndexType
entitiesCount
)
typename
Mesh
::
GlobalIndexType
entitiesCount
)
{
{
...
@@ -135,9 +135,9 @@ MeshTraverserAllEntitiesKernel( Mesh* mesh,
...
@@ -135,9 +135,9 @@ MeshTraverserAllEntitiesKernel( Mesh* mesh,
entityIndex
<
entitiesCount
;
entityIndex
<
entitiesCount
;
entityIndex
+=
blockDim
.
x
*
gridDim
.
x
)
entityIndex
+=
blockDim
.
x
*
gridDim
.
x
)
{
{
auto
&
entity
=
mesh
.
template
getEntity
<
EntitiesDimension
>(
entityIndex
);
auto
&
entity
=
mesh
->
template
getEntity
<
EntitiesDimension
>(
entityIndex
);
// TODO: if the Mesh::IdType is void, then we should also pass the entityIndex
// TODO: if the Mesh::IdType is void, then we should also pass the entityIndex
EntitiesProcessor
::
processEntity
(
mesh
,
userData
,
entity
);
EntitiesProcessor
::
processEntity
(
*
mesh
,
*
userData
,
entity
);
}
}
}
}
...
@@ -170,7 +170,7 @@ processBoundaryEntities( const MeshPointer& meshPointer,
...
@@ -170,7 +170,7 @@ processBoundaryEntities( const MeshPointer& meshPointer,
Devices
::
Cuda
::
synchronizeDevice
();
Devices
::
Cuda
::
synchronizeDevice
();
MeshTraverserBoundaryEntitiesKernel
<
EntitiesDimension
,
EntitiesProcessor
>
MeshTraverserBoundaryEntitiesKernel
<
EntitiesDimension
,
EntitiesProcessor
>
<<<
gridSize
,
blockSize
>>>
<<<
gridSize
,
blockSize
>>>
(
&
meshPointer
.
template
modify
Data
<
Devices
::
Cuda
>(),
(
&
meshPointer
.
template
get
Data
<
Devices
::
Cuda
>(),
&
userDataPointer
.
template
modifyData
<
Devices
::
Cuda
>(),
&
userDataPointer
.
template
modifyData
<
Devices
::
Cuda
>(),
entitiesCount
);
entitiesCount
);
#else
#else
...
@@ -200,7 +200,7 @@ processInteriorEntities( const MeshPointer& meshPointer,
...
@@ -200,7 +200,7 @@ processInteriorEntities( const MeshPointer& meshPointer,
Devices
::
Cuda
::
synchronizeDevice
();
Devices
::
Cuda
::
synchronizeDevice
();
MeshTraverserInteriorEntitiesKernel
<
EntitiesDimension
,
EntitiesProcessor
>
MeshTraverserInteriorEntitiesKernel
<
EntitiesDimension
,
EntitiesProcessor
>
<<<
gridSize
,
blockSize
>>>
<<<
gridSize
,
blockSize
>>>
(
&
meshPointer
.
template
modify
Data
<
Devices
::
Cuda
>(),
(
&
meshPointer
.
template
get
Data
<
Devices
::
Cuda
>(),
&
userDataPointer
.
template
modifyData
<
Devices
::
Cuda
>(),
&
userDataPointer
.
template
modifyData
<
Devices
::
Cuda
>(),
entitiesCount
);
entitiesCount
);
#else
#else
...
@@ -230,7 +230,7 @@ processAllEntities( const MeshPointer& meshPointer,
...
@@ -230,7 +230,7 @@ processAllEntities( const MeshPointer& meshPointer,
Devices
::
Cuda
::
synchronizeDevice
();
Devices
::
Cuda
::
synchronizeDevice
();
MeshTraverserAllEntitiesKernel
<
EntitiesDimension
,
EntitiesProcessor
>
MeshTraverserAllEntitiesKernel
<
EntitiesDimension
,
EntitiesProcessor
>
<<<
gridSize
,
blockSize
>>>
<<<
gridSize
,
blockSize
>>>
(
&
meshPointer
.
template
modify
Data
<
Devices
::
Cuda
>(),
(
&
meshPointer
.
template
get
Data
<
Devices
::
Cuda
>(),
&
userDataPointer
.
template
modifyData
<
Devices
::
Cuda
>(),
&
userDataPointer
.
template
modifyData
<
Devices
::
Cuda
>(),
entitiesCount
);
entitiesCount
);
#else
#else
...
...
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