コード例 #1
0
ファイル: CudaELLPACKmodMatrix.cs プロジェクト: xyuan/BoSSS
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="M">Sparse matrix in MSR format</param>
 /// <param name="CudaEnv"></param>
 public CudaELLPACKmodMatrix(MsrMatrix M, CudaEnviroment CudaEnv)
     : base(M, "ellMultiply", CudaEnv)
 {
     m_internalData = (ELLPACKmod)m_LocalMtx;
     size           = m_internalData.NoOfRows;
     colCount       = m_internalData.NoOfPackedCols;
     valStride      = m_internalData.MtxEntries.ColStride;
     colStride      = m_internalData.ColInd.ColStride;
     blockcount     = (int)Math.Ceiling((Decimal)size / blocksize);
 }
コード例 #2
0
        public clELLPACKmodMatrix(MsrMatrix M, clDevice device)
            : base(M, device, "ellMultiply")
        {
            m_internalData = (ELLPACKmod)m_LocalMtx;

            size      = m_internalData.NoOfRows;
            colCount  = m_internalData.NoOfPackedCols;
            valStride = m_internalData.MtxEntries.ColStride;
            colStride = m_internalData.ColInd.ColStride;

            localsize  = 256;
            globalsize = size;
            int m = size % localsize;

            if (m > 0)
            {
                globalsize += localsize - m;
            }
        }