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
c34ca5ac
There was an error fetching the commit references. Please try again later.
Commit
c34ca5ac
authored
6 years ago
by
Lukas Cejka
Committed by
Tomáš Oberhuber
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Preliminary templating of WarpInfo and WarpList. Commenting for backup purposes.
parent
b80ec5b8
No related branches found
No related tags found
1 merge request
!45
Matrices revision
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TNL/Matrices/AdEllpack.h
+52
-22
52 additions, 22 deletions
src/TNL/Matrices/AdEllpack.h
with
52 additions
and
22 deletions
src/TNL/Matrices/AdEllpack.h
+
52
−
22
View file @
c34ca5ac
...
...
@@ -27,50 +27,80 @@ namespace Matrices {
template
<
typename
Device
>
class
AdEllpackDeviceDependentCode
;
template
<
typename
MatrixType
>
struct
warpInfo
{
int
offset
;
int
rowOffset
;
int
localLoad
;
int
reduceMap
[
32
];
warpInfo
*
next
;
warpInfo
*
previous
;
using
RealType
=
typename
MatrixType
::
RealType
;
using
DeviceType
=
typename
MatrixType
::
DeviceType
;
using
IndexType
=
typename
MatrixType
::
IndexType
;
IndexType
offset
;
IndexType
rowOffset
;
IndexType
localLoad
;
IndexType
reduceMap
[
32
];
warpInfo
<
MatrixType
>*
next
;
warpInfo
<
MatrixType
>*
previous
;
};
template
<
typename
MatrixType
>
class
warpList
{
public:
using
RealType
=
typename
MatrixType
::
RealType
;
using
DeviceType
=
typename
MatrixType
::
DeviceType
;
using
IndexType
=
typename
MatrixType
::
IndexType
;
warpList
();
bool
addWarp
(
const
int
offset
,
const
int
rowOffset
,
const
int
localLoad
,
const
int
*
reduceMap
);
bool
addWarp
(
const
IndexType
offset
,
const
IndexType
rowOffset
,
const
IndexType
localLoad
,
const
IndexType
*
reduceMap
);
warpInfo
*
splitInHalf
(
warpInfo
*
warp
);
warpInfo
<
MatrixType
>
*
splitInHalf
(
warpInfo
<
MatrixType
>
*
warp
);
int
getNumberOfWarps
()
IndexType
getNumberOfWarps
()
{
return
this
->
numberOfWarps
;
}
warpInfo
*
getNextWarp
(
warpInfo
*
warp
)
warpInfo
<
MatrixType
>
*
getNextWarp
(
warpInfo
<
MatrixType
>
*
warp
)
{
return
warp
->
next
;
}
warpInfo
*
getHead
()
warpInfo
<
MatrixType
>
*
getHead
()
{
return
this
->
head
;
}
warpInfo
*
getTail
()
warpInfo
<
MatrixType
>
*
getTail
()
{
return
this
->
tail
;
}
~
warpList
();
void
printList
()
{
if
(
this
->
getHead
()
==
this
->
getTail
()
)
std
::
cout
<<
"HEAD==TAIL"
<<
std
::
endl
;
else
{
// TEST
for
(
warpInfo
<
MatrixType
>*
i
=
this
->
getHead
();
i
!=
this
->
getTail
()
->
next
;
i
=
i
->
next
)
{
if
(
i
==
this
->
getHead
()
)
std
::
cout
<<
"Head:"
<<
"
\t
i->localLoad = "
<<
i
->
localLoad
<<
"
\t
i->offset = "
<<
i
->
offset
<<
"
\t
i->rowOffset = "
<<
i
->
rowOffset
<<
std
::
endl
;
else
if
(
i
==
this
->
getTail
()
)
std
::
cout
<<
"Tail:"
<<
"
\t
i->localLoad = "
<<
i
->
localLoad
<<
"
\t
i->offset = "
<<
i
->
offset
<<
"
\t
i->rowOffset = "
<<
i
->
rowOffset
<<
std
::
endl
;
else
std
::
cout
<<
"
\t
i->localLoad = "
<<
i
->
localLoad
<<
"
\t
i->offset = "
<<
i
->
offset
<<
"
\t
i->rowOffset = "
<<
i
->
rowOffset
<<
std
::
endl
;
}
std
::
cout
<<
std
::
endl
;
}
}
private
:
int
numberOfWarps
;
IndexType
numberOfWarps
;
warpInfo
*
head
;
warpInfo
*
tail
;
warpInfo
<
MatrixType
>
*
head
;
warpInfo
<
MatrixType
>
*
tail
;
};
...
...
@@ -155,13 +185,13 @@ public:
bool
balanceLoad
(
const
RealType
average
,
ConstCompressedRowLengthsVectorView
rowLengths
,
warpList
*
list
);
warpList
<
ThisType
>
*
list
);
void
computeWarps
(
const
IndexType
SMs
,
const
IndexType
threadsPerSM
,
warpList
*
list
);
warpList
<
ThisType
>
*
list
);
bool
createArrays
(
warpList
*
list
);
bool
createArrays
(
warpList
<
ThisType
>
*
list
);
void
performRowTest
();
...
...
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