Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        public void CooGet(out CudaDeviceVariable <indexT> cooRowInd,
                           out CudaDeviceVariable <indexT> cooColInd,
                           out CudaDeviceVariable <dataT> cooValues)
        {
            CUdeviceptr ptrRowIdx = new CUdeviceptr();
            CUdeviceptr ptrColIdx = new CUdeviceptr();
            CUdeviceptr ptrValues = new CUdeviceptr();

            res = CudaSparseNativeMethods.cusparseCooGet(descr, ref rows, ref cols, ref nnz, ref ptrRowIdx,
                                                         ref ptrColIdx, ref ptrValues, ref typeIndices, ref idxBase, ref typeData);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cusparseCooGet", res));

            if (res != cusparseStatus.Success)
            {
                throw new CudaSparseException(res);
            }

            cooRowInd = new CudaDeviceVariable <indexT>(ptrRowIdx);
            cooColInd = new CudaDeviceVariable <indexT>(ptrColIdx);
            cooValues = new CudaDeviceVariable <dataT>(ptrValues);
        }