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
d88fdd03
Commit
d88fdd03
authored
Oct 28, 2014
by
ElenaGvozdeva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use LOCAL_SIZE+1
parent
65b8a1cb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
gemm.cl
modules/core/src/opencl/gemm.cl
+7
-5
No files found.
modules/core/src/opencl/gemm.cl
View file @
d88fdd03
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
#
define
IND_B
mad24
(
x,
WTSIZE,
B_offset
)
#
define
IND_B
mad24
(
x,
WTSIZE,
B_offset
)
#
define
STEP_B
B_step
/
WTSIZE
#
define
STEP_B
B_step
/
WTSIZE
#
define
LOCAL_SIZE_ODD
(
LOCAL_SIZE
+
1
)
#
if
cn==2
#
if
cn==2
#
if
kercn==2
#
if
kercn==2
#
define
MUL
(
a,
b
)
\
#
define
MUL
(
a,
b
)
\
...
@@ -65,8 +67,8 @@ __kernel void gemm(__global const uchar * A_ptr, int A_step, int A_offset,
...
@@ -65,8 +67,8 @@ __kernel void gemm(__global const uchar * A_ptr, int A_step, int A_offset,
MUL
(
A[i],
B[i*STEP_B]
)
;
MUL
(
A[i],
B[i*STEP_B]
)
;
#
else
#
else
__local
T
a_local[LOCAL_SIZE*LOCAL_SIZE]
;
__local
T
a_local[LOCAL_SIZE
_ODD
*LOCAL_SIZE]
;
__local
WT
b_local[LOCAL_SIZE*LOCAL_SIZE]
;
__local
WT
b_local[LOCAL_SIZE
_ODD
*LOCAL_SIZE]
;
int
reps
;
int
reps
;
#
if
NO_MULT
#
if
NO_MULT
...
@@ -78,9 +80,9 @@ __kernel void gemm(__global const uchar * A_ptr, int A_step, int A_offset,
...
@@ -78,9 +80,9 @@ __kernel void gemm(__global const uchar * A_ptr, int A_step, int A_offset,
for
(
int
p
=
0
; p < reps; ++p)
for
(
int
p
=
0
; p < reps; ++p)
{
{
if
(
p
*
LOCAL_SIZE
+
lidx
<
n
&&
y
<
D_rows
)
if
(
p
*
LOCAL_SIZE
+
lidx
<
n
&&
y
<
D_rows
)
a_local[mad24
(
lidy,
LOCAL_SIZE,
lidx
)
]
=
A[mad24
(
p,
LOCAL_SIZE,
lidx
)
]
;
a_local[mad24
(
lidy,
LOCAL_SIZE
_ODD
,
lidx
)
]
=
A[mad24
(
p,
LOCAL_SIZE,
lidx
)
]
;
if
(
p
*
LOCAL_SIZE
+
lidy
<
n
&&
x
<
D_cols
)
if
(
p
*
LOCAL_SIZE
+
lidy
<
n
&&
x
<
D_cols
)
b_local[mad24
(
lidy,
LOCAL_SIZE,
lidx
)
]
=
B[mad24
(
p,
LOCAL_SIZE,
lidy
)
*STEP_B]
;
b_local[mad24
(
lidy,
LOCAL_SIZE
_ODD
,
lidx
)
]
=
B[mad24
(
p,
LOCAL_SIZE,
lidy
)
*STEP_B]
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
...
@@ -92,7 +94,7 @@ __kernel void gemm(__global const uchar * A_ptr, int A_step, int A_offset,
...
@@ -92,7 +94,7 @@ __kernel void gemm(__global const uchar * A_ptr, int A_step, int A_offset,
#
else
#
else
for
(
int
i
=
0
; i < LOCAL_SIZE; ++i)
for
(
int
i
=
0
; i < LOCAL_SIZE; ++i)
#
endif
#
endif
MUL
(
a_local[mad24
(
lidy,
LOCAL_SIZE
,
i
)
],
b_local[mad24
(
i,
LOCAL_SIZE
,
lidx
)
]
)
;
MUL
(
a_local[mad24
(
lidy,
LOCAL_SIZE
_ODD,
i
)
],
b_local[mad24
(
i,
LOCAL_SIZE_ODD
,
lidx
)
]
)
;
}
}
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
barrier
(
CLK_LOCAL_MEM_FENCE
)
;
}
}
...
...
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