Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sycl' into sycl-graph-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Bensuo committed Jun 19, 2023
2 parents 850acc6 + 83f8779 commit c13ee53
Show file tree
Hide file tree
Showing 247 changed files with 12,377 additions and 8,963 deletions.
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ sycl/ @intel/llvm-reviewers-runtime
# Documentation
sycl/ReleaseNotes.md @intel/dpcpp-doc-reviewers @tfzhu
sycl/doc/ @intel/dpcpp-doc-reviewers
sycl/doc/design/ @intel/dpcpp-specification-reviewers
sycl/doc/design/ @intel/llvm-reviewers-runtime
sycl/doc/design/spirv-extensions/ @intel/dpcpp-spirv-doc-reviewers
sycl/doc/extensions/ @intel/dpcpp-specification-reviewers

Expand All @@ -44,7 +44,7 @@ sycl/plugins/unified_runtime/ @intel/dpcpp-l0-pi-reviewers
sycl/plugins/esimd_emulator/ @intel/dpcpp-esimd-reviewers

# CUDA plugin
sycl/plugins/cuda/ @intel/llvm-reviewers-cuda
sycl/plugins/**/cuda/ @intel/llvm-reviewers-cuda

# XPTI instrumentation utilities
xpti/ @intel/llvm-reviewers-runtime
Expand Down Expand Up @@ -74,7 +74,7 @@ clang/tools/clang-offload-*/ @intel/dpcpp-tools-reviewers
ESIMD/ @intel/dpcpp-esimd-reviewers
esimd/ @intel/dpcpp-esimd-reviewers
sycl/include/sycl/ext/intel/esimd.hpp @intel/dpcpp-esimd-reviewers
sycl/doc/extensions/experimental/sycl_ext_intel_esimd/ @intel/dpcpp-esimd-reviewers
sycl/doc/extensions/**/sycl_ext_intel_esimd/ @intel/dpcpp-esimd-reviewers
llvm/lib/SYCLLowerIR/CMakeLists.txt @intel/dpcpp-tools-reviewers @intel/dpcpp-esimd-reviewers

# invoke_simd
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Start/Stop AWS instance

on:
workflow_call:
inputs:
mode:
description: "Mode of operation: start or stop"
type: string
required: true

runs-on-list:
# See devops/actions/aws-ec2/action.yml for more details.
description: "JSON string with array of objects with aws-type, runs-on, aws-ami, aws-spot, aws-disk, aws-timebomb, one-job properties"
type: string
required: true

jobs:
aws:
runs-on: ubuntu-20.04
environment: aws
steps:
- name: Setup script
run: |
mkdir -p ./aws-ec2
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/action.yml -P ./aws-ec2
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/aws-ec2.js -P ./aws-ec2
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/package.json -P ./aws-ec2
npm install ./aws-ec2
- name: Start AWS EC2 runners
uses: ./aws-ec2
with:
mode: ${{ inputs.mode }}
runs-on-list: ${{ inputs.runs-on-list }}
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
45 changes: 10 additions & 35 deletions .github/workflows/sycl_linux_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,23 +183,11 @@ jobs:
name: Start AWS
needs: build
if: ${{ inputs.lts_aws_matrix != '[]' }}
runs-on: ubuntu-20.04
environment: aws
steps:
- name: Setup script
run: |
mkdir -p ./aws-ec2
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/action.yml -P ./aws-ec2
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/aws-ec2.js -P ./aws-ec2
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/package.json -P ./aws-ec2
npm install ./aws-ec2
- name: Start AWS EC2 runners
uses: ./aws-ec2
with:
runs-on-list: ${{ inputs.lts_aws_matrix }}
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
uses: ./.github/workflows/aws.yml
secrets: inherit
with:
mode: start
runs-on-list: ${{ inputs.lts_aws_matrix }}

e2e-tests:
needs: [build, aws-start]
Expand Down Expand Up @@ -301,21 +289,8 @@ jobs:
# Always attempt to shutdown AWS instance, even if AWS start was not
# successful.
if: ${{ always() && inputs.lts_aws_matrix != '[]' }}
runs-on: ubuntu-20.04
environment: aws
steps:
- name: Setup script
run: |
mkdir -p ./aws-ec2
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/action.yml -P ./aws-ec2
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/aws-ec2.js -P ./aws-ec2
wget raw.githubusercontent.com/intel/llvm/sycl/devops/actions/aws-ec2/package.json -P ./aws-ec2
npm install ./aws-ec2
- name: Stop AWS EC2 runners
uses: ./aws-ec2
with:
runs-on-list: ${{ inputs.lts_aws_matrix }}
mode: stop
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
uses: ./.github/workflows/aws.yml
secrets: inherit
with:
mode: stop
runs-on-list: ${{ inputs.lts_aws_matrix }}
2 changes: 1 addition & 1 deletion .github/workflows/sycl_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
build_cache_root: "/__w/"
build_artifact_suffix: default-2204
build_configure_extra_args: ''
build_configure_extra_args: '--hip --cuda --enable-esimd-emulator'

