Commit 3c352e0e authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed cast to void* in CUDA memory operations

This is necessary if the pointer type is const-qualified.
parent 25ebfde3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -384,7 +384,7 @@ class DevicePointer< Object, Devices::Cuda > : public SmartPointer
         {
            Assert( this->pointer, );
            Assert( this->cuda_pointer, );
            cudaMemcpy( this->cuda_pointer, this->pointer, sizeof( ObjectType ), cudaMemcpyHostToDevice );
            cudaMemcpy( (void*) this->cuda_pointer, (void*) this->pointer, sizeof( ObjectType ), cudaMemcpyHostToDevice );
            if( ! checkCudaDevice ) {
               return false;
            }
+2 −2
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ ObjectType* Cuda::passToDevice( const ObjectType& object )
                   cudaMemcpyHostToDevice ) != cudaSuccess )
   {
      checkCudaDevice;
      cudaFree( deviceObject );
      cudaFree( ( void* ) deviceObject );
      return 0;
   }
   return deviceObject;
@@ -126,7 +126,7 @@ template< typename ObjectType >
void Cuda::freeFromDevice( ObjectType* deviceObject )
{
#ifdef HAVE_CUDA
   cudaFree( deviceObject );
   cudaFree( ( void* ) deviceObject );
   checkCudaDevice;
#else
   Assert( false, std::cerr << "CUDA support is missing." );
+2 −2
Original line number Diff line number Diff line
@@ -394,7 +394,7 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer
            this->pointer->~ObjectType();
            new ( this->pointer ) ObjectType( args... );
#ifdef HAVE_CUDA
            cudaMemcpy( this->cuda_pointer, this->pointer, sizeof( Object ), cudaMemcpyHostToDevice );
            cudaMemcpy( (void*) this->cuda_pointer, (void*) this->pointer, sizeof( Object ), cudaMemcpyHostToDevice );
#endif
            return true;
         }
@@ -545,7 +545,7 @@ class SharedPointer< Object, Devices::Cuda, lazy > : public SmartPointer
#endif
            Assert( this->pointer, );
            Assert( this->cuda_pointer, );
            cudaMemcpy( this->cuda_pointer, this->pointer, sizeof( ObjectType ), cudaMemcpyHostToDevice );
            cudaMemcpy( (void*) this->cuda_pointer, (void*) this->pointer, sizeof( ObjectType ), cudaMemcpyHostToDevice );
            if( ! checkCudaDevice ) {
               return false;
            }
+1 −1
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ class UniquePointer< Object, Devices::Cuda > : public SmartPointer
#ifdef HAVE_CUDA
         if( this->modified )
         {
            cudaMemcpy( this->cuda_pointer, this->pointer, sizeof( Object ), cudaMemcpyHostToDevice );
            cudaMemcpy( (void*) this->cuda_pointer, (void*) this->pointer, sizeof( Object ), cudaMemcpyHostToDevice );
            if( ! checkCudaDevice )
               return false;
            return true;