Library/ManagedCuda/CudaTextureLinearPitched2D.cs
/// <summary>
/// Binds a linear address range to the texture reference. <para/>
/// Any previous address or CUDA array state associated with the texture reference is superseded by this function. <para/>
/// Any memory previously bound to the texture reference is unbound.<para/>
/// Size my differ to the previous bound variable, but type must be the same.
/// </summary>
/// <param name="deviceVar">New device variable to bind this texture reference to.</param>
Binds a linear address range to the texture reference.
Any previous address or CUDA array state associated with the texture reference is superseded by this function.
Any memory previously bound to the texture reference is unbound.
Size my differ to the previous bound variable, but type must be the same.
Binds a linear address range to the texture reference . Any previous address or CUDA array state associated with the texture reference is superseded by this function . Any memory previously bound to the texture reference is unbound . Size my differ to the previous bound variable but type must be the same .
public void Reset(CudaPitchedDeviceVariable<T> deviceVar)
        {
            if (disposed) throw new ObjectDisposedException(this.ToString());
            _height = deviceVar.Height;
            _width = deviceVar.Width;
            _dataSize = deviceVar.TotalSizeInBytes;
            _devVar = deviceVar;
            CUDAArrayDescriptor arrayDescr = new CUDAArrayDescriptor();
            arrayDescr.Format = _format;
            arrayDescr.Height = _height;
            arrayDescr.NumChannels = (uint)_numChannels;
            arrayDescr.Width = _width;
            res = DriverAPINativeMethods.TextureReferenceManagement.cuTexRefSetAddress2D_v2(_texref, ref arrayDescr, _devVar.DevicePointer, _devVar.Pitch);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cuTexRefSetAddress2D", res));
            if (res != CUResult.Success) throw new CudaException(res);
        }
public void Reset ( CudaPitchedDeviceVariable < T > deviceVar ) { if ( disposed ) throw new ObjectDisposedException ( this . ToString ( ) ) ; _height = deviceVar . Height ; _width = deviceVar . Width ; _dataSize = deviceVar . TotalSizeInBytes ; _devVar = deviceVar ; CUDAArrayDescriptor arrayDescr = new CUDAArrayDescriptor ( ) ; arrayDescr . Format = _format ; arrayDescr . Height = _height ; arrayDescr . NumChannels = ( uint ) _numChannels ; arrayDescr . Width = _width ; res = DriverAPINativeMethods . TextureReferenceManagement . cuTexRefSetAddress2D_v2 ( _texref , ref arrayDescr , _devVar . DevicePointer , _devVar . Pitch ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != CUResult . Success ) throw new CudaException ( res ) ; }
Binds a linear address range to the texture reference.
Binds a linear address range to the texture reference .
deviceVar
CudaPitchedDeviceVariable<T>
New device variable to bind this texture reference to.
New device variable to bind this texture reference to .