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 {
...
@@ -27,50 +27,80 @@ namespace Matrices {
template
<
typename
Device
>
template
<
typename
Device
>
class
AdEllpackDeviceDependentCode
;
class
AdEllpackDeviceDependentCode
;
template
<
typename
MatrixType
>
struct
warpInfo
struct
warpInfo
{
{
int
offset
;
using
RealType
=
typename
MatrixType
::
RealType
;
int
rowOffset
;
using
DeviceType
=
typename
MatrixType
::
DeviceType
;
int
localLoad
;
using
IndexType
=
typename
MatrixType
::
IndexType
;
int
reduceMap
[
32
];
IndexType
offset
;
warpInfo
*
next
;
IndexType
rowOffset
;
warpInfo
*
previous
;
IndexType
localLoad
;
IndexType
reduceMap
[
32
];
warpInfo
<
MatrixType
>*
next
;
warpInfo
<
MatrixType
>*
previous
;
};
};
template
<
typename
MatrixType
>
class
warpList
class
warpList
{
{
public:
public:
using
RealType
=
typename
MatrixType
::
RealType
;
using
DeviceType
=
typename
MatrixType
::
DeviceType
;
using
IndexType
=
typename
MatrixType
::
IndexType
;
warpList
();
warpList
();
bool
addWarp
(
const
int
offset
,
bool
addWarp
(
const
IndexType
offset
,
const
int
rowOffset
,
const
IndexType
rowOffset
,
const
int
localLoad
,
const
IndexType
localLoad
,
const
int
*
reduceMap
);
const
IndexType
*
reduceMap
);
warpInfo
*
splitInHalf
(
warpInfo
*
warp
);
warpInfo
<
MatrixType
>
*
splitInHalf
(
warpInfo
<
MatrixType
>
*
warp
);
int
getNumberOfWarps
()
IndexType
getNumberOfWarps
()
{
return
this
->
numberOfWarps
;
}
{
return
this
->
numberOfWarps
;
}
warpInfo
*
getNextWarp
(
warpInfo
*
warp
)
warpInfo
<
MatrixType
>
*
getNextWarp
(
warpInfo
<
MatrixType
>
*
warp
)
{
return
warp
->
next
;
}
{
return
warp
->
next
;
}
warpInfo
*
getHead
()
warpInfo
<
MatrixType
>
*
getHead
()
{
return
this
->
head
;
}
{
return
this
->
head
;
}
warpInfo
*
getTail
()
warpInfo
<
MatrixType
>
*
getTail
()
{
return
this
->
tail
;
}
{
return
this
->
tail
;
}
~
warpList
();
~
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
:
private
:
int
numberOfWarps
;
IndexType
numberOfWarps
;
warpInfo
*
head
;
warpInfo
<
MatrixType
>
*
head
;
warpInfo
*
tail
;
warpInfo
<
MatrixType
>
*
tail
;
};
};
...
@@ -155,13 +185,13 @@ public:
...
@@ -155,13 +185,13 @@ public:
bool
balanceLoad
(
const
RealType
average
,
bool
balanceLoad
(
const
RealType
average
,
ConstCompressedRowLengthsVectorView
rowLengths
,
ConstCompressedRowLengthsVectorView
rowLengths
,
warpList
*
list
);
warpList
<
ThisType
>
*
list
);
void
computeWarps
(
const
IndexType
SMs
,
void
computeWarps
(
const
IndexType
SMs
,
const
IndexType
threadsPerSM
,
const
IndexType
threadsPerSM
,
warpList
*
list
);
warpList
<
ThisType
>
*
list
);
bool
createArrays
(
warpList
*
list
);
bool
createArrays
(
warpList
<
ThisType
>
*
list
);
void
performRowTest
();
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