Skip to content

Commit

Permalink
Fix cudaMalloc conversion from T** to void**
Browse files Browse the repository at this point in the history
  • Loading branch information
vtemplier committed May 21, 2024
1 parent 2e553a3 commit 037fa27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/containers/CudaTensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ T* N2D2::CudaDeviceTensor<T>::getDevicePtr(int dev) const

if (mDataDevice[dev] == NULL) {
// Lazy memory allocation
CHECK_CUDA_STATUS(cudaMalloc(&(mDataDevice[dev]),
CHECK_CUDA_STATUS(cudaMalloc(reinterpret_cast<void**>(&(mDataDevice[dev])),
mCudaBaseTensor.size() * sizeof(T)));
}

Expand Down Expand Up @@ -782,7 +782,7 @@ void N2D2::CudaDeviceTensor<T>::aggregate(int srcDev, int dstDev) const
if (mForeignDataDevice[dstDev] == NULL) {
// Lazy allocation
CHECK_CUDA_STATUS(cudaMalloc(
&mForeignDataDevice[dstDev], mCudaBaseTensor.size() * sizeof(T)));
reinterpret_cast<void**>(&mForeignDataDevice[dstDev]), mCudaBaseTensor.size() * sizeof(T)));
}

CHECK_CUDA_STATUS(cudaMemcpyPeer(
Expand Down

0 comments on commit 037fa27

Please sign in to comment.