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
48c346ad
There was an error fetching the commit references. Please try again later.
Commit
48c346ad
authored
8 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Added FIXME notes to Cuda::configSetup and Cuda::setup
parent
f1d4780a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/TNL/Devices/Cuda.cpp
+3
-1
3 additions, 1 deletion
src/TNL/Devices/Cuda.cpp
src/TNL/Devices/Cuda.cu
+0
-21
0 additions, 21 deletions
src/TNL/Devices/Cuda.cu
with
3 additions
and
22 deletions
src/TNL/Devices/Cuda.cpp
+
3
−
1
View file @
48c346ad
...
@@ -41,6 +41,7 @@ int Cuda::getNumberOfGrids( const int blocks,
...
@@ -41,6 +41,7 @@ int Cuda::getNumberOfGrids( const int blocks,
void
Cuda
::
configSetup
(
Config
::
ConfigDescription
&
config
,
void
Cuda
::
configSetup
(
Config
::
ConfigDescription
&
config
,
const
String
&
prefix
)
const
String
&
prefix
)
{
{
// FIXME: HAVE_CUDA is never defined in .cpp files
#ifdef HAVE_CUDA
#ifdef HAVE_CUDA
config
.
addEntry
<
int
>
(
prefix
+
"cuda-device"
,
"Choose CUDA device to run the computation."
,
0
);
config
.
addEntry
<
int
>
(
prefix
+
"cuda-device"
,
"Choose CUDA device to run the computation."
,
0
);
#else
#else
...
@@ -51,8 +52,9 @@ void Cuda::configSetup( Config::ConfigDescription& config,
...
@@ -51,8 +52,9 @@ void Cuda::configSetup( Config::ConfigDescription& config,
bool
Cuda
::
setup
(
const
Config
::
ParameterContainer
&
parameters
,
bool
Cuda
::
setup
(
const
Config
::
ParameterContainer
&
parameters
,
const
String
&
prefix
)
const
String
&
prefix
)
{
{
// FIXME: HAVE_CUDA is never defined in .cpp files
#ifdef HAVE_CUDA
#ifdef HAVE_CUDA
int
cudaDevice
=
parameters
.
getParameter
<
int
>
(
"cuda-device"
);
int
cudaDevice
=
parameters
.
getParameter
<
int
>
(
prefix
+
"cuda-device"
);
if
(
cudaSetDevice
(
cudaDevice
)
!=
cudaSuccess
)
if
(
cudaSetDevice
(
cudaDevice
)
!=
cudaSuccess
)
{
{
std
::
cerr
<<
"I cannot activate CUDA device number "
<<
cudaDevice
<<
"."
<<
std
::
endl
;
std
::
cerr
<<
"I cannot activate CUDA device number "
<<
cudaDevice
<<
"."
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
src/TNL/Devices/Cuda.cu
+
0
−
21
View file @
48c346ad
...
@@ -15,27 +15,6 @@
...
@@ -15,27 +15,6 @@
namespace
TNL
{
namespace
TNL
{
namespace
Devices
{
namespace
Devices
{
/*void Cuda::configSetup( tnlConfigDescription& config, const String& prefix )
{
#ifdef HAVE_CUDA
config.addEntry< int >( prefix + "cuda-device", "Choose CUDA device.", 0 );
#else
config.addEntry< int >( prefix + "cuda-device", "Choose CUDA device (CUDA is not supported on this system).", 0 );
#endif
}
bool Cuda::setup( const tnlParameterContainer& parameters,
const String& prefix )
{
int cudaDevice = parameters.getParameter< int >( prefix + "cuda-device" );
#ifdef HAVE_CUDA
cudaSetDevice( cudaDevice );
checkCudaDevice;
#endif
return true;
}
*/
bool
Cuda
::
checkDevice
(
const
char
*
file_name
,
int
line
,
cudaError
error
)
bool
Cuda
::
checkDevice
(
const
char
*
file_name
,
int
line
,
cudaError
error
)
{
{
if
(
error
==
cudaSuccess
)
if
(
error
==
cudaSuccess
)
...
...
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