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
gaoqiong
composable_kernel
Commits
bcbe69aa
Commit
bcbe69aa
authored
Sep 07, 2023
by
Jing Zhang
Browse files
fixed convert
parent
5e98fc5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
example/42_groupnorm/groupnorm_sigmoid_mul_fp16.cpp
example/42_groupnorm/groupnorm_sigmoid_mul_fp16.cpp
+5
-5
include/ck/tensor_operation/gpu/element/unary_element_wise_operation.hpp
...or_operation/gpu/element/unary_element_wise_operation.hpp
+6
-0
No files found.
example/42_groupnorm/groupnorm_sigmoid_mul_fp16.cpp
View file @
bcbe69aa
...
@@ -14,14 +14,14 @@ using ComputeDataType = float;
...
@@ -14,14 +14,14 @@ using ComputeDataType = float;
struct
YElementOp
struct
YElementOp
{
{
template
<
typename
T
>
template
<
typename
Y
,
typename
X
>
__host__
__device__
void
operator
()(
T
&
y
,
const
T
&
x
)
const
__host__
__device__
void
operator
()(
Y
&
y
,
const
X
&
x
)
const
{
{
static_assert
(
ck
::
is_same
<
T
,
float
>::
value
||
ck
::
is_same
<
T
,
double
>::
value
||
static_assert
(
ck
::
is_same
<
X
,
float
>::
value
||
ck
::
is_same
<
X
,
double
>::
value
||
ck
::
is_same
<
T
,
ck
::
half_t
>::
value
,
ck
::
is_same
<
X
,
ck
::
half_t
>::
value
,
"Data type is not supported by this operation!"
);
"Data type is not supported by this operation!"
);
T
a
;
X
a
;
ck
::
tensor_operation
::
element_wise
::
Sigmoid
{}(
a
,
x
);
ck
::
tensor_operation
::
element_wise
::
Sigmoid
{}(
a
,
x
);
...
...
include/ck/tensor_operation/gpu/element/unary_element_wise_operation.hpp
View file @
bcbe69aa
...
@@ -87,6 +87,12 @@ struct PassThrough
...
@@ -87,6 +87,12 @@ struct PassThrough
y
=
type_convert
<
int8_t
>
(
x
);
y
=
type_convert
<
int8_t
>
(
x
);
}
}
template
<
>
__host__
__device__
void
operator
()
<
int8_t
,
float
>
(
int8_t
&
y
,
const
float
&
x
)
const
{
y
=
type_convert
<
int8_t
>
(
x
);
}
#ifdef CK_EXPERIMENTAL_BIT_INT_EXTENSION_INT4
#ifdef CK_EXPERIMENTAL_BIT_INT_EXTENSION_INT4
template
<
>
template
<
>
__host__
__device__
void
operator
()
<
int4_t
,
int4_t
>
(
int4_t
&
y
,
const
int4_t
&
x
)
const
__host__
__device__
void
operator
()
<
int4_t
,
int4_t
>
(
int4_t
&
y
,
const
int4_t
&
x
)
const
...
...
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