Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Maintenance moved to Monday 17.3. at 13:00. ETA 60 - 90 minutes.
Show more breadcrumbs
Nicolas Pope
ftl
Commits
14e0bfe8
Commit
14e0bfe8
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Remove size_t for texture size
parent
2220bf23
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#22759
passed
5 years ago
Stage: all
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/common/cpp/include/ftl/cuda_texture.hpp
+6
-6
6 additions, 6 deletions
components/common/cpp/include/ftl/cuda_texture.hpp
components/operators/src/segmentation.cu
+4
-4
4 additions, 4 deletions
components/operators/src/segmentation.cu
with
10 additions
and
10 deletions
components/common/cpp/include/ftl/cuda_texture.hpp
+
6
−
6
View file @
14e0bfe8
...
...
@@ -53,8 +53,8 @@ class TextureObjectBase {
inline
size_t
pixelPitch
()
const
{
return
pitch2_
;
}
inline
uchar
*
devicePtr
()
const
{
return
ptr_
;
};
__host__
__device__
inline
uchar
*
devicePtr
(
int
v
)
const
{
return
&
ptr_
[
v
*
pitch_
];
}
__host__
__device__
inline
size_
t
width
()
const
{
return
width_
;
}
__host__
__device__
inline
size_
t
height
()
const
{
return
height_
;
}
__host__
__device__
inline
unsigned
in
t
width
()
const
{
return
width_
;
}
__host__
__device__
inline
unsigned
in
t
height
()
const
{
return
height_
;
}
__host__
__device__
inline
cudaTextureObject_t
cudaTexture
()
const
{
return
texobj_
;
}
cv
::
cuda
::
GpuMat
to_gpumat
()
const
;
...
...
@@ -72,8 +72,8 @@ class TextureObjectBase {
cudaTextureObject_t
texobj_
;
size_t
pitch_
;
size_t
pitch2_
;
// in T units
size_
t
width_
;
size_
t
height_
;
unsigned
in
t
width_
;
unsigned
in
t
height_
;
uchar
*
ptr_
;
// Device memory pointer
bool
needsfree_
;
// We manage memory, so free it
bool
needsdestroy_
;
// The texture object needs to be destroyed
...
...
@@ -107,7 +107,7 @@ class TextureObject : public TextureObjectBase {
operator
cv
::
cuda
::
GpuMat
();
void
create
(
const
cv
::
Size
&
);
void
create
(
size_t
w
,
size_
t
h
);
void
create
(
unsigned
int
w
,
unsigned
in
t
h
);
__host__
__device__
T
*
devicePtr
()
const
{
return
(
T
*
)(
ptr_
);
};
__host__
__device__
T
*
devicePtr
(
int
v
)
const
{
return
&
(
T
*
)(
ptr_
)[
v
*
pitch2_
];
}
...
...
@@ -292,7 +292,7 @@ void TextureObject<T>::create(const cv::Size &s) {
}
template
<
typename
T
>
void
TextureObject
<
T
>::
create
(
size_t
w
,
size_
t
h
)
{
void
TextureObject
<
T
>::
create
(
unsigned
int
w
,
unsigned
in
t
h
)
{
if
(
width_
!=
w
||
height_
!=
h
)
{
*
this
=
std
::
move
(
TextureObject
<
T
>
(
w
,
h
));
}
...
...
This diff is collapsed.
Click to expand it.
components/operators/src/segmentation.cu
+
4
−
4
View file @
14e0bfe8
...
...
@@ -27,9 +27,9 @@ __device__ inline float cross<float>(float p1, float p2) {
template
<
typename
T
,
bool
SYM
>
__device__
uchar4
calculate_support_region
(
const
TextureObject
<
T
>
&
img
,
int
x
,
int
y
,
float
tau
,
int
v_max
,
int
h_max
)
{
int
x_min
=
max
(
0
,
x
-
h_max
);
int
x_max
=
min
(
img
.
width
()
-
1
,
static_cast
<
unsigned
long
>
(
x
+
h_max
));
int
x_max
=
min
(
img
.
width
()
-
1
,
static_cast
<
unsigned
int
>
(
x
+
h_max
));
int
y_min
=
max
(
0
,
y
-
v_max
);
int
y_max
=
min
(
img
.
height
()
-
1
,
static_cast
<
unsigned
long
>
(
y
+
v_max
));
int
y_max
=
min
(
img
.
height
()
-
1
,
static_cast
<
unsigned
int
>
(
y
+
v_max
));
uchar4
result
=
make_uchar4
(
0
,
0
,
0
,
0
);
...
...
@@ -93,9 +93,9 @@ __device__ uchar4 calculate_support_region(const TextureObject<T> &img, int x, i
__device__
uchar4
calculate_support_region
(
const
TextureObject
<
uint8_t
>
&
img
,
int
x
,
int
y
,
int
v_max
,
int
h_max
)
{
int
x_min
=
max
(
0
,
x
-
h_max
);
int
x_max
=
min
(
img
.
width
()
-
1
,
static_cast
<
unsigned
long
>
(
x
+
h_max
));
int
x_max
=
min
(
img
.
width
()
-
1
,
static_cast
<
unsigned
int
>
(
x
+
h_max
));
int
y_min
=
max
(
0
,
y
-
v_max
);
int
y_max
=
min
(
img
.
height
()
-
1
,
static_cast
<
unsigned
long
>
(
y
+
v_max
));
int
y_max
=
min
(
img
.
height
()
-
1
,
static_cast
<
unsigned
int
>
(
y
+
v_max
));
uchar4
result
=
make_uchar4
(
0
,
0
,
0
,
0
);
...
...
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