Esempio n. 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));
 }
Esempio n. 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));
        }
Esempio n. 3
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));
 }
Esempio n. 4
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));
 }
Esempio n. 5
0
 public virtual void CopyToMemoryBlock(MyMemoryBlock <T> destination, int srcOffset, int destOffset, int count)
 {
     destination.GetDevice(Owner.GPU).CopyToDevice(
         Device[Owner.GPU], srcOffset * ESize, destOffset * ESize, count * ESize);
 }
Esempio n. 6
0
 public virtual void CopyFromMemoryBlock(MyMemoryBlock <T> source, int srcOffset, int destOffset, int count)
 {
     Device[Owner.GPU].CopyToDevice(
         source.GetDevice(Owner.GPU), srcOffset * ESize, destOffset * ESize, count * ESize);
 }
Esempio n. 7
0
        public virtual void CopyToMemoryBlock(MyMemoryBlock <T> destination, int srcOffset, int destOffset, int count)
        {
            int size = Marshal.SizeOf(typeof(T));

            destination.GetDevice(Owner.GPU).CopyToDevice(Device[Owner.GPU], srcOffset * size, destOffset * size, count * size);
        }
Esempio n. 8
0
        public virtual void CopyFromMemoryBlock(MyMemoryBlock <T> source, int srcOffset, int destOffset, int count)
        {
            int size = Marshal.SizeOf(typeof(T));

            Device[Owner.GPU].CopyToDevice(source.GetDevice(Owner.GPU), srcOffset * size, destOffset * size, count * size);
        }