-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCLomatic #1123] Remove redundant -c flag #405
Open
daiyaan-ahmed6
wants to merge
2
commits into
oneapi-src:SYCLomatic
Choose a base branch
from
daiyaan-ahmed6:redundant_c_flag_fix
base: SYCLomatic
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,10 @@ | ||
all: one two three | ||
|
||
one: one.cu | ||
$(CC) -O2 --use_fast_math -DKERNEL_USE_PROFILE=1 -gencode arch=compute_${USE_SM},code=sm_${USE_SM} -DRUN_ON_GPU=1 one.cu -o one -allow-unsupported-compiler | ||
|
||
two: two.cu | ||
$(CC) -O2 --use_fast_math -DKERNEL_USE_PROFILE=1 -gencode arch=compute_${USE_SM},code=sm_${USE_SM} -DRUN_ON_GPU=1 two.cu | ||
|
||
three: three.cu four.cu | ||
$(CC) -O2 --use_fast_math -DKERNEL_USE_PROFILE=1 -gencode arch=compute_${USE_SM},code=sm_${USE_SM} -DRUN_ON_GPU=1 three.cu four.cu |
22 changes: 22 additions & 0 deletions
22
behavior_tests/src/cmp_cmds_c_opt_test/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,22 @@ | ||
[ | ||
{ | ||
"command": "nvcc -O2 -DKERNEL_USE_PROFILE=1 -DRUN_ON_GPU=1 -o one -allow-unsupported-compiler -D__CUDACC__=1 one.cu", | ||
"directory": "/export/users/dahmed/up/build/tools/clang/test/dpct/compile_commands_c_opt_test/Output/compile_commands_c_opt_test", | ||
"file": "/export/users/dahmed/up/build/tools/clang/test/dpct/compile_commands_c_opt_test/Output/compile_commands_c_opt_test/one.cu" | ||
}, | ||
{ | ||
"command": "nvcc -c -O2 -DKERNEL_USE_PROFILE=1 -DRUN_ON_GPU=1 -D__CUDACC__=1 two.cu", | ||
"directory": "/export/users/dahmed/up/build/tools/clang/test/dpct/compile_commands_c_opt_test/Output/compile_commands_c_opt_test", | ||
"file": "/export/users/dahmed/up/build/tools/clang/test/dpct/compile_commands_c_opt_test/Output/compile_commands_c_opt_test/two.cu" | ||
}, | ||
{ | ||
"command": "nvcc -c -O2 -DKERNEL_USE_PROFILE=1 -DRUN_ON_GPU=1 -D__CUDACC__=1 three.cu", | ||
"directory": "/export/users/dahmed/up/build/tools/clang/test/dpct/compile_commands_c_opt_test/Output/compile_commands_c_opt_test", | ||
"file": "/export/users/dahmed/up/build/tools/clang/test/dpct/compile_commands_c_opt_test/Output/compile_commands_c_opt_test/three.cu" | ||
}, | ||
{ | ||
"command": "nvcc -c -O2 -DKERNEL_USE_PROFILE=1 -DRUN_ON_GPU=1 -D__CUDACC__=1 four.cu", | ||
"directory": "/export/users/dahmed/up/build/tools/clang/test/dpct/compile_commands_c_opt_test/Output/compile_commands_c_opt_test", | ||
"file": "/export/users/dahmed/up/build/tools/clang/test/dpct/compile_commands_c_opt_test/Output/compile_commands_c_opt_test/four.cu" | ||
} | ||
] |
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,49 @@ | ||
# ====------ 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 | ||
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 -f Makefile CC=nvcc USE_SM=70 -B") | ||
new_database = parse_compilation_database("compile_commands.json") | ||
reference_database = parse_compilation_database("compile_commands.json_ref") | ||
new_database = list(set(new_database)) | ||
reference_database = list(set(reference_database)) | ||
new_database.sort() | ||
reference_database.sort() | ||
if(new_database == reference_database): | ||
return True | ||
return False | ||
|
||
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 | ||
__global__ void foo(){ | ||
|
||
} |
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,3 @@ | ||
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 | ||
__global__ void foo(){ | ||
|
||
} |
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 | ||
__global__ void foo(){ | ||
|
||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will '-c' be removed after the PR is merged, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the test case is for PR oneapi-src/SYCLomatic#1123, why it can run passed before PR 1123 is merged..