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
c8544f39
Commit
c8544f39
authored
Jun 02, 2011
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added begin/and with Thrust iterators for Device classes
parent
02cd916c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
devmem2d.hpp
modules/gpu/include/opencv2/gpu/devmem2d.hpp
+16
-3
No files found.
modules/gpu/include/opencv2/gpu/devmem2d.hpp
View file @
c8544f39
...
...
@@ -43,6 +43,11 @@
#ifndef __OPENCV_GPU_DEVMEM2D_HPP__
#define __OPENCV_GPU_DEVMEM2D_HPP__
#if defined(__DEVCLASES_ADD_THRUST_BEGIN_END__)
#include "thrust/device_ptr.h"
#endif
namespace
cv
{
namespace
gpu
...
...
@@ -55,6 +60,7 @@ namespace cv
#else
#define __CV_GPU_HOST_DEVICE__
#endif
template
<
bool
expr
>
struct
StaticAssert
;
template
<>
struct
StaticAssert
<
true
>
{
static
__CV_GPU_HOST_DEVICE__
void
check
(){}};
...
...
@@ -80,6 +86,11 @@ namespace cv
__CV_GPU_HOST_DEVICE__
size_t
elemSize
()
const
{
return
elem_size
;
}
__CV_GPU_HOST_DEVICE__
T
*
ptr
(
int
y
=
0
)
{
return
(
T
*
)(
(
char
*
)
data
+
y
*
step
);
}
__CV_GPU_HOST_DEVICE__
const
T
*
ptr
(
int
y
=
0
)
const
{
return
(
const
T
*
)(
(
const
char
*
)
data
+
y
*
step
);
}
#if defined(__DEVCLASES_ADD_THRUST_BEGIN_END__)
thrust
::
device_ptr
<
T
>
begin
()
const
{
return
thrust
::
device_ptr
<
T
>
(
data
);
}
thrust
::
device_ptr
<
T
>
end
()
const
{
return
thrust
::
device_ptr
<
T
>
(
data
)
+
cols
*
rows
;
}
#endif
};
template
<
typename
T
>
struct
PtrStep_
...
...
@@ -96,10 +107,12 @@ namespace cv
__CV_GPU_HOST_DEVICE__
size_t
elemSize
()
const
{
return
elem_size
;
}
__CV_GPU_HOST_DEVICE__
T
*
ptr
(
int
y
=
0
)
{
return
(
T
*
)(
(
char
*
)
data
+
y
*
step
);
}
__CV_GPU_HOST_DEVICE__
const
T
*
ptr
(
int
y
=
0
)
const
{
return
(
const
T
*
)(
(
const
char
*
)
data
+
y
*
step
);
}
};
#if defined(__DEVCLASES_ADD_THRUST_BEGIN_END__)
thrust
::
device_ptr
<
T
>
begin
()
const
{
return
thrust
::
device_ptr
<
T
>
(
data
);
}
#endif
};
template
<
typename
T
>
struct
PtrElemStep_
:
public
PtrStep_
<
T
>
{
PtrElemStep_
(
const
DevMem2D_
<
T
>&
mem
)
:
PtrStep_
<
T
>
(
mem
)
...
...
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