Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/scripts/therock_configure_ci.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
# SPDX-License-Identifier: MIT

import fnmatch
import json
import os
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ repos:
)$
- repo: local
hooks:
# - id: copyright-year-checker
# name: copyright-year-checker
# entry: script/check_copyright_year.sh
# verbose: false
# language: script
# types: [c++]
- id: copyright-header-checker
name: Check copyright headers
entry: script/check_copyright_year.sh
verbose: false
language: script
types_or: [c++, python, shell, cmake]
- id: remove-exec-bit
name: Remove executable bit from non-executable files
entry: script/remove_exec_bit.sh
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/core.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/core/algorithm/cluster_descriptor.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/host.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/host/arg_parser.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/add_rmsnorm2d_rdquant.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/add_rmsnorm2d_rdquant/kernel/add_rmsnorm2d_rdquant_fwd_kernel.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/batched_contraction.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/batched_contraction/kernel/batched_contraction_kernel.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/batched_transpose.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/batched_transpose/kernel/batched_transpose_kernel.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/common.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/common/generic_2d_block_shape.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/elementwise.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/elementwise/binary_elementwise_operation.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/epilogue.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/epilogue/cshuffle_epilogue.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/flatmm.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/flatmm/block/block_flatmm_asmem_bsmem_creg_v1.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/fmha.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/fmha/block/block_attention_bias_enum.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/fused_moe.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/fused_moe/kernel/fused_moegemm_kernel.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/gemm.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/gemm/block/block_gemm_areg_bgmem_creg_v1.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/gemm_quant.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/gemm_quant/block/block_gemm_quant_common.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/grouped_convolution.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/grouped_convolution/kernel/grouped_convolution_backward_data_kernel.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/image_to_column.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/image_to_column/kernel/image_to_column_kernel.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/layernorm2d.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/layernorm2d/kernel/layernorm2d_fwd_kernel.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/norm_reduce.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/norm_reduce/block/block_norm_reduce.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/permute.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/permute/kernel/generic_permute_kernel.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/pooling.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/pooling/kernel/pool_kernel.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/reduce.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/reduce/block/block_reduce.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/rmsnorm2d.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/rmsnorm2d/kernel/rmsnorm2d_fwd_kernel.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/smoothquant.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/smoothquant/kernel/moe_smoothquant_kernel.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/softmax.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/softmax/block/block_softmax_2d.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/topk.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/topk/block/block_topk_stream_2d.hpp"
Expand Down
3 changes: 1 addition & 2 deletions include/ck_tile/ops/topk_softmax.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2025, Advanced Micro Devices, Inc. All rights reserved.

#pragma once

#include "ck_tile/ops/topk_softmax/kernel/topk_softmax_kernel.hpp"
Expand Down
5 changes: 2 additions & 3 deletions include/ck_tile/remod.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
# SPDX-License-Identifier: MIT

from datetime import datetime
import pathlib
from pathlib import Path
import subprocess
Expand All @@ -13,8 +12,8 @@
OPS_COMMON = "common" # common header will be duplicated into ops/* other module

IGNORED_DIRS = ["utility", "ref"]
HEADER_COMMON = f"""// SPDX-License-Identifier: MIT
// Copyright (c) 2018-{datetime.now().year}, Advanced Micro Devices, Inc. All rights reserved.\n
HEADER_COMMON = """// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
// SPDX-License-Identifier: MIT
"""


Expand Down
70 changes: 61 additions & 9 deletions script/check_copyright_year.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,70 @@
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
# SPDX-License-Identifier: MIT

# This script checks if files have the correct copyright header template.
# It supports .hpp, .cpp, .inc, .py, .sh, and .cmake files.
#
# Usage: ./check_copyright_year.sh <file1> <file2> ...

current_year=$(date +%Y)
exit_code=0

for file in $@; do
if grep -q "Copyright (c)" $file
then
if ! grep -q "Copyright (c).*$current_year" $file
then
echo "ERROR: File $file has a copyright notice without the current year ($current_year)."
exit_code=1
fi
# Expected copyright header lines (without comment characters)
COPYRIGHT_LINE="Copyright (c) Advanced Micro Devices, Inc., or its affiliates."
SPDX_LINE="SPDX-License-Identifier: MIT"

check_file() {
local file=$1
local basename="${file##*/}"
local ext="${file##*.}"
local comment_char

# Determine comment character based on filename or extension
if [[ "$basename" == "CMakeLists.txt" ]]; then
comment_char="#"
else
case "$ext" in
cpp|hpp|inc)
comment_char="//"
;;
py|sh|cmake)
comment_char="#"
;;
*)
# Skip files with unsupported extensions
return 0
;;
esac
fi

# Build expected header patterns
expected_copyright="$comment_char $COPYRIGHT_LINE"
expected_spdx="$comment_char $SPDX_LINE"

# Check if file contains both required lines
if ! grep -qF "$expected_copyright" "$file"; then
echo "ERROR: File $file is missing the correct copyright header line."
echo " Expected: $expected_copyright"
return 1
fi

if ! grep -qF "$expected_spdx" "$file"; then
echo "ERROR: File $file is missing the correct SPDX license identifier line."
echo " Expected: $expected_spdx"
return 1
fi

return 0
}

# Process each file provided as argument
for file in "$@"; do
# Skip if file doesn't exist or is a directory
if [[ ! -f "$file" ]]; then
continue
fi

if ! check_file "$file"; then
exit_code=1
fi
done

Expand Down
Loading