[rocm-libraries] ROCm/rocm-libraries#4598 (commit 9ff8af1)

[CK_BUILDER] Fix two staging-compiler errors in CK builder
 code (#4598)

This PR fixes two compiler warnings that report as errors with the
latest compiler:

1. In tensor descriptor, the `operator[]` accessor needs a
`[[clang::lifetimebound]]` attribute.
2. In the unit tests for device buffer, there is a test that explicitly
checks for an error on a pointer that went out of scope, so it needs a
to disable `-Wlifetime-safety-permissive` in the test code.

I ran the CK `smoke-builder` tests with the staging compiler to verify.
This commit is contained in:
John Shumway
2026-02-18 01:27:35 +00:00
committed by assistant-librarian[bot]
parent 2b2a39be98
commit 1f6768472e
2 changed files with 8 additions and 2 deletions

View File

@@ -106,7 +106,7 @@ struct Extent : std::array<size_t, RANK>
/// @param i The index to index the array with.
///
/// @see std::array::operator[]
__device__ __host__ size_t& operator[](size_t i)
__device__ __host__ size_t& operator[](size_t i) [[clang::lifetimebound]]
{
if constexpr(RANK > 0)
{
@@ -450,7 +450,8 @@ struct TensorDescriptor
/// @brief Print tensor descriptor details.
///
/// Print tensor descriptor details - lengths and strides.
friend std::ostream& operator<<(std::ostream& os, const TensorDescriptor<DT, RANK>& tensor_desc)
friend std::ostream& operator<<([[clang::lifetimebound]] std::ostream& os,
const TensorDescriptor<DT, RANK>& tensor_desc)
{
os << tensor_desc.inner_descriptor_;
return os;