mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
remove last two unneeded size t conversions
This commit is contained in:
@@ -86,13 +86,13 @@ CuBuffer<T>::resize(size_t newSize)
|
|||||||
}
|
}
|
||||||
// Allocate memory for the new buffer
|
// Allocate memory for the new buffer
|
||||||
T* tmpBuffer = nullptr;
|
T* tmpBuffer = nullptr;
|
||||||
OPM_CUDA_SAFE_CALL(cudaMalloc(&tmpBuffer, sizeof(T) * detail::to_size_t(newSize)));
|
OPM_CUDA_SAFE_CALL(cudaMalloc(&tmpBuffer, sizeof(T) * newSize));
|
||||||
|
|
||||||
// Move the data from the old to the new buffer with truncation
|
// Move the data from the old to the new buffer with truncation
|
||||||
size_t sizeOfMove = std::min({m_numberOfElements, newSize});
|
size_t sizeOfMove = std::min({m_numberOfElements, newSize});
|
||||||
OPM_CUDA_SAFE_CALL(cudaMemcpy(tmpBuffer,
|
OPM_CUDA_SAFE_CALL(cudaMemcpy(tmpBuffer,
|
||||||
m_dataOnDevice,
|
m_dataOnDevice,
|
||||||
detail::to_size_t(sizeOfMove) * sizeof(T),
|
sizeOfMove * sizeof(T),
|
||||||
cudaMemcpyDeviceToDevice));
|
cudaMemcpyDeviceToDevice));
|
||||||
|
|
||||||
// free the old buffer
|
// free the old buffer
|
||||||
|
|||||||
Reference in New Issue
Block a user