Пример #1
0
 public virtual void CopyToMemoryBlockAsync(MyMemoryBlock <T> destination, int srcOffset, int destOffset, int count,
                                            CudaStream stream = null)
 {
     destination.GetDevice(Owner.GPU).AsyncCopyToDevice(
         Device[Owner.GPU], srcOffset * ESize, destOffset * ESize, count * ESize,
         MyKernelFactory.GetCuStreamOrDefault(stream));
 }
Пример #2
0
        // TODO(Premek): Add more copy functions to be consistent with Async variants. (And cleanup the API in general.)

        #region Async copy device to device

        public virtual void CopyFromMemoryBlockAsync(MyMemoryBlock <T> source, int srcOffset, int destOffset, int count,
                                                     CudaStream stream = null)
        {
            Device[Owner.GPU].AsyncCopyToDevice(
                source.GetDevice(Owner.GPU), srcOffset * ESize, destOffset * ESize, count * ESize,
                MyKernelFactory.GetCuStreamOrDefault(stream));
        }
Пример #3
0
 public virtual void FillAsync(uint value, CudaStream stream = null)
 {
     Device[Owner.GPU].MemsetAsync(value, MyKernelFactory.GetCuStreamOrDefault(stream));
 }
Пример #4
0
 /// <summary>
 /// Asynchonously copies the whole block or part of it when the destination is not large enough.
 /// </summary>
 public virtual void CopyToMemoryBlockAsync(MyMemoryBlock <T> destination, CudaStream stream = null)
 {
     destination.GetDevice(Owner.GPU).AsyncCopyToDevice(Device[Owner.GPU], MyKernelFactory.GetCuStreamOrDefault(stream));
 }
Пример #5
0
 /// <summary>
 /// Asynchonously copies the whole source block or part of it when the destination is not large enough.
 /// </summary>
 public virtual void CopyFromMemoryBlockAsync(MyMemoryBlock <T> source, CudaStream stream = null)
 {
     Device[Owner.GPU].AsyncCopyToDevice(source.GetDevice(Owner.GPU), MyKernelFactory.GetCuStreamOrDefault(stream));
 }