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
fd87d533
"vscode:/vscode.git/clone" did not exist on "bfe4aa2af51040d0050ed57c81b98cf030ce071e"
Commit
fd87d533
authored
Sep 06, 2023
by
Astha Rai
Browse files
added example file to check kernel
parent
1c02848d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
example/44_elementwise_permute/CMakeLists.txt
example/44_elementwise_permute/CMakeLists.txt
+1
-0
example/44_elementwise_permute/elementwise_permute_4D_fp16_2d.cpp
...44_elementwise_permute/elementwise_permute_4D_fp16_2d.cpp
+5
-4
No files found.
example/44_elementwise_permute/CMakeLists.txt
View file @
fd87d533
...
@@ -3,4 +3,5 @@ if(DTYPES MATCHES "fp16" OR NOT DEFINED DTYPES)
...
@@ -3,4 +3,5 @@ if(DTYPES MATCHES "fp16" OR NOT DEFINED DTYPES)
add_example_executable
(
example_elementwise_permute_4D_fp16_2d elementwise_permute_4D_fp16_2d.cpp
)
add_example_executable
(
example_elementwise_permute_4D_fp16_2d elementwise_permute_4D_fp16_2d.cpp
)
add_example_executable
(
example_elementwise_permute_5D elementwise_permute_5D.cpp
)
add_example_executable
(
example_elementwise_permute_5D elementwise_permute_5D.cpp
)
add_example_executable
(
example_elementwise_permute_5D_2d elementwise_permute_5D_2d.cpp
)
add_example_executable
(
example_elementwise_permute_5D_2d elementwise_permute_5D_2d.cpp
)
add_example_executable
(
example_elementwise_permute_5D_3d elementwise_permute_5D_3d.cpp
)
endif
()
endif
()
example/44_elementwise_permute/elementwise_permute_4D_fp16_2d.cpp
View file @
fd87d533
...
@@ -54,8 +54,8 @@ int main()
...
@@ -54,8 +54,8 @@ int main()
//const int W = 1024;
//const int W = 1024;
const
int
N
=
16
;
const
int
N
=
16
;
const
int
C
=
8
;
const
int
C
=
8
;
const
int
H
=
8
;
const
int
H
=
32
;
const
int
W
=
8
;
const
int
W
=
64
;
/**const int N = 120;
/**const int N = 120;
const int H = 32;
const int H = 32;
const int W = 64;
const int W = 64;
...
@@ -110,13 +110,13 @@ int main()
...
@@ -110,13 +110,13 @@ int main()
float
gb_per_sec
=
num_btype
/
1.E6
/
ave_time
;
float
gb_per_sec
=
num_btype
/
1.E6
/
ave_time
;
LogRangeAsType
<
float
>
(
std
::
cout
<<
"A : "
,
a
.
mData
,
","
)
<<
std
::
endl
;
//LogRangeAsType<float>(std::cout << "A : ", a.mData, ",") << std::endl;
//LogRangeAsType<float>(std::cout << "B : ", b.mData, ",") << std::endl;
std
::
cout
<<
"Perf: "
<<
ave_time
<<
" ms, "
<<
tflops
<<
" TFlops, "
<<
gb_per_sec
<<
" GB/s"
std
::
cout
<<
"Perf: "
<<
ave_time
<<
" ms, "
<<
tflops
<<
" TFlops, "
<<
gb_per_sec
<<
" GB/s"
<<
std
::
endl
;
<<
std
::
endl
;
bool
pass
=
true
;
bool
pass
=
true
;
//LogRangeAsType<float>(std::cout << "B : ", b.mData, ",") << std::endl;
if
(
do_verification
)
if
(
do_verification
)
{
{
b_device_buf
.
FromDevice
(
b
.
mData
.
data
());
b_device_buf
.
FromDevice
(
b
.
mData
.
data
());
...
@@ -127,6 +127,7 @@ int main()
...
@@ -127,6 +127,7 @@ int main()
host_b
,
a
,
nchw
,
PassThrough
{});
host_b
,
a
,
nchw
,
PassThrough
{});
//LogRangeAsType<float>(std::cout << "Host_b : ", host_b.mData, ",") << std::endl;
//LogRangeAsType<float>(std::cout << "Host_b : ", host_b.mData, ",") << std::endl;
LogRangeAsType
<
float
>
(
std
::
cout
<<
"B : "
,
b
.
mData
,
","
)
<<
std
::
endl
;
// LogRangeAsType<float>(std::cout << "Host b : ", host_b.mData, ",") << std::endl;
// LogRangeAsType<float>(std::cout << "Host b : ", host_b.mData, ",") << std::endl;
pass
&=
pass
&=
ck
::
utils
::
check_err
(
b
.
mData
,
host_b
.
mData
,
"Error: Incorrect results b"
,
1e-3
,
1e-3
);
ck
::
utils
::
check_err
(
b
.
mData
,
host_b
.
mData
,
"Error: Incorrect results b"
,
1e-3
,
1e-3
);
...
...
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