Skip to content

Commit

Permalink
Merge branch 'sycl' into global_objects_doc
Browse files Browse the repository at this point in the history
* sycl: (566 commits)
  [SYCL] Fix explicit copy operation for host device (intel#2627)
  [SYCL] Fix initialization issue on Windows (intel#2632)
  [SYCL][CUDA] Disable image_write test on CUDA devices (intel#2630)
  [SYCL] Removes any knowledge of specific memory advices from PI API. (intel#2607)
  [BuildBot] Uplift GPU RT version for Linux to 20.40.18075 (intel#2626)
  [SYCL] Wrap complex global objects to control lifetime (intel#2516)
  [SYCL][CUDA] Image Basic Test (intel#1970)
  [SYCL] Align get_info<info::device::version>() with the SYCL spec (intel#2507)
  [Driver][SYCL] Correct optimization disabling option for gen (intel#2622)
  [SYCL][LIT] Add deleter func for test in buffer.cpp to avoid potential SegFault (intel#2616)
  [SYCL] Remove half type alias causing name conflicts (intel#2624)
  [BuildBot] OpenCL CPU/FPGAEMU driver uplift (intel#2620)
  [SYCL][Doc] Add overview of kernel-program caching (intel#2514)
  [SYCL] Remove two-input sub-group shuffles (intel#2614)
  [SYCL] Add support for new spelling of FPGA kernel attribute scheduler_target_fmax_mhz (intel#2618)
  [SYCL] Align image class constructors with the SYCL spec (intel#2603)
  [SYCL] Remove tests migrated to llvm-test-suite (intel#2611)
  [SYCL][NFC] Fix dependency for SYCL add_sycl_executable macro (intel#2613)
  [SYCL][PI][L0] Update environment variables from LEVEL0 to LEVEL_ZERO (intel#2612)
  [SYCL] Add KernelNameTypeVisitor validation check (intel#2596)
  ...
  • Loading branch information
Alexander Batashev committed Oct 14, 2020
2 parents 7eee966 + f20fd4d commit 37158c5
Show file tree
Hide file tree
Showing 1,666 changed files with 60,785 additions and 33,123 deletions.
38 changes: 19 additions & 19 deletions buildbot/dependency.conf
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
[VERSIONS]
# https://github.com/intel/llvm/releases/download/2020-WW36/oclcpuexp-2020.11.8.0.27_rel.tar.gz
ocl_cpu_rt_ver=2020.11.8.0.27
# https://github.com/intel/llvm/releases/download/2020-WW36/win-oclcpuexp-2020.11.8.0.27_rel.zip
ocl_cpu_rt_ver_win=2020.11.8.0.27
# https://github.com/intel/llvm/releases/download/2020-WW41/oclcpuexp-2020.11.10.0.05_rel.tar.gz
ocl_cpu_rt_ver=2020.11.10.0.05
# https://github.com/intel/llvm/releases/download/2020-WW41/win-oclcpuexp-2020.11.10.0.05_rel.zip
ocl_cpu_rt_ver_win=2020.11.10.0.05
# Same GPU driver supports Level Zero and OpenCL:
# https://github.com/intel/compute-runtime/releases/tag/20.39.17972
ocl_gpu_rt_ver=20.39.17972
# https://github.com/intel/compute-runtime/releases/tag/20.40.18075
ocl_gpu_rt_ver=20.40.18075
# Same GPU driver supports Level Zero and OpenCL:
# https://downloadmirror.intel.com/29879/a08/igfx_win10_100.8778.zip
ocl_gpu_rt_ver_win=27.20.100.8778
intel_sycl_ver=build
# https://github.com/oneapi-src/oneTBB/releases/download/v2021.1-beta08/oneapi-tbb-2021.1-beta08-lin.tgz
tbb_ver=2021.1.9.636
tbb_ver=2021.1.10.2267
# https://github.com/oneapi-src/oneTBB/releases/download/v2021.1-beta08/oneapi-tbb-2021.1-beta08-win.zip
tbb_ver_win=2021.1.9.636
# https://github.com/intel/llvm/releases/download/2020-WW36/fpgaemu-2020.11.8.0.27_rel.tar.gz
ocl_fpga_emu_ver=2020.11.8.0.27
# https://github.com/intel/llvm/releases/download/2020-WW36/win-fpgaemu-2020.11.8.0.27_rel.zip
ocl_fpga_emu_ver_win=2020.11.8.0.27
fpga_ver=20200811_000001
fpga_ver_win=20200811_000006
tbb_ver_win=2021.1.10.2267
# https://github.com/intel/llvm/releases/download/2020-WW41/fpgaemu-2020.11.10.0.05_rel.tar.gz
ocl_fpga_emu_ver=2020.11.10.0.05
# https://github.com/intel/llvm/releases/download/2020-WW41/win-fpgaemu-2020.11.10.0.05_rel.zip
ocl_fpga_emu_ver_win=2020.11.10.0.05
fpga_ver=20200913_000017
fpga_ver_win=20200913_000017

[DRIVER VERSIONS]
cpu_driver_lin=2020.11.8.0.27
cpu_driver_win=2020.11.8.0.27
gpu_driver_lin=20.39.17972
cpu_driver_lin=2020.11.10.0.05
cpu_driver_win=2020.11.10.0.05
gpu_driver_lin=20.40.18075
gpu_driver_win=27.20.100.8778
fpga_driver_lin=2020.11.8.0.27
fpga_driver_win=2020.11.8.0.27
fpga_driver_lin=2020.11.10.0.05
fpga_driver_win=2020.11.10.0.05
# NVidia CUDA driver
# TODO provide URL for CUDA driver
nvidia_gpu_driver_lin=435.21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,17 @@ namespace clang {
namespace tidy {
namespace android {

namespace {
AST_MATCHER(BinaryOperator, isRHSATempFailureRetryArg) {
if (!Node.getBeginLoc().isMacroID())
return false;

const SourceManager &SM = Finder->getASTContext().getSourceManager();
if (!SM.isMacroArgExpansion(Node.getRHS()->IgnoreParenCasts()->getBeginLoc()))
return false;

const LangOptions &Opts = Finder->getASTContext().getLangOpts();
SourceLocation LocStart = Node.getBeginLoc();
while (LocStart.isMacroID()) {
SourceLocation Invocation = SM.getImmediateMacroCallerLoc(LocStart);
Token Tok;
if (!Lexer::getRawToken(SM.getSpellingLoc(Invocation), Tok, SM, Opts,
/*IgnoreWhiteSpace=*/true)) {
if (Tok.getKind() == tok::raw_identifier &&
Tok.getRawIdentifier() == "TEMP_FAILURE_RETRY")
return true;
}
ComparisonInTempFailureRetryCheck::ComparisonInTempFailureRetryCheck(
StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context),
RawRetryList(Options.get("RetryMacros", "TEMP_FAILURE_RETRY")) {
StringRef(RawRetryList).split(RetryMacros, ",", -1, false);
}

LocStart = Invocation;
}
return false;
void ComparisonInTempFailureRetryCheck::storeOptions(
ClangTidyOptions::OptionMap &Opts) {
Options.store(Opts, "RetryMacros", RawRetryList);
}
} // namespace

void ComparisonInTempFailureRetryCheck::registerMatchers(MatchFinder *Finder) {
// Both glibc's and Bionic's TEMP_FAILURE_RETRY macros structurally look like:
Expand All @@ -63,15 +48,43 @@ void ComparisonInTempFailureRetryCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(
binaryOperator(hasOperatorName("="),
hasRHS(ignoringParenCasts(
binaryOperator(isComparisonOperator()).bind("binop"))),
isRHSATempFailureRetryArg()),
binaryOperator(isComparisonOperator()).bind("inner"))))
.bind("outer"),
this);
}

void ComparisonInTempFailureRetryCheck::check(
const MatchFinder::MatchResult &Result) {
const auto &BinOp = *Result.Nodes.getNodeAs<BinaryOperator>("binop");
diag(BinOp.getOperatorLoc(), "top-level comparison in TEMP_FAILURE_RETRY");
StringRef RetryMacroName;
const auto &Node = *Result.Nodes.getNodeAs<BinaryOperator>("outer");
if (!Node.getBeginLoc().isMacroID())
return;

const SourceManager &SM = *Result.SourceManager;
if (!SM.isMacroArgExpansion(Node.getRHS()->IgnoreParenCasts()->getBeginLoc()))
return;

const LangOptions &Opts = Result.Context->getLangOpts();
SourceLocation LocStart = Node.getBeginLoc();
while (LocStart.isMacroID()) {
SourceLocation Invocation = SM.getImmediateMacroCallerLoc(LocStart);
Token Tok;
if (!Lexer::getRawToken(SM.getSpellingLoc(Invocation), Tok, SM, Opts,
/*IgnoreWhiteSpace=*/true)) {
if (Tok.getKind() == tok::raw_identifier &&
llvm::is_contained(RetryMacros, Tok.getRawIdentifier())) {
RetryMacroName = Tok.getRawIdentifier();
break;
}
}

LocStart = Invocation;
}
if (RetryMacroName.empty())
return;

const auto &Inner = *Result.Nodes.getNodeAs<BinaryOperator>("inner");
diag(Inner.getOperatorLoc(), "top-level comparison in %0") << RetryMacroName;

// FIXME: FixIts would be nice, but potentially nontrivial when nested macros
// happen, e.g. `TEMP_FAILURE_RETRY(IS_ZERO(foo()))`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_COMPARISONINTEMPFAILURERETRYCHECK_H

#include "../ClangTidyCheck.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include <string>

namespace clang {
namespace tidy {
Expand All @@ -22,10 +25,14 @@ namespace android {
/// TEMP_FAILURE_RETRY is a macro provided by both glibc and Bionic.
class ComparisonInTempFailureRetryCheck : public ClangTidyCheck {
public:
ComparisonInTempFailureRetryCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
ComparisonInTempFailureRetryCheck(StringRef Name, ClangTidyContext *Context);
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;

private:
const std::string RawRetryList;
SmallVector<StringRef, 5> RetryMacros;
};

} // namespace android
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ struct UnqualNameVisitor : public RecursiveASTVisitor<UnqualNameVisitor> {
->getName()))
return false;
break;
case TypeLoc::Typedef:
if (VisitUnqualName(
TL.getAs<TypedefTypeLoc>().getTypePtr()->getDecl()->getName()))
return false;
break;
default:
break;
}
Expand Down
1 change: 1 addition & 0 deletions clang-tools-extra/clang-tidy/readability/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ add_clang_library(clangTidyReadabilityModule
DeleteNullPointerCheck.cpp
DeletedDefaultCheck.cpp
ElseAfterReturnCheck.cpp
FunctionCognitiveComplexityCheck.cpp
FunctionSizeCheck.cpp
IdentifierNamingCheck.cpp
ImplicitBoolConversionCheck.cpp
Expand Down
Loading

0 comments on commit 37158c5

Please sign in to comment.