Exemplo n.º 1
0
 public CpuGpuArrayInt AddIntArray(ArrayName arrayName, int dim1, int dim2)
 {
     var dim = dim1 * dim2;
     var res = new CpuGpuArrayInt(this._gpuModule, dim1, dim2);
     _IntArrays.Add(arrayName, res);
     return res;
 }
Exemplo n.º 2
0
 public CpuGpuArrayInt(CpuGpuArrayInt array, int rows, int cols)
 {
     _gpuModule = array._gpuModule;
     CPUArray = array.CPUArray;
     GPUArray = array.GPUArray;
     RowCount = rows;
     ColCount = cols;
 }
Exemplo n.º 3
0
 public CpuGpuArrayInt(CpuGpuArrayInt array, int rows, int cols)
 {
     _gpuModule = array._gpuModule;
     CPUArray   = array.CPUArray;
     GPUArray   = array.GPUArray;
     RowCount   = rows;
     ColCount   = cols;
 }
Exemplo n.º 4
0
        void InitArrays(int dataSize, int rowCount)
        {
            if (NonZeroCount > dataSize)
            {
                throw new ArgumentException();
            }
            DataSize   = dataSize;
            RowCount   = rowCount;
            CPUValues  = new float[DataSize];
            CPUIndices = new int[DataSize];

            if (_gpuModule != null)
            {
                GPUValues  = CpuGpuArray.AllocateGPUArray(_gpuModule, DataSize);
                GPUIndices = CpuGpuArrayInt.AllocateGPUArray(_gpuModule, DataSize);
            }
        }