Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
santan-cuda-drr-service
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘劭荣(20软)
santan-cuda-drr-service
Commits
70f4830b
Commit
70f4830b
authored
Sep 17, 2020
by
刘劭荣(20软)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
减少GPU CPU交换时间
parent
e1eaf4a8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
3 deletions
+15
-3
drr.cpp
cuda-drr-socket/drr.cpp
+14
-3
socketManager.cpp
cuda-drr-socket/socketManager.cpp
+1
-0
cuda-drr-socket.iobj
x64/Release/cuda-drr-socket.iobj
+0
-0
cuda-drr-socket.ipdb
x64/Release/cuda-drr-socket.ipdb
+0
-0
No files found.
cuda-drr-socket/drr.cpp
View file @
70f4830b
...
...
@@ -41,6 +41,7 @@ drr::drr(std::string input)
image
=
reader
->
GetOutput
();
ImageType
::
SizeType
sizeCT
=
image
->
GetLargestPossibleRegion
().
GetSize
();
InputImageType
::
SpacingType
ctPixelSpacing
=
image
->
GetSpacing
();
//free(cpp_object3D);
cpp_object3D
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
sizeCT
[
0
]
*
sizeCT
[
1
]
*
sizeCT
[
2
]);
for
(
int
i
=
0
;
i
<
sizeCT
[
0
];
i
++
)
...
...
@@ -53,7 +54,15 @@ drr::drr(std::string input)
cpp_object3D
[
k
+
j
*
(
sizeCT
[
2
])
+
i
*
(
sizeCT
[
1
]
*
sizeCT
[
2
])]
=
image
->
GetPixel
(
index
);
}
int
SizeCT
[
3
];
SizeCT
[
0
]
=
sizeCT
[
0
];
SizeCT
[
1
]
=
sizeCT
[
1
];
SizeCT
[
2
]
=
sizeCT
[
2
];
float
PixelSpacingCT
[
3
];
PixelSpacingCT
[
0
]
=
ctPixelSpacing
[
0
];
PixelSpacingCT
[
1
]
=
ctPixelSpacing
[
1
];
PixelSpacingCT
[
2
]
=
ctPixelSpacing
[
2
];
loadDICOMInGPUMemory
(
cpp_object3D
,
SizeCT
,
PixelSpacingCT
);
std
::
cout
<<
"itk readfile :"
<<
(
double
)
clock
()
/
CLOCKS_PER_SEC
-
time
<<
std
::
endl
;
}
...
...
@@ -61,7 +70,6 @@ drr::drr(std::string input)
drr
::~
drr
()
{
freeDICOMFromGPUMemory
();
freeAuxiliaryVariablesInGPUMemory
();
}
float
*
drr
::
cudaDRR
(
float
rx
,
float
ry
,
float
rz
,
int
dx
,
int
dy
,
float
threshold
)
...
...
@@ -231,9 +239,12 @@ float* drr::cudaDRR(float rx, float ry, float rz, int dx, int dy, float threshol
cudaPara
.
numThreads
=
1024
;
cudaPara
.
numBlocks
=
(
int
)
ceil
((
float
)
output_size
[
0
]
*
output_size
[
1
]
/
1024
);
loadDICOMInGPUMemory
(
image3d
.
image
,
image3d
.
SizeCT
,
image3d
.
PixelSpacingCT
);
loadOuputVariablesInGPUMemory
((
int
)
output_size
[
0
],(
int
)
output_size
[
1
]);
float
*
object2d
=
calculateDRRwithCUDA
(
cudaPara
,
para
);
freeAuxiliaryVariablesInGPUMemory
();
return
object2d
;
//////////////以下代码为保存DRR到硬盘
...
...
cuda-drr-socket/socketManager.cpp
View file @
70f4830b
...
...
@@ -18,6 +18,7 @@ void socketManager::get_CUDAdrr(const char * path)
{
if
(
rd
!=
NULL
)
{
// 析构 释放GPU内存
rd
->~
drr
();
rd
=
NULL
;
}
rd
=
new
drr
(
path
);
...
...
x64/Release/cuda-drr-socket.iobj
View file @
70f4830b
No preview for this file type
x64/Release/cuda-drr-socket.ipdb
View file @
70f4830b
No preview for this file type
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