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
a5ffa1da
Commit
a5ffa1da
authored
Jun 07, 2013
by
Vadim Pisarevsky
Committed by
OpenCV Buildbot
Jun 07, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #963 from bitwangyaoyao:master_oclMat
parents
10340fe2
9284c07a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
13 deletions
+17
-13
util.hpp
modules/ocl/include/opencv2/ocl/private/util.hpp
+2
-2
initialization.cpp
modules/ocl/src/initialization.cpp
+0
-6
matrix_operations.cpp
modules/ocl/src/matrix_operations.cpp
+15
-5
No files found.
modules/ocl/include/opencv2/ocl/private/util.hpp
View file @
a5ffa1da
...
...
@@ -65,9 +65,9 @@ namespace cv
clMemcpyDeviceToDevice
};
///////////////////////////OpenCL call wrappers////////////////////////////
//void CV_EXPORTS openCLMallocPitch(Context *clCxt, void **dev_ptr, size_t *pitch,
// size_t widthInBytes, size_t height);
void
CV_EXPORTS
openCLMallocPitch
(
Context
*
clCxt
,
void
**
dev_ptr
,
size_t
*
pitch
,
size_t
widthInBytes
,
size_t
height
);
void
CV_EXPORTS
openCLMallocPitchEx
(
Context
*
clCxt
,
void
**
dev_ptr
,
size_t
*
pitch
,
size_t
widthInBytes
,
size_t
height
,
DevMemRW
rw_type
,
DevMemType
mem_type
,
void
*
hptr
=
0
);
void
CV_EXPORTS
openCLMemcpy2D
(
Context
*
clCxt
,
void
*
dst
,
size_t
dpitch
,
...
...
modules/ocl/src/initialization.cpp
View file @
a5ffa1da
...
...
@@ -423,12 +423,6 @@ namespace cv
}
void
openCLMallocPitch
(
Context
*
clCxt
,
void
**
dev_ptr
,
size_t
*
pitch
,
size_t
widthInBytes
,
size_t
height
)
{
openCLMallocPitchEx
(
clCxt
,
dev_ptr
,
pitch
,
widthInBytes
,
height
,
gDeviceMemRW
,
gDeviceMemType
);
}
void
openCLMallocPitchEx
(
Context
*
clCxt
,
void
**
dev_ptr
,
size_t
*
pitch
,
size_t
widthInBytes
,
size_t
height
,
DevMemRW
rw_type
,
DevMemType
mem_type
,
void
*
hptr
)
{
...
...
modules/ocl/src/matrix_operations.cpp
View file @
a5ffa1da
...
...
@@ -183,11 +183,21 @@ void cv::ocl::oclMat::upload(const Mat &m)
int
pitch
=
wholeSize
.
width
*
3
*
m
.
elemSize1
();
int
tail_padding
=
m
.
elemSize1
()
*
3072
;
int
err
;
cl_mem
temp
=
clCreateBuffer
((
cl_context
)
clCxt
->
oclContext
(),
CL_MEM_READ_WRITE
,
(
pitch
*
wholeSize
.
height
+
tail_padding
-
1
)
/
tail_padding
*
tail_padding
,
0
,
&
err
);
openCLVerifyCall
(
err
);
cl_mem
temp
;
if
(
gDeviceMemType
!=
DEVICE_MEM_UHP
&&
gDeviceMemType
!=
DEVICE_MEM_CHP
){
temp
=
clCreateBuffer
((
cl_context
)
clCxt
->
oclContext
(),
CL_MEM_READ_WRITE
,
(
pitch
*
wholeSize
.
height
+
tail_padding
-
1
)
/
tail_padding
*
tail_padding
,
0
,
&
err
);
openCLVerifyCall
(
err
);
openCLMemcpy2D
(
clCxt
,
temp
,
pitch
,
m
.
datastart
,
m
.
step
,
wholeSize
.
width
*
m
.
elemSize
(),
wholeSize
.
height
,
clMemcpyHostToDevice
,
3
);
}
else
{
temp
=
clCreateBuffer
((
cl_context
)
clCxt
->
oclContext
(),
CL_MEM_READ_WRITE
|
CL_MEM_USE_HOST_PTR
,
(
pitch
*
wholeSize
.
height
+
tail_padding
-
1
)
/
tail_padding
*
tail_padding
,
m
.
datastart
,
&
err
);
openCLVerifyCall
(
err
);
}
openCLMemcpy2D
(
clCxt
,
temp
,
pitch
,
m
.
datastart
,
m
.
step
,
wholeSize
.
width
*
m
.
elemSize
(),
wholeSize
.
height
,
clMemcpyHostToDevice
,
3
);
convert_C3C4
(
temp
,
*
this
);
openCLSafeCall
(
clReleaseMemObject
(
temp
));
}
...
...
@@ -915,7 +925,7 @@ void cv::ocl::oclMat::createEx(int _rows, int _cols, int _type,
size_t
esz
=
elemSize
();
void
*
dev_ptr
;
openCLMallocPitch
Ex
(
clCxt
,
&
dev_ptr
,
&
step
,
GPU_MATRIX_MALLOC_STEP
(
esz
*
cols
),
openCLMallocPitch
(
clCxt
,
&
dev_ptr
,
&
step
,
GPU_MATRIX_MALLOC_STEP
(
esz
*
cols
),
rows
,
rw_type
,
mem_type
,
hptr
);
if
(
esz
*
cols
==
step
)
...
...
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