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_ROCM
Commits
4fec5ad3
Commit
4fec5ad3
authored
Oct 28, 2022
by
aska-0096
Browse files
Merge branch 'develop' of
https://github.com/ROCmSoftwarePlatform/composable_kernel
into wmma_op
parents
24faa1fc
87fd1152
Changes
282
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
14 deletions
+70
-14
test/normalization/test_groupnorm_fp32.cpp
test/normalization/test_groupnorm_fp32.cpp
+0
-7
test/space_filling_curve/space_filling_curve.cpp
test/space_filling_curve/space_filling_curve.cpp
+70
-7
No files found.
test/normalization/test_groupnorm_fp32.cpp
View file @
4fec5ad3
...
...
@@ -43,13 +43,6 @@ class TestGroupnorm : public ::testing::Test
using
KernelTypes
=
::
testing
::
Types
<
// XDataType, GammaDataType, BetaDataType, AccDataType, YDataType>
std
::
tuple
<
F32
,
F32
,
F32
,
F32
,
F32
>
,
std
::
tuple
<
F32
,
F32
,
F32
,
F32
,
F32
>
,
std
::
tuple
<
F32
,
F32
,
F32
,
F32
,
F32
>
,
std
::
tuple
<
F32
,
F32
,
F32
,
F32
,
F32
>
,
std
::
tuple
<
F32
,
F32
,
F32
,
F32
,
F32
>
,
std
::
tuple
<
F32
,
F32
,
F32
,
F32
,
F32
>
,
std
::
tuple
<
F32
,
F32
,
F32
,
F32
,
F32
>
,
std
::
tuple
<
F32
,
F32
,
F32
,
F32
,
F32
>>
;
TYPED_TEST_SUITE
(
TestGroupnorm
,
KernelTypes
);
...
...
test/space_filling_curve/space_filling_curve.cpp
View file @
4fec5ad3
...
...
@@ -12,28 +12,91 @@
using
namespace
ck
;
void
traverse_using_space_filling_curve
();
void
traverse_using_space_filling_curve_linear
();
void
traverse_using_space_filling_curve_snakecurved
();
int
main
(
int
argc
,
char
**
argv
)
{
(
void
)
argc
;
(
void
)
argv
;
traverse_using_space_filling_curve
();
traverse_using_space_filling_curve_linear
();
traverse_using_space_filling_curve_snakecurved
();
return
0
;
}
void
traverse_using_space_filling_curve
()
void
traverse_using_space_filling_curve
_linear
()
{
constexpr
auto
I0
=
Number
<
0
>
{};
constexpr
auto
I1
=
Number
<
1
>
{};
constexpr
auto
I2
=
Number
<
2
>
{};
using
TensorLengths
=
Sequence
<
16
,
10
,
9
>
;
using
DimAccessOrder
=
Sequence
<
2
,
0
,
1
>
;
using
ScalarsPerAccess
=
Sequence
<
4
,
2
,
3
>
;
using
SpaceFillingCurve
=
SpaceFillingCurve
<
TensorLengths
,
DimAccessOrder
,
ScalarsPerAccess
>
;
using
TensorLengths
=
Sequence
<
3
,
2
,
2
>
;
using
DimAccessOrder
=
Sequence
<
2
,
0
,
1
>
;
using
ScalarsPerAccess
=
Sequence
<
1
,
1
,
1
>
;
using
SpaceFillingCurve
=
SpaceFillingCurve
<
TensorLengths
,
DimAccessOrder
,
ScalarsPerAccess
,
false
>
;
constexpr
auto
expected
=
make_tuple
(
make_tuple
(
0
,
0
,
0
),
make_tuple
(
0
,
1
,
0
),
make_tuple
(
1
,
0
,
0
),
make_tuple
(
1
,
1
,
0
),
make_tuple
(
2
,
0
,
0
),
make_tuple
(
2
,
1
,
0
),
make_tuple
(
0
,
0
,
1
),
make_tuple
(
0
,
1
,
1
),
make_tuple
(
1
,
0
,
1
),
make_tuple
(
1
,
1
,
1
),
make_tuple
(
2
,
0
,
1
),
make_tuple
(
2
,
1
,
1
));
constexpr
index_t
num_access
=
SpaceFillingCurve
::
GetNumOfAccess
();
static_assert
(
num_access
==
reduce_on_sequence
(
TensorLengths
{}
/
ScalarsPerAccess
{},
math
::
multiplies
{},
Number
<
1
>
{}));
static_for
<
1
,
num_access
,
1
>
{}([
&
](
auto
i
)
{
constexpr
auto
idx_curr
=
SpaceFillingCurve
::
GetIndex
(
i
);
static_assert
(
idx_curr
[
I0
]
==
expected
[
i
][
I0
]);
static_assert
(
idx_curr
[
I1
]
==
expected
[
i
][
I1
]);
static_assert
(
idx_curr
[
I2
]
==
expected
[
i
][
I2
]);
constexpr
auto
backward_step
=
SpaceFillingCurve
::
GetBackwardStep
(
i
);
constexpr
auto
expected_step
=
expected
[
i
-
I1
]
-
expected
[
i
];
static_assert
(
backward_step
[
I0
]
==
expected_step
[
I0
]);
static_assert
(
backward_step
[
I1
]
==
expected_step
[
I1
]);
static_assert
(
backward_step
[
I2
]
==
expected_step
[
I2
]);
});
static_for
<
0
,
num_access
-
1
,
1
>
{}([
&
](
auto
i
)
{
constexpr
auto
idx_curr
=
SpaceFillingCurve
::
GetIndex
(
i
);
static_assert
(
idx_curr
[
I0
]
==
expected
[
i
][
I0
]);
static_assert
(
idx_curr
[
I1
]
==
expected
[
i
][
I1
]);
static_assert
(
idx_curr
[
I2
]
==
expected
[
i
][
I2
]);
constexpr
auto
forward_step
=
SpaceFillingCurve
::
GetForwardStep
(
i
);
constexpr
auto
expected_step
=
expected
[
i
+
I1
]
-
expected
[
i
];
static_assert
(
forward_step
[
I0
]
==
expected_step
[
I0
]);
static_assert
(
forward_step
[
I1
]
==
expected_step
[
I1
]);
static_assert
(
forward_step
[
I2
]
==
expected_step
[
I2
]);
});
}
void
traverse_using_space_filling_curve_snakecurved
()
{
constexpr
auto
I0
=
Number
<
0
>
{};
constexpr
auto
I1
=
Number
<
1
>
{};
constexpr
auto
I2
=
Number
<
2
>
{};
using
TensorLengths
=
Sequence
<
16
,
10
,
9
>
;
using
DimAccessOrder
=
Sequence
<
2
,
0
,
1
>
;
using
ScalarsPerAccess
=
Sequence
<
4
,
2
,
3
>
;
using
SpaceFillingCurve
=
SpaceFillingCurve
<
TensorLengths
,
DimAccessOrder
,
ScalarsPerAccess
,
true
>
;
constexpr
auto
expected
=
make_tuple
(
make_tuple
(
0
,
0
,
0
),
make_tuple
(
0
,
2
,
0
),
...
...
Prev
1
…
11
12
13
14
15
Next
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