forked from oneapi-src/SYCLomatic-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCLomatic oneapi-src#510] Avoid multiple func def if DNN header is …
…included in multiple files (oneapi-src#202) Signed-off-by: Lu, John <[email protected]>
- Loading branch information
Showing
5 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<test driverID="test_feature" name="TEMPLATE"> | ||
<description>test</description> | ||
<files> | ||
<file path="feature_case/dnn/cudnn-scale.cu" /> | ||
<file path="feature_case/dnn/cudnn-sum.cu" /> | ||
<file path="feature_case/cudnn_multiple_files" /> | ||
</files> | ||
<rules /> | ||
</test> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# ====------ do_test.py---------- *- Python -* ----===## | ||
# | ||
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
# See https://llvm.org/LICENSE.txt for license information. | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# | ||
# | ||
# ===----------------------------------------------------------------------===# | ||
import subprocess | ||
import platform | ||
import os | ||
import sys | ||
from test_config import CT_TOOL | ||
|
||
from test_utils import * | ||
|
||
def setup_test(): | ||
change_dir(test_config.current_test) | ||
return True | ||
|
||
def migrate_test(): | ||
# clean previous migration output | ||
if (os.path.exists("dpct_output")): | ||
shutil.rmtree("dpct_output") | ||
|
||
call_subprocess("sed 's/main/scale_main/' cudnn-scale.cu --in-place") | ||
call_subprocess("sed 's/main/sum_main/' cudnn-sum.cu --in-place") | ||
call_subprocess(test_config.CT_TOOL + " --cuda-include-path=" + test_config.include_path + " multiple_main.cpp cudnn-scale.cu cudnn-sum.cu") | ||
return os.path.exists(os.path.join("dpct_output", "cudnn-scale.dp.cpp")) | ||
|
||
def build_test(): | ||
srcs = [] | ||
objects = [] | ||
if platform.system() == 'Linux': | ||
linkopt = ["-ldnnl"] | ||
else: | ||
linkopt = ["dnnl.lib"] | ||
|
||
srcs.append(os.path.join("dpct_output", "multiple_main.cpp")) | ||
srcs.append(os.path.join("dpct_output", "cudnn-scale.dp.cpp")) | ||
srcs.append(os.path.join("dpct_output", "cudnn-sum.dp.cpp")) | ||
return compile_and_link(srcs,objects,linkopt) | ||
|
||
def run_test(): | ||
return call_subprocess(os.path.join(os.path.curdir, test_config.current_test + '.run ')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
int scale_main(); | ||
int sum_main(); | ||
|
||
int main() { | ||
if (scale_main()) return 1; | ||
if (sum_main()) return 1; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters