Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
1b9bccb8
Commit
1b9bccb8
authored
Oct 08, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move Level into shared memory
parent
30bce16a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
17 deletions
+9
-17
isf-sc.cu
modules/gpu/src/cuda/isf-sc.cu
+7
-17
icf.hpp
modules/gpu/src/icf.hpp
+2
-0
No files found.
modules/gpu/src/cuda/isf-sc.cu
View file @
1b9bccb8
...
...
@@ -94,11 +94,6 @@ namespace icf {
float relScale = level.relScale;
float farea = (scaledRect.z - scaledRect.x) * (scaledRect.w - scaledRect.y);
dprintf("%d: feature %d box %d %d %d %d\n",threadIdx.x, (node.threshold >> 28), scaledRect.x, scaledRect.y,
scaledRect.z, scaledRect.w);
dprintf("%d: rescale: %f [%f %f] selected %f\n",threadIdx.x, level.relScale, level.scaling[0], level.scaling[1],
level.scaling[(node.threshold >> 28) > 6]);
// rescale
scaledRect.x = __float2int_rn(relScale * scaledRect.x);
scaledRect.y = __float2int_rn(relScale * scaledRect.y);
...
...
@@ -110,14 +105,7 @@ namespace icf {
const float expected_new_area = farea * relScale * relScale;
float approx = __fdividef(sarea, expected_new_area);
dprintf("%d: new rect: %d box %d %d %d %d rel areas %f %f\n",threadIdx.x, (node.threshold >> 28),
scaledRect.x, scaledRect.y, scaledRect.z, scaledRect.w, farea * relScale * relScale, sarea);
float rootThreshold = (node.threshold & 0x0FFFFFFFU) * approx;
rootThreshold *= level.scaling[(node.threshold >> 28) > 6];
dprintf("%d: approximation %f %d -> %f %f\n",threadIdx.x, approx, (node.threshold & 0x0FFFFFFFU), rootThreshold,
level.scaling[(node.threshold >> 28) > 6]);
float rootThreshold = (node.threshold & 0x0FFFFFFFU) * approx * level.scaling[(node.threshold >> 28) > 6];
return rootThreshold;
}
...
...
@@ -179,18 +167,20 @@ namespace icf {
const int y = blockIdx.y * blockDim.y + threadIdx.y;
const int x = blockIdx.x;
__shared__ volatile char roiCache[8];
// load Lavel
__shared__ Level level;
// check POI
__shared__ volatile char roiCache[8];
if (!threadIdx.y && !threadIdx.x)
{
((float2*)roiCache)[threadIdx.x] = tex2D(troi, blockIdx.y, x);
}
__syncthreads();
if (!roiCache[threadIdx.y]) return;
Level level = levels[downscales + blockIdx.z];
if (!threadIdx.x)
level = levels[downscales + blockIdx.z];
if(x >= level.workRect.x || y >= level.workRect.y) return;
...
...
modules/gpu/src/icf.hpp
View file @
1b9bccb8
...
...
@@ -90,6 +90,8 @@ struct __align__(8) Level //is actually 24 bytes
objSize
.
x
=
round
(
oct
.
size
.
x
*
relScale
);
objSize
.
y
=
round
(
oct
.
size
.
y
*
relScale
);
}
__device
Level
(){}
};
struct
__align__
(
8
)
Node
...
...
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