Page MenuHomePhabricator

[clang-tidy] new altera single work item barrier check
Needs ReviewPublic

Authored by ffrankies on Jan 5 2020, 7:31 PM.

Details

Summary

This lint check is a part of the FLOCL (FPGA Linters for OpenCL) project out of the Synergy Lab at Virginia Tech.

FLOCL is a set of lint checks aimed at FPGA developers who write code in OpenCL.

The altera single work item barrier check finds OpenCL kernel functions that call a barrier function but do not call an ID function. These kernel functions will be treated as single work-item kernels, which could be inefficient or lead to errors.

Based on the "Altera SDK for OpenCL: Best Practices Guide."

Depends on https://reviews.llvm.org/D66564 due to the altera module being introduced there.

Diff Detail

Event Timeline

ffrankies created this revision.Jan 5 2020, 7:31 PM

I think will be good idea to separate module code in own review or refer to previous one of previous reviews as dependency.

clang-tidy/altera/SingleWorkItemBarrierCheck.cpp
52

const auto *.

70

Just IsNDRange. See readability-simplify-boolean-expr.

docs/clang-tidy/checks/altera-single-work-item-barrier.rst
52

Please highlight 1600 with single back-quotes.

mgehre removed a subscriber: mgehre.Jan 5 2020, 10:59 PM
ffrankies updated this revision to Diff 243717.Mon, Feb 10, 7:38 PM
ffrankies marked 3 inline comments as done.

Implemented requested changes by @Eugene.Zelenko

  • Changed auto to const auto *
  • Changed if(IsNDRange == true) to if(IsNDRange)
  • Highlighted 1600 with single back-quotes
  • Added link to https://reviews.llvm.org/D66564 as a dependency in Summary (is there someplace else I can refer to that as a dependency?)