-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'SYCLomatic' into enable_back
- Loading branch information
Showing
25 changed files
with
1,447 additions
and
13 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
11 changes: 11 additions & 0 deletions
11
behavior_tests/config/TEMPLATE_behavior_tests_after_11.5.xml
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_behavior" name="TEMPLATE"> | ||
<description>test</description> | ||
<files> | ||
<file path="src/${testName}" /> | ||
</files> | ||
<rules> | ||
<platformRule OSFamily="Windows" kit="CUDA11.6" kitRange="OLDER" runOnThisPlatform="false"/> | ||
</rules> | ||
</test> |
51 changes: 51 additions & 0 deletions
51
behavior_tests/src/cmp-cmds-linker-entry-src-files/Makefile
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,51 @@ | ||
#=============================================================================== | ||
# User Options | ||
#=============================================================================== | ||
|
||
# Compiler can be set below, or via environment variable | ||
CC = nvcc | ||
OPTIMIZE = yes | ||
DEBUG = no | ||
ARCH = sm_60 | ||
|
||
#=============================================================================== | ||
# Program name & source code list | ||
#=============================================================================== | ||
|
||
program = main | ||
|
||
#=============================================================================== | ||
# Sets Flags | ||
#=============================================================================== | ||
|
||
# Standard Flags | ||
CFLAGS := $(EXTRA_CFLAGS) -std=c++14 -Xcompiler -Wall -arch=$(ARCH) | ||
|
||
# Linker Flags | ||
LDFLAGS = | ||
|
||
# Debug Flags | ||
ifeq ($(DEBUG),yes) | ||
CFLAGS += -g -DDEBUG | ||
LDFLAGS += -g | ||
endif | ||
|
||
# Optimization Flags | ||
ifeq ($(OPTIMIZE),yes) | ||
CFLAGS += -O3 | ||
endif | ||
#=============================================================================== | ||
# Targets to Build | ||
#=============================================================================== | ||
|
||
$(program): one.o two.o three.c four.c | ||
$(CC) $(CFLAGS) one.o two.o three.c four.c -o $@ $(LDFLAGS) | ||
|
||
%.o: %.cu | ||
$(CC) $(CFLAGS) -c $< -o $@ | ||
|
||
clean: | ||
rm -rf $(program) *.o *.bmp *.bin | ||
|
||
run: $(program) | ||
./$(program) |
26 changes: 26 additions & 0 deletions
26
behavior_tests/src/cmp-cmds-linker-entry-src-files/compile_commands.json_ref
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,26 @@ | ||
[ | ||
{ | ||
"command": "nvcc -c -std=c++14 -Wall --cuda-gpu-arch=sm_60 -O3 -o one.o -D__CUDACC__=1 one.cu", | ||
"directory": "${TEST_DIRECTORY}", | ||
"file": "${TEST_DIRECTORY}/one.cu" | ||
}, | ||
{ | ||
"command": "nvcc -c -std=c++14 -Wall --cuda-gpu-arch=sm_60 -O3 -o two.o -D__CUDACC__=1 two.cu", | ||
"directory": "${TEST_DIRECTORY}", | ||
"file": "${TEST_DIRECTORY}/two.cu" | ||
}, | ||
{ | ||
"command": "nvcc -c -std=c++14 -Wall --cuda-gpu-arch=sm_60 -O3 -D__CUDACC__=1 -o four.o four.c", | ||
"directory": "${TEST_DIRECTORY}", | ||
"file": "${TEST_DIRECTORY}/four.c" | ||
}, | ||
{ | ||
"command": "nvcc -c -std=c++14 -Wall --cuda-gpu-arch=sm_60 -O3 -D__CUDACC__=1 -o three.o three.c", | ||
"directory": "${TEST_DIRECTORY}", | ||
"file": "${TEST_DIRECTORY}/three.c" | ||
}, | ||
{ | ||
"command": "nvcc -std=c++14 -Wall --cuda-gpu-arch=sm_60 -O3 one.o two.o -o main -D__CUDACC__=1 four.o three.o", | ||
"directory": "${TEST_DIRECTORY}" | ||
} | ||
] |
59 changes: 59 additions & 0 deletions
59
behavior_tests/src/cmp-cmds-linker-entry-src-files/do_test.py
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,59 @@ | ||
# ====------ 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 filecmp | ||
import subprocess | ||
import platform | ||
import os | ||
import sys | ||
import json | ||
|
||
from test_utils import * | ||
|
||
|
||
def setup_test(): | ||
change_dir(test_config.current_test) | ||
return True | ||
|
||
|
||
def parse_compilation_database(compilation_database_name): | ||
if (not os.path.isfile(compilation_database_name)): | ||
print("The compilation database is not existed, please double check\n") | ||
|
||
with open(compilation_database_name) as compilation_database: | ||
compilation_database_items = json.load(compilation_database) | ||
database_source_files = [] | ||
for entry in compilation_database_items: | ||
compilation_item = entry['file'] | ||
database_source_files.append(os.path.basename(compilation_item)) | ||
return database_source_files | ||
|
||
|
||
def migrate_test(): | ||
call_subprocess("intercept-build make") | ||
test_dir = os.path.join(os.getcwd()) | ||
ref_cmp_db_file = open(test_dir+"/compile_commands.json_ref", "rt") | ||
cmp_cmds = ref_cmp_db_file.read() | ||
cmp_cmds = cmp_cmds.replace('${TEST_DIRECTORY}', test_dir) | ||
ref_cmp_db_file.close() | ||
ref_cmp_db_file = open(test_dir+"/compile_commands.json_ref", "wt") | ||
ref_cmp_db_file.write(cmp_cmds) | ||
ref_cmp_db_file.close() | ||
|
||
result = filecmp.cmp(test_dir+"/compile_commands.json", | ||
test_dir+"/compile_commands.json_ref", shallow=False) | ||
|
||
return result | ||
|
||
|
||
def build_test(): | ||
return True | ||
|
||
|
||
def run_test(): | ||
return True |
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,4 @@ | ||
// RUN: echo 0 | ||
void foo4(){ | ||
|
||
} |
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,6 @@ | ||
#include <iostream> | ||
|
||
int main() { | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// RUN: echo 0 | ||
void foo3(){ | ||
|
||
} |
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,4 @@ | ||
// RUN: echo 0 | ||
__global__ void foo2(){ | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<test driverID="test_feature" name="TEMPLATE"> | ||
<description>test</description> | ||
<files> | ||
<file path="feature_case/driverArray/driverArray.cu" /> | ||
</files> | ||
</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,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<test driverID="test_feature" name="TEMPLATE"> | ||
<description>test</description> | ||
<files> | ||
<file path="feature_case/driverMemset/driverMemset.cu" /> | ||
</files> | ||
</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,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<test driverID="test_feature" name="TEMPLATE"> | ||
<description>test</description> | ||
<files> | ||
<file path="feature_case/match/${testName}.cu" /> | ||
</files> | ||
<rules> | ||
<platformRule OSFamily="Linux" kit="CUDA9.2" kitRange="OLDER" runOnThisPlatform="false"/> | ||
<platformRule OSFamily="Windows" kit="CUDA9.2" kitRange="OLDER" runOnThisPlatform="false"/> | ||
</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,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<test driverID="test_feature" name="TEMPLATE"> | ||
<description>test</description> | ||
<files> | ||
<file path="feature_case/thrust/${testName}.cu" /> | ||
</files> | ||
<rules> | ||
<platformRule OSFamily="Linux" kit="CUDA10.0" kitRange="OLDER" runOnThisPlatform="false"/> | ||
<platformRule OSFamily="Windows" kit="CUDA10.0" kitRange="OLDER" runOnThisPlatform="false"/> | ||
<optlevelRule excludeOptlevelNameString="cuda_backend" /> | ||
</rules> | ||
</test> |
Oops, something went wrong.