runtime/onednn: Check onednn file exist

Previously, the status return with 0 even though the file
required was not exist.
Fixed the file exist checking for onednn source file required
for compilation testing.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
This commit is contained in:
Yeoh Ee Peng 2020-04-28 10:58:49 +08:00 committed by Anuj Mittal
parent b6175f453d
commit 89dc2a5ea2

View File

@ -13,9 +13,9 @@ class MkldnnTest(object):
mkldnn_src_test_filename = 'api.c'
mkldnn_src_test_file = ''
(status, output) = self.target.run('cd %s; find -name %s' % (mkldnn_src_dir, mkldnn_src_test_filename))
if status:
return status, output
(__, output) = self.target.run('cd %s; find -name %s' % (mkldnn_src_dir, mkldnn_src_test_filename))
if 'No such file or directory' in output:
return -1, output
mkldnn_src_test_file = os.path.join(mkldnn_src_dir, output)
(status, output) = self.target.run('gcc %s -o /tmp/%s -ldnnl' % (mkldnn_src_test_file, self.mkldnn_target_test_filename))