Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
elsa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
34
Issues
34
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
11
Merge Requests
11
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
IP
elsa
Commits
e23556cc
Commit
e23556cc
authored
Mar 16, 2020
by
Jens Petit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DataHandlerGPU: Avoid host-device transfers in Siddons and Josephs (
#21
)
parent
b84ee79d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
elsa/projectors_cuda/JosephsMethodCUDA.cpp
elsa/projectors_cuda/JosephsMethodCUDA.cpp
+18
-2
elsa/projectors_cuda/SiddonsMethodCUDA.cpp
elsa/projectors_cuda/SiddonsMethodCUDA.cpp
+9
-1
No files found.
elsa/projectors_cuda/JosephsMethodCUDA.cpp
View file @
e23556cc
...
...
@@ -434,7 +434,15 @@ namespace elsa
{
cudaMemcpy3DParms
cpyParams
=
{};
cpyParams
.
extent
=
extent
;
cpyParams
.
kind
=
direction
;
cudaPointerAttributes
ptrAttributes
;
// if host data is a cuda pointer it must be managed unified memory -> internal copy
if
(
cudaPointerGetAttributes
(
&
ptrAttributes
,
hostData
)
==
cudaSuccess
)
{
Logger
::
get
(
"JosephsMethodCUDA"
)
->
debug
(
"Use internal GPU copy"
);
cpyParams
.
kind
=
cudaMemcpyDeviceToDevice
;
}
else
{
cpyParams
.
kind
=
direction
;
}
cudaPitchedPtr
tmp
=
make_cudaPitchedPtr
(
hostData
,
extent
.
width
,
extent
.
width
,
extent
.
height
);
...
...
@@ -493,7 +501,15 @@ namespace elsa
cpyParams
.
srcPtr
.
ysize
=
domainDimsui
[
1
];
cpyParams
.
dstArray
=
volume
;
cpyParams
.
extent
=
volumeExtent
;
cpyParams
.
kind
=
cudaMemcpyHostToDevice
;
// if host data is a cuda pointer it must be managed unified memory -> internal copy
cudaPointerAttributes
ptrAttributes
;
if
(
cudaPointerGetAttributes
(
&
ptrAttributes
,
(
void
*
)
&
hostData
[
0
])
==
cudaSuccess
)
{
Logger
::
get
(
"JosephsMethodCUDA"
)
->
debug
(
"Internal GPU copy of texture"
);
cpyParams
.
kind
=
cudaMemcpyDeviceToDevice
;
}
else
{
cpyParams
.
kind
=
cudaMemcpyHostToDevice
;
}
if
(
cudaMemcpy3DAsync
(
&
cpyParams
)
!=
cudaSuccess
)
throw
std
::
logic_error
(
...
...
elsa/projectors_cuda/SiddonsMethodCUDA.cpp
View file @
e23556cc
...
...
@@ -273,7 +273,15 @@ namespace elsa
{
cudaMemcpy3DParms
cpyParams
=
{};
cpyParams
.
extent
=
extent
;
cpyParams
.
kind
=
direction
;
cudaPointerAttributes
ptrAttributes
;
// if host data is a cuda pointer it must be managed unified memory -> internal copy
if
(
cudaPointerGetAttributes
(
&
ptrAttributes
,
hostData
)
==
cudaSuccess
)
{
Logger
::
get
(
"SiddonsMethodCUDA"
)
->
debug
(
"Use internal GPU copy"
);
cpyParams
.
kind
=
cudaMemcpyDeviceToDevice
;
}
else
{
cpyParams
.
kind
=
direction
;
}
cudaPitchedPtr
tmp
=
make_cudaPitchedPtr
(
hostData
,
extent
.
width
,
extent
.
width
,
extent
.
height
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment