Skip to content

[SYCL-MLIR] Merge from intel/llvm sycl branch #9895

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

Merged
merged 31 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
56e05af
[SYCL][CUDA] Improve function to guess local work size more efficient…
mmoadeli Jun 13, 2023
93eb9ff
[SYCL][CUDA] Add missing device scope to atomic fence (#9824)
npmiller Jun 13, 2023
a055665
[CI] Improve devops/actions/cached_checkout (#9831)
aelovikov-intel Jun 13, 2023
b3e0428
[SYCL] Non-standard RT namespace removed(#7133) (#9837)
marcin-smuklerz-mobica Jun 13, 2023
36e6e06
[SYCL][NFC] Remove llvm-no-spir-kernel tool (#9710)
mdtoguchi Jun 13, 2023
2e6f732
[CI] Move lint job to self-hosted runner (#9844)
aelovikov-intel Jun 13, 2023
53c8089
[CI] Don't install lz4 (#9848)
aelovikov-intel Jun 13, 2023
6b74243
[CI] Enable HIP/CUDA/ESIMD plugins in nightly build (#9850)
aelovikov-intel Jun 13, 2023
9ad2588
[SYCL][ESIMD][E2E] Revert "Fix scale tests on hardware that doesn't s…
sarnex Jun 13, 2023
f4525e9
[SYCL] Remove _CODELOC* macro from API (#9847)
KseniyaTikhomirova Jun 13, 2023
c87e780
[SYCL] Disable the ZE_DEBUG tests on Windows (#9854)
bso-intel Jun 14, 2023
ec59d44
[SYCL][CUDA] Port CUDA plugin to Unified Runtime (#9512)
callumfare Jun 14, 2023
f749876
[SYCL][CODEOWNERS] Make intel/llvm-reviewers-runtime design docs code…
steffenlarsen Jun 14, 2023
de5b479
[SYCL][ESIMD] Allow implicit conversion from std::experimental::simd_…
sarnex Jun 14, 2023
447f598
[SYCL] Disable ZE_DEBUG test for interop (#9857)
bso-intel Jun 14, 2023
054ed1c
[SYCL][CUDA] Fix post merge errors from #9512 (#9872)
kbenzie Jun 14, 2023
405778a
[SYCL][FE][Driver] Implement floating point accuracy control (#8280)
zahiraam Jun 14, 2023
c2f0858
[CI] Remove FPGA Emulator workaround (#9855)
aelovikov-intel Jun 14, 2023
5f0dbfe
[CI] Remove ROCm LD_LIBRARY_PATH setup (#9856)
aelovikov-intel Jun 14, 2023
c063b99
[SYCL] Re-land "Represent JointMatrixINTEL type as extension type" (#…
MrSidims Jun 14, 2023
90406b2
[SYCL] Const-qualify sycl::logical_{or, and} (#9861)
jzc Jun 14, 2023
83d0997
[SYCL][DOC] Add sycl_ext_intel_grf_size extension (#9779)
sarnex Jun 14, 2023
1d0230a
[CI] Try to fix lint issues (#9876)
aelovikov-intel Jun 14, 2023
a69e515
[SYCL] Fix multi_ptr ctor for extended address spaces (#9869)
steffenlarsen Jun 14, 2023
52c4efb
[CI] Add debug output for the clang-format task (#9881)
aelovikov-intel Jun 14, 2023
3d866f2
[SYCL][ESIMD][NFC] Do not use deprecated APIs in ESIMD headers and te…
turinevgeny Jun 14, 2023
c6a9eee
[CI] Another attempt to fix lint task (#9885)
aelovikov-intel Jun 14, 2023
ef03323
[SYCL] Improve is_compatible (#9769)
KornevNikita Jun 14, 2023
c9219ce
[SYCL][UR][CUDA] Update CODEOWNERS for Unified Runtime CUDA Adapter (…
alycm Jun 14, 2023
2777e7d
Merge remote-tracking branch 'upstream/sycl' into sycl-mlir
whitneywhtsang Jun 15, 2023
0d222a6
[SYCL-MLIR] Update xfail list after rebase
whitneywhtsang Jun 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
22 changes: 16 additions & 6 deletions .github/workflows/sycl_precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,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
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
9 changes: 7 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
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 @@ -1732,6 +1732,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 @@ -7029,6 +7036,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 @@ -182,7 +181,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