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
dc8572dc
Commit
dc8572dc
authored
Jun 11, 2011
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
data_mov_utils.hpp
parent
c6918039
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
datamov_utils.hpp
modules/gpu/src/opencv2/gpu/device/datamov_utils.hpp
+39
-0
No files found.
modules/gpu/src/opencv2/gpu/device/datamov_utils.hpp
0 → 100644
View file @
dc8572dc
#if __CUDA_ARCH__ >= 200
// for Fermi memory space is detected automatically
template
<
typename
T
>
struct
ForceGlobLoad
{
__device__
__forceinline__
static
void
Ld
(
T
*
ptr
,
int
offset
,
T
&
val
)
{
val
=
d_ptr
[
offset
];
}
};
#else
#if defined(_WIN64) || defined(__LP64__)
// 64-bit register modifier for inlined asm
#define _OPENCV_ASM_PTR_ "l"
#else
// 32-bit register modifier for inlined asm
#define _OPENCV_ASM_PTR_ "r"
#endif
template
<
class
T
>
struct
ForceGlobLoad
;
#define DEFINE_FORCE_GLOB_LOAD(base_type, ptx_type, reg_mod) \
template <> struct ForceGlobLoad<base_type> \
{ \
__device__ __forceinline__ static void Ld(type* ptr, int offset, type& val) \
{
\
asm
(
"ld.global."
#
ptx_type
" %0, [%1];"
:
"="
#
reg_mod
(
val
)
:
_OPENCV_ASM_PTR_
(
d_ptr
+
offset
));
\
}
\
};
DEFINE_FORCE_GLOB_LOAD
(
int
,
s32
,
r
)
DEFINE_FORCE_GLOB_LOAD
(
float
,
f32
,
f
)
#undef DEFINE_FORCE_GLOB_LOAD
#endif
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