Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
FastMoE
Commits
03b78901
Commit
03b78901
authored
Apr 27, 2021
by
TiagoMAntunes
Browse files
Fixed incorrect shared memory type in column reduce kernel
parent
3d1987d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
cuda/moe_compute_kernel.cu
cuda/moe_compute_kernel.cu
+6
-1
No files found.
cuda/moe_compute_kernel.cu
View file @
03b78901
...
@@ -45,7 +45,12 @@ template <typename scalar_t>
...
@@ -45,7 +45,12 @@ template <typename scalar_t>
__global__
__global__
void
column_reduce
(
const
scalar_t
*
matrix
,
scalar_t
*
result
,
void
column_reduce
(
const
scalar_t
*
matrix
,
scalar_t
*
result
,
int
m
/* lines */
,
int
n
/* columns*/
)
{
int
m
/* lines */
,
int
n
/* columns*/
)
{
extern
__shared__
float
sdata
[];
// https://stackoverflow.com/questions/27570552/templated-cuda-kernel-with-dynamic-shared-memory
extern
__shared__
__align__
(
sizeof
(
scalar_t
))
unsigned
char
my_smem
[];
scalar_t
*
sdata
=
reinterpret_cast
<
scalar_t
*>
(
my_smem
);
unsigned
int
tid
=
threadIdx
.
x
+
threadIdx
.
y
*
blockDim
.
x
;
// line
unsigned
int
tid
=
threadIdx
.
x
+
threadIdx
.
y
*
blockDim
.
x
;
// line
unsigned
int
i
=
threadIdx
.
x
*
n
+
threadIdx
.
y
+
blockIdx
.
y
*
blockDim
.
y
;
// get to idx th line
unsigned
int
i
=
threadIdx
.
x
*
n
+
threadIdx
.
y
+
blockIdx
.
y
*
blockDim
.
y
;
// get to idx th line
unsigned
int
offset
=
0
;
unsigned
int
offset
=
0
;
...
...
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