Commit 974348d6 authored by carlushuang's avatar carlushuang
Browse files

ignore cpu validation to WA GOMP_CPU_AFFINITY stuck in cpu validation code

parent f29a5350
...@@ -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)
......
...@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment