Backends/SiaNet.Backend.TensorSharp/Cuda/CudaBasicOps.cs
/// <summary>
/// Copies the cpu to gpu.
/// </summary>
/// <param name="result">The result.</param>
/// <param name="src">The source.</param>
/// <exception cref="InvalidOperationException">Tensors must have equal numbers of elements</exception>
Copies the cpu to gpu.
Copies the cpu to gpu .
[RegisterOpArgCount("copy")]
        public void CopyCpuToGpu(
            [OpArgStorageType(typeof(CudaStorage))] NDArray result,
            [OpArgStorageType(typeof(Cpu.CpuStorage))] NDArray src)
        {
            var totalElements = result.ElementCount();
            if (totalElements != src.ElementCount())
                throw new InvalidOperationException("Tensors must have equal numbers of elements");
            if (src.DimensionCount == 0) return;
            copyOps.CopyCpuToGpu(result, src, totalElements);
        }
[ RegisterOpArgCount ( " " ) ] public void CopyCpuToGpu ( [ OpArgStorageType ( typeof ( CudaStorage ) ) ] NDArray result , [ OpArgStorageType ( typeof ( Cpu . CpuStorage ) ) ] NDArray src ) { var totalElements = result . ElementCount ( ) ; if ( totalElements != src . ElementCount ( ) ) throw new InvalidOperationException ( " " ) ; if ( src . DimensionCount == 0 ) return ; copyOps . CopyCpuToGpu ( result , src , totalElements ) ; }
Copies the cpu to gpu.
Copies the cpu to gpu .
Tensors must have equal numbers of elements
Tensors must have equal numbers of elements
NDArray
[OpArgStorageType(typeof(Cpu.CpuStorage))]
result
None
src
None