Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
87f6e3e5
Commit
87f6e3e5
authored
7 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
Task #11547: Tie compute target checks to specific CUDA versions
parent
ef9c0890
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
RTCP/Cobalt/GPUProc/src/cuda/gpu_utils.cc
+13
-7
13 additions, 7 deletions
RTCP/Cobalt/GPUProc/src/cuda/gpu_utils.cc
with
13 additions
and
7 deletions
RTCP/Cobalt/GPUProc/src/cuda/gpu_utils.cc
+
13
−
7
View file @
87f6e3e5
...
@@ -53,8 +53,10 @@ namespace LOFAR
...
@@ -53,8 +53,10 @@ namespace LOFAR
unsigned
major
=
device
.
getComputeCapabilityMajor
();
unsigned
major
=
device
.
getComputeCapabilityMajor
();
unsigned
minor
=
device
.
getComputeCapabilityMinor
();
unsigned
minor
=
device
.
getComputeCapabilityMinor
();
#if CUDA_VERSION >= 8000 // possibly holds for 6.x and 7.x as well
return
(
CUjit_target
)(
major
*
10
+
minor
);
#else
switch
(
major
)
{
switch
(
major
)
{
#ifdef CU_TARGET_COMPUTE_10
case
0
:
case
0
:
return
CU_TARGET_COMPUTE_10
;
return
CU_TARGET_COMPUTE_10
;
...
@@ -71,7 +73,7 @@ namespace LOFAR
...
@@ -71,7 +73,7 @@ namespace LOFAR
default:
default:
return
CU_TARGET_COMPUTE_13
;
return
CU_TARGET_COMPUTE_13
;
}
}
#endif
case
2
:
case
2
:
switch
(
minor
)
{
switch
(
minor
)
{
case
0
:
case
0
:
...
@@ -96,8 +98,8 @@ namespace LOFAR
...
@@ -96,8 +98,8 @@ namespace LOFAR
default
:
default
:
return
CU_TARGET_COMPUTE_30
;
return
CU_TARGET_COMPUTE_30
;
#endif
#endif
}
}
#endif
}
}
// Return the highest compute target supported by all the given devices
// Return the highest compute target supported by all the given devices
...
@@ -124,11 +126,13 @@ namespace LOFAR
...
@@ -124,11 +126,13 @@ namespace LOFAR
// the .cu file is written in).
// the .cu file is written in).
string
get_virtarch
(
CUjit_target
target
)
string
get_virtarch
(
CUjit_target
target
)
{
{
#if CUDA_VERSION >= 8000 // possibly holds for 6.x and 7.x as well
return
str
(
format
(
"compute_%d"
)
%
target
);
#else
switch
(
target
)
{
switch
(
target
)
{
default:
default:
return
"compute_unknown"
;
return
"compute_unknown"
;
#ifdef CU_TARGET_COMPUTE_10
case
CU_TARGET_COMPUTE_10
:
case
CU_TARGET_COMPUTE_10
:
return
"compute_10"
;
return
"compute_10"
;
...
@@ -140,7 +144,6 @@ namespace LOFAR
...
@@ -140,7 +144,6 @@ namespace LOFAR
case
CU_TARGET_COMPUTE_13
:
case
CU_TARGET_COMPUTE_13
:
return
"compute_13"
;
return
"compute_13"
;
#endif
case
CU_TARGET_COMPUTE_20
:
case
CU_TARGET_COMPUTE_20
:
case
CU_TARGET_COMPUTE_21
:
case
CU_TARGET_COMPUTE_21
:
...
@@ -155,17 +158,20 @@ namespace LOFAR
...
@@ -155,17 +158,20 @@ namespace LOFAR
return
"compute_35"
;
return
"compute_35"
;
#endif
#endif
}
}
#endif
}
}
// Translate a compute target to a GPU architecture (= the instruction
// Translate a compute target to a GPU architecture (= the instruction
// set supported by the actual GPU).
// set supported by the actual GPU).
string
get_gpuarch
(
CUjit_target
target
)
string
get_gpuarch
(
CUjit_target
target
)
{
{
#if CUDA_VERSION >= 8000 // possibly holds for 6.x and 7.x as well
return
str
(
format
(
"sm_%d"
)
%
target
);
#else
switch
(
target
)
{
switch
(
target
)
{
default:
default:
return
"sm_unknown"
;
return
"sm_unknown"
;
#ifdef CU_TARGET_COMPUTE_10
case
CU_TARGET_COMPUTE_10
:
case
CU_TARGET_COMPUTE_10
:
return
"sm_10"
;
return
"sm_10"
;
...
@@ -177,7 +183,6 @@ namespace LOFAR
...
@@ -177,7 +183,6 @@ namespace LOFAR
case
CU_TARGET_COMPUTE_13
:
case
CU_TARGET_COMPUTE_13
:
return
"sm_13"
;
return
"sm_13"
;
#endif
case
CU_TARGET_COMPUTE_20
:
case
CU_TARGET_COMPUTE_20
:
return
"sm_20"
;
return
"sm_20"
;
...
@@ -193,6 +198,7 @@ namespace LOFAR
...
@@ -193,6 +198,7 @@ namespace LOFAR
return
"sm_35"
;
return
"sm_35"
;
#endif
#endif
}
}
#endif
}
}
string
lofarRoot
()
string
lofarRoot
()
...
...
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