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
f77a6d82
There was an error fetching the commit references. Please try again later.
Commit
f77a6d82
authored
8 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Added constexpr to some Cuda methods
parent
3fd133eb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/TNL/Devices/Cuda.cpp
+0
-5
0 additions, 5 deletions
src/TNL/Devices/Cuda.cpp
src/TNL/Devices/Cuda.h
+7
-7
7 additions, 7 deletions
src/TNL/Devices/Cuda.h
src/TNL/Devices/Cuda_impl.h
+15
-10
15 additions, 10 deletions
src/TNL/Devices/Cuda_impl.h
with
22 additions
and
22 deletions
src/TNL/Devices/Cuda.cpp
+
0
−
5
View file @
f77a6d82
...
...
@@ -26,11 +26,6 @@ String Cuda::getDeviceType()
return
String
(
"Cuda"
);
}
int
Cuda
::
getGPUTransferBufferSize
()
{
return
1
<<
20
;
}
int
Cuda
::
getNumberOfBlocks
(
const
int
threads
,
const
int
blockSize
)
{
...
...
This diff is collapsed.
Click to expand it.
src/TNL/Devices/Cuda.h
+
7
−
7
View file @
f77a6d82
...
...
@@ -38,11 +38,15 @@ class Cuda
static
String
getDeviceType
();
__cuda_callable__
static
inline
int
getMaxGridSize
();
__cuda_callable__
static
inline
constexpr
int
getMaxGridSize
();
__cuda_callable__
static
inline
int
getMaxBlockSize
();
__cuda_callable__
static
inline
constexpr
int
getMaxBlockSize
();
__cuda_callable__
static
inline
int
getWarpSize
();
__cuda_callable__
static
inline
constexpr
int
getWarpSize
();
__cuda_callable__
static
inline
constexpr
int
getNumberOfSharedMemoryBanks
();
static
inline
constexpr
int
getGPUTransferBufferSize
();
#ifdef HAVE_CUDA
static
int
getDeviceId
();
...
...
@@ -51,10 +55,6 @@ class Cuda
__device__
static
Index
getGlobalThreadIdx
(
const
Index
gridIdx
=
0
);
#endif
__cuda_callable__
static
inline
int
getNumberOfSharedMemoryBanks
();
static
int
getGPUTransferBufferSize
();
static
int
getNumberOfBlocks
(
const
int
threads
,
const
int
blockSize
);
...
...
This diff is collapsed.
Click to expand it.
src/TNL/Devices/Cuda_impl.h
+
15
−
10
View file @
f77a6d82
...
...
@@ -16,26 +16,38 @@ namespace TNL {
namespace
Devices
{
__cuda_callable__
inline
int
Cuda
::
getMaxGridSize
()
inline
constexpr
int
Cuda
::
getMaxGridSize
()
{
// TODO: make it preprocessor macro constant defined in tnlConfig
return
65535
;
};
__cuda_callable__
inline
int
Cuda
::
getMaxBlockSize
()
inline
constexpr
int
Cuda
::
getMaxBlockSize
()
{
// TODO: make it preprocessor macro constant defined in tnlConfig
return
1024
;
};
__cuda_callable__
inline
int
Cuda
::
getWarpSize
()
inline
constexpr
int
Cuda
::
getWarpSize
()
{
// TODO: make it preprocessor macro constant defined in tnlConfig
return
32
;
}
__cuda_callable__
inline
constexpr
int
Cuda
::
getNumberOfSharedMemoryBanks
()
{
// TODO: make it preprocessor macro constant defined in tnlConfig
return
32
;
}
inline
constexpr
int
Cuda
::
getGPUTransferBufferSize
()
{
return
1
<<
20
;
}
#ifdef HAVE_CUDA
template
<
typename
Index
>
__device__
Index
Cuda
::
getGlobalThreadIdx
(
const
Index
gridIdx
)
...
...
@@ -45,13 +57,6 @@ __device__ Index Cuda::getGlobalThreadIdx( const Index gridIdx )
#endif
__cuda_callable__
inline
int
Cuda
::
getNumberOfSharedMemoryBanks
()
{
// TODO: make it preprocessor macro constant defined in tnlConfig
return
32
;
}
template
<
typename
ObjectType
>
ObjectType
*
Cuda
::
passToDevice
(
const
ObjectType
&
object
)
{
...
...
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