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
974348d6
Commit
974348d6
authored
Jun 20, 2022
by
carlushuang
Browse files
ignore cpu validation to WA GOMP_CPU_AFFINITY stuck in cpu validation code
parent
f29a5350
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
example/cpu_01_conv2d_fwd/cpu_conv2d_fwd.cpp
example/cpu_01_conv2d_fwd/cpu_conv2d_fwd.cpp
+8
-5
example/cpu_02_conv2d_fwd_bias_relu_add/cpu_conv2d_fwd_bias_relu_add.cpp
...conv2d_fwd_bias_relu_add/cpu_conv2d_fwd_bias_relu_add.cpp
+8
-5
No files found.
example/cpu_01_conv2d_fwd/cpu_conv2d_fwd.cpp
View file @
974348d6
...
@@ -415,6 +415,8 @@ int main(int argc, char* argv[])
...
@@ -415,6 +415,8 @@ int main(int argc, char* argv[])
wei_device_buf
.
ToDevice
(
wei_y_x_c_k
.
mData
.
data
());
wei_device_buf
.
ToDevice
(
wei_y_x_c_k
.
mData
.
data
());
#endif
#endif
// get host result
// get host result
int
cpu_validation
=
ck
::
getenv_int
(
"CK_CPU_VALIDATION"
,
1
);
if
(
cpu_validation
)
{
{
auto
ref_conv
=
ReferenceConvFwdInstance
{};
auto
ref_conv
=
ReferenceConvFwdInstance
{};
auto
ref_invoker
=
ref_conv
.
MakeInvoker
();
auto
ref_invoker
=
ref_conv
.
MakeInvoker
();
...
@@ -610,7 +612,7 @@ int main(int argc, char* argv[])
...
@@ -610,7 +612,7 @@ int main(int argc, char* argv[])
out_device_buf
.
FromDevice
(
out_n_k_ho_wo_device_result
.
mData
.
data
());
out_device_buf
.
FromDevice
(
out_n_k_ho_wo_device_result
.
mData
.
data
());
if
(
!
check_out
(
out_n_k_ho_wo_host_result
,
if
(
cpu_validation
&&
!
check_out
(
out_n_k_ho_wo_host_result
,
out_n_k_ho_wo_device_result
,
out_n_k_ho_wo_device_result
,
1e-6
,
1e-6
,
per_pixel_check
))
per_pixel_check
))
...
@@ -620,7 +622,8 @@ int main(int argc, char* argv[])
...
@@ -620,7 +622,8 @@ int main(int argc, char* argv[])
}
}
else
else
{
{
std
::
cout
<<
"Pass Info: "
<<
conv_ptr
->
GetTypeString
()
<<
", Time:"
<<
time
std
::
cout
<<
(
cpu_validation
?
"Pass"
:
"Ignore"
)
<<
" Info: "
<<
conv_ptr
->
GetTypeString
()
<<
", Time:"
<<
time
<<
"ms, Gflops:"
<<
gflops
<<
std
::
endl
;
<<
"ms, Gflops:"
<<
gflops
<<
std
::
endl
;
if
(
time
<
fastest_kernel_time
)
if
(
time
<
fastest_kernel_time
)
...
...
example/cpu_02_conv2d_fwd_bias_relu_add/cpu_conv2d_fwd_bias_relu_add.cpp
View file @
974348d6
...
@@ -452,6 +452,8 @@ int main(int argc, char* argv[])
...
@@ -452,6 +452,8 @@ int main(int argc, char* argv[])
resi_device_buf
.
ToDevice
(
residual
.
mData
.
data
());
resi_device_buf
.
ToDevice
(
residual
.
mData
.
data
());
// get host result
// get host result
int
cpu_validation
=
ck
::
getenv_int
(
"CK_CPU_VALIDATION"
,
1
);
if
(
cpu_validation
)
{
{
auto
ref_conv
=
ReferenceConvFwdInstance
{};
auto
ref_conv
=
ReferenceConvFwdInstance
{};
auto
ref_invoker
=
ref_conv
.
MakeInvoker
();
auto
ref_invoker
=
ref_conv
.
MakeInvoker
();
...
@@ -748,7 +750,7 @@ int main(int argc, char* argv[])
...
@@ -748,7 +750,7 @@ int main(int argc, char* argv[])
out_device_buf
.
FromDevice
(
out_n_k_ho_wo_device_result
.
mData
.
data
());
out_device_buf
.
FromDevice
(
out_n_k_ho_wo_device_result
.
mData
.
data
());
if
(
!
check_out
(
out_n_k_ho_wo_host_result
,
if
(
cpu_validation
&&
!
check_out
(
out_n_k_ho_wo_host_result
,
out_n_k_ho_wo_device_result
,
out_n_k_ho_wo_device_result
,
1e-6
,
1e-6
,
per_pixel_check
))
per_pixel_check
))
...
@@ -758,7 +760,8 @@ int main(int argc, char* argv[])
...
@@ -758,7 +760,8 @@ int main(int argc, char* argv[])
}
}
else
else
{
{
std
::
cout
<<
"Pass Info: "
<<
conv_ptr
->
GetTypeString
()
<<
", Time:"
<<
time
std
::
cout
<<
(
cpu_validation
?
"Pass"
:
"Ignore"
)
<<
" Info: "
<<
conv_ptr
->
GetTypeString
()
<<
", Time:"
<<
time
<<
"ms, Gflops:"
<<
gflops
<<
std
::
endl
;
<<
"ms, Gflops:"
<<
gflops
<<
std
::
endl
;
if
(
time
<
fastest_kernel_time
)
if
(
time
<
fastest_kernel_time
)
...
...
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