Exemple #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;
 }
 public CpuGpuArrayInt(CpuGpuArrayInt array, int rows, int cols)
 {
     _gpuModule = array._gpuModule;
     CPUArray = array.CPUArray;
     GPUArray = array.GPUArray;
     RowCount = rows;
     ColCount = cols;
 }
 public CpuGpuArrayInt(CpuGpuArrayInt array, int rows, int cols)
 {
     _gpuModule = array._gpuModule;
     CPUArray   = array.CPUArray;
     GPUArray   = array.GPUArray;
     RowCount   = rows;
     ColCount   = cols;
 }
        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);
            }
        }