[Issue]: c++ array access assertion
Problem Description
Packaging CK on Fedora uses -Wp,-D_GLIBCXX_ASSERTIONS
There are several failures similar to
In file included from /home/trix/work/rocm/composable_kernel/include/ck/ck.hpp:10:
In file included from /usr/include/hip/hip_runtime.h:62:
In file included from /usr/include/hip/amd_detail/amd_hip_runtime.h:114:
In file included from /usr/include/hip/hip_runtime_api.h:568:
In file included from /usr/include/hip/texture_types.h:47:
In file included from /usr/include/hip/channel_descriptor.h:32:
In file included from /usr/include/hip/amd_detail/amd_channel_descriptor.h:29:
In file included from /usr/include/hip/amd_detail/amd_hip_vector_types.h:49:
/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/array:208:2: error: reference to host function '__glibcxx_assert_fail' in host device function
208 | __glibcxx_requires_subscript(__n);
| ^
/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/debug/assertions.h:44:3: note: expanded from macro '__glibcxx_requires_subscript'
44 | __glibcxx_assert(_N < this->size())
| ^
/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/x86_64-redhat-linux/bits/c++config.h:2438:7: note: expanded from macro '__glibcxx_assert'
2438 | _GLIBCXX_ASSERT_FAIL(cond); \
| ^
/usr/lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/x86_64-redhat-linux/bits/c++config.h:2427:8: note: expanded from macro '_GLIBCXX_ASSERT_FAIL'
2427 | std::__glibcxx_assert_fail(FILE, LINE, PRETTY_FUNCTION, \
| ^
/home/trix/work/rocm/composable_kernel/include/ck/tensor_operation/gpu/device/impl/device_batched_contraction_multiple_d_xdl_cshuffle.hpp:526:17: note: called by 'operator()<ck::integral_con
stant<int, 0>>'
526 | ds_offset[i] = static_cast<long_index_t>(g_idx) *
| ^
/home/trix/work/rocm/composable_kernel/include/ck/utility/functional2.hpp:22:18: note: called by 'operator()<(lambda at /home/trix/work/rocm/composable_kernel/include/ck/tensor_operation/gpu
/device/impl/device_batched_contraction_multiple_d_xdl_cshuffle.hpp:525:44)>'
22 | swallow{(f(Number<Is>{}), 0)...};
| ^
/home/trix/work/rocm/composable_kernel/include/ck/utility/functional2.hpp:44:9: note: called by 'operator()<(lambda at /home/trix/work/rocm/composable_kernel/include/ck/tensor_operation/gpu/
device/impl/device_batched_contraction_multiple_d_xdl_cshuffle.hpp:525:44)>'
44 | detail::static_for_impl<typename arithmetic_sequence_gen<NBegin, NEnd, Increment>::type>{}(
| ^
/home/trix/work/rocm/composable_kernel/include/ck/tensor_operation/gpu/device/impl/device_batched_contraction_multiple_d_xdl_cshuffle.hpp:525:13: note: called by 'GetDsPtrOffset'
525 | static_for<0, NumDTensor, 1>{}([&](auto i) {
| ^
There is something off with DS arrays' access. This shadow of NumDTensor looks wrong
Operating System
Fedora Rawhide
CPU
x86_64
GPU
AMD Instinct MI300X
Other
No response
ROCm Version
ROCm 6.0.0
ROCm Component
No response
Steps to Reproduce
build with cmake option -DUSE_GLIBCXX_ASSERTIONS=ON
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
No response