ubuntu2204_opaque_pointers_build_test:
if: github.repository == 'intel/llvm'
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/sycl_post_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@ on:
push:
branches:
- sycl
pull_request:
branches:
- sycl
paths:
- .github/workflows/sycl_post_commit.yml
- .github/workflows/sycl_gen_test_matrix.yml
- .github/workflows/sycl_linux_build_and_test.yml
- .github/workflows/sycl_windows_build_and_test.yml
- .github/workflows/sycl_macos_build_and_test.yml
workflow_dispatch:
- test-devops-pr/**

jobs:
# This job generates matrix of tests for SYCL End-to-End tests
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/sycl_precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,29 @@ jobs:
uses: ./.github/workflows/sycl_detect_changes.yml

lint:
runs-on: ubuntu-22.04
runs-on: cuda
container:
image: ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:no-drivers
# actions/checkout fails without "--privileged".
options: -u 1001:1001 --privileged
steps:
- name: 'PR commits + 1'
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
sparse-checkout: |
devops/actions/cached_checkout
- name: 'PR commits + 2'
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 2 ))" >> "${GITHUB_ENV}"
- uses: ./devops/actions/cached_checkout
with:
path: src
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
ref: ${{ github.event.pull_request.head.sha }}
cache_path: "/__w/repo_cache/"
merge: false
- name: Run clang-format
uses: ./devops/actions/clang-format
uses: ./src/devops/actions/clang-format
with:
path: src

# This job generates matrix of tests for SYCL End-to-End tests
test_matrix:
Expand Down
6 changes: 3 additions & 3 deletions clang/include/clang/AST/PrettyPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ struct PrintingPolicy {
/// \endcode
unsigned SuppressTypedefs : 1;

/// When true, suppress printing final specifier.
unsigned SuppressFinalSpecifier : 1;

/// When true, suppresses printing template arguments in names of C++
/// constructors.
unsigned SuppressTemplateArgsInCXXConstructors : 1;
Expand All @@ -220,9 +223,6 @@ struct PrintingPolicy {
/// argument for the parameter.
unsigned SuppressDefaultTemplateArgs : 1;

/// When true, suppress printing final specifier.
unsigned SuppressFinalSpecifier : 1;

/// Whether we can use 'bool' rather than '_Bool' (even if the language
/// doesn't actually have 'bool', because, e.g., it is defined as a macro).
unsigned Bool : 1;
Expand Down
4 changes: 4 additions & 0 deletions clang/include/clang/Basic/CodeGenOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ CODEGENOPT(VirtualFunctionElimination, 1, 0) ///< Whether to apply the dead
/// virtual function elimination
/// optimization.

/// Whether accuracy levels for math library functions are requested by the
/// user. These accuracy levels will then be expressed in terms of ULPs.
CODEGENOPT(FPAccuracy, 1, 0)

/// Whether to use public LTO visibility for entities in std and stdext
/// namespaces. This is enabled by clang-cl's /MT and /MTd flags.
CODEGENOPT(LTOVisibilityPublicStd, 1, 0)
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Basic/DiagnosticCommonKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ def warn_stack_clash_protection_inline_asm : Warning<
def warn_slh_does_not_support_asm_goto : Warning<
"speculative load hardening does not protect functions with asm goto">,
InGroup<DiagGroup<"slh-asm-goto">>;

def err_drv_incompatible_options : Error<
"the combination of '%0' and '%1' is incompatible">;
}

// Sema && Serialization
Expand Down
11 changes: 9 additions & 2 deletions clang/include/clang/Basic/DiagnosticDriverKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def err_drv_no_cuda_libdevice : Error<
"via '--cuda-path', or pass '-nocudalib' to build without linking with "
"libdevice">;

def warn_function_fp_accuracy_already_set : Warning <
"floating point accuracy value of '%0' has already been assigned to "
"function '%1'">,
InGroup<DiagGroup<"fp-accuracy-already-set">>;
def err_drv_no_rocm_device_lib : Error<
"cannot find ROCm device library%select{| for %1|for ABI version %1}0; provide its path via "
"'--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build "
Expand Down Expand Up @@ -141,8 +145,9 @@ def err_drv_invalid_unwindlib_name : Error<
"invalid unwind library name in argument '%0'">;
def err_drv_incompatible_unwindlib : Error<
"--rtlib=libgcc requires --unwindlib=libgcc">;
def err_drv_incompatible_options : Error<
"the combination of '%0' and '%1' is incompatible">;
def err_drv_incompatible_fp_accuracy_options : Error<
"floating point accuracy requirements cannot be guaranteed when '-fmath-errno' "
"is enabled; use '-fno-math-errno' to enable floating point accuracy control">;
def err_drv_invalid_stdlib_name : Error<
"invalid library name in argument '%0'">;
def err_drv_invalid_output_with_multiple_archs : Error<
Expand Down Expand Up @@ -355,6 +360,8 @@ def err_drv_expecting_fsycl_with_sycl_opt : Error<
"'%0' must be used in conjunction with '-fsycl' to enable offloading">;
def err_drv_fsycl_with_c_type : Error<
"'%0' must not be used in conjunction with '-fsycl', which expects C++ source">;
def err_drv_fsycl_with_pch : Error<
"Precompiled header generation is not supported with '-fsycl'">;
def err_drv_fsycl_unsupported_with_opt
: Error<"'%0' is not supported with '-fsycl'">;
def err_drv_sycl_missing_amdgpu_arch : Error<
Expand Down
3 changes: 2 additions & 1 deletion clang/include/clang/Basic/FPOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ OPTION(AllowReciprocal, bool, 1, NoSignedZero)
OPTION(AllowApproxFunc, bool, 1, AllowReciprocal)
OPTION(FPEvalMethod, LangOptions::FPEvalMethodKind, 2, AllowApproxFunc)
OPTION(Float16ExcessPrecision, LangOptions::ExcessPrecisionKind, 2, FPEvalMethod)
OPTION(BFloat16ExcessPrecision, LangOptions::ExcessPrecisionKind, 2, FPEvalMethod)
OPTION(BFloat16ExcessPrecision, LangOptions::ExcessPrecisionKind, 2, Float16ExcessPrecision)
OPTION(FPAccuracy, LangOptions::FPAccuracyKind, 3, BFloat16ExcessPrecision)
#undef OPTION
1 change: 1 addition & 0 deletions clang/include/clang/Basic/LangOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ BENIGN_ENUM_LANGOPT(FPExceptionMode, FPExceptionModeKind, 2, FPE_Default, "FP Ex
BENIGN_ENUM_LANGOPT(FPEvalMethod, FPEvalMethodKind, 2, FEM_UnsetOnCommandLine, "FP type used for floating point arithmetic")
ENUM_LANGOPT(Float16ExcessPrecision, ExcessPrecisionKind, 2, FPP_Standard, "Intermediate truncation behavior for Float16 arithmetic")
ENUM_LANGOPT(BFloat16ExcessPrecision, ExcessPrecisionKind, 2, FPP_Standard, "Intermediate truncation behavior for BFloat16 arithmetic")
BENIGN_ENUM_LANGOPT(FPAccuracy, FPAccuracyKind, 3, FPA_Default, "Accuracy for floating point operations and library functions")
LANGOPT(NoBitFieldTypeAlign , 1, 0, "bit-field type alignment")
LANGOPT(HexagonQdsp6Compat , 1, 0, "hexagon-qdsp6 backward compatibility")
LANGOPT(ObjCAutoRefCount , 1, 0, "Objective-C automated reference counting")
Expand Down
13 changes: 13 additions & 0 deletions clang/include/clang/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,15 @@ class LangOptions : public LangOptionsBase {

enum ExcessPrecisionKind { FPP_Standard, FPP_Fast, FPP_None };

enum FPAccuracyKind {
FPA_Default,
FPA_High,
FPA_Medium,
FPA_Low,
FPA_Sycl,
FPA_Cuda,
};

/// Possible exception handling behavior.
enum class ExceptionHandlingKind { None, SjLj, WinEH, DwarfCFI, Wasm };

Expand Down Expand Up @@ -509,6 +518,10 @@ class LangOptions : public LangOptionsBase {
/// records.
std::string OptRecordFile;

std::string FPAccuracyVal;
using FPAccuracyFuncMapTy = std::map<std::string, std::string>;
FPAccuracyFuncMapTy FPAccuracyFuncMap;

LangOptions();

/// Set language defaults for the given input language and
Expand Down
16 changes: 0 additions & 16 deletions clang/include/clang/Driver/Action.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ class Action {
OffloadPackagerJobClass,
OffloadDepsJobClass,
SPIRVTranslatorJobClass,
SPIRCheckJobClass,
SYCLPostLinkJobClass,
BackendCompileJobClass,
FileTableTformJobClass,
Expand Down Expand Up @@ -750,21 +749,6 @@ class SPIRVTranslatorJobAction : public JobAction {
}
};

// Provides a check of the given input file for the existence of SPIR kernel
// code. This is currently only used for FPGA specific tool chains and can
// be expanded to perform other SPIR checks if needed.
// TODO: No longer being used for FPGA (or elsewhere), cleanup needed.
class SPIRCheckJobAction : public JobAction {
void anchor() override;

public:
SPIRCheckJobAction(Action *Input, types::ID OutputType);

static bool classof(const Action *A) {
return A->getKind() == SPIRCheckJobClass;
}
};

class SYCLPostLinkJobAction : public JobAction {
void anchor() override;

Expand Down
15 changes: 15 additions & 0 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -1729,6 +1729,13 @@ def ffp_exception_behavior_EQ : Joined<["-"], "ffp-exception-behavior=">, Group<
Values<"ignore,maytrap,strict">, NormalizedValuesScope<"LangOptions">,
NormalizedValues<["FPE_Ignore", "FPE_MayTrap", "FPE_Strict"]>,
MarshallingInfoEnum<LangOpts<"FPExceptionMode">, "FPE_Default">;
def ffp_accuracy_EQ : Joined<["-"], "ffp-accuracy=">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Specifies the required accuracy for floating-point operations and library calls.">,
Values<"default,high,medium,low,sycl,cuda">, NormalizedValuesScope<"LangOptions">,
NormalizedValues<["FPA_Default", "FPA_High", "FPA_Medium", "FPA_Low", "FPA_Sycl", "FPA_Cuda"]>,
MarshallingInfoEnum<LangOpts<"FPAccuracy">, "FPA_Default">;
def ffp_builtin_accuracy_EQ : Joined<["-"], "ffp-builtin-accuracy=">, Group<f_Group>, Flags<[CC1Option]>;

defm fast_math : BoolFOption<"fast-math",
LangOpts<"FastMath">, DefaultFalse,
PosFlag<SetTrue, [CC1Option, CoreOption, FC1Option, FlangOption], "Allow aggressive, lossy floating-point optimizations",
Expand Down Expand Up @@ -7020,6 +7027,14 @@ class CLRemainingArgsJoined<string name> : Option<["/", "-"], name,
// (We don't put any of these in cl_compile_Group as the options they alias are
// already in the right group.)

// INTEL_CUSTOMIZATION
def _SLASH_Qfp_accuracy_EQ : CLJoined<"Qfp-accuracy=">,
Alias<ffp_accuracy_EQ>;
def _SLASH_Qfp_accuracy_COL : CLJoined<"Qfp-accuracy:">,
Alias<ffp_accuracy_EQ>,HelpText<"Specifies the required accuracy for "
"floating-point operations and library calls.">;
// END INTEL_CUSTOMIZATION

def _SLASH_Brepro : CLFlag<"Brepro">,
HelpText<"Do not write current time into COFF output (breaks link.exe /incremental)">,
Alias<mno_incremental_linker_compatible>;
Expand Down
2 changes: 0 additions & 2 deletions clang/include/clang/Driver/ToolChain.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ class ToolChain {
mutable std::unique_ptr<Tool> OffloadPackager;
mutable std::unique_ptr<Tool> OffloadDeps;
mutable std::unique_ptr<Tool> SPIRVTranslator;
mutable std::unique_ptr<Tool> SPIRCheck;
mutable std::unique_ptr<Tool> SYCLPostLink;
mutable std::unique_ptr<Tool> BackendCompiler;
mutable std::unique_ptr<Tool> AppendFooter;
Expand All @@ -180,7 +179,6 @@ class ToolChain {
Tool *getOffloadPackager() const;
Tool *getOffloadDeps() const;
Tool *getSPIRVTranslator() const;
Tool *getSPIRCheck() const;
Tool *getSYCLPostLink() const;
Tool *getBackendCompiler() const;
Tool *getAppendFooter() const;
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Frontend/CompilerInvocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ class CompilerInvocation : public CompilerInvocationRefBase,
std::vector<std::string> &Includes,
DiagnosticsEngine &Diags);

static void ParseFpAccuracyArgs(LangOptions &Opts, llvm::opt::ArgList &Args,
DiagnosticsEngine &Diags);

/// Generate command line options from LangOptions.
static void GenerateLangArgs(const LangOptions &Opts,
SmallVectorImpl<const char *> &Args,
Expand Down
Loading

0 comments on commit c13ee53

Please sign in to comment.