triton-lang / triton

Development repository for the Triton language and compiler
https://triton-lang.org/
MIT License
13.47k stars 1.66k forks source link

[AMD] Improve codebase style consistency in third_party/amd #5229

Open knwng opened 9 hours ago

knwng commented 9 hours ago

This commit improved codebase style consistency in 3 aspects

  1. Updated namespace declaration to a nested fasion
  2. Unified header guards
  3. Updated comment styles following LLVM/MLIR style, focusing on the comments on the declarations of top-level function/class/struct and class members.

New contributor declaration

knwng commented 8 hours ago

For record, the code snippets this PR fixed was found by the following commands:

namespace:

cd third_party/amd/
grep -nrI --exclude-dir "backend" "namespace" .

header guard:

#!/bin/bash

set -euxo pipefail

ROOT=$(cd .. && pwd)

cd ./third_party/amd/

cpplint \
    --exclude="backend/" \
    --root=${ROOT} \
    --repository=${ROOT} \
    --recursive \
    --filter=-runtime,-whitespace,-legal/copyright,-readability/todo,-build/include_what_you_use,-build/include_order,-build/include,+build/namespaces,+build/header_guard,-build/namespaces \
    --quiet \
    .

comments:

cd third_party/amd/
egrep -nrI --exclude-dir "backend" "^\ +//\ " .

And since third_party/amd/backend/ has many files ported from other codebases, it has been excluded in this PR.