Fix vec operator[] (#419)
Change-Id: I1b6767b8b7f7dbcf9998662dd9f8ae3a96e1deca
[ROCm/clr commit: 9533ceb8aa]
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
328aeb758c
Коммит
0fcf5ef2c5
@@ -364,10 +364,10 @@ get_native_pointer(const HIP_vector_base<T, n>& base_vec) {
|
||||
|
||||
// Operators
|
||||
__HOST_DEVICE__
|
||||
T& operator[](size_t idx) noexcept { return (*hip_impl::get_native_pointer(*this))[idx]; }
|
||||
T& operator[](size_t idx) noexcept { return reinterpret_cast<T*>(this)[idx]; }
|
||||
__HOST_DEVICE__
|
||||
const T& operator[](size_t idx) const noexcept {
|
||||
return (*hip_impl::get_native_pointer(*this))[idx];
|
||||
return reinterpret_cast<const T*>(this)[idx];
|
||||
}
|
||||
|
||||
__HOST_DEVICE__
|
||||
|
||||
Ссылка в новой задаче
Block a user