mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-14 18:17:44 +00:00
[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. --------- Co-authored-by: illsilin_amdeng <Illia.Silin@amd.com>
This commit is contained in:
@@ -48,6 +48,10 @@ TEST(DeviceBuffer, AutoFree)
|
||||
const auto size = 12345;
|
||||
std::byte* ptr = nullptr;
|
||||
|
||||
// In this test we are explicitly testing a pointer that is out of scope, so
|
||||
// we have to disable the clang compiler's lifestime safety checks.
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wlifetime-safety-permissive"
|
||||
{
|
||||
auto buffer = ckt::alloc_buffer(size);
|
||||
ptr = buffer.get();
|
||||
@@ -55,6 +59,7 @@ TEST(DeviceBuffer, AutoFree)
|
||||
|
||||
// Trying to use a pointer after freeing should return en error in HIP.
|
||||
EXPECT_THAT(hipMemset(ptr, 0xFF, size), HipError(hipErrorInvalidValue));
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
// Reset internal HIP error state.
|
||||
// Otherwise, the error may leak into other tests, triggering anything that
|
||||
|
||||
Reference in New Issue
Block a user