OSDN Git Service

modified: utilsrc/src/Admin/Makefile
[eos/others.git] / utiltools / X86MAC64 / cuda / doc / html / cusparse / index.html
1 <!DOCTYPE html
2   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us" xml:lang="en-us">
4    <head>
5       <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
6       <meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>
7       <meta name="copyright" content="(C) Copyright 2005"></meta>
8       <meta name="DC.rights.owner" content="(C) Copyright 2005"></meta>
9       <meta name="DC.Type" content="concept"></meta>
10       <meta name="DC.Title" content="CUSPARSE"></meta>
11       <meta name="abstract" content="The API reference guide for CUSPARSE, the CUDA sparse matrix library."></meta>
12       <meta name="description" content="The API reference guide for CUSPARSE, the CUDA sparse matrix library."></meta>
13       <meta name="DC.Coverage" content="CUDA API References"></meta>
14       <meta name="DC.subject" content="CUDA CUSPARSE, CUDA CUSPARSE asynchronous execution, CUDA CUSPARSE index format, CUDA CUSPARSE vector format, CUDA CUSPARSE matrix format, CUDA CUSPARSE type, CUDA CUSPARSE helper function, CUDA CUSPARSE format conversion, CUDA CUSPARSE preconditioners, CUDA CUSPARSE level function"></meta>
15       <meta name="keywords" content="CUDA CUSPARSE, CUDA CUSPARSE asynchronous execution, CUDA CUSPARSE index format, CUDA CUSPARSE vector format, CUDA CUSPARSE matrix format, CUDA CUSPARSE type, CUDA CUSPARSE helper function, CUDA CUSPARSE format conversion, CUDA CUSPARSE preconditioners, CUDA CUSPARSE level function"></meta>
16       <meta name="DC.Format" content="XHTML"></meta>
17       <meta name="DC.Identifier" content="abstract"></meta>
18       <link rel="stylesheet" type="text/css" href="../common/formatting/commonltr.css"></link>
19       <link rel="stylesheet" type="text/css" href="../common/formatting/site.css"></link>
20       <title>CUSPARSE :: CUDA Toolkit Documentation</title>
21       <!--[if lt IE 9]>
22       <script src="../common/formatting/html5shiv-printshiv.min.js"></script>
23       <![endif]-->
24       <script type="text/javascript" charset="utf-8" src="../common/formatting/jquery.min.js"></script>
25       <script type="text/javascript" charset="utf-8" src="../common/formatting/jquery.ba-hashchange.min.js"></script>
26       <link rel="canonical" href="http://docs.nvidia.com/cuda/cusparse/index.html"></link>
27       <link rel="stylesheet" type="text/css" href="../common/formatting/qwcode.highlight.css"></link>
28    </head>
29    <body>
30       
31       <article id="contents">
32          <div id="eqn-warning">This document includes math equations
33             (highlighted in red) which are best viewed with <a target="_blank" href="https://www.mozilla.org/firefox">Firefox</a> version 4.0
34             or higher, or another <a target="_blank" href="http://www.w3.org/Math/Software/mathml_software_cat_browsers.html">MathML-aware
35                browser</a>. There is also a <a href="../../pdf/CUSPARSE_Library.pdf">PDF version of this
36                document</a>.
37             
38          </div>
39          <div id="eqn-warning-buf"></div>
40          <div id="release-info">CUSPARSE
41             (<a href="../../pdf/CUSPARSE_Library.pdf">PDF</a>)
42             -
43             CUDA Toolkit v5.5
44             (<a href="https://developer.nvidia.com/cuda-toolkit-archive">older</a>)
45             -
46             Last updated 
47             September 5, 2013
48             -
49             <a href="mailto:cudatools@nvidia.com?subject=CUDA Tools Documentation Feedback: cusparse">Send Feedback</a></div>
50          <div class="topic nested0" id="abstract"><a name="abstract" shape="rect">
51                <!-- --></a><h2 class="title topictitle1"><a href="#abstract" name="abstract" shape="rect">CUSPARSE</a></h2>
52             <div class="body conbody"></div>
53          </div>
54          <div class="topic concept nested0" id="introduction"><a name="introduction" shape="rect">
55                <!-- --></a><h2 class="title topictitle1"><a href="#introduction" name="introduction" shape="rect">1.&nbsp;Introduction</a></h2>
56             <div class="body conbody">
57                <p class="p">The CUSPARSE library contains a set of basic linear algebra subroutines used for handling sparse
58                   matrices. It is implemented on top of the NVIDIA® CUDA™ runtime (which is part of the
59                   CUDA Toolkit) and is designed to be called from C and C++. The library routines can be classified
60                   into four categories:
61                </p>
62                <div class="p"><a name="introduction__ul_wnl_2dp_sg" shape="rect">
63                      <!-- --></a><ul class="ul" id="introduction__ul_wnl_2dp_sg">
64                      <li class="li">Level 1: operations between a vector in sparse format and a vector in dense format</li>
65                      <li class="li">Level 2: operations between a matrix in sparse format and a vector in dense format</li>
66                      <li class="li">Level 3: operations between a matrix in sparse format and a set of vectors in dense format
67                         (which can also usually be viewed as a dense tall matrix)
68                      </li>
69                      <li class="li">Conversion: operations that allow conversion between different matrix formats</li>
70                   </ul>
71                </div>
72                <p class="p">The CUSPARSE library allows developers to access the computational resources of the NVIDIA
73                   graphics processing unit (GPU), although it does not auto-parallelize across multiple GPUs. The
74                   CUSPARSE API assumes that input and output data reside in GPU (device) memory, unless it is
75                   explicitly indicated otherwise by the string <samp class="ph codeph">DevHostPtr</samp> in a function parameter's
76                   name (for example, the parameter <samp class="ph codeph">*resultDevHostPtr</samp> in the function
77                   <samp class="ph codeph">cusparse&lt;t&gt;doti()</samp>).
78                </p>
79                <p class="p">It is the responsibility of the developer to allocate memory and to copy data between GPU memory
80                   and CPU memory using standard CUDA runtime API routines, such as <samp class="ph codeph">cudaMalloc()</samp>,
81                   <samp class="ph codeph">cudaFree()</samp>, <samp class="ph codeph">cudaMemcpy()</samp>, and
82                   <samp class="ph codeph">cudaMemcpyAsync()</samp>.
83                </p>
84                <div class="p">
85                   <div class="note note"><span class="notetitle">Note:</span> The CUSPARSE library requires hardware with compute capability (CC) of at least 1.1 or higher.
86                      Please see the <em class="ph i">NVIDIA CUDA C Programming Guide, Appendix A</em> for a list of the compute
87                      capabilities corresponding to all NVIDIA GPUs.
88                   </div>
89                </div>
90             </div>
91             <div class="topic concept nested1" id="naming-convention"><a name="naming-convention" shape="rect">
92                   <!-- --></a><h3 class="title topictitle2"><a href="#naming-convention" name="naming-convention" shape="rect">1.1.&nbsp;Naming Conventions</a></h3>
93                <div class="body conbody">
94                   <p class="p">The CUSPARSE library functions are available for data types <samp class="ph codeph">float</samp>,
95                      <samp class="ph codeph">double</samp>, <samp class="ph codeph">cuComplex</samp>, and <samp class="ph codeph">cuDoubleComplex</samp>.
96                      The sparse Level 1, Level 2, and Level 3 functions follow this naming convention:
97                   </p>
98                   <p class="p"><samp class="ph codeph">cusparse</samp>&lt;<samp class="ph codeph">t</samp>&gt;[&lt;<samp class="ph codeph">matrix data
99                         format</samp>&gt;]&lt;<samp class="ph codeph">operation</samp>&gt;[&lt;<samp class="ph codeph">output matrix
100                         data format</samp>&gt;]
101                   </p>
102                   <p class="p">where &lt;<samp class="ph codeph">t</samp>&gt; can be <samp class="ph codeph">S</samp>, <samp class="ph codeph">D</samp>,
103                      <samp class="ph codeph">C</samp>, <samp class="ph codeph">Z</samp>, or <samp class="ph codeph">X</samp>, corresponding to the data
104                      types <samp class="ph codeph">float</samp>, <samp class="ph codeph">double</samp>, <samp class="ph codeph">cuComplex</samp>,
105                      <samp class="ph codeph">cuDoubleComplex</samp>, and the generic type, respectively.
106                   </p>
107                   <p class="p">The &lt;<samp class="ph codeph">matrix data format</samp>&gt; can be <samp class="ph codeph">dense</samp>,
108                      <samp class="ph codeph">coo</samp>, <samp class="ph codeph">csr</samp>, <samp class="ph codeph">csc</samp>, or <samp class="ph codeph">hyb</samp>,
109                      corresponding to the dense, coordinate, compressed sparse row, compressed sparse column, and
110                      hybrid storage formats, respectively.
111                   </p>
112                   <p class="p">Finally, the &lt;<samp class="ph codeph">operation</samp>&gt; can be <samp class="ph codeph">axpyi</samp>,
113                      <samp class="ph codeph">doti</samp>, <samp class="ph codeph">dotci</samp>, <samp class="ph codeph">gthr</samp>,
114                      <samp class="ph codeph">gthrz</samp>, <samp class="ph codeph">roti</samp>, or <samp class="ph codeph">sctr</samp>, corresponding to the
115                      Level 1 functions; it also can be <samp class="ph codeph">mv</samp> or <samp class="ph codeph">sv</samp>, corresponding to
116                      the Level 2 functions, as well as <samp class="ph codeph">mm</samp> or <samp class="ph codeph">sm</samp>, corresponding to
117                      the Level 3 functions.
118                   </p>
119                   <p class="p">All of the functions have the return type <samp class="ph codeph">cusparseStatus_t</samp> and are explained in
120                      more detail in the chapters that follow.
121                   </p>
122                </div>
123             </div>
124             <div class="topic concept nested1" id="asynchronous-execution"><a name="asynchronous-execution" shape="rect">
125                   <!-- --></a><h3 class="title topictitle2"><a href="#asynchronous-execution" name="asynchronous-execution" shape="rect">1.2.&nbsp;Asynchronous Execution</a></h3>
126                <div class="body conbody">
127                   <p class="p">The CUSPARSE library functions are executed asynchronously with respect to the host and may
128                      return control to the application on the host before the result is ready. Developers can use
129                      the <samp class="ph codeph">cudaDeviceSynchronize()</samp> function to ensure that the execution of a
130                      particular CUSPARSE library routine has completed.
131                   </p>
132                   <p class="p">A developer can also use the <samp class="ph codeph">cudaMemcpy()</samp> routine to copy data from the device
133                      to the host and vice versa, using the <samp class="ph codeph">cudaMemcpyDeviceToHost</samp> and
134                      <samp class="ph codeph">cudaMemcpyHostToDevice</samp> parameters, respectively. In this case there is no
135                      need to add a call to <samp class="ph codeph">cudaDeviceSynchronize()</samp> because the call to
136                      <samp class="ph codeph">cudaMemcpy()</samp> with the above parameters is blocking and completes only when
137                      the results are ready on the host.
138                   </p>
139                </div>
140             </div>
141          </div>
142          <div class="topic concept nested0" id="using-the-cusparse-api"><a name="using-the-cusparse-api" shape="rect">
143                <!-- --></a><h2 class="title topictitle1"><a href="#using-the-cusparse-api" name="using-the-cusparse-api" shape="rect">2.&nbsp;Using the CUSPARSE API</a></h2>
144             <div class="body conbody">
145                <p class="p">This chapter describes how to use the CUSPARSE library API. It is not a reference for the CUSPARSE API data types and functions;
146                   that is provided in subsequent chapters. 
147                </p>
148             </div>
149             <div class="topic concept nested1" id="thread-safety"><a name="thread-safety" shape="rect">
150                   <!-- --></a><h3 class="title topictitle2"><a href="#thread-safety" name="thread-safety" shape="rect">2.1.&nbsp;Thread Safety</a></h3>
151                <div class="body conbody">
152                   <p class="p">The library is thread safe and its functions can be called from multiple host threads.</p>
153                </div>
154             </div>
155             <div class="topic concept nested1" id="scalar-parameters2"><a name="scalar-parameters2" shape="rect">
156                   <!-- --></a><h3 class="title topictitle2"><a href="#scalar-parameters2" name="scalar-parameters2" shape="rect">2.2.&nbsp;Scalar Parameters</a></h3>
157                <div class="body conbody">
158                   <p class="p">In the CUSPARSE API, the scalar parameters 
159                      
160                      <math xmlns="http://www.w3.org/1998/Math/MathML">
161                         <mi>α</mi>
162                      </math>
163                      and 
164                      
165                      <math xmlns="http://www.w3.org/1998/Math/MathML">
166                         <mi>β</mi>
167                      </math>
168                      can be passed by reference on the host or the device.
169                   </p>
170                   <p class="p">The few functions that return a scalar result, such as <samp class="ph codeph">doti()</samp> and
171                      <samp class="ph codeph">nnz()</samp>, return the resulting value by reference on the host or the device.
172                      Even though these functions return immediately, similarly to those that return matrix and
173                      vector results, the scalar result is not ready until execution of the routine on the GPU
174                      completes. This requires proper synchronization be used when reading the result from the
175                      host.
176                   </p>
177                   <p class="p">This feature allows the CUSPARSE library functions to execute completely asynchronously using
178                      streams, even when 
179                      
180                      <math xmlns="http://www.w3.org/1998/Math/MathML">
181                         <mi>α</mi>
182                      </math>
183                      and 
184                      
185                      <math xmlns="http://www.w3.org/1998/Math/MathML">
186                         <mi>β</mi>
187                      </math>
188                      are generated by a previous kernel. This situation arises, for example, when the
189                      library is used to implement iterative methods for the solution of linear systems and
190                      eigenvalue problems [3].
191                   </p>
192                </div>
193             </div>
194             <div class="topic concept nested1" id="parallelism-with-streams"><a name="parallelism-with-streams" shape="rect">
195                   <!-- --></a><h3 class="title topictitle2"><a href="#parallelism-with-streams" name="parallelism-with-streams" shape="rect">2.3.&nbsp;Parallelism with Streams</a></h3>
196                <div class="body conbody">
197                   <p class="p">If the application performs several small independent computations, or if it makes data transfers
198                      in parallel with the computation, CUDA streams can be used to overlap these tasks.
199                   </p>
200                   <p class="p">The application can conceptually associate a stream with each task. To achieve the overlap of
201                      computation between the tasks, the developer should create CUDA streams using the
202                      function <samp class="ph codeph">cudaStreamCreate()</samp> and set the stream to be used by each
203                      individual CUSPARSE library routine by calling
204                      <samp class="ph codeph">cusparseSetStream()</samp> just before calling the actual CUSPARSE
205                      routine. Then, computations performed in separate streams would be overlapped
206                      automatically on the GPU, when possible. This approach is especially useful when
207                      the computation performed by a single task is relatively small and is not enough
208                      to fill the GPU with work, or when there is a data transfer that can be performed
209                      in parallel with the computation.
210                   </p>
211                   <p class="p">When streams are used, we recommend using the new CUSPARSE API with scalar parameters and results
212                      passed by reference in the device memory to achieve maximum computational
213                      overlap.
214                   </p>
215                   <p class="p">Although a developer can create many streams, in practice it is not possible to have more than 16
216                      concurrent kernels executing at the same time.
217                   </p>
218                </div>
219             </div>
220          </div>
221          <div class="topic concept nested0" id="cusparse-indexing-and-data-formats"><a name="cusparse-indexing-and-data-formats" shape="rect">
222                <!-- --></a><h2 class="title topictitle1"><a href="#cusparse-indexing-and-data-formats" name="cusparse-indexing-and-data-formats" shape="rect">3.&nbsp;CUSPARSE Indexing and Data Formats</a></h2>
223             <div class="body conbody">
224                <p class="p">The CUSPARSE library supports dense and sparse vector, and dense and sparse matrix formats.</p>
225             </div>
226             <div class="topic concept nested1" id="index-base-format"><a name="index-base-format" shape="rect">
227                   <!-- --></a><h3 class="title topictitle2"><a href="#index-base-format" name="index-base-format" shape="rect">3.1.&nbsp;Index Base Format</a></h3>
228                <div class="body conbody">
229                   <p class="p">The library supports zero- and one-based indexing. The index base is selected through the <samp class="ph codeph">cusparseIndexBase_t</samp> type, which is passed as a standalone parameter or as a field in the matrix descriptor <samp class="ph codeph">cusparseMatDescr_t</samp> type.
230                   </p>
231                </div>
232             </div>
233             <div class="topic concept nested1" id="vector-formats"><a name="vector-formats" shape="rect">
234                   <!-- --></a><h3 class="title topictitle2"><a href="#vector-formats" name="vector-formats" shape="rect">3.2.&nbsp;Vector Formats</a></h3>
235                <div class="body conbody">
236                   <p class="p">This section describes dense and sparse vector formats.</p>
237                </div>
238                <div class="topic concept nested2" id="dense-format"><a name="dense-format" shape="rect">
239                      <!-- --></a><h3 class="title topictitle2"><a href="#dense-format" name="dense-format" shape="rect">3.2.1.&nbsp;Dense Format</a></h3>
240                   <div class="body conbody">
241                      <p class="p">Dense vectors are represented with a single data array that is stored linearly in memory, such as
242                         the following 
243                         
244                         <math xmlns="http://www.w3.org/1998/Math/MathML">
245                            <mn>7</mn>
246                            <mo>×</mo>
247                            <mn>1</mn>
248                         </math>
249                         dense vector.
250                      </p>
251                      <div class="tablenoborder">
252                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
253                            <tbody class="tbody">
254                               <tr class="row">
255                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
256                                     <p class="p d4p_eqn_block">
257                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
258                                           <mfenced open="[" close="]">
259                                              <mtable rowspacing="4pt" columnspacing="1em">
260                                                 <mtr>
261                                                    <mtd>
262                                                       <mn>1.0</mn>
263                                                    </mtd>
264                                                    <mtd>
265                                                       <mn>0.0</mn>
266                                                    </mtd>
267                                                    <mtd>
268                                                       <mn>0.0</mn>
269                                                    </mtd>
270                                                    <mtd>
271                                                       <mn>2.0</mn>
272                                                    </mtd>
273                                                    <mtd>
274                                                       <mn>3.0</mn>
275                                                    </mtd>
276                                                    <mtd>
277                                                       <mn>0.0</mn>
278                                                    </mtd>
279                                                    <mtd>
280                                                       <mn>4.0</mn>
281                                                    </mtd>
282                                                 </mtr>
283                                              </mtable>
284                                           </mfenced>
285                                        </math>
286                                     </p>
287                                  </td>
288                               </tr>
289                            </tbody>
290                         </table>
291                      </div>
292                      <p class="p">(This vector is referenced again in the next section.)</p>
293                   </div>
294                </div>
295                <div class="topic concept nested2" id="sparse-format"><a name="sparse-format" shape="rect">
296                      <!-- --></a><h3 class="title topictitle2"><a href="#sparse-format" name="sparse-format" shape="rect">3.2.2.&nbsp;Sparse Format</a></h3>
297                   <div class="body conbody">
298                      <p class="p">Sparse vectors are represented with two arrays.</p>
299                      <ul class="ul">
300                         <li class="li">
301                            <p class="p">The <em class="ph i">data array</em> has the nonzero values from the equivalent array in dense format.
302                            </p>
303                         </li>
304                         <li class="li">
305                            <p class="p">The <em class="ph i">integer index array</em> has the positions of the corresponding nonzero values in the equivalent array in dense format.
306                            </p>
307                         </li>
308                      </ul>
309                      <p class="p">For example, the dense vector&nbsp;in section 3.2.1 can be stored as a sparse vector with
310                         one-based indexing.
311                      </p>
312                      <div class="tablenoborder">
313                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
314                            <tbody class="tbody">
315                               <tr class="row">
316                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
317                                     <p class="p d4p_eqn_block">
318                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
319                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
320                                              <mtr>
321                                                 <mtd></mtd>
322                                                 <mtd></mtd>
323                                                 <mtd>
324                                                    <mfenced open="[" close="]">
325                                                       <mtable rowspacing="4pt" columnspacing="1em">
326                                                          <mtr>
327                                                             <mtd>
328                                                                <mn>1.0</mn>
329                                                             </mtd>
330                                                             <mtd>
331                                                                <mn>2.0</mn>
332                                                             </mtd>
333                                                             <mtd>
334                                                                <mn>3.0</mn>
335                                                             </mtd>
336                                                             <mtd>
337                                                                <mn>4.0</mn>
338                                                             </mtd>
339                                                          </mtr>
340                                                       </mtable>
341                                                    </mfenced>
342                                                 </mtd>
343                                              </mtr>
344                                              <mtr>
345                                                 <mtd></mtd>
346                                                 <mtd></mtd>
347                                                 <mtd>
348                                                    <mfenced open="[" close="]">
349                                                       <mtable rowspacing="4pt" columnspacing="1em">
350                                                          <mtr>
351                                                             <mtd>
352                                                                <mn>1</mn>
353                                                                <mrow class="MJX-TeXAtom-ORD">
354                                                                   <mphantom>
355                                                                      <mn>.0</mn>
356                                                                   </mphantom>
357                                                                </mrow>
358                                                             </mtd>
359                                                             <mtd>
360                                                                <mn>4</mn>
361                                                                <mrow class="MJX-TeXAtom-ORD">
362                                                                   <mphantom>
363                                                                      <mn>.0</mn>
364                                                                   </mphantom>
365                                                                </mrow>
366                                                             </mtd>
367                                                             <mtd>
368                                                                <mn>5</mn>
369                                                                <mrow class="MJX-TeXAtom-ORD">
370                                                                   <mphantom>
371                                                                      <mn>.0</mn>
372                                                                   </mphantom>
373                                                                </mrow>
374                                                             </mtd>
375                                                             <mtd>
376                                                                <mn>7</mn>
377                                                                <mrow class="MJX-TeXAtom-ORD">
378                                                                   <mphantom>
379                                                                      <mn>.0</mn>
380                                                                   </mphantom>
381                                                                </mrow>
382                                                             </mtd>
383                                                          </mtr>
384                                                       </mtable>
385                                                    </mfenced>
386                                                 </mtd>
387                                              </mtr>
388                                           </mtable>
389                                        </math>
390                                     </p>
391                                  </td>
392                               </tr>
393                            </tbody>
394                         </table>
395                      </div>
396                      <p class="p">It can also be stored as a sparse vector with zero-based indexing.</p>
397                      <div class="tablenoborder">
398                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
399                            <tbody class="tbody">
400                               <tr class="row">
401                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
402                                     <p class="p d4p_eqn_block">
403                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
404                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
405                                              <mtr>
406                                                 <mtd></mtd>
407                                                 <mtd></mtd>
408                                                 <mtd>
409                                                    <mfenced open="[" close="]">
410                                                       <mtable rowspacing="4pt" columnspacing="1em">
411                                                          <mtr>
412                                                             <mtd>
413                                                                <mn>1.0</mn>
414                                                             </mtd>
415                                                             <mtd>
416                                                                <mn>2.0</mn>
417                                                             </mtd>
418                                                             <mtd>
419                                                                <mn>3.0</mn>
420                                                             </mtd>
421                                                             <mtd>
422                                                                <mn>4.0</mn>
423                                                             </mtd>
424                                                          </mtr>
425                                                       </mtable>
426                                                    </mfenced>
427                                                 </mtd>
428                                              </mtr>
429                                              <mtr>
430                                                 <mtd></mtd>
431                                                 <mtd></mtd>
432                                                 <mtd>
433                                                    <mfenced open="[" close="]">
434                                                       <mtable rowspacing="4pt" columnspacing="1em">
435                                                          <mtr>
436                                                             <mtd>
437                                                                <mn>0</mn>
438                                                                <mrow class="MJX-TeXAtom-ORD">
439                                                                   <mphantom>
440                                                                      <mn>.0</mn>
441                                                                   </mphantom>
442                                                                </mrow>
443                                                             </mtd>
444                                                             <mtd>
445                                                                <mn>3</mn>
446                                                                <mrow class="MJX-TeXAtom-ORD">
447                                                                   <mphantom>
448                                                                      <mn>.0</mn>
449                                                                   </mphantom>
450                                                                </mrow>
451                                                             </mtd>
452                                                             <mtd>
453                                                                <mn>4</mn>
454                                                                <mrow class="MJX-TeXAtom-ORD">
455                                                                   <mphantom>
456                                                                      <mn>.0</mn>
457                                                                   </mphantom>
458                                                                </mrow>
459                                                             </mtd>
460                                                             <mtd>
461                                                                <mn>6</mn>
462                                                                <mrow class="MJX-TeXAtom-ORD">
463                                                                   <mphantom>
464                                                                      <mn>.0</mn>
465                                                                   </mphantom>
466                                                                </mrow>
467                                                             </mtd>
468                                                          </mtr>
469                                                       </mtable>
470                                                    </mfenced>
471                                                 </mtd>
472                                              </mtr>
473                                           </mtable>
474                                        </math>
475                                     </p>
476                                  </td>
477                               </tr>
478                            </tbody>
479                         </table>
480                      </div>
481                      <p class="p">In each example, the top row is the data array and the bottom row is the index array, and it
482                         is assumed that the indices are provided in increasing order and that each index appears only
483                         once.
484                      </p>
485                   </div>
486                </div>
487             </div>
488             <div class="topic concept nested1" id="matrix-formats"><a name="matrix-formats" shape="rect">
489                   <!-- --></a><h3 class="title topictitle2"><a href="#matrix-formats" name="matrix-formats" shape="rect">3.3.&nbsp;Matrix Formats</a></h3>
490                <div class="body conbody">
491                   <p class="p">Dense and several sparse formats for matrices are discussed in this section.</p>
492                </div>
493                <div class="topic concept nested2" id="dense-format2"><a name="dense-format2" shape="rect">
494                      <!-- --></a><h3 class="title topictitle2"><a href="#dense-format2" name="dense-format2" shape="rect">3.3.1.&nbsp;Dense Format</a></h3>
495                   <div class="body conbody">
496                      <p class="p">The dense matrix <samp class="ph codeph">X</samp> is assumed to be stored in column-major format in memory and
497                         is represented by the following parameters.
498                      </p>
499                      <div class="tablenoborder">
500                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
501                            <tbody class="tbody">
502                               <tr class="row">
503                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
504                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
505                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The number of rows in the matrix.</td>
506                               </tr>
507                               <tr class="row">
508                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
509                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
510                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The number of columns in the matrix.</td>
511                               </tr>
512                               <tr class="row">
513                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">ldX</samp></td>
514                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
515                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The leading dimension of <samp class="ph codeph">X</samp>, which must be greater than or equal to
516                                     <samp class="ph codeph">m</samp>. If <samp class="ph codeph">ldX</samp> is greater than <samp class="ph codeph">m</samp>, then
517                                     <samp class="ph codeph">X</samp> represents a sub-matrix of a larger matrix stored in
518                                     memory
519                                  </td>
520                               </tr>
521                               <tr class="row">
522                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">X</samp></td>
523                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
524                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the data array containing the matrix elements. It is assumed that enough storage
525                                     is allocated for <samp class="ph codeph">X</samp> to hold all of the matrix elements and that
526                                     CUSPARSE library functions may access values outside of the sub-matrix, but will never
527                                     overwrite them.
528                                  </td>
529                               </tr>
530                            </tbody>
531                         </table>
532                      </div>
533                      <p class="p">For example, <samp class="ph codeph">m×n</samp> dense matrix <samp class="ph codeph">X</samp> with leading dimension
534                         <samp class="ph codeph">ldX</samp> can be stored with one-based indexing as shown.
535                      </p>
536                      <div class="tablenoborder">
537                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
538                            <tbody class="tbody">
539                               <tr class="row">
540                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
541                                     <p class="p d4p_eqn_block">
542                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
543                                           <mfenced open="[" close="]">
544                                              <mtable rowspacing="4pt" columnspacing="1em">
545                                                 <mtr>
546                                                    <mtd>
547                                                       <msub>
548                                                          <mi>X</mi>
549                                                          <mrow class="MJX-TeXAtom-ORD">
550                                                             <mn>1</mn>
551                                                             <mo>,</mo>
552                                                             <mn>1</mn>
553                                                          </mrow>
554                                                       </msub>
555                                                    </mtd>
556                                                    <mtd>
557                                                       <msub>
558                                                          <mi>X</mi>
559                                                          <mrow class="MJX-TeXAtom-ORD">
560                                                             <mn>1</mn>
561                                                             <mo>,</mo>
562                                                             <mn>2</mn>
563                                                          </mrow>
564                                                       </msub>
565                                                    </mtd>
566                                                    <mtd>
567                                                       <mo>⋯</mo>
568                                                    </mtd>
569                                                    <mtd>
570                                                       <msub>
571                                                          <mi>X</mi>
572                                                          <mrow class="MJX-TeXAtom-ORD">
573                                                             <mn>1</mn>
574                                                             <mo>,</mo>
575                                                             <mi>n</mi>
576                                                          </mrow>
577                                                       </msub>
578                                                    </mtd>
579                                                 </mtr>
580                                                 <mtr>
581                                                    <mtd>
582                                                       <msub>
583                                                          <mi>X</mi>
584                                                          <mrow class="MJX-TeXAtom-ORD">
585                                                             <mn>2</mn>
586                                                             <mo>,</mo>
587                                                             <mn>1</mn>
588                                                          </mrow>
589                                                       </msub>
590                                                    </mtd>
591                                                    <mtd>
592                                                       <msub>
593                                                          <mi>X</mi>
594                                                          <mrow class="MJX-TeXAtom-ORD">
595                                                             <mn>2</mn>
596                                                             <mo>,</mo>
597                                                             <mn>2</mn>
598                                                          </mrow>
599                                                       </msub>
600                                                    </mtd>
601                                                    <mtd>
602                                                       <mo>⋯</mo>
603                                                    </mtd>
604                                                    <mtd>
605                                                       <msub>
606                                                          <mi>X</mi>
607                                                          <mrow class="MJX-TeXAtom-ORD">
608                                                             <mn>2</mn>
609                                                             <mo>,</mo>
610                                                             <mi>n</mi>
611                                                          </mrow>
612                                                       </msub>
613                                                    </mtd>
614                                                 </mtr>
615                                                 <mtr>
616                                                    <mtd>
617                                                       <mo>⋮</mo>
618                                                    </mtd>
619                                                    <mtd>
620                                                       <mo>⋮</mo>
621                                                    </mtd>
622                                                    <mtd>
623                                                       <mo>⋱</mo>
624                                                    </mtd>
625                                                    <mtd>
626                                                       <mo>⋮</mo>
627                                                    </mtd>
628                                                 </mtr>
629                                                 <mtr>
630                                                    <mtd>
631                                                       <msub>
632                                                          <mi>X</mi>
633                                                          <mrow class="MJX-TeXAtom-ORD">
634                                                             <mi>m</mi>
635                                                             <mo>,</mo>
636                                                             <mn>1</mn>
637                                                          </mrow>
638                                                       </msub>
639                                                    </mtd>
640                                                    <mtd>
641                                                       <msub>
642                                                          <mi>X</mi>
643                                                          <mrow class="MJX-TeXAtom-ORD">
644                                                             <mi>m</mi>
645                                                             <mo>,</mo>
646                                                             <mn>2</mn>
647                                                          </mrow>
648                                                       </msub>
649                                                    </mtd>
650                                                    <mtd>
651                                                       <mo>⋯</mo>
652                                                    </mtd>
653                                                    <mtd>
654                                                       <msub>
655                                                          <mi>X</mi>
656                                                          <mrow class="MJX-TeXAtom-ORD">
657                                                             <mi>m</mi>
658                                                             <mo>,</mo>
659                                                             <mi>n</mi>
660                                                          </mrow>
661                                                       </msub>
662                                                    </mtd>
663                                                 </mtr>
664                                                 <mtr>
665                                                    <mtd>
666                                                       <mo>⋮</mo>
667                                                    </mtd>
668                                                    <mtd>
669                                                       <mo>⋮</mo>
670                                                    </mtd>
671                                                    <mtd>
672                                                       <mo>⋱</mo>
673                                                    </mtd>
674                                                    <mtd>
675                                                       <mo>⋮</mo>
676                                                    </mtd>
677                                                 </mtr>
678                                                 <mtr>
679                                                    <mtd>
680                                                       <msub>
681                                                          <mi>X</mi>
682                                                          <mrow class="MJX-TeXAtom-ORD">
683                                                             <mi>l</mi>
684                                                             <mi>d</mi>
685                                                             <mi>X</mi>
686                                                             <mo>,</mo>
687                                                             <mn>1</mn>
688                                                          </mrow>
689                                                       </msub>
690                                                    </mtd>
691                                                    <mtd>
692                                                       <msub>
693                                                          <mi>X</mi>
694                                                          <mrow class="MJX-TeXAtom-ORD">
695                                                             <mi>l</mi>
696                                                             <mi>d</mi>
697                                                             <mi>X</mi>
698                                                             <mo>,</mo>
699                                                             <mn>2</mn>
700                                                          </mrow>
701                                                       </msub>
702                                                    </mtd>
703                                                    <mtd>
704                                                       <mo>⋯</mo>
705                                                    </mtd>
706                                                    <mtd>
707                                                       <msub>
708                                                          <mi>X</mi>
709                                                          <mrow class="MJX-TeXAtom-ORD">
710                                                             <mi>l</mi>
711                                                             <mi>d</mi>
712                                                             <mi>X</mi>
713                                                             <mo>,</mo>
714                                                             <mi>n</mi>
715                                                          </mrow>
716                                                       </msub>
717                                                    </mtd>
718                                                 </mtr>
719                                              </mtable>
720                                           </mfenced>
721                                        </math>
722                                     </p>
723                                  </td>
724                               </tr>
725                            </tbody>
726                         </table>
727                      </div>
728                      <p class="p">Its elements are arranged linearly in memory in the order below.</p>
729                      <div class="tablenoborder">
730                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
731                            <tbody class="tbody">
732                               <tr class="row">
733                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
734                                     <p class="p d4p_eqn_block">
735                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
736                                           <mfenced open="[" close="]">
737                                              <mtable rowspacing="4pt" columnspacing="1em">
738                                                 <mtr>
739                                                    <mtd>
740                                                       <msub>
741                                                          <mi>X</mi>
742                                                          <mrow class="MJX-TeXAtom-ORD">
743                                                             <mn>1</mn>
744                                                             <mo>,</mo>
745                                                             <mn>1</mn>
746                                                          </mrow>
747                                                       </msub>
748                                                    </mtd>
749                                                    <mtd>
750                                                       <msub>
751                                                          <mi>X</mi>
752                                                          <mrow class="MJX-TeXAtom-ORD">
753                                                             <mn>2</mn>
754                                                             <mo>,</mo>
755                                                             <mn>1</mn>
756                                                          </mrow>
757                                                       </msub>
758                                                    </mtd>
759                                                    <mtd>
760                                                       <mo>⋯</mo>
761                                                    </mtd>
762                                                    <mtd>
763                                                       <msub>
764                                                          <mi>X</mi>
765                                                          <mrow class="MJX-TeXAtom-ORD">
766                                                             <mi>m</mi>
767                                                             <mo>,</mo>
768                                                             <mn>1</mn>
769                                                          </mrow>
770                                                       </msub>
771                                                    </mtd>
772                                                    <mtd>
773                                                       <mo>⋯</mo>
774                                                    </mtd>
775                                                    <mtd>
776                                                       <msub>
777                                                          <mi>X</mi>
778                                                          <mrow class="MJX-TeXAtom-ORD">
779                                                             <mi>l</mi>
780                                                             <mi>d</mi>
781                                                             <mi>X</mi>
782                                                             <mo>,</mo>
783                                                             <mn>1</mn>
784                                                          </mrow>
785                                                       </msub>
786                                                    </mtd>
787                                                    <mtd>
788                                                       <mo>⋯</mo>
789                                                    </mtd>
790                                                    <mtd>
791                                                       <msub>
792                                                          <mi>X</mi>
793                                                          <mrow class="MJX-TeXAtom-ORD">
794                                                             <mn>1</mn>
795                                                             <mo>,</mo>
796                                                             <mi>n</mi>
797                                                          </mrow>
798                                                       </msub>
799                                                    </mtd>
800                                                    <mtd>
801                                                       <msub>
802                                                          <mi>X</mi>
803                                                          <mrow class="MJX-TeXAtom-ORD">
804                                                             <mn>2</mn>
805                                                             <mo>,</mo>
806                                                             <mi>n</mi>
807                                                          </mrow>
808                                                       </msub>
809                                                    </mtd>
810                                                    <mtd>
811                                                       <mo>⋯</mo>
812                                                    </mtd>
813                                                    <mtd>
814                                                       <msub>
815                                                          <mi>X</mi>
816                                                          <mrow class="MJX-TeXAtom-ORD">
817                                                             <mi>m</mi>
818                                                             <mo>,</mo>
819                                                             <mi>n</mi>
820                                                          </mrow>
821                                                       </msub>
822                                                    </mtd>
823                                                    <mtd>
824                                                       <mo>⋯</mo>
825                                                    </mtd>
826                                                    <mtd>
827                                                       <msub>
828                                                          <mi>X</mi>
829                                                          <mrow class="MJX-TeXAtom-ORD">
830                                                             <mi>l</mi>
831                                                             <mi>d</mi>
832                                                             <mi>X</mi>
833                                                             <mo>,</mo>
834                                                             <mi>n</mi>
835                                                          </mrow>
836                                                       </msub>
837                                                    </mtd>
838                                                 </mtr>
839                                              </mtable>
840                                           </mfenced>
841                                        </math>
842                                     </p>
843                                  </td>
844                               </tr>
845                            </tbody>
846                         </table>
847                      </div>
848                      <div class="note note"><span class="notetitle">Note:</span> This format and notation are similar to those used in the NVIDIA CUDA CUBLAS
849                         library.
850                      </div>
851                   </div>
852                </div>
853                <div class="topic concept nested2" id="coordinate-format-coo"><a name="coordinate-format-coo" shape="rect">
854                      <!-- --></a><h3 class="title topictitle2"><a href="#coordinate-format-coo" name="coordinate-format-coo" shape="rect">3.3.2.&nbsp;Coordinate Format (COO)</a></h3>
855                   <div class="body conbody">
856                      <p class="p">The <samp class="ph codeph">m×n</samp> sparse matrix <samp class="ph codeph">A</samp> is represented in COO format
857                         by the following parameters.
858                      </p>
859                      <div class="tablenoborder">
860                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
861                            <tbody class="tbody">
862                               <tr class="row">
863                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
864                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
865                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The number of nonzero elements in the matrix.</td>
866                               </tr>
867                               <tr class="row">
868                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">cooValA</samp></td>
869                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
870                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the data array of length <samp class="ph codeph">nnz</samp> that holds all nonzero
871                                     values of <samp class="ph codeph">A</samp> in row-major format.
872                                  </td>
873                               </tr>
874                               <tr class="row">
875                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">cooRowIndA</samp></td>
876                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
877                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the integer array of length <samp class="ph codeph">nnz</samp> that contains the row
878                                     indices of the corresponding elements in array <samp class="ph codeph">cooValA</samp>.
879                                  </td>
880                               </tr>
881                               <tr class="row">
882                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">cooColIndA</samp></td>
883                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
884                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the integer array of length <samp class="ph codeph">nnz</samp> that contains the
885                                     column indices of the corresponding elements in array
886                                     <samp class="ph codeph">cooValA</samp>.
887                                  </td>
888                               </tr>
889                            </tbody>
890                         </table>
891                      </div>
892                      <p class="p">A sparse matrix in COO format is assumed to be stored in row-major format: the index arrays
893                         are first sorted by row indices and then within the same row by compressed column indices. It
894                         is assumed that each pair of row and column indices appears only once.
895                      </p>
896                      <p class="p">For example, consider the following 
897                         
898                         <math xmlns="http://www.w3.org/1998/Math/MathML">
899                            <mn>4</mn>
900                            <mo>×</mo>
901                            <mn>5</mn>
902                         </math>
903                         matrix <samp class="ph codeph">A</samp>.
904                      </p>
905                      <div class="tablenoborder">
906                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
907                            <tbody class="tbody">
908                               <tr class="row">
909                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
910                                     <p class="p d4p_eqn_block">
911                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
912                                           <mfenced open="[" close="]">
913                                              <mtable rowspacing="4pt" columnspacing="1em">
914                                                 <mtr>
915                                                    <mtd>
916                                                       <mn>1.0</mn>
917                                                    </mtd>
918                                                    <mtd>
919                                                       <mn>4.0</mn>
920                                                    </mtd>
921                                                    <mtd>
922                                                       <mn>0.0</mn>
923                                                    </mtd>
924                                                    <mtd>
925                                                       <mn>0.0</mn>
926                                                    </mtd>
927                                                    <mtd>
928                                                       <mn>0.0</mn>
929                                                    </mtd>
930                                                 </mtr>
931                                                 <mtr>
932                                                    <mtd>
933                                                       <mn>0.0</mn>
934                                                    </mtd>
935                                                    <mtd>
936                                                       <mn>2.0</mn>
937                                                    </mtd>
938                                                    <mtd>
939                                                       <mn>3.0</mn>
940                                                    </mtd>
941                                                    <mtd>
942                                                       <mn>0.0</mn>
943                                                    </mtd>
944                                                    <mtd>
945                                                       <mn>0.0</mn>
946                                                    </mtd>
947                                                 </mtr>
948                                                 <mtr>
949                                                    <mtd>
950                                                       <mn>5.0</mn>
951                                                    </mtd>
952                                                    <mtd>
953                                                       <mn>0.0</mn>
954                                                    </mtd>
955                                                    <mtd>
956                                                       <mn>0.0</mn>
957                                                    </mtd>
958                                                    <mtd>
959                                                       <mn>7.0</mn>
960                                                    </mtd>
961                                                    <mtd>
962                                                       <mn>8.0</mn>
963                                                    </mtd>
964                                                 </mtr>
965                                                 <mtr>
966                                                    <mtd>
967                                                       <mn>0.0</mn>
968                                                    </mtd>
969                                                    <mtd>
970                                                       <mn>0.0</mn>
971                                                    </mtd>
972                                                    <mtd>
973                                                       <mn>9.0</mn>
974                                                    </mtd>
975                                                    <mtd>
976                                                       <mn>0.0</mn>
977                                                    </mtd>
978                                                    <mtd>
979                                                       <mn>6.0</mn>
980                                                    </mtd>
981                                                 </mtr>
982                                              </mtable>
983                                           </mfenced>
984                                        </math>
985                                     </p>
986                                  </td>
987                               </tr>
988                            </tbody>
989                         </table>
990                      </div>
991                      <p class="p">It is stored in COO format with zero-based indexing this way.</p>
992                      <div class="tablenoborder">
993                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
994                            <tbody class="tbody">
995                               <tr class="row">
996                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
997                                     <p class="p d4p_eqn_block">
998                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
999                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
1000                                              <mtr>
1001                                                 <mtd>
1002                                                    <mtext>cooValA</mtext>
1003                                                 </mtd>
1004                                                 <mtd>
1005                                                    <mo>=</mo>
1006                                                 </mtd>
1007                                                 <mtd>
1008                                                    <mfenced open="[" close="]">
1009                                                       <mtable rowspacing="4pt" columnspacing="1em">
1010                                                          <mtr>
1011                                                             <mtd>
1012                                                                <mn>1.0</mn>
1013                                                             </mtd>
1014                                                             <mtd>
1015                                                                <mn>4.0</mn>
1016                                                             </mtd>
1017                                                             <mtd>
1018                                                                <mn>2.0</mn>
1019                                                             </mtd>
1020                                                             <mtd>
1021                                                                <mn>3.0</mn>
1022                                                             </mtd>
1023                                                             <mtd>
1024                                                                <mn>5.0</mn>
1025                                                             </mtd>
1026                                                             <mtd>
1027                                                                <mn>7.0</mn>
1028                                                             </mtd>
1029                                                             <mtd>
1030                                                                <mn>8.0</mn>
1031                                                             </mtd>
1032                                                             <mtd>
1033                                                                <mn>9.0</mn>
1034                                                             </mtd>
1035                                                             <mtd>
1036                                                                <mn>6.0</mn>
1037                                                             </mtd>
1038                                                          </mtr>
1039                                                       </mtable>
1040                                                    </mfenced>
1041                                                 </mtd>
1042                                              </mtr>
1043                                              <mtr>
1044                                                 <mtd>
1045                                                    <mtext>cooRowIndA</mtext>
1046                                                 </mtd>
1047                                                 <mtd>
1048                                                    <mo>=</mo>
1049                                                 </mtd>
1050                                                 <mtd>
1051                                                    <mfenced open="[" close="]">
1052                                                       <mtable rowspacing="4pt" columnspacing="1em">
1053                                                          <mtr>
1054                                                             <mtd>
1055                                                                <mn>0</mn>
1056                                                                <mrow class="MJX-TeXAtom-ORD">
1057                                                                   <mphantom>
1058                                                                      <mn>.0</mn>
1059                                                                   </mphantom>
1060                                                                </mrow>
1061                                                             </mtd>
1062                                                             <mtd>
1063                                                                <mn>0</mn>
1064                                                                <mrow class="MJX-TeXAtom-ORD">
1065                                                                   <mphantom>
1066                                                                      <mn>.0</mn>
1067                                                                   </mphantom>
1068                                                                </mrow>
1069                                                             </mtd>
1070                                                             <mtd>
1071                                                                <mn>1</mn>
1072                                                                <mrow class="MJX-TeXAtom-ORD">
1073                                                                   <mphantom>
1074                                                                      <mn>.0</mn>
1075                                                                   </mphantom>
1076                                                                </mrow>
1077                                                             </mtd>
1078                                                             <mtd>
1079                                                                <mn>1</mn>
1080                                                                <mrow class="MJX-TeXAtom-ORD">
1081                                                                   <mphantom>
1082                                                                      <mn>.0</mn>
1083                                                                   </mphantom>
1084                                                                </mrow>
1085                                                             </mtd>
1086                                                             <mtd>
1087                                                                <mn>2</mn>
1088                                                                <mrow class="MJX-TeXAtom-ORD">
1089                                                                   <mphantom>
1090                                                                      <mn>.0</mn>
1091                                                                   </mphantom>
1092                                                                </mrow>
1093                                                             </mtd>
1094                                                             <mtd>
1095                                                                <mn>2</mn>
1096                                                                <mrow class="MJX-TeXAtom-ORD">
1097                                                                   <mphantom>
1098                                                                      <mn>.0</mn>
1099                                                                   </mphantom>
1100                                                                </mrow>
1101                                                             </mtd>
1102                                                             <mtd>
1103                                                                <mn>2</mn>
1104                                                                <mrow class="MJX-TeXAtom-ORD">
1105                                                                   <mphantom>
1106                                                                      <mn>.0</mn>
1107                                                                   </mphantom>
1108                                                                </mrow>
1109                                                             </mtd>
1110                                                             <mtd>
1111                                                                <mn>3</mn>
1112                                                                <mrow class="MJX-TeXAtom-ORD">
1113                                                                   <mphantom>
1114                                                                      <mn>.0</mn>
1115                                                                   </mphantom>
1116                                                                </mrow>
1117                                                             </mtd>
1118                                                             <mtd>
1119                                                                <mn>3</mn>
1120                                                                <mrow class="MJX-TeXAtom-ORD">
1121                                                                   <mphantom>
1122                                                                      <mn>.0</mn>
1123                                                                   </mphantom>
1124                                                                </mrow>
1125                                                             </mtd>
1126                                                          </mtr>
1127                                                       </mtable>
1128                                                    </mfenced>
1129                                                 </mtd>
1130                                              </mtr>
1131                                              <mtr>
1132                                                 <mtd>
1133                                                    <mtext>cooColIndA</mtext>
1134                                                 </mtd>
1135                                                 <mtd>
1136                                                    <mo>=</mo>
1137                                                 </mtd>
1138                                                 <mtd>
1139                                                    <mfenced open="[" close="]">
1140                                                       <mtable rowspacing="4pt" columnspacing="1em">
1141                                                          <mtr>
1142                                                             <mtd>
1143                                                                <mn>0</mn>
1144                                                                <mrow class="MJX-TeXAtom-ORD">
1145                                                                   <mphantom>
1146                                                                      <mn>.0</mn>
1147                                                                   </mphantom>
1148                                                                </mrow>
1149                                                             </mtd>
1150                                                             <mtd>
1151                                                                <mn>1</mn>
1152                                                                <mrow class="MJX-TeXAtom-ORD">
1153                                                                   <mphantom>
1154                                                                      <mn>.0</mn>
1155                                                                   </mphantom>
1156                                                                </mrow>
1157                                                             </mtd>
1158                                                             <mtd>
1159                                                                <mn>1</mn>
1160                                                                <mrow class="MJX-TeXAtom-ORD">
1161                                                                   <mphantom>
1162                                                                      <mn>.0</mn>
1163                                                                   </mphantom>
1164                                                                </mrow>
1165                                                             </mtd>
1166                                                             <mtd>
1167                                                                <mn>2</mn>
1168                                                                <mrow class="MJX-TeXAtom-ORD">
1169                                                                   <mphantom>
1170                                                                      <mn>.0</mn>
1171                                                                   </mphantom>
1172                                                                </mrow>
1173                                                             </mtd>
1174                                                             <mtd>
1175                                                                <mn>0</mn>
1176                                                                <mrow class="MJX-TeXAtom-ORD">
1177                                                                   <mphantom>
1178                                                                      <mn>.0</mn>
1179                                                                   </mphantom>
1180                                                                </mrow>
1181                                                             </mtd>
1182                                                             <mtd>
1183                                                                <mn>3</mn>
1184                                                                <mrow class="MJX-TeXAtom-ORD">
1185                                                                   <mphantom>
1186                                                                      <mn>.0</mn>
1187                                                                   </mphantom>
1188                                                                </mrow>
1189                                                             </mtd>
1190                                                             <mtd>
1191                                                                <mn>4</mn>
1192                                                                <mrow class="MJX-TeXAtom-ORD">
1193                                                                   <mphantom>
1194                                                                      <mn>.0</mn>
1195                                                                   </mphantom>
1196                                                                </mrow>
1197                                                             </mtd>
1198                                                             <mtd>
1199                                                                <mn>2</mn>
1200                                                                <mrow class="MJX-TeXAtom-ORD">
1201                                                                   <mphantom>
1202                                                                      <mn>.0</mn>
1203                                                                   </mphantom>
1204                                                                </mrow>
1205                                                             </mtd>
1206                                                             <mtd>
1207                                                                <mn>4</mn>
1208                                                                <mrow class="MJX-TeXAtom-ORD">
1209                                                                   <mphantom>
1210                                                                      <mn>.0</mn>
1211                                                                   </mphantom>
1212                                                                </mrow>
1213                                                             </mtd>
1214                                                          </mtr>
1215                                                       </mtable>
1216                                                    </mfenced>
1217                                                 </mtd>
1218                                              </mtr>
1219                                           </mtable>
1220                                        </math>
1221                                     </p>
1222                                  </td>
1223                               </tr>
1224                            </tbody>
1225                         </table>
1226                      </div>
1227                      <p class="p">In the COO format with one-based indexing, it is stored as shown.</p>
1228                      <div class="tablenoborder">
1229                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
1230                            <tbody class="tbody">
1231                               <tr class="row">
1232                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
1233                                     <p class="p d4p_eqn_block">
1234                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
1235                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
1236                                              <mtr>
1237                                                 <mtd>
1238                                                    <mtext>cooValA</mtext>
1239                                                 </mtd>
1240                                                 <mtd>
1241                                                    <mo>=</mo>
1242                                                 </mtd>
1243                                                 <mtd>
1244                                                    <mfenced open="[" close="]">
1245                                                       <mtable rowspacing="4pt" columnspacing="1em">
1246                                                          <mtr>
1247                                                             <mtd>
1248                                                                <mn>1.0</mn>
1249                                                             </mtd>
1250                                                             <mtd>
1251                                                                <mn>4.0</mn>
1252                                                             </mtd>
1253                                                             <mtd>
1254                                                                <mn>2.0</mn>
1255                                                             </mtd>
1256                                                             <mtd>
1257                                                                <mn>3.0</mn>
1258                                                             </mtd>
1259                                                             <mtd>
1260                                                                <mn>5.0</mn>
1261                                                             </mtd>
1262                                                             <mtd>
1263                                                                <mn>7.0</mn>
1264                                                             </mtd>
1265                                                             <mtd>
1266                                                                <mn>8.0</mn>
1267                                                             </mtd>
1268                                                             <mtd>
1269                                                                <mn>9.0</mn>
1270                                                             </mtd>
1271                                                             <mtd>
1272                                                                <mn>6.0</mn>
1273                                                             </mtd>
1274                                                          </mtr>
1275                                                       </mtable>
1276                                                    </mfenced>
1277                                                 </mtd>
1278                                              </mtr>
1279                                              <mtr>
1280                                                 <mtd>
1281                                                    <mtext>cooRowIndA</mtext>
1282                                                 </mtd>
1283                                                 <mtd>
1284                                                    <mo>=</mo>
1285                                                 </mtd>
1286                                                 <mtd>
1287                                                    <mfenced open="[" close="]">
1288                                                       <mtable rowspacing="4pt" columnspacing="1em">
1289                                                          <mtr>
1290                                                             <mtd>
1291                                                                <mn>1</mn>
1292                                                                <mrow class="MJX-TeXAtom-ORD">
1293                                                                   <mphantom>
1294                                                                      <mn>.0</mn>
1295                                                                   </mphantom>
1296                                                                </mrow>
1297                                                             </mtd>
1298                                                             <mtd>
1299                                                                <mn>1</mn>
1300                                                                <mrow class="MJX-TeXAtom-ORD">
1301                                                                   <mphantom>
1302                                                                      <mn>.0</mn>
1303                                                                   </mphantom>
1304                                                                </mrow>
1305                                                             </mtd>
1306                                                             <mtd>
1307                                                                <mn>2</mn>
1308                                                                <mrow class="MJX-TeXAtom-ORD">
1309                                                                   <mphantom>
1310                                                                      <mn>.0</mn>
1311                                                                   </mphantom>
1312                                                                </mrow>
1313                                                             </mtd>
1314                                                             <mtd>
1315                                                                <mn>2</mn>
1316                                                                <mrow class="MJX-TeXAtom-ORD">
1317                                                                   <mphantom>
1318                                                                      <mn>.0</mn>
1319                                                                   </mphantom>
1320                                                                </mrow>
1321                                                             </mtd>
1322                                                             <mtd>
1323                                                                <mn>3</mn>
1324                                                                <mrow class="MJX-TeXAtom-ORD">
1325                                                                   <mphantom>
1326                                                                      <mn>.0</mn>
1327                                                                   </mphantom>
1328                                                                </mrow>
1329                                                             </mtd>
1330                                                             <mtd>
1331                                                                <mn>3</mn>
1332                                                                <mrow class="MJX-TeXAtom-ORD">
1333                                                                   <mphantom>
1334                                                                      <mn>.0</mn>
1335                                                                   </mphantom>
1336                                                                </mrow>
1337                                                             </mtd>
1338                                                             <mtd>
1339                                                                <mn>3</mn>
1340                                                                <mrow class="MJX-TeXAtom-ORD">
1341                                                                   <mphantom>
1342                                                                      <mn>.0</mn>
1343                                                                   </mphantom>
1344                                                                </mrow>
1345                                                             </mtd>
1346                                                             <mtd>
1347                                                                <mn>4</mn>
1348                                                                <mrow class="MJX-TeXAtom-ORD">
1349                                                                   <mphantom>
1350                                                                      <mn>.0</mn>
1351                                                                   </mphantom>
1352                                                                </mrow>
1353                                                             </mtd>
1354                                                             <mtd>
1355                                                                <mn>4</mn>
1356                                                                <mrow class="MJX-TeXAtom-ORD">
1357                                                                   <mphantom>
1358                                                                      <mn>.0</mn>
1359                                                                   </mphantom>
1360                                                                </mrow>
1361                                                             </mtd>
1362                                                          </mtr>
1363                                                       </mtable>
1364                                                    </mfenced>
1365                                                 </mtd>
1366                                              </mtr>
1367                                              <mtr>
1368                                                 <mtd>
1369                                                    <mtext>cooColIndA</mtext>
1370                                                 </mtd>
1371                                                 <mtd>
1372                                                    <mo>=</mo>
1373                                                 </mtd>
1374                                                 <mtd>
1375                                                    <mfenced open="[" close="]">
1376                                                       <mtable rowspacing="4pt" columnspacing="1em">
1377                                                          <mtr>
1378                                                             <mtd>
1379                                                                <mn>1</mn>
1380                                                                <mrow class="MJX-TeXAtom-ORD">
1381                                                                   <mphantom>
1382                                                                      <mn>.0</mn>
1383                                                                   </mphantom>
1384                                                                </mrow>
1385                                                             </mtd>
1386                                                             <mtd>
1387                                                                <mn>2</mn>
1388                                                                <mrow class="MJX-TeXAtom-ORD">
1389                                                                   <mphantom>
1390                                                                      <mn>.0</mn>
1391                                                                   </mphantom>
1392                                                                </mrow>
1393                                                             </mtd>
1394                                                             <mtd>
1395                                                                <mn>2</mn>
1396                                                                <mrow class="MJX-TeXAtom-ORD">
1397                                                                   <mphantom>
1398                                                                      <mn>.0</mn>
1399                                                                   </mphantom>
1400                                                                </mrow>
1401                                                             </mtd>
1402                                                             <mtd>
1403                                                                <mn>3</mn>
1404                                                                <mrow class="MJX-TeXAtom-ORD">
1405                                                                   <mphantom>
1406                                                                      <mn>.0</mn>
1407                                                                   </mphantom>
1408                                                                </mrow>
1409                                                             </mtd>
1410                                                             <mtd>
1411                                                                <mn>1</mn>
1412                                                                <mrow class="MJX-TeXAtom-ORD">
1413                                                                   <mphantom>
1414                                                                      <mn>.0</mn>
1415                                                                   </mphantom>
1416                                                                </mrow>
1417                                                             </mtd>
1418                                                             <mtd>
1419                                                                <mn>4</mn>
1420                                                                <mrow class="MJX-TeXAtom-ORD">
1421                                                                   <mphantom>
1422                                                                      <mn>.0</mn>
1423                                                                   </mphantom>
1424                                                                </mrow>
1425                                                             </mtd>
1426                                                             <mtd>
1427                                                                <mn>5</mn>
1428                                                                <mrow class="MJX-TeXAtom-ORD">
1429                                                                   <mphantom>
1430                                                                      <mn>.0</mn>
1431                                                                   </mphantom>
1432                                                                </mrow>
1433                                                             </mtd>
1434                                                             <mtd>
1435                                                                <mn>3</mn>
1436                                                                <mrow class="MJX-TeXAtom-ORD">
1437                                                                   <mphantom>
1438                                                                      <mn>.0</mn>
1439                                                                   </mphantom>
1440                                                                </mrow>
1441                                                             </mtd>
1442                                                             <mtd>
1443                                                                <mn>5</mn>
1444                                                                <mrow class="MJX-TeXAtom-ORD">
1445                                                                   <mphantom>
1446                                                                      <mn>.0</mn>
1447                                                                   </mphantom>
1448                                                                </mrow>
1449                                                             </mtd>
1450                                                          </mtr>
1451                                                       </mtable>
1452                                                    </mfenced>
1453                                                 </mtd>
1454                                              </mtr>
1455                                           </mtable>
1456                                        </math>
1457                                     </p>
1458                                  </td>
1459                               </tr>
1460                            </tbody>
1461                         </table>
1462                      </div>
1463                   </div>
1464                </div>
1465                <div class="topic concept nested2" id="compressed-sparse-row-format-csr"><a name="compressed-sparse-row-format-csr" shape="rect">
1466                      <!-- --></a><h3 class="title topictitle2"><a href="#compressed-sparse-row-format-csr" name="compressed-sparse-row-format-csr" shape="rect">3.3.3.&nbsp;Compressed Sparse Row Format (CSR)</a></h3>
1467                   <div class="body conbody">
1468                      <p class="p">The only way the CSR differs from the COO format is that the array containing the row indices is
1469                         compressed in CSR format. The <samp class="ph codeph">m×n</samp> sparse matrix <samp class="ph codeph">A</samp> is
1470                         represented in CSR format by the following parameters.
1471                      </p>
1472                      <div class="tablenoborder">
1473                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
1474                            <tbody class="tbody">
1475                               <tr class="row">
1476                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
1477                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
1478                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The number of nonzero elements in the matrix.</td>
1479                               </tr>
1480                               <tr class="row">
1481                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
1482                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
1483                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the data array of length <samp class="ph codeph">nnz</samp> that holds all nonzero values of A
1484                                     in row-major format.
1485                                  </td>
1486                               </tr>
1487                               <tr class="row">
1488                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
1489                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
1490                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the integer array of length <samp class="ph codeph">m+1</samp> that holds indices into the
1491                                     arrays <samp class="ph codeph">csrColIndA</samp> and <samp class="ph codeph">csrValA</samp>. The first
1492                                     <samp class="ph codeph">m</samp> entries of this array contain the indices of the first nonzero
1493                                     element in the <samp class="ph codeph">i</samp>th row for <samp class="ph codeph">i=i,...,m</samp>, while the last
1494                                     entry contains <samp class="ph codeph">nnz+csrRowPtrA(0)</samp>. In general,
1495                                     <samp class="ph codeph">csrRowPtrA(0)</samp> is <samp class="ph codeph">0</samp> or <samp class="ph codeph">1</samp> for zero-
1496                                     and one-based indexing, respectively.
1497                                  </td>
1498                               </tr>
1499                               <tr class="row">
1500                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
1501                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
1502                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the integer array of length <samp class="ph codeph">nnz</samp> that contains the column indices of the corresponding elements in array <samp class="ph codeph">csrValA</samp>.
1503                                  </td>
1504                               </tr>
1505                            </tbody>
1506                         </table>
1507                      </div>
1508                      <p class="p">Sparse matrices  in CSR format are assumed to be stored in row-major CSR format, in other words,
1509                         the index arrays are first sorted by row indices and then within the same row by column
1510                         indices. It is assumed that each pair of row and column indices appears only once.
1511                      </p>
1512                      <p class="p">Consider again the 
1513                         
1514                         <math xmlns="http://www.w3.org/1998/Math/MathML">
1515                            <mn>4</mn>
1516                            <mo>×</mo>
1517                            <mn>5</mn>
1518                         </math>
1519                         matrix<samp class="ph codeph">A</samp>.
1520                      </p>
1521                      <div class="tablenoborder">
1522                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
1523                            <tbody class="tbody">
1524                               <tr class="row">
1525                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
1526                                     <p class="p d4p_eqn_block">
1527                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
1528                                           <mfenced open="[" close="]">
1529                                              <mtable rowspacing="4pt" columnspacing="1em">
1530                                                 <mtr>
1531                                                    <mtd>
1532                                                       <mn>1.0</mn>
1533                                                    </mtd>
1534                                                    <mtd>
1535                                                       <mn>4.0</mn>
1536                                                    </mtd>
1537                                                    <mtd>
1538                                                       <mn>0.0</mn>
1539                                                    </mtd>
1540                                                    <mtd>
1541                                                       <mn>0.0</mn>
1542                                                    </mtd>
1543                                                    <mtd>
1544                                                       <mn>0.0</mn>
1545                                                    </mtd>
1546                                                 </mtr>
1547                                                 <mtr>
1548                                                    <mtd>
1549                                                       <mn>0.0</mn>
1550                                                    </mtd>
1551                                                    <mtd>
1552                                                       <mn>2.0</mn>
1553                                                    </mtd>
1554                                                    <mtd>
1555                                                       <mn>3.0</mn>
1556                                                    </mtd>
1557                                                    <mtd>
1558                                                       <mn>0.0</mn>
1559                                                    </mtd>
1560                                                    <mtd>
1561                                                       <mn>0.0</mn>
1562                                                    </mtd>
1563                                                 </mtr>
1564                                                 <mtr>
1565                                                    <mtd>
1566                                                       <mn>5.0</mn>
1567                                                    </mtd>
1568                                                    <mtd>
1569                                                       <mn>0.0</mn>
1570                                                    </mtd>
1571                                                    <mtd>
1572                                                       <mn>0.0</mn>
1573                                                    </mtd>
1574                                                    <mtd>
1575                                                       <mn>7.0</mn>
1576                                                    </mtd>
1577                                                    <mtd>
1578                                                       <mn>8.0</mn>
1579                                                    </mtd>
1580                                                 </mtr>
1581                                                 <mtr>
1582                                                    <mtd>
1583                                                       <mn>0.0</mn>
1584                                                    </mtd>
1585                                                    <mtd>
1586                                                       <mn>0.0</mn>
1587                                                    </mtd>
1588                                                    <mtd>
1589                                                       <mn>9.0</mn>
1590                                                    </mtd>
1591                                                    <mtd>
1592                                                       <mn>0.0</mn>
1593                                                    </mtd>
1594                                                    <mtd>
1595                                                       <mn>6.0</mn>
1596                                                    </mtd>
1597                                                 </mtr>
1598                                              </mtable>
1599                                           </mfenced>
1600                                        </math>
1601                                     </p>
1602                                  </td>
1603                               </tr>
1604                            </tbody>
1605                         </table>
1606                      </div>
1607                      <p class="p">It is stored in CSR format with zero-based indexing as shown.</p>
1608                      <div class="tablenoborder">
1609                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
1610                            <tbody class="tbody">
1611                               <tr class="row">
1612                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
1613                                     <p class="p d4p_eqn_block">
1614                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
1615                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
1616                                              <mtr>
1617                                                 <mtd>
1618                                                    <mtext>csrValA</mtext>
1619                                                 </mtd>
1620                                                 <mtd>
1621                                                    <mo>=</mo>
1622                                                 </mtd>
1623                                                 <mtd>
1624                                                    <mfenced open="[" close="]">
1625                                                       <mtable rowspacing="4pt" columnspacing="1em">
1626                                                          <mtr>
1627                                                             <mtd>
1628                                                                <mn>1.0</mn>
1629                                                             </mtd>
1630                                                             <mtd>
1631                                                                <mn>4.0</mn>
1632                                                             </mtd>
1633                                                             <mtd>
1634                                                                <mn>2.0</mn>
1635                                                             </mtd>
1636                                                             <mtd>
1637                                                                <mn>3.0</mn>
1638                                                             </mtd>
1639                                                             <mtd>
1640                                                                <mn>5.0</mn>
1641                                                             </mtd>
1642                                                             <mtd>
1643                                                                <mn>7.0</mn>
1644                                                             </mtd>
1645                                                             <mtd>
1646                                                                <mn>8.0</mn>
1647                                                             </mtd>
1648                                                             <mtd>
1649                                                                <mn>9.0</mn>
1650                                                             </mtd>
1651                                                             <mtd>
1652                                                                <mn>6.0</mn>
1653                                                             </mtd>
1654                                                          </mtr>
1655                                                       </mtable>
1656                                                    </mfenced>
1657                                                 </mtd>
1658                                              </mtr>
1659                                              <mtr>
1660                                                 <mtd>
1661                                                    <mtext>csrRowPtrA</mtext>
1662                                                 </mtd>
1663                                                 <mtd>
1664                                                    <mo>=</mo>
1665                                                 </mtd>
1666                                                 <mtd>
1667                                                    <mfenced open="[" close="]">
1668                                                       <mtable rowspacing="4pt" columnspacing="1em">
1669                                                          <mtr>
1670                                                             <mtd>
1671                                                                <mn>0</mn>
1672                                                                <mrow class="MJX-TeXAtom-ORD">
1673                                                                   <mphantom>
1674                                                                      <mn>.0</mn>
1675                                                                   </mphantom>
1676                                                                </mrow>
1677                                                             </mtd>
1678                                                             <mtd>
1679                                                                <mn>2</mn>
1680                                                                <mrow class="MJX-TeXAtom-ORD">
1681                                                                   <mphantom>
1682                                                                      <mn>.0</mn>
1683                                                                   </mphantom>
1684                                                                </mrow>
1685                                                             </mtd>
1686                                                             <mtd>
1687                                                                <mn>4</mn>
1688                                                                <mrow class="MJX-TeXAtom-ORD">
1689                                                                   <mphantom>
1690                                                                      <mn>.0</mn>
1691                                                                   </mphantom>
1692                                                                </mrow>
1693                                                             </mtd>
1694                                                             <mtd>
1695                                                                <mn>7</mn>
1696                                                                <mrow class="MJX-TeXAtom-ORD">
1697                                                                   <mphantom>
1698                                                                      <mn>.0</mn>
1699                                                                   </mphantom>
1700                                                                </mrow>
1701                                                             </mtd>
1702                                                             <mtd>
1703                                                                <mn>9</mn>
1704                                                                <mrow class="MJX-TeXAtom-ORD">
1705                                                                   <mphantom>
1706                                                                      <mn>.0</mn>
1707                                                                   </mphantom>
1708                                                                </mrow>
1709                                                             </mtd>
1710                                                          </mtr>
1711                                                       </mtable>
1712                                                    </mfenced>
1713                                                 </mtd>
1714                                              </mtr>
1715                                              <mtr>
1716                                                 <mtd>
1717                                                    <mtext>csrColIndA</mtext>
1718                                                 </mtd>
1719                                                 <mtd>
1720                                                    <mo>=</mo>
1721                                                 </mtd>
1722                                                 <mtd>
1723                                                    <mfenced open="[" close="]">
1724                                                       <mtable rowspacing="4pt" columnspacing="1em">
1725                                                          <mtr>
1726                                                             <mtd>
1727                                                                <mn>0</mn>
1728                                                                <mrow class="MJX-TeXAtom-ORD">
1729                                                                   <mphantom>
1730                                                                      <mn>.0</mn>
1731                                                                   </mphantom>
1732                                                                </mrow>
1733                                                             </mtd>
1734                                                             <mtd>
1735                                                                <mn>1</mn>
1736                                                                <mrow class="MJX-TeXAtom-ORD">
1737                                                                   <mphantom>
1738                                                                      <mn>.0</mn>
1739                                                                   </mphantom>
1740                                                                </mrow>
1741                                                             </mtd>
1742                                                             <mtd>
1743                                                                <mn>1</mn>
1744                                                                <mrow class="MJX-TeXAtom-ORD">
1745                                                                   <mphantom>
1746                                                                      <mn>.0</mn>
1747                                                                   </mphantom>
1748                                                                </mrow>
1749                                                             </mtd>
1750                                                             <mtd>
1751                                                                <mn>2</mn>
1752                                                                <mrow class="MJX-TeXAtom-ORD">
1753                                                                   <mphantom>
1754                                                                      <mn>.0</mn>
1755                                                                   </mphantom>
1756                                                                </mrow>
1757                                                             </mtd>
1758                                                             <mtd>
1759                                                                <mn>0</mn>
1760                                                                <mrow class="MJX-TeXAtom-ORD">
1761                                                                   <mphantom>
1762                                                                      <mn>.0</mn>
1763                                                                   </mphantom>
1764                                                                </mrow>
1765                                                             </mtd>
1766                                                             <mtd>
1767                                                                <mn>3</mn>
1768                                                                <mrow class="MJX-TeXAtom-ORD">
1769                                                                   <mphantom>
1770                                                                      <mn>.0</mn>
1771                                                                   </mphantom>
1772                                                                </mrow>
1773                                                             </mtd>
1774                                                             <mtd>
1775                                                                <mn>4</mn>
1776                                                                <mrow class="MJX-TeXAtom-ORD">
1777                                                                   <mphantom>
1778                                                                      <mn>.0</mn>
1779                                                                   </mphantom>
1780                                                                </mrow>
1781                                                             </mtd>
1782                                                             <mtd>
1783                                                                <mn>2</mn>
1784                                                                <mrow class="MJX-TeXAtom-ORD">
1785                                                                   <mphantom>
1786                                                                      <mn>.0</mn>
1787                                                                   </mphantom>
1788                                                                </mrow>
1789                                                             </mtd>
1790                                                             <mtd>
1791                                                                <mn>4</mn>
1792                                                                <mrow class="MJX-TeXAtom-ORD">
1793                                                                   <mphantom>
1794                                                                      <mn>.0</mn>
1795                                                                   </mphantom>
1796                                                                </mrow>
1797                                                             </mtd>
1798                                                          </mtr>
1799                                                       </mtable>
1800                                                    </mfenced>
1801                                                 </mtd>
1802                                              </mtr>
1803                                           </mtable>
1804                                        </math>
1805                                     </p>
1806                                  </td>
1807                               </tr>
1808                            </tbody>
1809                         </table>
1810                      </div>
1811                      <p class="p">This is how it is stored in CSR format with one-based indexing.</p>
1812                      <div class="tablenoborder">
1813                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
1814                            <tbody class="tbody">
1815                               <tr class="row">
1816                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
1817                                     <p class="p d4p_eqn_block">
1818                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
1819                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
1820                                              <mtr>
1821                                                 <mtd>
1822                                                    <mtext>csrValA</mtext>
1823                                                 </mtd>
1824                                                 <mtd>
1825                                                    <mo>=</mo>
1826                                                 </mtd>
1827                                                 <mtd>
1828                                                    <mfenced open="[" close="]">
1829                                                       <mtable rowspacing="4pt" columnspacing="1em">
1830                                                          <mtr>
1831                                                             <mtd>
1832                                                                <mn>1.0</mn>
1833                                                             </mtd>
1834                                                             <mtd>
1835                                                                <mn>4.0</mn>
1836                                                             </mtd>
1837                                                             <mtd>
1838                                                                <mn>2.0</mn>
1839                                                             </mtd>
1840                                                             <mtd>
1841                                                                <mn>3.0</mn>
1842                                                             </mtd>
1843                                                             <mtd>
1844                                                                <mn>5.0</mn>
1845                                                             </mtd>
1846                                                             <mtd>
1847                                                                <mn>7.0</mn>
1848                                                             </mtd>
1849                                                             <mtd>
1850                                                                <mn>8.0</mn>
1851                                                             </mtd>
1852                                                             <mtd>
1853                                                                <mn>9.0</mn>
1854                                                             </mtd>
1855                                                             <mtd>
1856                                                                <mn>6.0</mn>
1857                                                             </mtd>
1858                                                          </mtr>
1859                                                       </mtable>
1860                                                    </mfenced>
1861                                                 </mtd>
1862                                              </mtr>
1863                                              <mtr>
1864                                                 <mtd>
1865                                                    <mtext>csrRowPtrA</mtext>
1866                                                 </mtd>
1867                                                 <mtd>
1868                                                    <mo>=</mo>
1869                                                 </mtd>
1870                                                 <mtd>
1871                                                    <mfenced open="[" close="]">
1872                                                       <mtable rowspacing="4pt" columnspacing="1em">
1873                                                          <mtr>
1874                                                             <mtd>
1875                                                                <mn>1</mn>
1876                                                                <mrow class="MJX-TeXAtom-ORD">
1877                                                                   <mphantom>
1878                                                                      <mn>.0</mn>
1879                                                                   </mphantom>
1880                                                                </mrow>
1881                                                             </mtd>
1882                                                             <mtd>
1883                                                                <mn>3</mn>
1884                                                                <mrow class="MJX-TeXAtom-ORD">
1885                                                                   <mphantom>
1886                                                                      <mn>.0</mn>
1887                                                                   </mphantom>
1888                                                                </mrow>
1889                                                             </mtd>
1890                                                             <mtd>
1891                                                                <mn>5</mn>
1892                                                                <mrow class="MJX-TeXAtom-ORD">
1893                                                                   <mphantom>
1894                                                                      <mn>.0</mn>
1895                                                                   </mphantom>
1896                                                                </mrow>
1897                                                             </mtd>
1898                                                             <mtd>
1899                                                                <mn>8</mn>
1900                                                                <mrow class="MJX-TeXAtom-ORD">
1901                                                                   <mphantom>
1902                                                                      <mn>.0</mn>
1903                                                                   </mphantom>
1904                                                                </mrow>
1905                                                             </mtd>
1906                                                             <mtd>
1907                                                                <mn>10</mn>
1908                                                                <mrow class="MJX-TeXAtom-ORD">
1909                                                                   <mphantom>
1910                                                                      <mn>.0</mn>
1911                                                                   </mphantom>
1912                                                                </mrow>
1913                                                             </mtd>
1914                                                          </mtr>
1915                                                       </mtable>
1916                                                    </mfenced>
1917                                                 </mtd>
1918                                              </mtr>
1919                                              <mtr>
1920                                                 <mtd>
1921                                                    <mtext>csrColIndA</mtext>
1922                                                 </mtd>
1923                                                 <mtd>
1924                                                    <mo>=</mo>
1925                                                 </mtd>
1926                                                 <mtd>
1927                                                    <mfenced open="[" close="]">
1928                                                       <mtable rowspacing="4pt" columnspacing="1em">
1929                                                          <mtr>
1930                                                             <mtd>
1931                                                                <mn>1</mn>
1932                                                                <mrow class="MJX-TeXAtom-ORD">
1933                                                                   <mphantom>
1934                                                                      <mn>.0</mn>
1935                                                                   </mphantom>
1936                                                                </mrow>
1937                                                             </mtd>
1938                                                             <mtd>
1939                                                                <mn>2</mn>
1940                                                                <mrow class="MJX-TeXAtom-ORD">
1941                                                                   <mphantom>
1942                                                                      <mn>.0</mn>
1943                                                                   </mphantom>
1944                                                                </mrow>
1945                                                             </mtd>
1946                                                             <mtd>
1947                                                                <mn>2</mn>
1948                                                                <mrow class="MJX-TeXAtom-ORD">
1949                                                                   <mphantom>
1950                                                                      <mn>.0</mn>
1951                                                                   </mphantom>
1952                                                                </mrow>
1953                                                             </mtd>
1954                                                             <mtd>
1955                                                                <mn>3</mn>
1956                                                                <mrow class="MJX-TeXAtom-ORD">
1957                                                                   <mphantom>
1958                                                                      <mn>.0</mn>
1959                                                                   </mphantom>
1960                                                                </mrow>
1961                                                             </mtd>
1962                                                             <mtd>
1963                                                                <mn>1</mn>
1964                                                                <mrow class="MJX-TeXAtom-ORD">
1965                                                                   <mphantom>
1966                                                                      <mn>.0</mn>
1967                                                                   </mphantom>
1968                                                                </mrow>
1969                                                             </mtd>
1970                                                             <mtd>
1971                                                                <mn>4</mn>
1972                                                                <mrow class="MJX-TeXAtom-ORD">
1973                                                                   <mphantom>
1974                                                                      <mn>.0</mn>
1975                                                                   </mphantom>
1976                                                                </mrow>
1977                                                             </mtd>
1978                                                             <mtd>
1979                                                                <mn>5</mn>
1980                                                                <mrow class="MJX-TeXAtom-ORD">
1981                                                                   <mphantom>
1982                                                                      <mn>.0</mn>
1983                                                                   </mphantom>
1984                                                                </mrow>
1985                                                             </mtd>
1986                                                             <mtd>
1987                                                                <mn>3</mn>
1988                                                                <mrow class="MJX-TeXAtom-ORD">
1989                                                                   <mphantom>
1990                                                                      <mn>.0</mn>
1991                                                                   </mphantom>
1992                                                                </mrow>
1993                                                             </mtd>
1994                                                             <mtd>
1995                                                                <mn>5</mn>
1996                                                                <mrow class="MJX-TeXAtom-ORD">
1997                                                                   <mphantom>
1998                                                                      <mn>.0</mn>
1999                                                                   </mphantom>
2000                                                                </mrow>
2001                                                             </mtd>
2002                                                          </mtr>
2003                                                       </mtable>
2004                                                    </mfenced>
2005                                                 </mtd>
2006                                              </mtr>
2007                                           </mtable>
2008                                        </math>
2009                                     </p>
2010                                  </td>
2011                               </tr>
2012                            </tbody>
2013                         </table>
2014                      </div>
2015                   </div>
2016                </div>
2017                <div class="topic concept nested2" id="compressed-sparse-column-format-csc"><a name="compressed-sparse-column-format-csc" shape="rect">
2018                      <!-- --></a><h3 class="title topictitle2"><a href="#compressed-sparse-column-format-csc" name="compressed-sparse-column-format-csc" shape="rect">3.3.4.&nbsp;Compressed Sparse Column Format (CSC)</a></h3>
2019                   <div class="body conbody">
2020                      <p class="p">The CSC format is different from the COO format in two ways: the matrix is stored in
2021                         column-major format, and the array containing the column indices is compressed in CSC format.
2022                         The <samp class="ph codeph">m×n</samp> matrix <samp class="ph codeph">A</samp> is represented in CSC format by the
2023                         following parameters.
2024                      </p>
2025                      <div class="tablenoborder">
2026                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
2027                            <tbody class="tbody">
2028                               <tr class="row">
2029                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
2030                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
2031                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The number of nonzero elements in the matrix.</td>
2032                               </tr>
2033                               <tr class="row">
2034                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">cscValA</samp></td>
2035                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
2036                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the data array of length <samp class="ph codeph">nnz</samp> that holds all nonzero
2037                                     values of <samp class="ph codeph">A</samp> in column-major format.
2038                                  </td>
2039                               </tr>
2040                               <tr class="row">
2041                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">cscRowIndA</samp></td>
2042                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
2043                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the integer array of length <samp class="ph codeph">nnz</samp> that contains the row
2044                                     indices of the corresponding elements in array <samp class="ph codeph">cscValA</samp>.
2045                                  </td>
2046                               </tr>
2047                               <tr class="row">
2048                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">cscColPtrA</samp></td>
2049                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
2050                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the integer array of length <samp class="ph codeph">n+1</samp> that holds indices
2051                                     into the arrays <samp class="ph codeph">cscRowIndA</samp> and <samp class="ph codeph">cscValA</samp>. The first
2052                                     <samp class="ph codeph">n</samp> entries of this array contain the indices of the first nonzero
2053                                     element in the <samp class="ph codeph">i</samp>th row for <samp class="ph codeph">i=i,...,n</samp>, while the last
2054                                     entry contains <samp class="ph codeph">nnz+cscColPtrA(0)</samp>. In general,
2055                                     <samp class="ph codeph">cscColPtrA(0)</samp> is <samp class="ph codeph">0</samp> or <samp class="ph codeph">1</samp> for zero-
2056                                     and one-based indexing, respectively.
2057                                  </td>
2058                               </tr>
2059                            </tbody>
2060                         </table>
2061                      </div>
2062                      <div class="note note"><span class="notetitle">Note:</span> The matrix <samp class="ph codeph">A</samp> in CSR format has exactly the same memory layout as its
2063                         transpose in CSC format (and vice versa).
2064                      </div>
2065                      <p class="p">For example, consider once again the 
2066                         
2067                         <math xmlns="http://www.w3.org/1998/Math/MathML">
2068                            <mn>4</mn>
2069                            <mo>×</mo>
2070                            <mn>5</mn>
2071                         </math>
2072                         matrix <samp class="ph codeph">A</samp>.
2073                      </p>
2074                      <div class="tablenoborder">
2075                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
2076                            <tbody class="tbody">
2077                               <tr class="row">
2078                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
2079                                     <p class="p d4p_eqn_block">
2080                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
2081                                           <mfenced open="[" close="]">
2082                                              <mtable rowspacing="4pt" columnspacing="1em">
2083                                                 <mtr>
2084                                                    <mtd>
2085                                                       <mn>1.0</mn>
2086                                                    </mtd>
2087                                                    <mtd>
2088                                                       <mn>4.0</mn>
2089                                                    </mtd>
2090                                                    <mtd>
2091                                                       <mn>0.0</mn>
2092                                                    </mtd>
2093                                                    <mtd>
2094                                                       <mn>0.0</mn>
2095                                                    </mtd>
2096                                                    <mtd>
2097                                                       <mn>0.0</mn>
2098                                                    </mtd>
2099                                                 </mtr>
2100                                                 <mtr>
2101                                                    <mtd>
2102                                                       <mn>0.0</mn>
2103                                                    </mtd>
2104                                                    <mtd>
2105                                                       <mn>2.0</mn>
2106                                                    </mtd>
2107                                                    <mtd>
2108                                                       <mn>3.0</mn>
2109                                                    </mtd>
2110                                                    <mtd>
2111                                                       <mn>0.0</mn>
2112                                                    </mtd>
2113                                                    <mtd>
2114                                                       <mn>0.0</mn>
2115                                                    </mtd>
2116                                                 </mtr>
2117                                                 <mtr>
2118                                                    <mtd>
2119                                                       <mn>5.0</mn>
2120                                                    </mtd>
2121                                                    <mtd>
2122                                                       <mn>0.0</mn>
2123                                                    </mtd>
2124                                                    <mtd>
2125                                                       <mn>0.0</mn>
2126                                                    </mtd>
2127                                                    <mtd>
2128                                                       <mn>7.0</mn>
2129                                                    </mtd>
2130                                                    <mtd>
2131                                                       <mn>8.0</mn>
2132                                                    </mtd>
2133                                                 </mtr>
2134                                                 <mtr>
2135                                                    <mtd>
2136                                                       <mn>0.0</mn>
2137                                                    </mtd>
2138                                                    <mtd>
2139                                                       <mn>0.0</mn>
2140                                                    </mtd>
2141                                                    <mtd>
2142                                                       <mn>9.0</mn>
2143                                                    </mtd>
2144                                                    <mtd>
2145                                                       <mn>0.0</mn>
2146                                                    </mtd>
2147                                                    <mtd>
2148                                                       <mn>6.0</mn>
2149                                                    </mtd>
2150                                                 </mtr>
2151                                              </mtable>
2152                                           </mfenced>
2153                                        </math>
2154                                     </p>
2155                                  </td>
2156                               </tr>
2157                            </tbody>
2158                         </table>
2159                      </div>
2160                      <p class="p">It is stored in CSC format with zero-based indexing this way.</p>
2161                      <div class="tablenoborder">
2162                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
2163                            <tbody class="tbody">
2164                               <tr class="row">
2165                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
2166                                     <p class="p d4p_eqn_block">
2167                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
2168                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
2169                                              <mtr>
2170                                                 <mtd>
2171                                                    <mtext>cscValA</mtext>
2172                                                 </mtd>
2173                                                 <mtd>
2174                                                    <mo>=</mo>
2175                                                 </mtd>
2176                                                 <mtd>
2177                                                    <mfenced open="[" close="]">
2178                                                       <mtable rowspacing="4pt" columnspacing="1em">
2179                                                          <mtr>
2180                                                             <mtd>
2181                                                                <mn>1.0</mn>
2182                                                             </mtd>
2183                                                             <mtd>
2184                                                                <mn>5.0</mn>
2185                                                             </mtd>
2186                                                             <mtd>
2187                                                                <mn>4.0</mn>
2188                                                             </mtd>
2189                                                             <mtd>
2190                                                                <mn>2.0</mn>
2191                                                             </mtd>
2192                                                             <mtd>
2193                                                                <mn>3.0</mn>
2194                                                             </mtd>
2195                                                             <mtd>
2196                                                                <mn>9.0</mn>
2197                                                             </mtd>
2198                                                             <mtd>
2199                                                                <mn>7.0</mn>
2200                                                             </mtd>
2201                                                             <mtd>
2202                                                                <mn>8.0</mn>
2203                                                             </mtd>
2204                                                             <mtd>
2205                                                                <mn>6.0</mn>
2206                                                             </mtd>
2207                                                          </mtr>
2208                                                       </mtable>
2209                                                    </mfenced>
2210                                                 </mtd>
2211                                              </mtr>
2212                                              <mtr>
2213                                                 <mtd>
2214                                                    <mtext>cscRowIndA</mtext>
2215                                                 </mtd>
2216                                                 <mtd>
2217                                                    <mo>=</mo>
2218                                                 </mtd>
2219                                                 <mtd>
2220                                                    <mfenced open="[" close="]">
2221                                                       <mtable rowspacing="4pt" columnspacing="1em">
2222                                                          <mtr>
2223                                                             <mtd>
2224                                                                <mn>0</mn>
2225                                                                <mrow class="MJX-TeXAtom-ORD">
2226                                                                   <mphantom>
2227                                                                      <mn>.0</mn>
2228                                                                   </mphantom>
2229                                                                </mrow>
2230                                                             </mtd>
2231                                                             <mtd>
2232                                                                <mn>2</mn>
2233                                                                <mrow class="MJX-TeXAtom-ORD">
2234                                                                   <mphantom>
2235                                                                      <mn>.0</mn>
2236                                                                   </mphantom>
2237                                                                </mrow>
2238                                                             </mtd>
2239                                                             <mtd>
2240                                                                <mn>0</mn>
2241                                                                <mrow class="MJX-TeXAtom-ORD">
2242                                                                   <mphantom>
2243                                                                      <mn>.0</mn>
2244                                                                   </mphantom>
2245                                                                </mrow>
2246                                                             </mtd>
2247                                                             <mtd>
2248                                                                <mn>1</mn>
2249                                                                <mrow class="MJX-TeXAtom-ORD">
2250                                                                   <mphantom>
2251                                                                      <mn>.0</mn>
2252                                                                   </mphantom>
2253                                                                </mrow>
2254                                                             </mtd>
2255                                                             <mtd>
2256                                                                <mn>1</mn>
2257                                                                <mrow class="MJX-TeXAtom-ORD">
2258                                                                   <mphantom>
2259                                                                      <mn>.0</mn>
2260                                                                   </mphantom>
2261                                                                </mrow>
2262                                                             </mtd>
2263                                                             <mtd>
2264                                                                <mn>3</mn>
2265                                                                <mrow class="MJX-TeXAtom-ORD">
2266                                                                   <mphantom>
2267                                                                      <mn>.0</mn>
2268                                                                   </mphantom>
2269                                                                </mrow>
2270                                                             </mtd>
2271                                                             <mtd>
2272                                                                <mn>2</mn>
2273                                                                <mrow class="MJX-TeXAtom-ORD">
2274                                                                   <mphantom>
2275                                                                      <mn>.0</mn>
2276                                                                   </mphantom>
2277                                                                </mrow>
2278                                                             </mtd>
2279                                                             <mtd>
2280                                                                <mn>2</mn>
2281                                                                <mrow class="MJX-TeXAtom-ORD">
2282                                                                   <mphantom>
2283                                                                      <mn>.0</mn>
2284                                                                   </mphantom>
2285                                                                </mrow>
2286                                                             </mtd>
2287                                                             <mtd>
2288                                                                <mn>3</mn>
2289                                                                <mrow class="MJX-TeXAtom-ORD">
2290                                                                   <mphantom>
2291                                                                      <mn>.0</mn>
2292                                                                   </mphantom>
2293                                                                </mrow>
2294                                                             </mtd>
2295                                                          </mtr>
2296                                                       </mtable>
2297                                                    </mfenced>
2298                                                 </mtd>
2299                                              </mtr>
2300                                              <mtr>
2301                                                 <mtd>
2302                                                    <mtext>cscColPtrA</mtext>
2303                                                 </mtd>
2304                                                 <mtd>
2305                                                    <mo>=</mo>
2306                                                 </mtd>
2307                                                 <mtd>
2308                                                    <mfenced open="[" close="]">
2309                                                       <mtable rowspacing="4pt" columnspacing="1em">
2310                                                          <mtr>
2311                                                             <mtd>
2312                                                                <mn>0</mn>
2313                                                                <mrow class="MJX-TeXAtom-ORD">
2314                                                                   <mphantom>
2315                                                                      <mn>.0</mn>
2316                                                                   </mphantom>
2317                                                                </mrow>
2318                                                             </mtd>
2319                                                             <mtd>
2320                                                                <mn>2</mn>
2321                                                                <mrow class="MJX-TeXAtom-ORD">
2322                                                                   <mphantom>
2323                                                                      <mn>.0</mn>
2324                                                                   </mphantom>
2325                                                                </mrow>
2326                                                             </mtd>
2327                                                             <mtd>
2328                                                                <mn>4</mn>
2329                                                                <mrow class="MJX-TeXAtom-ORD">
2330                                                                   <mphantom>
2331                                                                      <mn>.0</mn>
2332                                                                   </mphantom>
2333                                                                </mrow>
2334                                                             </mtd>
2335                                                             <mtd>
2336                                                                <mn>6</mn>
2337                                                                <mrow class="MJX-TeXAtom-ORD">
2338                                                                   <mphantom>
2339                                                                      <mn>.0</mn>
2340                                                                   </mphantom>
2341                                                                </mrow>
2342                                                             </mtd>
2343                                                             <mtd>
2344                                                                <mn>7</mn>
2345                                                                <mrow class="MJX-TeXAtom-ORD">
2346                                                                   <mphantom>
2347                                                                      <mn>.0</mn>
2348                                                                   </mphantom>
2349                                                                </mrow>
2350                                                             </mtd>
2351                                                             <mtd>
2352                                                                <mn>9</mn>
2353                                                                <mrow class="MJX-TeXAtom-ORD">
2354                                                                   <mphantom>
2355                                                                      <mn>.0</mn>
2356                                                                   </mphantom>
2357                                                                </mrow>
2358                                                             </mtd>
2359                                                          </mtr>
2360                                                       </mtable>
2361                                                    </mfenced>
2362                                                 </mtd>
2363                                              </mtr>
2364                                           </mtable>
2365                                        </math>
2366                                     </p>
2367                                  </td>
2368                               </tr>
2369                            </tbody>
2370                         </table>
2371                      </div>
2372                      <p class="p">In CSC format with one-based indexing, this is how it is stored.</p>
2373                      <div class="tablenoborder">
2374                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
2375                            <tbody class="tbody">
2376                               <tr class="row">
2377                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
2378                                     <p class="p d4p_eqn_block">
2379                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
2380                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
2381                                              <mtr>
2382                                                 <mtd>
2383                                                    <mtext>cscValA</mtext>
2384                                                 </mtd>
2385                                                 <mtd>
2386                                                    <mo>=</mo>
2387                                                 </mtd>
2388                                                 <mtd>
2389                                                    <mfenced open="[" close="]">
2390                                                       <mtable rowspacing="4pt" columnspacing="1em">
2391                                                          <mtr>
2392                                                             <mtd>
2393                                                                <mn>1.0</mn>
2394                                                             </mtd>
2395                                                             <mtd>
2396                                                                <mn>5.0</mn>
2397                                                             </mtd>
2398                                                             <mtd>
2399                                                                <mn>4.0</mn>
2400                                                             </mtd>
2401                                                             <mtd>
2402                                                                <mn>2.0</mn>
2403                                                             </mtd>
2404                                                             <mtd>
2405                                                                <mn>3.0</mn>
2406                                                             </mtd>
2407                                                             <mtd>
2408                                                                <mn>9.0</mn>
2409                                                             </mtd>
2410                                                             <mtd>
2411                                                                <mn>7.0</mn>
2412                                                             </mtd>
2413                                                             <mtd>
2414                                                                <mn>8.0</mn>
2415                                                             </mtd>
2416                                                             <mtd>
2417                                                                <mn>6.0</mn>
2418                                                             </mtd>
2419                                                          </mtr>
2420                                                       </mtable>
2421                                                    </mfenced>
2422                                                 </mtd>
2423                                              </mtr>
2424                                              <mtr>
2425                                                 <mtd>
2426                                                    <mtext>cscRowIndA</mtext>
2427                                                 </mtd>
2428                                                 <mtd>
2429                                                    <mo>=</mo>
2430                                                 </mtd>
2431                                                 <mtd>
2432                                                    <mfenced open="[" close="]">
2433                                                       <mtable rowspacing="4pt" columnspacing="1em">
2434                                                          <mtr>
2435                                                             <mtd>
2436                                                                <mn>1</mn>
2437                                                                <mrow class="MJX-TeXAtom-ORD">
2438                                                                   <mphantom>
2439                                                                      <mn>.0</mn>
2440                                                                   </mphantom>
2441                                                                </mrow>
2442                                                             </mtd>
2443                                                             <mtd>
2444                                                                <mn>3</mn>
2445                                                                <mrow class="MJX-TeXAtom-ORD">
2446                                                                   <mphantom>
2447                                                                      <mn>.0</mn>
2448                                                                   </mphantom>
2449                                                                </mrow>
2450                                                             </mtd>
2451                                                             <mtd>
2452                                                                <mn>1</mn>
2453                                                                <mrow class="MJX-TeXAtom-ORD">
2454                                                                   <mphantom>
2455                                                                      <mn>.0</mn>
2456                                                                   </mphantom>
2457                                                                </mrow>
2458                                                             </mtd>
2459                                                             <mtd>
2460                                                                <mn>2</mn>
2461                                                                <mrow class="MJX-TeXAtom-ORD">
2462                                                                   <mphantom>
2463                                                                      <mn>.0</mn>
2464                                                                   </mphantom>
2465                                                                </mrow>
2466                                                             </mtd>
2467                                                             <mtd>
2468                                                                <mn>2</mn>
2469                                                                <mrow class="MJX-TeXAtom-ORD">
2470                                                                   <mphantom>
2471                                                                      <mn>.0</mn>
2472                                                                   </mphantom>
2473                                                                </mrow>
2474                                                             </mtd>
2475                                                             <mtd>
2476                                                                <mn>4</mn>
2477                                                                <mrow class="MJX-TeXAtom-ORD">
2478                                                                   <mphantom>
2479                                                                      <mn>.0</mn>
2480                                                                   </mphantom>
2481                                                                </mrow>
2482                                                             </mtd>
2483                                                             <mtd>
2484                                                                <mn>3</mn>
2485                                                                <mrow class="MJX-TeXAtom-ORD">
2486                                                                   <mphantom>
2487                                                                      <mn>.0</mn>
2488                                                                   </mphantom>
2489                                                                </mrow>
2490                                                             </mtd>
2491                                                             <mtd>
2492                                                                <mn>3</mn>
2493                                                                <mrow class="MJX-TeXAtom-ORD">
2494                                                                   <mphantom>
2495                                                                      <mn>.0</mn>
2496                                                                   </mphantom>
2497                                                                </mrow>
2498                                                             </mtd>
2499                                                             <mtd>
2500                                                                <mn>4</mn>
2501                                                                <mrow class="MJX-TeXAtom-ORD">
2502                                                                   <mphantom>
2503                                                                      <mn>.0</mn>
2504                                                                   </mphantom>
2505                                                                </mrow>
2506                                                             </mtd>
2507                                                          </mtr>
2508                                                       </mtable>
2509                                                    </mfenced>
2510                                                 </mtd>
2511                                              </mtr>
2512                                              <mtr>
2513                                                 <mtd>
2514                                                    <mtext>cscColPtrA</mtext>
2515                                                 </mtd>
2516                                                 <mtd>
2517                                                    <mo>=</mo>
2518                                                 </mtd>
2519                                                 <mtd>
2520                                                    <mfenced open="[" close="]">
2521                                                       <mtable rowspacing="4pt" columnspacing="1em">
2522                                                          <mtr>
2523                                                             <mtd>
2524                                                                <mn>1</mn>
2525                                                                <mrow class="MJX-TeXAtom-ORD">
2526                                                                   <mphantom>
2527                                                                      <mn>.0</mn>
2528                                                                   </mphantom>
2529                                                                </mrow>
2530                                                             </mtd>
2531                                                             <mtd>
2532                                                                <mn>3</mn>
2533                                                                <mrow class="MJX-TeXAtom-ORD">
2534                                                                   <mphantom>
2535                                                                      <mn>.0</mn>
2536                                                                   </mphantom>
2537                                                                </mrow>
2538                                                             </mtd>
2539                                                             <mtd>
2540                                                                <mn>5</mn>
2541                                                                <mrow class="MJX-TeXAtom-ORD">
2542                                                                   <mphantom>
2543                                                                      <mn>.0</mn>
2544                                                                   </mphantom>
2545                                                                </mrow>
2546                                                             </mtd>
2547                                                             <mtd>
2548                                                                <mn>7</mn>
2549                                                                <mrow class="MJX-TeXAtom-ORD">
2550                                                                   <mphantom>
2551                                                                      <mn>.0</mn>
2552                                                                   </mphantom>
2553                                                                </mrow>
2554                                                             </mtd>
2555                                                             <mtd>
2556                                                                <mn>8</mn>
2557                                                                <mrow class="MJX-TeXAtom-ORD">
2558                                                                   <mphantom>
2559                                                                      <mn>.0</mn>
2560                                                                   </mphantom>
2561                                                                </mrow>
2562                                                             </mtd>
2563                                                             <mtd>
2564                                                                <mn>10</mn>
2565                                                                <mrow class="MJX-TeXAtom-ORD">
2566                                                                   <mphantom>
2567                                                                      <mn>.0</mn>
2568                                                                   </mphantom>
2569                                                                </mrow>
2570                                                             </mtd>
2571                                                          </mtr>
2572                                                       </mtable>
2573                                                    </mfenced>
2574                                                 </mtd>
2575                                              </mtr>
2576                                           </mtable>
2577                                        </math>
2578                                     </p>
2579                                  </td>
2580                               </tr>
2581                            </tbody>
2582                         </table>
2583                      </div>
2584                      <p class="p"> Each pair of row and column indices appears only once.</p>
2585                   </div>
2586                </div>
2587                <div class="topic concept nested2" id="ellpack-itpack-format-ell"><a name="ellpack-itpack-format-ell" shape="rect">
2588                      <!-- --></a><h3 class="title topictitle2"><a href="#ellpack-itpack-format-ell" name="ellpack-itpack-format-ell" shape="rect">3.3.5.&nbsp;Ellpack-Itpack Format (ELL)</a></h3>
2589                   <div class="body conbody">
2590                      <p class="p">An <samp class="ph codeph">m×n</samp> sparse matrix <samp class="ph codeph">A</samp> with at most
2591                         <samp class="ph codeph">k</samp> nonzero elements per row is stored in the Ellpack-Itpack (ELL) format
2592                         [2] using two dense arrays of dimension <samp class="ph codeph">m×k</samp>. The first data
2593                         array contains the values of the nonzero elements in the matrix, while the second integer
2594                         array contains the corresponding column indices.
2595                      </p>
2596                      <p class="p">For example, consider the 
2597                         
2598                         <math xmlns="http://www.w3.org/1998/Math/MathML">
2599                            <mn>4</mn>
2600                            <mo>×</mo>
2601                            <mn>5</mn>
2602                         </math>
2603                         matrix <samp class="ph codeph">A</samp>.
2604                      </p>
2605                      <div class="tablenoborder">
2606                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
2607                            <tbody class="tbody">
2608                               <tr class="row">
2609                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
2610                                     <p class="p d4p_eqn_block">
2611                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
2612                                           <mfenced open="[" close="]">
2613                                              <mtable rowspacing="4pt" columnspacing="1em">
2614                                                 <mtr>
2615                                                    <mtd>
2616                                                       <mn>1.0</mn>
2617                                                    </mtd>
2618                                                    <mtd>
2619                                                       <mn>4.0</mn>
2620                                                    </mtd>
2621                                                    <mtd>
2622                                                       <mn>0.0</mn>
2623                                                    </mtd>
2624                                                    <mtd>
2625                                                       <mn>0.0</mn>
2626                                                    </mtd>
2627                                                    <mtd>
2628                                                       <mn>0.0</mn>
2629                                                    </mtd>
2630                                                 </mtr>
2631                                                 <mtr>
2632                                                    <mtd>
2633                                                       <mn>0.0</mn>
2634                                                    </mtd>
2635                                                    <mtd>
2636                                                       <mn>2.0</mn>
2637                                                    </mtd>
2638                                                    <mtd>
2639                                                       <mn>3.0</mn>
2640                                                    </mtd>
2641                                                    <mtd>
2642                                                       <mn>0.0</mn>
2643                                                    </mtd>
2644                                                    <mtd>
2645                                                       <mn>0.0</mn>
2646                                                    </mtd>
2647                                                 </mtr>
2648                                                 <mtr>
2649                                                    <mtd>
2650                                                       <mn>5.0</mn>
2651                                                    </mtd>
2652                                                    <mtd>
2653                                                       <mn>0.0</mn>
2654                                                    </mtd>
2655                                                    <mtd>
2656                                                       <mn>0.0</mn>
2657                                                    </mtd>
2658                                                    <mtd>
2659                                                       <mn>7.0</mn>
2660                                                    </mtd>
2661                                                    <mtd>
2662                                                       <mn>8.0</mn>
2663                                                    </mtd>
2664                                                 </mtr>
2665                                                 <mtr>
2666                                                    <mtd>
2667                                                       <mn>0.0</mn>
2668                                                    </mtd>
2669                                                    <mtd>
2670                                                       <mn>0.0</mn>
2671                                                    </mtd>
2672                                                    <mtd>
2673                                                       <mn>9.0</mn>
2674                                                    </mtd>
2675                                                    <mtd>
2676                                                       <mn>0.0</mn>
2677                                                    </mtd>
2678                                                    <mtd>
2679                                                       <mn>6.0</mn>
2680                                                    </mtd>
2681                                                 </mtr>
2682                                              </mtable>
2683                                           </mfenced>
2684                                        </math>
2685                                     </p>
2686                                  </td>
2687                               </tr>
2688                            </tbody>
2689                         </table>
2690                      </div>
2691                      <p class="p">This is how it is stored in ELL format with zero-based indexing.</p>
2692                      <div class="tablenoborder">
2693                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
2694                            <tbody class="tbody">
2695                               <tr class="row">
2696                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
2697                                     <p class="p d4p_eqn_block">
2698                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
2699                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
2700                                              <mtr>
2701                                                 <mtd>
2702                                                    <mtext>data</mtext>
2703                                                 </mtd>
2704                                                 <mtd>
2705                                                    <mo>=</mo>
2706                                                 </mtd>
2707                                                 <mtd>
2708                                                    <mfenced open="[" close="]">
2709                                                       <mtable rowspacing="4pt" columnspacing="1em">
2710                                                          <mtr>
2711                                                             <mtd>
2712                                                                <mn>1.0</mn>
2713                                                             </mtd>
2714                                                             <mtd>
2715                                                                <mn>4.0</mn>
2716                                                             </mtd>
2717                                                             <mtd>
2718                                                                <mn>0.0</mn>
2719                                                             </mtd>
2720                                                          </mtr>
2721                                                          <mtr>
2722                                                             <mtd>
2723                                                                <mn>2.0</mn>
2724                                                             </mtd>
2725                                                             <mtd>
2726                                                                <mn>3.0</mn>
2727                                                             </mtd>
2728                                                             <mtd>
2729                                                                <mn>0.0</mn>
2730                                                             </mtd>
2731                                                          </mtr>
2732                                                          <mtr>
2733                                                             <mtd>
2734                                                                <mn>5.0</mn>
2735                                                             </mtd>
2736                                                             <mtd>
2737                                                                <mn>7.0</mn>
2738                                                             </mtd>
2739                                                             <mtd>
2740                                                                <mn>8.0</mn>
2741                                                             </mtd>
2742                                                          </mtr>
2743                                                          <mtr>
2744                                                             <mtd>
2745                                                                <mn>9.0</mn>
2746                                                             </mtd>
2747                                                             <mtd>
2748                                                                <mn>6.0</mn>
2749                                                             </mtd>
2750                                                             <mtd>
2751                                                                <mn>0.0</mn>
2752                                                             </mtd>
2753                                                          </mtr>
2754                                                       </mtable>
2755                                                    </mfenced>
2756                                                 </mtd>
2757                                              </mtr>
2758                                              <mtr>
2759                                                 <mtd>
2760                                                    <mtext>indices</mtext>
2761                                                 </mtd>
2762                                                 <mtd>
2763                                                    <mo>=</mo>
2764                                                 </mtd>
2765                                                 <mtd>
2766                                                    <mfenced open="[" close="]">
2767                                                       <mtable rowspacing="4pt" columnspacing="1em">
2768                                                          <mtr>
2769                                                             <mtd>
2770                                                                <mn>0</mn>
2771                                                                <mrow class="MJX-TeXAtom-ORD">
2772                                                                   <mphantom>
2773                                                                      <mn>.0</mn>
2774                                                                   </mphantom>
2775                                                                </mrow>
2776                                                             </mtd>
2777                                                             <mtd>
2778                                                                <mn>1</mn>
2779                                                                <mrow class="MJX-TeXAtom-ORD">
2780                                                                   <mphantom>
2781                                                                      <mn>.0</mn>
2782                                                                   </mphantom>
2783                                                                </mrow>
2784                                                             </mtd>
2785                                                             <mtd>
2786                                                                <mo>−</mo>
2787                                                                <mn>1</mn>
2788                                                                <mrow class="MJX-TeXAtom-ORD">
2789                                                                   <mphantom>
2790                                                                      <mo>.</mo>
2791                                                                   </mphantom>
2792                                                                </mrow>
2793                                                             </mtd>
2794                                                          </mtr>
2795                                                          <mtr>
2796                                                             <mtd>
2797                                                                <mn>1</mn>
2798                                                                <mrow class="MJX-TeXAtom-ORD">
2799                                                                   <mphantom>
2800                                                                      <mn>.0</mn>
2801                                                                   </mphantom>
2802                                                                </mrow>
2803                                                             </mtd>
2804                                                             <mtd>
2805                                                                <mn>2</mn>
2806                                                                <mrow class="MJX-TeXAtom-ORD">
2807                                                                   <mphantom>
2808                                                                      <mn>.0</mn>
2809                                                                   </mphantom>
2810                                                                </mrow>
2811                                                             </mtd>
2812                                                             <mtd>
2813                                                                <mo>−</mo>
2814                                                                <mn>1</mn>
2815                                                                <mrow class="MJX-TeXAtom-ORD">
2816                                                                   <mphantom>
2817                                                                      <mo>.</mo>
2818                                                                   </mphantom>
2819                                                                </mrow>
2820                                                             </mtd>
2821                                                          </mtr>
2822                                                          <mtr>
2823                                                             <mtd>
2824                                                                <mn>0</mn>
2825                                                                <mrow class="MJX-TeXAtom-ORD">
2826                                                                   <mphantom>
2827                                                                      <mn>.0</mn>
2828                                                                   </mphantom>
2829                                                                </mrow>
2830                                                             </mtd>
2831                                                             <mtd>
2832                                                                <mn>3</mn>
2833                                                                <mrow class="MJX-TeXAtom-ORD">
2834                                                                   <mphantom>
2835                                                                      <mn>.0</mn>
2836                                                                   </mphantom>
2837                                                                </mrow>
2838                                                             </mtd>
2839                                                             <mtd>
2840                                                                <mrow class="MJX-TeXAtom-ORD">
2841                                                                   <mphantom>
2842                                                                      <mo>−</mo>
2843                                                                   </mphantom>
2844                                                                </mrow>
2845                                                                <mn>4</mn>
2846                                                                <mrow class="MJX-TeXAtom-ORD">
2847                                                                   <mphantom>
2848                                                                      <mo>.</mo>
2849                                                                   </mphantom>
2850                                                                </mrow>
2851                                                             </mtd>
2852                                                          </mtr>
2853                                                          <mtr>
2854                                                             <mtd>
2855                                                                <mn>2</mn>
2856                                                                <mrow class="MJX-TeXAtom-ORD">
2857                                                                   <mphantom>
2858                                                                      <mn>.0</mn>
2859                                                                   </mphantom>
2860                                                                </mrow>
2861                                                             </mtd>
2862                                                             <mtd>
2863                                                                <mn>4</mn>
2864                                                                <mrow class="MJX-TeXAtom-ORD">
2865                                                                   <mphantom>
2866                                                                      <mn>.0</mn>
2867                                                                   </mphantom>
2868                                                                </mrow>
2869                                                             </mtd>
2870                                                             <mtd>
2871                                                                <mo>−</mo>
2872                                                                <mn>1</mn>
2873                                                                <mrow class="MJX-TeXAtom-ORD">
2874                                                                   <mphantom>
2875                                                                      <mo>.</mo>
2876                                                                   </mphantom>
2877                                                                </mrow>
2878                                                             </mtd>
2879                                                          </mtr>
2880                                                       </mtable>
2881                                                    </mfenced>
2882                                                 </mtd>
2883                                              </mtr>
2884                                           </mtable>
2885                                        </math>
2886                                     </p>
2887                                  </td>
2888                               </tr>
2889                            </tbody>
2890                         </table>
2891                      </div>
2892                      <p class="p">It is stored this way in ELL format with one-based indexing.</p>
2893                      <div class="tablenoborder">
2894                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
2895                            <tbody class="tbody">
2896                               <tr class="row">
2897                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
2898                                     <p class="p d4p_eqn_block">
2899                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
2900                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
2901                                              <mtr>
2902                                                 <mtd>
2903                                                    <mtext>data</mtext>
2904                                                 </mtd>
2905                                                 <mtd>
2906                                                    <mo>=</mo>
2907                                                 </mtd>
2908                                                 <mtd>
2909                                                    <mfenced open="[" close="]">
2910                                                       <mtable rowspacing="4pt" columnspacing="1em">
2911                                                          <mtr>
2912                                                             <mtd>
2913                                                                <mn>1.0</mn>
2914                                                             </mtd>
2915                                                             <mtd>
2916                                                                <mn>4.0</mn>
2917                                                             </mtd>
2918                                                             <mtd>
2919                                                                <mn>0.0</mn>
2920                                                             </mtd>
2921                                                          </mtr>
2922                                                          <mtr>
2923                                                             <mtd>
2924                                                                <mn>2.0</mn>
2925                                                             </mtd>
2926                                                             <mtd>
2927                                                                <mn>3.0</mn>
2928                                                             </mtd>
2929                                                             <mtd>
2930                                                                <mn>0.0</mn>
2931                                                             </mtd>
2932                                                          </mtr>
2933                                                          <mtr>
2934                                                             <mtd>
2935                                                                <mn>5.0</mn>
2936                                                             </mtd>
2937                                                             <mtd>
2938                                                                <mn>7.0</mn>
2939                                                             </mtd>
2940                                                             <mtd>
2941                                                                <mn>8.0</mn>
2942                                                             </mtd>
2943                                                          </mtr>
2944                                                          <mtr>
2945                                                             <mtd>
2946                                                                <mn>9.0</mn>
2947                                                             </mtd>
2948                                                             <mtd>
2949                                                                <mn>6.0</mn>
2950                                                             </mtd>
2951                                                             <mtd>
2952                                                                <mn>0.0</mn>
2953                                                             </mtd>
2954                                                          </mtr>
2955                                                       </mtable>
2956                                                    </mfenced>
2957                                                 </mtd>
2958                                              </mtr>
2959                                              <mtr>
2960                                                 <mtd>
2961                                                    <mtext>indices</mtext>
2962                                                 </mtd>
2963                                                 <mtd>
2964                                                    <mo>=</mo>
2965                                                 </mtd>
2966                                                 <mtd>
2967                                                    <mfenced open="[" close="]">
2968                                                       <mtable rowspacing="4pt" columnspacing="1em">
2969                                                          <mtr>
2970                                                             <mtd>
2971                                                                <mn>1</mn>
2972                                                                <mrow class="MJX-TeXAtom-ORD">
2973                                                                   <mphantom>
2974                                                                      <mn>.0</mn>
2975                                                                   </mphantom>
2976                                                                </mrow>
2977                                                             </mtd>
2978                                                             <mtd>
2979                                                                <mn>2</mn>
2980                                                                <mrow class="MJX-TeXAtom-ORD">
2981                                                                   <mphantom>
2982                                                                      <mn>.0</mn>
2983                                                                   </mphantom>
2984                                                                </mrow>
2985                                                             </mtd>
2986                                                             <mtd>
2987                                                                <mo>−</mo>
2988                                                                <mn>1</mn>
2989                                                                <mrow class="MJX-TeXAtom-ORD">
2990                                                                   <mphantom>
2991                                                                      <mo>.</mo>
2992                                                                   </mphantom>
2993                                                                </mrow>
2994                                                             </mtd>
2995                                                          </mtr>
2996                                                          <mtr>
2997                                                             <mtd>
2998                                                                <mn>2</mn>
2999                                                                <mrow class="MJX-TeXAtom-ORD">
3000                                                                   <mphantom>
3001                                                                      <mn>.0</mn>
3002                                                                   </mphantom>
3003                                                                </mrow>
3004                                                             </mtd>
3005                                                             <mtd>
3006                                                                <mn>3</mn>
3007                                                                <mrow class="MJX-TeXAtom-ORD">
3008                                                                   <mphantom>
3009                                                                      <mn>.0</mn>
3010                                                                   </mphantom>
3011                                                                </mrow>
3012                                                             </mtd>
3013                                                             <mtd>
3014                                                                <mo>−</mo>
3015                                                                <mn>1</mn>
3016                                                                <mrow class="MJX-TeXAtom-ORD">
3017                                                                   <mphantom>
3018                                                                      <mo>.</mo>
3019                                                                   </mphantom>
3020                                                                </mrow>
3021                                                             </mtd>
3022                                                          </mtr>
3023                                                          <mtr>
3024                                                             <mtd>
3025                                                                <mn>1</mn>
3026                                                                <mrow class="MJX-TeXAtom-ORD">
3027                                                                   <mphantom>
3028                                                                      <mn>.0</mn>
3029                                                                   </mphantom>
3030                                                                </mrow>
3031                                                             </mtd>
3032                                                             <mtd>
3033                                                                <mn>4</mn>
3034                                                                <mrow class="MJX-TeXAtom-ORD">
3035                                                                   <mphantom>
3036                                                                      <mn>.0</mn>
3037                                                                   </mphantom>
3038                                                                </mrow>
3039                                                             </mtd>
3040                                                             <mtd>
3041                                                                <mrow class="MJX-TeXAtom-ORD">
3042                                                                   <mphantom>
3043                                                                      <mo>−</mo>
3044                                                                   </mphantom>
3045                                                                </mrow>
3046                                                                <mn>5</mn>
3047                                                                <mrow class="MJX-TeXAtom-ORD">
3048                                                                   <mphantom>
3049                                                                      <mo>.</mo>
3050                                                                   </mphantom>
3051                                                                </mrow>
3052                                                             </mtd>
3053                                                          </mtr>
3054                                                          <mtr>
3055                                                             <mtd>
3056                                                                <mn>3</mn>
3057                                                                <mrow class="MJX-TeXAtom-ORD">
3058                                                                   <mphantom>
3059                                                                      <mn>.0</mn>
3060                                                                   </mphantom>
3061                                                                </mrow>
3062                                                             </mtd>
3063                                                             <mtd>
3064                                                                <mn>5</mn>
3065                                                                <mrow class="MJX-TeXAtom-ORD">
3066                                                                   <mphantom>
3067                                                                      <mn>.0</mn>
3068                                                                   </mphantom>
3069                                                                </mrow>
3070                                                             </mtd>
3071                                                             <mtd>
3072                                                                <mo>−</mo>
3073                                                                <mn>1</mn>
3074                                                                <mrow class="MJX-TeXAtom-ORD">
3075                                                                   <mphantom>
3076                                                                      <mo>.</mo>
3077                                                                   </mphantom>
3078                                                                </mrow>
3079                                                             </mtd>
3080                                                          </mtr>
3081                                                       </mtable>
3082                                                    </mfenced>
3083                                                 </mtd>
3084                                              </mtr>
3085                                           </mtable>
3086                                        </math>
3087                                     </p>
3088                                  </td>
3089                               </tr>
3090                            </tbody>
3091                         </table>
3092                      </div>
3093                      <p class="p">Sparse matrices in ELL format are assumed to be stored in column-major format in memory.
3094                         Also, rows with less than <samp class="ph codeph">k</samp> nonzero elements are padded in the
3095                         <samp class="ph codeph">data</samp> and <samp class="ph codeph">indices</samp> arrays with zero and 
3096                         
3097                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3098                            <mo>−</mo>
3099                            <mn>1</mn>
3100                         </math>
3101                         , respectively.
3102                      </p>
3103                      <p class="p">The ELL format is not supported directly, but it is used to store the regular part of the
3104                         matrix in the HYB format that is described in the next section.
3105                      </p>
3106                   </div>
3107                </div>
3108                <div class="topic concept nested2" id="hybrid-format-hyb"><a name="hybrid-format-hyb" shape="rect">
3109                      <!-- --></a><h3 class="title topictitle2"><a href="#hybrid-format-hyb" name="hybrid-format-hyb" shape="rect">3.3.6.&nbsp;Hybrid Format (HYB)</a></h3>
3110                   <div class="body conbody">
3111                      <p class="p">The HYB sparse storage format is composed of a regular part, usually stored in ELL format,
3112                         and an irregular part, usually stored in COO format [1]. The ELL and COO parts are
3113                         always stored using zero-based indexing. HYB is implemented as an opaque data format that
3114                         requires the use of a conversion operation to store a matrix in it. The conversion operation
3115                         partitions the general matrix into the regular and irregular parts automatically or according
3116                         to developer-specified criteria.
3117                      </p>
3118                      <p class="p">For more information, please refer to the description of
3119                         <samp class="ph codeph">cusparseHybPartition_t</samp> type, as well as the description of the conversion
3120                         routines <samp class="ph codeph">dense2hyb</samp>, <samp class="ph codeph">csc2hyb</samp> and <samp class="ph codeph">csr2hyb</samp>.
3121                      </p>
3122                   </div>
3123                </div>
3124                <div class="topic concept nested2" id="block-compressed-sparse-row-format-bsr"><a name="block-compressed-sparse-row-format-bsr" shape="rect">
3125                      <!-- --></a><h3 class="title topictitle2"><a href="#block-compressed-sparse-row-format-bsr" name="block-compressed-sparse-row-format-bsr" shape="rect">3.3.7.&nbsp;Block Compressed Sparse Row Format (BSR)</a></h3>
3126                   <div class="body conbody">
3127                      <p class="p">The only difference between the CSR and BSR formats is the format of the storage element. The
3128                         former stores primitive data types (<samp class="ph codeph">single</samp>, <samp class="ph codeph">double</samp>,
3129                         <samp class="ph codeph">cuComplex</samp>, and <samp class="ph codeph">cuDoubleComplex</samp>) whereas the latter stores
3130                         a two-dimensional square block of primitive data types. The dimension of the square block is 
3131                         
3132                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3133                            <mi>b</mi>
3134                            <mi>l</mi>
3135                            <mi>o</mi>
3136                            <mi>c</mi>
3137                            <mi>k</mi>
3138                            <mi>D</mi>
3139                            <mi>i</mi>
3140                            <mi>m</mi>
3141                         </math>
3142                         . The <samp class="ph codeph">m×n</samp> sparse matrix <samp class="ph codeph">A</samp> is equivalent
3143                         to a block sparse matrix 
3144                         
3145                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3146                            <msub>
3147                               <mi>A</mi>
3148                               <mi>b</mi>
3149                            </msub>
3150                         </math>
3151                         with 
3152                         
3153                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3154                            <mi>m</mi>
3155                            <mi>b</mi>
3156                            <mo>=</mo>
3157                            <mfrac>
3158                               <mrow>
3159                                  <mi>m</mi>
3160                                  <mo>+</mo>
3161                                  <mi>b</mi>
3162                                  <mi>l</mi>
3163                                  <mi>o</mi>
3164                                  <mi>c</mi>
3165                                  <mi>k</mi>
3166                                  <mi>D</mi>
3167                                  <mi>i</mi>
3168                                  <mi>m</mi>
3169                                  <mo>−</mo>
3170                                  <mn>1</mn>
3171                               </mrow>
3172                               <mrow>
3173                                  <mi>b</mi>
3174                                  <mi>l</mi>
3175                                  <mi>o</mi>
3176                                  <mi>c</mi>
3177                                  <mi>k</mi>
3178                                  <mi>D</mi>
3179                                  <mi>i</mi>
3180                                  <mi>m</mi>
3181                               </mrow>
3182                            </mfrac>
3183                         </math>
3184                         block rows and 
3185                         
3186                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3187                            <mi>n</mi>
3188                            <mi>b</mi>
3189                            <mo>=</mo>
3190                            <mfrac>
3191                               <mrow>
3192                                  <mi>n</mi>
3193                                  <mo>+</mo>
3194                                  <mi>b</mi>
3195                                  <mi>l</mi>
3196                                  <mi>o</mi>
3197                                  <mi>c</mi>
3198                                  <mi>k</mi>
3199                                  <mi>D</mi>
3200                                  <mi>i</mi>
3201                                  <mi>m</mi>
3202                                  <mo>−</mo>
3203                                  <mn>1</mn>
3204                               </mrow>
3205                               <mrow>
3206                                  <mi>b</mi>
3207                                  <mi>l</mi>
3208                                  <mi>o</mi>
3209                                  <mi>c</mi>
3210                                  <mi>k</mi>
3211                                  <mi>D</mi>
3212                                  <mi>i</mi>
3213                                  <mi>m</mi>
3214                               </mrow>
3215                            </mfrac>
3216                         </math>
3217                         block columns. If 
3218                         
3219                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3220                            <mi>m</mi>
3221                         </math>
3222                         or 
3223                         
3224                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3225                            <mi>n</mi>
3226                         </math>
3227                         is not multiple of 
3228                         
3229                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3230                            <mi>b</mi>
3231                            <mi>l</mi>
3232                            <mi>o</mi>
3233                            <mi>c</mi>
3234                            <mi>k</mi>
3235                            <mi>D</mi>
3236                            <mi>i</mi>
3237                            <mi>m</mi>
3238                         </math>
3239                         , then zeros are filled into 
3240                         
3241                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3242                            <msub>
3243                               <mi>A</mi>
3244                               <mi>b</mi>
3245                            </msub>
3246                         </math>
3247                         .
3248                      </p>
3249                      <p class="p"><samp class="ph codeph">A</samp> is represented in BSR format by the following parameters.
3250                      </p>
3251                      <div class="tablenoborder">
3252                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
3253                            <tbody class="tbody">
3254                               <tr class="row">
3255                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">blockDim</samp></td>
3256                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
3257                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Block dimension of matrix <samp class="ph codeph">A</samp>.
3258                                  </td>
3259                               </tr>
3260                               <tr class="row">
3261                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">mb</samp></td>
3262                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
3263                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The number of block rows of <samp class="ph codeph">A</samp>.
3264                                  </td>
3265                               </tr>
3266                               <tr class="row">
3267                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">nb</samp></td>
3268                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
3269                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The number of block columns of <samp class="ph codeph">A</samp>.
3270                                  </td>
3271                               </tr>
3272                               <tr class="row">
3273                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">nnzb</samp></td>
3274                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
3275                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The number of nonzero blocks in the matrix.</td>
3276                               </tr>
3277                               <tr class="row">
3278                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">bsrValA</samp></td>
3279                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
3280                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the data array of length 
3281                                     
3282                                     <math xmlns="http://www.w3.org/1998/Math/MathML">
3283                                        <mi>n</mi>
3284                                        <mi>n</mi>
3285                                        <mi>z</mi>
3286                                        <mi>b</mi>
3287                                        <mo>∗</mo>
3288                                        <mi>b</mi>
3289                                        <mi>l</mi>
3290                                        <mi>o</mi>
3291                                        <mi>c</mi>
3292                                        <mi>k</mi>
3293                                        <mi>D</mi>
3294                                        <mi>i</mi>
3295                                        <msup>
3296                                           <mi>m</mi>
3297                                           <mn>2</mn>
3298                                        </msup>
3299                                     </math>
3300                                     that holds all elements of nonzero blocks of <samp class="ph codeph">A</samp>. The
3301                                     block elements are stored in either column-major order or row-major order.
3302                                  </td>
3303                               </tr>
3304                               <tr class="row">
3305                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">bsrRowPtrA</samp></td>
3306                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
3307                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the integer array of length <samp class="ph codeph">mb+1</samp> that holds indices into the
3308                                     arrays <samp class="ph codeph">bsrColIndA</samp> and <samp class="ph codeph">bsrValA</samp>. The first
3309                                     <samp class="ph codeph">mb</samp> entries of this array contain the indices of the first nonzero
3310                                     block in the <samp class="ph codeph">i</samp>th block row for <samp class="ph codeph">i=1,...,mb</samp>, while the
3311                                     last entry contains <samp class="ph codeph">nnzb+bsrRowPtrA(0)</samp>. In general,
3312                                     <samp class="ph codeph">bsrRowPtrA(0)</samp> is <samp class="ph codeph">0</samp> or <samp class="ph codeph">1</samp> for zero-
3313                                     and one-based indexing, respectively.
3314                                  </td>
3315                               </tr>
3316                               <tr class="row">
3317                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">bsrColIndA</samp></td>
3318                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
3319                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the integer array of length <samp class="ph codeph">nnzb</samp> that contains the column indices of the corresponding blocks in array <samp class="ph codeph">bsrValA</samp>.
3320                                  </td>
3321                               </tr>
3322                            </tbody>
3323                         </table>
3324                      </div>
3325                      <p class="p">As with CSR format, (row, column) indices of BSR are stored in row-major order. The index arrays
3326                         are first sorted by row indices and then within the same row by column indices.
3327                      </p>
3328                      <p class="p">For example, consider again the <samp class="ph codeph">4×5</samp> matrix <samp class="ph codeph">A</samp>.
3329                      </p>
3330                      <div class="tablenoborder">
3331                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
3332                            <tbody class="tbody">
3333                               <tr class="row">
3334                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
3335                                     <p class="p d4p_eqn_block">
3336                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
3337                                           <mfenced open="[" close="]">
3338                                              <mtable rowspacing="4pt" columnspacing="1em">
3339                                                 <mtr>
3340                                                    <mtd>
3341                                                       <mn>1.0</mn>
3342                                                    </mtd>
3343                                                    <mtd>
3344                                                       <mn>4.0</mn>
3345                                                    </mtd>
3346                                                    <mtd>
3347                                                       <mn>0.0</mn>
3348                                                    </mtd>
3349                                                    <mtd>
3350                                                       <mn>0.0</mn>
3351                                                    </mtd>
3352                                                    <mtd>
3353                                                       <mn>0.0</mn>
3354                                                    </mtd>
3355                                                 </mtr>
3356                                                 <mtr>
3357                                                    <mtd>
3358                                                       <mn>0.0</mn>
3359                                                    </mtd>
3360                                                    <mtd>
3361                                                       <mn>2.0</mn>
3362                                                    </mtd>
3363                                                    <mtd>
3364                                                       <mn>3.0</mn>
3365                                                    </mtd>
3366                                                    <mtd>
3367                                                       <mn>0.0</mn>
3368                                                    </mtd>
3369                                                    <mtd>
3370                                                       <mn>0.0</mn>
3371                                                    </mtd>
3372                                                 </mtr>
3373                                                 <mtr>
3374                                                    <mtd>
3375                                                       <mn>5.0</mn>
3376                                                    </mtd>
3377                                                    <mtd>
3378                                                       <mn>0.0</mn>
3379                                                    </mtd>
3380                                                    <mtd>
3381                                                       <mn>0.0</mn>
3382                                                    </mtd>
3383                                                    <mtd>
3384                                                       <mn>7.0</mn>
3385                                                    </mtd>
3386                                                    <mtd>
3387                                                       <mn>8.0</mn>
3388                                                    </mtd>
3389                                                 </mtr>
3390                                                 <mtr>
3391                                                    <mtd>
3392                                                       <mn>0.0</mn>
3393                                                    </mtd>
3394                                                    <mtd>
3395                                                       <mn>0.0</mn>
3396                                                    </mtd>
3397                                                    <mtd>
3398                                                       <mn>9.0</mn>
3399                                                    </mtd>
3400                                                    <mtd>
3401                                                       <mn>0.0</mn>
3402                                                    </mtd>
3403                                                    <mtd>
3404                                                       <mn>6.0</mn>
3405                                                    </mtd>
3406                                                 </mtr>
3407                                              </mtable>
3408                                           </mfenced>
3409                                        </math>
3410                                     </p>
3411                                  </td>
3412                               </tr>
3413                            </tbody>
3414                         </table>
3415                      </div>
3416                      <p class="p">If 
3417                         
3418                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3419                            <mi>b</mi>
3420                            <mi>l</mi>
3421                            <mi>o</mi>
3422                            <mi>c</mi>
3423                            <mi>k</mi>
3424                            <mi>D</mi>
3425                            <mi>i</mi>
3426                            <mi>m</mi>
3427                         </math>
3428                         is equal to 2, then 
3429                         
3430                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3431                            <mi>m</mi>
3432                            <mi>b</mi>
3433                         </math>
3434                         is 2, 
3435                         
3436                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3437                            <mi>n</mi>
3438                            <mi>b</mi>
3439                         </math>
3440                         is 3, and matrix <samp class="ph codeph">A</samp> is split into <samp class="ph codeph">2×3</samp>
3441                         block matrix 
3442                         
3443                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3444                            <msub>
3445                               <mi>A</mi>
3446                               <mi>b</mi>
3447                            </msub>
3448                         </math>
3449                         . The dimension of 
3450                         
3451                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3452                            <msub>
3453                               <mi>A</mi>
3454                               <mi>b</mi>
3455                            </msub>
3456                         </math>
3457                         is <samp class="ph codeph">4×6</samp>, slightly bigger than matrix 
3458                         
3459                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3460                            <mi>A</mi>
3461                         </math>
3462                         , so zeros are filled in the last column of 
3463                         
3464                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3465                            <msub>
3466                               <mi>A</mi>
3467                               <mi>b</mi>
3468                            </msub>
3469                         </math>
3470                         . The element-wise view of 
3471                         
3472                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3473                            <msub>
3474                               <mi>A</mi>
3475                               <mi>b</mi>
3476                            </msub>
3477                         </math>
3478                         is this.
3479                      </p>
3480                      <div class="tablenoborder">
3481                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
3482                            <tbody class="tbody">
3483                               <tr class="row">
3484                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
3485                                     <p class="p d4p_eqn_block">
3486                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
3487                                           <mfenced open="[" close="]">
3488                                              <mtable rowspacing="4pt" columnspacing="1em">
3489                                                 <mtr>
3490                                                    <mtd>
3491                                                       <mn>1.0</mn>
3492                                                    </mtd>
3493                                                    <mtd>
3494                                                       <mn>4.0</mn>
3495                                                    </mtd>
3496                                                    <mtd>
3497                                                       <mn>0.0</mn>
3498                                                    </mtd>
3499                                                    <mtd>
3500                                                       <mn>0.0</mn>
3501                                                    </mtd>
3502                                                    <mtd>
3503                                                       <mn>0.0</mn>
3504                                                    </mtd>
3505                                                    <mtd>
3506                                                       <mn>0.0</mn>
3507                                                    </mtd>
3508                                                 </mtr>
3509                                                 <mtr>
3510                                                    <mtd>
3511                                                       <mn>0.0</mn>
3512                                                    </mtd>
3513                                                    <mtd>
3514                                                       <mn>2.0</mn>
3515                                                    </mtd>
3516                                                    <mtd>
3517                                                       <mn>3.0</mn>
3518                                                    </mtd>
3519                                                    <mtd>
3520                                                       <mn>0.0</mn>
3521                                                    </mtd>
3522                                                    <mtd>
3523                                                       <mn>0.0</mn>
3524                                                    </mtd>
3525                                                    <mtd>
3526                                                       <mn>0.0</mn>
3527                                                    </mtd>
3528                                                 </mtr>
3529                                                 <mtr>
3530                                                    <mtd>
3531                                                       <mn>5.0</mn>
3532                                                    </mtd>
3533                                                    <mtd>
3534                                                       <mn>0.0</mn>
3535                                                    </mtd>
3536                                                    <mtd>
3537                                                       <mn>0.0</mn>
3538                                                    </mtd>
3539                                                    <mtd>
3540                                                       <mn>7.0</mn>
3541                                                    </mtd>
3542                                                    <mtd>
3543                                                       <mn>8.0</mn>
3544                                                    </mtd>
3545                                                    <mtd>
3546                                                       <mn>0.0</mn>
3547                                                    </mtd>
3548                                                 </mtr>
3549                                                 <mtr>
3550                                                    <mtd>
3551                                                       <mn>0.0</mn>
3552                                                    </mtd>
3553                                                    <mtd>
3554                                                       <mn>0.0</mn>
3555                                                    </mtd>
3556                                                    <mtd>
3557                                                       <mn>9.0</mn>
3558                                                    </mtd>
3559                                                    <mtd>
3560                                                       <mn>0.0</mn>
3561                                                    </mtd>
3562                                                    <mtd>
3563                                                       <mn>6.0</mn>
3564                                                    </mtd>
3565                                                    <mtd>
3566                                                       <mn>0.0</mn>
3567                                                    </mtd>
3568                                                 </mtr>
3569                                              </mtable>
3570                                           </mfenced>
3571                                        </math>
3572                                     </p>
3573                                  </td>
3574                               </tr>
3575                            </tbody>
3576                         </table>
3577                      </div>
3578                      <p class="p">Based on zero-based indexing, the block-wise view of 
3579                         
3580                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3581                            <msub>
3582                               <mi>A</mi>
3583                               <mi>b</mi>
3584                            </msub>
3585                         </math>
3586                         can be represented as follows.
3587                      </p>
3588                      <div class="tablenoborder">
3589                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
3590                            <tbody class="tbody">
3591                               <tr class="row">
3592                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
3593                                     <math xmlns="http://www.w3.org/1998/Math/MathML">
3594                                        <msub>
3595                                           <mi>A</mi>
3596                                           <mrow class="MJX-TeXAtom-ORD">
3597                                              <mi>b</mi>
3598                                           </mrow>
3599                                        </msub>
3600                                        <mo>=</mo>
3601                                        <mfenced open="[" close="]">
3602                                           <mtable rowspacing="4pt" columnspacing="1em">
3603                                              <mtr>
3604                                                 <mtd>
3605                                                    <msub>
3606                                                       <mi>A</mi>
3607                                                       <mrow class="MJX-TeXAtom-ORD">
3608                                                          <mn>00</mn>
3609                                                       </mrow>
3610                                                    </msub>
3611                                                 </mtd>
3612                                                 <mtd>
3613                                                    <msub>
3614                                                       <mi>A</mi>
3615                                                       <mrow class="MJX-TeXAtom-ORD">
3616                                                          <mn>01</mn>
3617                                                       </mrow>
3618                                                    </msub>
3619                                                 </mtd>
3620                                                 <mtd>
3621                                                    <msub>
3622                                                       <mi>A</mi>
3623                                                       <mrow class="MJX-TeXAtom-ORD">
3624                                                          <mn>02</mn>
3625                                                       </mrow>
3626                                                    </msub>
3627                                                 </mtd>
3628                                              </mtr>
3629                                              <mtr>
3630                                                 <mtd>
3631                                                    <msub>
3632                                                       <mi>A</mi>
3633                                                       <mrow class="MJX-TeXAtom-ORD">
3634                                                          <mn>10</mn>
3635                                                       </mrow>
3636                                                    </msub>
3637                                                 </mtd>
3638                                                 <mtd>
3639                                                    <msub>
3640                                                       <mi>A</mi>
3641                                                       <mrow class="MJX-TeXAtom-ORD">
3642                                                          <mn>11</mn>
3643                                                       </mrow>
3644                                                    </msub>
3645                                                 </mtd>
3646                                                 <mtd>
3647                                                    <msub>
3648                                                       <mi>A</mi>
3649                                                       <mrow class="MJX-TeXAtom-ORD">
3650                                                          <mn>12</mn>
3651                                                       </mrow>
3652                                                    </msub>
3653                                                 </mtd>
3654                                              </mtr>
3655                                           </mtable>
3656                                        </mfenced>
3657                                     </math>
3658                                  </td>
3659                               </tr>
3660                            </tbody>
3661                         </table>
3662                      </div>
3663                      <p class="p">The basic element of BSR is a nonzero 
3664                         
3665                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3666                            <msub>
3667                               <mi>A</mi>
3668                               <mrow class="MJX-TeXAtom-ORD">
3669                                  <mi>i</mi>
3670                                  <mi>j</mi>
3671                               </mrow>
3672                            </msub>
3673                         </math>
3674                         block, one that contains at least one nonzero element of <samp class="ph codeph">A</samp>.
3675                         Five of six blocks are nonzero in 
3676                         
3677                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3678                            <msub>
3679                               <mi>A</mi>
3680                               <mi>b</mi>
3681                            </msub>
3682                         </math>
3683                         . 
3684                      </p>
3685                      <div class="tablenoborder">
3686                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
3687                            <tbody class="tbody">
3688                               <tr class="row">
3689                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
3690                                     <math xmlns="http://www.w3.org/1998/Math/MathML">
3691                                        <msub>
3692                                           <mi>A</mi>
3693                                           <mrow class="MJX-TeXAtom-ORD">
3694                                              <mn>00</mn>
3695                                           </mrow>
3696                                        </msub>
3697                                        <mo>=</mo>
3698                                        <mfenced open="[" close="]">
3699                                           <mtable rowspacing="4pt" columnspacing="1em">
3700                                              <mtr>
3701                                                 <mtd>
3702                                                    <mn>1</mn>
3703                                                 </mtd>
3704                                                 <mtd>
3705                                                    <mn>4</mn>
3706                                                 </mtd>
3707                                              </mtr>
3708                                              <mtr>
3709                                                 <mtd>
3710                                                    <mn>0</mn>
3711                                                 </mtd>
3712                                                 <mtd>
3713                                                    <mn>2</mn>
3714                                                 </mtd>
3715                                              </mtr>
3716                                           </mtable>
3717                                        </mfenced>
3718                                        <mo>,</mo>
3719                                        <msub>
3720                                           <mi>A</mi>
3721                                           <mrow class="MJX-TeXAtom-ORD">
3722                                              <mn>01</mn>
3723                                           </mrow>
3724                                        </msub>
3725                                        <mo>=</mo>
3726                                        <mfenced open="[" close="]">
3727                                           <mtable rowspacing="4pt" columnspacing="1em">
3728                                              <mtr>
3729                                                 <mtd>
3730                                                    <mn>0</mn>
3731                                                 </mtd>
3732                                                 <mtd>
3733                                                    <mn>0</mn>
3734                                                 </mtd>
3735                                              </mtr>
3736                                              <mtr>
3737                                                 <mtd>
3738                                                    <mn>3</mn>
3739                                                 </mtd>
3740                                                 <mtd>
3741                                                    <mn>0</mn>
3742                                                 </mtd>
3743                                              </mtr>
3744                                           </mtable>
3745                                        </mfenced>
3746                                        <mo>,</mo>
3747                                        <msub>
3748                                           <mi>A</mi>
3749                                           <mrow class="MJX-TeXAtom-ORD">
3750                                              <mn>10</mn>
3751                                           </mrow>
3752                                        </msub>
3753                                        <mo>=</mo>
3754                                        <mfenced open="[" close="]">
3755                                           <mtable rowspacing="4pt" columnspacing="1em">
3756                                              <mtr>
3757                                                 <mtd>
3758                                                    <mn>5</mn>
3759                                                 </mtd>
3760                                                 <mtd>
3761                                                    <mn>0</mn>
3762                                                 </mtd>
3763                                              </mtr>
3764                                              <mtr>
3765                                                 <mtd>
3766                                                    <mn>0</mn>
3767                                                 </mtd>
3768                                                 <mtd>
3769                                                    <mn>0</mn>
3770                                                 </mtd>
3771                                              </mtr>
3772                                           </mtable>
3773                                        </mfenced>
3774                                        <mo>,</mo>
3775                                        <msub>
3776                                           <mi>A</mi>
3777                                           <mrow class="MJX-TeXAtom-ORD">
3778                                              <mn>11</mn>
3779                                           </mrow>
3780                                        </msub>
3781                                        <mo>=</mo>
3782                                        <mfenced open="[" close="]">
3783                                           <mtable rowspacing="4pt" columnspacing="1em">
3784                                              <mtr>
3785                                                 <mtd>
3786                                                    <mn>0</mn>
3787                                                 </mtd>
3788                                                 <mtd>
3789                                                    <mn>7</mn>
3790                                                 </mtd>
3791                                              </mtr>
3792                                              <mtr>
3793                                                 <mtd>
3794                                                    <mn>9</mn>
3795                                                 </mtd>
3796                                                 <mtd>
3797                                                    <mn>0</mn>
3798                                                 </mtd>
3799                                              </mtr>
3800                                           </mtable>
3801                                        </mfenced>
3802                                        <mo>,</mo>
3803                                        <msub>
3804                                           <mi>A</mi>
3805                                           <mrow class="MJX-TeXAtom-ORD">
3806                                              <mn>12</mn>
3807                                           </mrow>
3808                                        </msub>
3809                                        <mo>=</mo>
3810                                        <mfenced open="[" close="]">
3811                                           <mtable rowspacing="4pt" columnspacing="1em">
3812                                              <mtr>
3813                                                 <mtd>
3814                                                    <mn>8</mn>
3815                                                 </mtd>
3816                                                 <mtd>
3817                                                    <mn>0</mn>
3818                                                 </mtd>
3819                                              </mtr>
3820                                              <mtr>
3821                                                 <mtd>
3822                                                    <mn>6</mn>
3823                                                 </mtd>
3824                                                 <mtd>
3825                                                    <mn>0</mn>
3826                                                 </mtd>
3827                                              </mtr>
3828                                           </mtable>
3829                                        </mfenced>
3830                                     </math>
3831                                  </td>
3832                               </tr>
3833                            </tbody>
3834                         </table>
3835                      </div>
3836                      <p class="p">BSR format only stores the information of nonzero blocks, including block indices 
3837                         
3838                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3839                            <mo stretchy="false">(</mo>
3840                            <mi>i</mi>
3841                            <mo>,</mo>
3842                            <mi>j</mi>
3843                            <mo stretchy="false">)</mo>
3844                         </math>
3845                         and values 
3846                         
3847                         <math xmlns="http://www.w3.org/1998/Math/MathML">
3848                            <msub>
3849                               <mi>A</mi>
3850                               <mrow class="MJX-TeXAtom-ORD">
3851                                  <mi>i</mi>
3852                                  <mi>j</mi>
3853                               </mrow>
3854                            </msub>
3855                         </math>
3856                         . Also row indices are compressed in CSR format.
3857                      </p>
3858                      <div class="tablenoborder">
3859                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
3860                            <tbody class="tbody">
3861                               <tr class="row">
3862                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
3863                                     <p class="p d4p_eqn_block">
3864                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
3865                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
3866                                              <mtr>
3867                                                 <mtd>
3868                                                    <mtext>bsrValA</mtext>
3869                                                 </mtd>
3870                                                 <mtd>
3871                                                    <mo>=</mo>
3872                                                 </mtd>
3873                                                 <mtd>
3874                                                    <mfenced open="[" close="]">
3875                                                       <mtable rowspacing="4pt" columnspacing="0.8em">
3876                                                          <mtr>
3877                                                             <mtd>
3878                                                                <msub>
3879                                                                   <mi>A</mi>
3880                                                                   <mrow class="MJX-TeXAtom-ORD">
3881                                                                      <mn>00</mn>
3882                                                                   </mrow>
3883                                                                </msub>
3884                                                             </mtd>
3885                                                             <mtd>
3886                                                                <msub>
3887                                                                   <mi>A</mi>
3888                                                                   <mrow class="MJX-TeXAtom-ORD">
3889                                                                      <mn>01</mn>
3890                                                                   </mrow>
3891                                                                </msub>
3892                                                             </mtd>
3893                                                             <mtd>
3894                                                                <msub>
3895                                                                   <mi>A</mi>
3896                                                                   <mrow class="MJX-TeXAtom-ORD">
3897                                                                      <mn>10</mn>
3898                                                                   </mrow>
3899                                                                </msub>
3900                                                             </mtd>
3901                                                             <mtd>
3902                                                                <msub>
3903                                                                   <mi>A</mi>
3904                                                                   <mrow class="MJX-TeXAtom-ORD">
3905                                                                      <mn>11</mn>
3906                                                                   </mrow>
3907                                                                </msub>
3908                                                             </mtd>
3909                                                             <mtd>
3910                                                                <msub>
3911                                                                   <mi>A</mi>
3912                                                                   <mrow class="MJX-TeXAtom-ORD">
3913                                                                      <mn>12</mn>
3914                                                                   </mrow>
3915                                                                </msub>
3916                                                             </mtd>
3917                                                          </mtr>
3918                                                       </mtable>
3919                                                    </mfenced>
3920                                                 </mtd>
3921                                              </mtr>
3922                                              <mtr>
3923                                                 <mtd>
3924                                                    <mtext>bsrRowPtrA</mtext>
3925                                                 </mtd>
3926                                                 <mtd>
3927                                                    <mo>=</mo>
3928                                                 </mtd>
3929                                                 <mtd>
3930                                                    <mfenced open="[" close="]">
3931                                                       <mtable rowspacing="4pt" columnspacing="1em">
3932                                                          <mtr>
3933                                                             <mtd>
3934                                                                <mn>0</mn>
3935                                                                <mrow class="MJX-TeXAtom-ORD">
3936                                                                   <mphantom>
3937                                                                      <mn>.0</mn>
3938                                                                   </mphantom>
3939                                                                </mrow>
3940                                                             </mtd>
3941                                                             <mtd>
3942                                                                <mn>2</mn>
3943                                                                <mrow class="MJX-TeXAtom-ORD">
3944                                                                   <mphantom>
3945                                                                      <mn>.0</mn>
3946                                                                   </mphantom>
3947                                                                </mrow>
3948                                                             </mtd>
3949                                                             <mtd>
3950                                                                <mn>5</mn>
3951                                                             </mtd>
3952                                                          </mtr>
3953                                                       </mtable>
3954                                                    </mfenced>
3955                                                 </mtd>
3956                                              </mtr>
3957                                              <mtr>
3958                                                 <mtd>
3959                                                    <mtext>bsrColIndA</mtext>
3960                                                 </mtd>
3961                                                 <mtd>
3962                                                    <mo>=</mo>
3963                                                 </mtd>
3964                                                 <mtd>
3965                                                    <mfenced open="[" close="]">
3966                                                       <mtable rowspacing="4pt" columnspacing="1em">
3967                                                          <mtr>
3968                                                             <mtd>
3969                                                                <mn>0</mn>
3970                                                                <mrow class="MJX-TeXAtom-ORD">
3971                                                                   <mphantom>
3972                                                                      <mn>.0</mn>
3973                                                                   </mphantom>
3974                                                                </mrow>
3975                                                             </mtd>
3976                                                             <mtd>
3977                                                                <mn>1</mn>
3978                                                                <mrow class="MJX-TeXAtom-ORD">
3979                                                                   <mphantom>
3980                                                                      <mn>.0</mn>
3981                                                                   </mphantom>
3982                                                                </mrow>
3983                                                             </mtd>
3984                                                             <mtd>
3985                                                                <mn>0</mn>
3986                                                                <mrow class="MJX-TeXAtom-ORD">
3987                                                                   <mphantom>
3988                                                                      <mn>.0</mn>
3989                                                                   </mphantom>
3990                                                                </mrow>
3991                                                             </mtd>
3992                                                             <mtd>
3993                                                                <mn>1</mn>
3994                                                                <mrow class="MJX-TeXAtom-ORD">
3995                                                                   <mphantom>
3996                                                                      <mn>.0</mn>
3997                                                                   </mphantom>
3998                                                                </mrow>
3999                                                             </mtd>
4000                                                             <mtd>
4001                                                                <mn>2</mn>
4002                                                             </mtd>
4003                                                          </mtr>
4004                                                       </mtable>
4005                                                    </mfenced>
4006                                                 </mtd>
4007                                              </mtr>
4008                                           </mtable>
4009                                        </math>
4010                                     </p>
4011                                  </td>
4012                               </tr>
4013                            </tbody>
4014                         </table>
4015                      </div>
4016                      <p class="p">There are two ways to arrange the data element of block 
4017                         
4018                         
4019                         <math xmlns="http://www.w3.org/1998/Math/MathML">
4020                            <msub>
4021                               <mi>A</mi>
4022                               <mrow class="MJX-TeXAtom-ORD">
4023                                  <mi>i</mi>
4024                                  <mi>j</mi>
4025                               </mrow>
4026                            </msub>
4027                         </math>
4028                         : row-major order and column-major order. Under column-major order, the physical
4029                         storage of <samp class="ph codeph">bsrValA</samp> is this.
4030                      </p>
4031                      <div class="tablenoborder">
4032                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
4033                            <tbody class="tbody">
4034                               <tr class="row">
4035                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
4036                                     <math xmlns="http://www.w3.org/1998/Math/MathML">
4037                                        <mtable columnalign="center center center center center" rowspacing="4pt" columnspacing="1em" columnlines="solid solid solid solid">
4038                                           <mtr>
4039                                              <mtd>
4040                                                 <mi>b</mi>
4041                                                 <mi>s</mi>
4042                                                 <mi>r</mi>
4043                                                 <mi>V</mi>
4044                                                 <mi>a</mi>
4045                                                 <mi>l</mi>
4046                                                 <mi>A</mi>
4047                                                 <mo>=</mo>
4048                                                 <mo stretchy="false">[</mo>
4049                                                 <mn>1</mn>
4050                                                 <mrow class="MJX-TeXAtom-ORD">
4051                                                    <mphantom>
4052                                                       <mn>.0</mn>
4053                                                    </mphantom>
4054                                                 </mrow>
4055                                                 <mn>0</mn>
4056                                                 <mrow class="MJX-TeXAtom-ORD">
4057                                                    <mphantom>
4058                                                       <mn>.0</mn>
4059                                                    </mphantom>
4060                                                 </mrow>
4061                                                 <mn>4</mn>
4062                                                 <mrow class="MJX-TeXAtom-ORD">
4063                                                    <mphantom>
4064                                                       <mn>.0</mn>
4065                                                    </mphantom>
4066                                                 </mrow>
4067                                                 <mn>2</mn>
4068                                                 <mrow class="MJX-TeXAtom-ORD">
4069                                                    <mphantom>
4070                                                       <mn>.0</mn>
4071                                                    </mphantom>
4072                                                 </mrow>
4073                                              </mtd>
4074                                              <mtd>
4075                                                 <mn>0</mn>
4076                                                 <mrow class="MJX-TeXAtom-ORD">
4077                                                    <mphantom>
4078                                                       <mn>.0</mn>
4079                                                    </mphantom>
4080                                                 </mrow>
4081                                                 <mn>3</mn>
4082                                                 <mrow class="MJX-TeXAtom-ORD">
4083                                                    <mphantom>
4084                                                       <mn>.0</mn>
4085                                                    </mphantom>
4086                                                 </mrow>
4087                                                 <mn>0</mn>
4088                                                 <mrow class="MJX-TeXAtom-ORD">
4089                                                    <mphantom>
4090                                                       <mn>.0</mn>
4091                                                    </mphantom>
4092                                                 </mrow>
4093                                                 <mn>0</mn>
4094                                                 <mrow class="MJX-TeXAtom-ORD">
4095                                                    <mphantom>
4096                                                       <mn>.0</mn>
4097                                                    </mphantom>
4098                                                 </mrow>
4099                                              </mtd>
4100                                              <mtd>
4101                                                 <mn>5</mn>
4102                                                 <mrow class="MJX-TeXAtom-ORD">
4103                                                    <mphantom>
4104                                                       <mn>.0</mn>
4105                                                    </mphantom>
4106                                                 </mrow>
4107                                                 <mn>0</mn>
4108                                                 <mrow class="MJX-TeXAtom-ORD">
4109                                                    <mphantom>
4110                                                       <mn>.0</mn>
4111                                                    </mphantom>
4112                                                 </mrow>
4113                                                 <mn>0</mn>
4114                                                 <mrow class="MJX-TeXAtom-ORD">
4115                                                    <mphantom>
4116                                                       <mn>.0</mn>
4117                                                    </mphantom>
4118                                                 </mrow>
4119                                                 <mn>0</mn>
4120                                                 <mrow class="MJX-TeXAtom-ORD">
4121                                                    <mphantom>
4122                                                       <mn>.0</mn>
4123                                                    </mphantom>
4124                                                 </mrow>
4125                                              </mtd>
4126                                              <mtd>
4127                                                 <mn>0</mn>
4128                                                 <mrow class="MJX-TeXAtom-ORD">
4129                                                    <mphantom>
4130                                                       <mn>.0</mn>
4131                                                    </mphantom>
4132                                                 </mrow>
4133                                                 <mn>9</mn>
4134                                                 <mrow class="MJX-TeXAtom-ORD">
4135                                                    <mphantom>
4136                                                       <mn>.0</mn>
4137                                                    </mphantom>
4138                                                 </mrow>
4139                                                 <mn>7</mn>
4140                                                 <mrow class="MJX-TeXAtom-ORD">
4141                                                    <mphantom>
4142                                                       <mn>.0</mn>
4143                                                    </mphantom>
4144                                                 </mrow>
4145                                                 <mn>0</mn>
4146                                                 <mrow class="MJX-TeXAtom-ORD">
4147                                                    <mphantom>
4148                                                       <mn>.0</mn>
4149                                                    </mphantom>
4150                                                 </mrow>
4151                                              </mtd>
4152                                              <mtd>
4153                                                 <mn>8</mn>
4154                                                 <mrow class="MJX-TeXAtom-ORD">
4155                                                    <mphantom>
4156                                                       <mn>.0</mn>
4157                                                    </mphantom>
4158                                                 </mrow>
4159                                                 <mn>6</mn>
4160                                                 <mrow class="MJX-TeXAtom-ORD">
4161                                                    <mphantom>
4162                                                       <mn>.0</mn>
4163                                                    </mphantom>
4164                                                 </mrow>
4165                                                 <mn>0</mn>
4166                                                 <mrow class="MJX-TeXAtom-ORD">
4167                                                    <mphantom>
4168                                                       <mn>.0</mn>
4169                                                    </mphantom>
4170                                                 </mrow>
4171                                                 <mn>0</mn>
4172                                                 <mrow class="MJX-TeXAtom-ORD">
4173                                                    <mphantom>
4174                                                       <mn>.0</mn>
4175                                                    </mphantom>
4176                                                 </mrow>
4177                                                 <mo stretchy="false">]</mo>
4178                                              </mtd>
4179                                           </mtr>
4180                                        </mtable>
4181                                     </math>
4182                                  </td>
4183                               </tr>
4184                            </tbody>
4185                         </table>
4186                      </div>
4187                      <p class="p">Under row-major order, the physical storage of <samp class="ph codeph">bsrValA</samp> is this.
4188                      </p>
4189                      <div class="tablenoborder">
4190                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
4191                            <tbody class="tbody">
4192                               <tr class="row">
4193                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
4194                                     <math xmlns="http://www.w3.org/1998/Math/MathML">
4195                                        <mtable columnalign="center center center center center" rowspacing="4pt" columnspacing="1em" columnlines="solid solid solid solid">
4196                                           <mtr>
4197                                              <mtd>
4198                                                 <mi>b</mi>
4199                                                 <mi>s</mi>
4200                                                 <mi>r</mi>
4201                                                 <mi>V</mi>
4202                                                 <mi>a</mi>
4203                                                 <mi>l</mi>
4204                                                 <mi>A</mi>
4205                                                 <mo>=</mo>
4206                                                 <mo stretchy="false">[</mo>
4207                                                 <mn>1</mn>
4208                                                 <mrow class="MJX-TeXAtom-ORD">
4209                                                    <mphantom>
4210                                                       <mn>.0</mn>
4211                                                    </mphantom>
4212                                                 </mrow>
4213                                                 <mn>4</mn>
4214                                                 <mrow class="MJX-TeXAtom-ORD">
4215                                                    <mphantom>
4216                                                       <mn>.0</mn>
4217                                                    </mphantom>
4218                                                 </mrow>
4219                                                 <mn>0</mn>
4220                                                 <mrow class="MJX-TeXAtom-ORD">
4221                                                    <mphantom>
4222                                                       <mn>.0</mn>
4223                                                    </mphantom>
4224                                                 </mrow>
4225                                                 <mn>2</mn>
4226                                                 <mrow class="MJX-TeXAtom-ORD">
4227                                                    <mphantom>
4228                                                       <mn>.0</mn>
4229                                                    </mphantom>
4230                                                 </mrow>
4231                                              </mtd>
4232                                              <mtd>
4233                                                 <mn>0</mn>
4234                                                 <mrow class="MJX-TeXAtom-ORD">
4235                                                    <mphantom>
4236                                                       <mn>.0</mn>
4237                                                    </mphantom>
4238                                                 </mrow>
4239                                                 <mn>0</mn>
4240                                                 <mrow class="MJX-TeXAtom-ORD">
4241                                                    <mphantom>
4242                                                       <mn>.0</mn>
4243                                                    </mphantom>
4244                                                 </mrow>
4245                                                 <mn>3</mn>
4246                                                 <mrow class="MJX-TeXAtom-ORD">
4247                                                    <mphantom>
4248                                                       <mn>.0</mn>
4249                                                    </mphantom>
4250                                                 </mrow>
4251                                                 <mn>0</mn>
4252                                                 <mrow class="MJX-TeXAtom-ORD">
4253                                                    <mphantom>
4254                                                       <mn>.0</mn>
4255                                                    </mphantom>
4256                                                 </mrow>
4257                                              </mtd>
4258                                              <mtd>
4259                                                 <mn>5</mn>
4260                                                 <mrow class="MJX-TeXAtom-ORD">
4261                                                    <mphantom>
4262                                                       <mn>.0</mn>
4263                                                    </mphantom>
4264                                                 </mrow>
4265                                                 <mn>0</mn>
4266                                                 <mrow class="MJX-TeXAtom-ORD">
4267                                                    <mphantom>
4268                                                       <mn>.0</mn>
4269                                                    </mphantom>
4270                                                 </mrow>
4271                                                 <mn>0</mn>
4272                                                 <mrow class="MJX-TeXAtom-ORD">
4273                                                    <mphantom>
4274                                                       <mn>.0</mn>
4275                                                    </mphantom>
4276                                                 </mrow>
4277                                                 <mn>0</mn>
4278                                                 <mrow class="MJX-TeXAtom-ORD">
4279                                                    <mphantom>
4280                                                       <mn>.0</mn>
4281                                                    </mphantom>
4282                                                 </mrow>
4283                                              </mtd>
4284                                              <mtd>
4285                                                 <mn>0</mn>
4286                                                 <mrow class="MJX-TeXAtom-ORD">
4287                                                    <mphantom>
4288                                                       <mn>.0</mn>
4289                                                    </mphantom>
4290                                                 </mrow>
4291                                                 <mn>7</mn>
4292                                                 <mrow class="MJX-TeXAtom-ORD">
4293                                                    <mphantom>
4294                                                       <mn>.0</mn>
4295                                                    </mphantom>
4296                                                 </mrow>
4297                                                 <mn>9</mn>
4298                                                 <mrow class="MJX-TeXAtom-ORD">
4299                                                    <mphantom>
4300                                                       <mn>.0</mn>
4301                                                    </mphantom>
4302                                                 </mrow>
4303                                                 <mn>0</mn>
4304                                                 <mrow class="MJX-TeXAtom-ORD">
4305                                                    <mphantom>
4306                                                       <mn>.0</mn>
4307                                                    </mphantom>
4308                                                 </mrow>
4309                                              </mtd>
4310                                              <mtd>
4311                                                 <mn>8</mn>
4312                                                 <mrow class="MJX-TeXAtom-ORD">
4313                                                    <mphantom>
4314                                                       <mn>.0</mn>
4315                                                    </mphantom>
4316                                                 </mrow>
4317                                                 <mn>0</mn>
4318                                                 <mrow class="MJX-TeXAtom-ORD">
4319                                                    <mphantom>
4320                                                       <mn>.0</mn>
4321                                                    </mphantom>
4322                                                 </mrow>
4323                                                 <mn>6</mn>
4324                                                 <mrow class="MJX-TeXAtom-ORD">
4325                                                    <mphantom>
4326                                                       <mn>.0</mn>
4327                                                    </mphantom>
4328                                                 </mrow>
4329                                                 <mn>0</mn>
4330                                                 <mrow class="MJX-TeXAtom-ORD">
4331                                                    <mphantom>
4332                                                       <mn>.0</mn>
4333                                                    </mphantom>
4334                                                 </mrow>
4335                                                 <mo stretchy="false">]</mo>
4336                                              </mtd>
4337                                           </mtr>
4338                                        </mtable>
4339                                     </math>
4340                                  </td>
4341                               </tr>
4342                            </tbody>
4343                         </table>
4344                      </div>
4345                      <p class="p">Similarly, in BSR format with one-based indexing and column-major order, <samp class="ph codeph">A</samp> can
4346                         be represented by the following.
4347                      </p>
4348                      <div class="tablenoborder">
4349                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
4350                            <tbody class="tbody">
4351                               <tr class="row">
4352                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
4353                                     <math xmlns="http://www.w3.org/1998/Math/MathML">
4354                                        <msub>
4355                                           <mi>A</mi>
4356                                           <mrow class="MJX-TeXAtom-ORD">
4357                                              <mi>b</mi>
4358                                           </mrow>
4359                                        </msub>
4360                                        <mo>=</mo>
4361                                        <mfenced open="[" close="]">
4362                                           <mtable rowspacing="4pt" columnspacing="1em">
4363                                              <mtr>
4364                                                 <mtd>
4365                                                    <msub>
4366                                                       <mi>A</mi>
4367                                                       <mrow class="MJX-TeXAtom-ORD">
4368                                                          <mn>11</mn>
4369                                                       </mrow>
4370                                                    </msub>
4371                                                 </mtd>
4372                                                 <mtd>
4373                                                    <msub>
4374                                                       <mi>A</mi>
4375                                                       <mrow class="MJX-TeXAtom-ORD">
4376                                                          <mn>12</mn>
4377                                                       </mrow>
4378                                                    </msub>
4379                                                 </mtd>
4380                                                 <mtd>
4381                                                    <msub>
4382                                                       <mi>A</mi>
4383                                                       <mrow class="MJX-TeXAtom-ORD">
4384                                                          <mn>13</mn>
4385                                                       </mrow>
4386                                                    </msub>
4387                                                 </mtd>
4388                                              </mtr>
4389                                              <mtr>
4390                                                 <mtd>
4391                                                    <msub>
4392                                                       <mi>A</mi>
4393                                                       <mrow class="MJX-TeXAtom-ORD">
4394                                                          <mn>21</mn>
4395                                                       </mrow>
4396                                                    </msub>
4397                                                 </mtd>
4398                                                 <mtd>
4399                                                    <msub>
4400                                                       <mi>A</mi>
4401                                                       <mrow class="MJX-TeXAtom-ORD">
4402                                                          <mn>22</mn>
4403                                                       </mrow>
4404                                                    </msub>
4405                                                 </mtd>
4406                                                 <mtd>
4407                                                    <msub>
4408                                                       <mi>A</mi>
4409                                                       <mrow class="MJX-TeXAtom-ORD">
4410                                                          <mn>23</mn>
4411                                                       </mrow>
4412                                                    </msub>
4413                                                 </mtd>
4414                                              </mtr>
4415                                           </mtable>
4416                                        </mfenced>
4417                                     </math>
4418                                  </td>
4419                               </tr>
4420                            </tbody>
4421                         </table>
4422                      </div>
4423                      <div class="tablenoborder">
4424                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
4425                            <tbody class="tbody">
4426                               <tr class="row">
4427                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
4428                                     <math xmlns="http://www.w3.org/1998/Math/MathML">
4429                                        <mtable columnalign="center center center center center" rowspacing="4pt" columnspacing="1em" columnlines="solid solid solid solid">
4430                                           <mtr>
4431                                              <mtd>
4432                                                 <mi>b</mi>
4433                                                 <mi>s</mi>
4434                                                 <mi>r</mi>
4435                                                 <mi>V</mi>
4436                                                 <mi>a</mi>
4437                                                 <mi>l</mi>
4438                                                 <mi>A</mi>
4439                                                 <mo>=</mo>
4440                                                 <mo stretchy="false">[</mo>
4441                                                 <mn>1</mn>
4442                                                 <mrow class="MJX-TeXAtom-ORD">
4443                                                    <mphantom>
4444                                                       <mn>.0</mn>
4445                                                    </mphantom>
4446                                                 </mrow>
4447                                                 <mn>0</mn>
4448                                                 <mrow class="MJX-TeXAtom-ORD">
4449                                                    <mphantom>
4450                                                       <mn>.0</mn>
4451                                                    </mphantom>
4452                                                 </mrow>
4453                                                 <mn>4</mn>
4454                                                 <mrow class="MJX-TeXAtom-ORD">
4455                                                    <mphantom>
4456                                                       <mn>.0</mn>
4457                                                    </mphantom>
4458                                                 </mrow>
4459                                                 <mn>2</mn>
4460                                                 <mrow class="MJX-TeXAtom-ORD">
4461                                                    <mphantom>
4462                                                       <mn>.0</mn>
4463                                                    </mphantom>
4464                                                 </mrow>
4465                                              </mtd>
4466                                              <mtd>
4467                                                 <mn>0</mn>
4468                                                 <mrow class="MJX-TeXAtom-ORD">
4469                                                    <mphantom>
4470                                                       <mn>.0</mn>
4471                                                    </mphantom>
4472                                                 </mrow>
4473                                                 <mn>3</mn>
4474                                                 <mrow class="MJX-TeXAtom-ORD">
4475                                                    <mphantom>
4476                                                       <mn>.0</mn>
4477                                                    </mphantom>
4478                                                 </mrow>
4479                                                 <mn>0</mn>
4480                                                 <mrow class="MJX-TeXAtom-ORD">
4481                                                    <mphantom>
4482                                                       <mn>.0</mn>
4483                                                    </mphantom>
4484                                                 </mrow>
4485                                                 <mn>0</mn>
4486                                                 <mrow class="MJX-TeXAtom-ORD">
4487                                                    <mphantom>
4488                                                       <mn>.0</mn>
4489                                                    </mphantom>
4490                                                 </mrow>
4491                                              </mtd>
4492                                              <mtd>
4493                                                 <mn>5</mn>
4494                                                 <mrow class="MJX-TeXAtom-ORD">
4495                                                    <mphantom>
4496                                                       <mn>.0</mn>
4497                                                    </mphantom>
4498                                                 </mrow>
4499                                                 <mn>0</mn>
4500                                                 <mrow class="MJX-TeXAtom-ORD">
4501                                                    <mphantom>
4502                                                       <mn>.0</mn>
4503                                                    </mphantom>
4504                                                 </mrow>
4505                                                 <mn>0</mn>
4506                                                 <mrow class="MJX-TeXAtom-ORD">
4507                                                    <mphantom>
4508                                                       <mn>.0</mn>
4509                                                    </mphantom>
4510                                                 </mrow>
4511                                                 <mn>0</mn>
4512                                                 <mrow class="MJX-TeXAtom-ORD">
4513                                                    <mphantom>
4514                                                       <mn>.0</mn>
4515                                                    </mphantom>
4516                                                 </mrow>
4517                                              </mtd>
4518                                              <mtd>
4519                                                 <mn>0</mn>
4520                                                 <mrow class="MJX-TeXAtom-ORD">
4521                                                    <mphantom>
4522                                                       <mn>.0</mn>
4523                                                    </mphantom>
4524                                                 </mrow>
4525                                                 <mn>9</mn>
4526                                                 <mrow class="MJX-TeXAtom-ORD">
4527                                                    <mphantom>
4528                                                       <mn>.0</mn>
4529                                                    </mphantom>
4530                                                 </mrow>
4531                                                 <mn>7</mn>
4532                                                 <mrow class="MJX-TeXAtom-ORD">
4533                                                    <mphantom>
4534                                                       <mn>.0</mn>
4535                                                    </mphantom>
4536                                                 </mrow>
4537                                                 <mn>0</mn>
4538                                                 <mrow class="MJX-TeXAtom-ORD">
4539                                                    <mphantom>
4540                                                       <mn>.0</mn>
4541                                                    </mphantom>
4542                                                 </mrow>
4543                                              </mtd>
4544                                              <mtd>
4545                                                 <mn>8</mn>
4546                                                 <mrow class="MJX-TeXAtom-ORD">
4547                                                    <mphantom>
4548                                                       <mn>.0</mn>
4549                                                    </mphantom>
4550                                                 </mrow>
4551                                                 <mn>6</mn>
4552                                                 <mrow class="MJX-TeXAtom-ORD">
4553                                                    <mphantom>
4554                                                       <mn>.0</mn>
4555                                                    </mphantom>
4556                                                 </mrow>
4557                                                 <mn>0</mn>
4558                                                 <mrow class="MJX-TeXAtom-ORD">
4559                                                    <mphantom>
4560                                                       <mn>.0</mn>
4561                                                    </mphantom>
4562                                                 </mrow>
4563                                                 <mn>0</mn>
4564                                                 <mrow class="MJX-TeXAtom-ORD">
4565                                                    <mphantom>
4566                                                       <mn>.0</mn>
4567                                                    </mphantom>
4568                                                 </mrow>
4569                                                 <mo stretchy="false">]</mo>
4570                                              </mtd>
4571                                           </mtr>
4572                                        </mtable>
4573                                     </math>
4574                                  </td>
4575                               </tr>
4576                            </tbody>
4577                         </table>
4578                      </div>
4579                      <div class="tablenoborder">
4580                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
4581                            <tbody class="tbody">
4582                               <tr class="row">
4583                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
4584                                     <p class="p d4p_eqn_block">
4585                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
4586                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
4587                                              <mtr>
4588                                                 <mtd>
4589                                                    <mtext>bsrRowPtrA</mtext>
4590                                                 </mtd>
4591                                                 <mtd>
4592                                                    <mo>=</mo>
4593                                                 </mtd>
4594                                                 <mtd>
4595                                                    <mfenced open="[" close="]">
4596                                                       <mtable rowspacing="4pt" columnspacing="1em">
4597                                                          <mtr>
4598                                                             <mtd>
4599                                                                <mn>1</mn>
4600                                                                <mrow class="MJX-TeXAtom-ORD">
4601                                                                   <mphantom>
4602                                                                      <mn>.0</mn>
4603                                                                   </mphantom>
4604                                                                </mrow>
4605                                                             </mtd>
4606                                                             <mtd>
4607                                                                <mn>3</mn>
4608                                                                <mrow class="MJX-TeXAtom-ORD">
4609                                                                   <mphantom>
4610                                                                      <mn>.0</mn>
4611                                                                   </mphantom>
4612                                                                </mrow>
4613                                                             </mtd>
4614                                                             <mtd>
4615                                                                <mn>6</mn>
4616                                                             </mtd>
4617                                                          </mtr>
4618                                                       </mtable>
4619                                                    </mfenced>
4620                                                 </mtd>
4621                                              </mtr>
4622                                              <mtr>
4623                                                 <mtd>
4624                                                    <mtext>bsrColIndA</mtext>
4625                                                 </mtd>
4626                                                 <mtd>
4627                                                    <mo>=</mo>
4628                                                 </mtd>
4629                                                 <mtd>
4630                                                    <mfenced open="[" close="]">
4631                                                       <mtable rowspacing="4pt" columnspacing="1em">
4632                                                          <mtr>
4633                                                             <mtd>
4634                                                                <mn>1</mn>
4635                                                                <mrow class="MJX-TeXAtom-ORD">
4636                                                                   <mphantom>
4637                                                                      <mn>.0</mn>
4638                                                                   </mphantom>
4639                                                                </mrow>
4640                                                             </mtd>
4641                                                             <mtd>
4642                                                                <mn>2</mn>
4643                                                                <mrow class="MJX-TeXAtom-ORD">
4644                                                                   <mphantom>
4645                                                                      <mn>.0</mn>
4646                                                                   </mphantom>
4647                                                                </mrow>
4648                                                             </mtd>
4649                                                             <mtd>
4650                                                                <mn>1</mn>
4651                                                                <mrow class="MJX-TeXAtom-ORD">
4652                                                                   <mphantom>
4653                                                                      <mn>.0</mn>
4654                                                                   </mphantom>
4655                                                                </mrow>
4656                                                             </mtd>
4657                                                             <mtd>
4658                                                                <mn>2</mn>
4659                                                                <mrow class="MJX-TeXAtom-ORD">
4660                                                                   <mphantom>
4661                                                                      <mn>.0</mn>
4662                                                                   </mphantom>
4663                                                                </mrow>
4664                                                             </mtd>
4665                                                             <mtd>
4666                                                                <mn>3</mn>
4667                                                             </mtd>
4668                                                          </mtr>
4669                                                       </mtable>
4670                                                    </mfenced>
4671                                                 </mtd>
4672                                              </mtr>
4673                                           </mtable>
4674                                        </math>
4675                                     </p>
4676                                  </td>
4677                               </tr>
4678                            </tbody>
4679                         </table>
4680                      </div>
4681                      <div class="note note"><span class="notetitle">Note:</span> The storage format of blocks in BSR format can be column-major or row-major, independently
4682                         of the base index. However, if the developer has BSR format from the Math Kernel Library (MKL)
4683                         and wants to directly copy it to BSR in CUSPARSE, then <samp class="ph codeph">cusparseDirection_t</samp> is
4684                         <samp class="ph codeph">CUSPARSE_DIRECTION_COLUMN</samp> if the base index is one; otherwise,
4685                         <samp class="ph codeph">cusparseDirection_t</samp> is <samp class="ph codeph">CUSPARSE_DIRECTION_ROW</samp>.
4686                      </div>
4687                   </div>
4688                </div>
4689                <div class="topic concept nested2" id="extended-bsr-format-bsrx"><a name="extended-bsr-format-bsrx" shape="rect">
4690                      <!-- --></a><h3 class="title topictitle2"><a href="#extended-bsr-format-bsrx" name="extended-bsr-format-bsrx" shape="rect">3.3.8.&nbsp;Extended BSR Format (BSRX)</a></h3>
4691                   <div class="body conbody">
4692                      <p class="p">BSRX is the same as the BSR format,  but the array <samp class="ph codeph">bsrRowPtrA</samp> is separated into
4693                         two parts. The first nonzero block of each row is still specified by the array
4694                         <samp class="ph codeph">bsrRowPtrA</samp>, which is the same as in BSR, but the position next to the last
4695                         nonzero block of each row is specified by the array <samp class="ph codeph">bsrEndPtrA</samp>. Briefly, BSRX
4696                         format is simply like a 4-vector variant of BSR format.
4697                      </p>
4698                      <p class="p">Matrix <samp class="ph codeph">A</samp> is represented in BSRX format by the following parameters.
4699                      </p>
4700                      <div class="tablenoborder">
4701                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
4702                            <tbody class="tbody">
4703                               <tr class="row">
4704                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">blockDim</samp></td>
4705                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
4706                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Block dimension of matrix <samp class="ph codeph">A</samp>.
4707                                  </td>
4708                               </tr>
4709                               <tr class="row">
4710                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">mb</samp></td>
4711                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
4712                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The number of block rows of <samp class="ph codeph">A</samp>.
4713                                  </td>
4714                               </tr>
4715                               <tr class="row">
4716                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">nb</samp></td>
4717                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
4718                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The number of block columns of <samp class="ph codeph">A</samp>.
4719                                  </td>
4720                               </tr>
4721                               <tr class="row">
4722                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">nnzb</samp></td>
4723                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(integer)</td>
4724                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">The size of <samp class="ph codeph">bsrColIndA</samp> and <samp class="ph codeph">bsrValA</samp>; <samp class="ph codeph">nnzb</samp>
4725                                     is greater than or equal to the number of nonzero blocks in the matrix
4726                                     <samp class="ph codeph">A</samp>.
4727                                  </td>
4728                               </tr>
4729                               <tr class="row">
4730                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">bsrValA</samp></td>
4731                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
4732                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the data array of length 
4733                                     
4734                                     <math xmlns="http://www.w3.org/1998/Math/MathML">
4735                                        <mi>n</mi>
4736                                        <mi>n</mi>
4737                                        <mi>z</mi>
4738                                        <mi>b</mi>
4739                                        <mo>∗</mo>
4740                                        <mi>b</mi>
4741                                        <mi>l</mi>
4742                                        <mi>o</mi>
4743                                        <mi>c</mi>
4744                                        <mi>k</mi>
4745                                        <mi>D</mi>
4746                                        <mi>i</mi>
4747                                        <msup>
4748                                           <mi>m</mi>
4749                                           <mn>2</mn>
4750                                        </msup>
4751                                     </math>
4752                                     that holds all the elements of the nonzero blocks of <samp class="ph codeph">A</samp>.
4753                                     The block elements are stored in either column-major order or row-major order.
4754                                  </td>
4755                               </tr>
4756                               <tr class="row">
4757                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">bsrRowPtrA</samp></td>
4758                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
4759                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the integer array of length <samp class="ph codeph">mb</samp> that holds indices into the arrays
4760                                     <samp class="ph codeph">bsrColIndA</samp> and <samp class="ph codeph">bsrValA</samp>;
4761                                     <samp class="ph codeph">bsrRowPtr(i)</samp> is the position of the first nonzero block of the
4762                                     <samp class="ph codeph">i</samp>th block row in <samp class="ph codeph">bsrColIndA</samp> and
4763                                     <samp class="ph codeph">bsrValA</samp>.
4764                                  </td>
4765                               </tr>
4766                               <tr class="row">
4767                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">bsrEndPtrA</samp></td>
4768                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
4769                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the integer array of length <samp class="ph codeph">mb</samp> that holds indices into the arrays
4770                                     <samp class="ph codeph">bsrColIndA</samp> and <samp class="ph codeph">bsrValA</samp>;
4771                                     <samp class="ph codeph">bsrRowPtr(i)</samp> is the position next to the last nonzero block of the
4772                                     <samp class="ph codeph">i</samp>th block row in <samp class="ph codeph">bsrColIndA</samp> and
4773                                     <samp class="ph codeph">bsrValA</samp>.
4774                                  </td>
4775                               </tr>
4776                               <tr class="row">
4777                                  <td class="entry" valign="top" width="20%" rowspan="1" colspan="1"><samp class="ph codeph">bsrColIndA</samp></td>
4778                                  <td class="entry" valign="top" width="10%" rowspan="1" colspan="1">(pointer)</td>
4779                                  <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">Points to the integer array of length <samp class="ph codeph">nnzb</samp> that contains the column indices of the corresponding blocks in array <samp class="ph codeph">bsrValA</samp>.
4780                                  </td>
4781                               </tr>
4782                            </tbody>
4783                         </table>
4784                      </div>
4785                      <p class="p">A simple conversion between BSR and BSRX can be done as follows. Suppose the developer has a
4786                         <samp class="ph codeph">2×3</samp> block sparse matrix 
4787                         
4788                         <math xmlns="http://www.w3.org/1998/Math/MathML">
4789                            <msub>
4790                               <mi>A</mi>
4791                               <mi>b</mi>
4792                            </msub>
4793                         </math>
4794                         represented as shown.
4795                      </p>
4796                      <div class="tablenoborder">
4797                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
4798                            <tbody class="tbody">
4799                               <tr class="row">
4800                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
4801                                     <math xmlns="http://www.w3.org/1998/Math/MathML">
4802                                        <msub>
4803                                           <mi>A</mi>
4804                                           <mrow class="MJX-TeXAtom-ORD">
4805                                              <mi>b</mi>
4806                                           </mrow>
4807                                        </msub>
4808                                        <mo>=</mo>
4809                                        <mfenced open="[" close="]">
4810                                           <mtable rowspacing="4pt" columnspacing="1em">
4811                                              <mtr>
4812                                                 <mtd>
4813                                                    <msub>
4814                                                       <mi>A</mi>
4815                                                       <mrow class="MJX-TeXAtom-ORD">
4816                                                          <mn>00</mn>
4817                                                       </mrow>
4818                                                    </msub>
4819                                                 </mtd>
4820                                                 <mtd>
4821                                                    <msub>
4822                                                       <mi>A</mi>
4823                                                       <mrow class="MJX-TeXAtom-ORD">
4824                                                          <mn>01</mn>
4825                                                       </mrow>
4826                                                    </msub>
4827                                                 </mtd>
4828                                                 <mtd>
4829                                                    <msub>
4830                                                       <mi>A</mi>
4831                                                       <mrow class="MJX-TeXAtom-ORD">
4832                                                          <mn>02</mn>
4833                                                       </mrow>
4834                                                    </msub>
4835                                                 </mtd>
4836                                              </mtr>
4837                                              <mtr>
4838                                                 <mtd>
4839                                                    <msub>
4840                                                       <mi>A</mi>
4841                                                       <mrow class="MJX-TeXAtom-ORD">
4842                                                          <mn>10</mn>
4843                                                       </mrow>
4844                                                    </msub>
4845                                                 </mtd>
4846                                                 <mtd>
4847                                                    <msub>
4848                                                       <mi>A</mi>
4849                                                       <mrow class="MJX-TeXAtom-ORD">
4850                                                          <mn>11</mn>
4851                                                       </mrow>
4852                                                    </msub>
4853                                                 </mtd>
4854                                                 <mtd>
4855                                                    <msub>
4856                                                       <mi>A</mi>
4857                                                       <mrow class="MJX-TeXAtom-ORD">
4858                                                          <mn>12</mn>
4859                                                       </mrow>
4860                                                    </msub>
4861                                                 </mtd>
4862                                              </mtr>
4863                                           </mtable>
4864                                        </mfenced>
4865                                     </math>
4866                                  </td>
4867                               </tr>
4868                            </tbody>
4869                         </table>
4870                      </div>
4871                      <p class="p">Assume it has this BSR format.</p>
4872                      <div class="tablenoborder">
4873                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
4874                            <tbody class="tbody">
4875                               <tr class="row">
4876                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
4877                                     <p class="p d4p_eqn_block">
4878                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
4879                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
4880                                              <mtr>
4881                                                 <mtd>
4882                                                    <mtext>bsrValA of BSR</mtext>
4883                                                 </mtd>
4884                                                 <mtd>
4885                                                    <mo>=</mo>
4886                                                 </mtd>
4887                                                 <mtd>
4888                                                    <mfenced open="[" close="]">
4889                                                       <mtable rowspacing="4pt" columnspacing="0.8em">
4890                                                          <mtr>
4891                                                             <mtd>
4892                                                                <msub>
4893                                                                   <mi>A</mi>
4894                                                                   <mrow class="MJX-TeXAtom-ORD">
4895                                                                      <mn>00</mn>
4896                                                                   </mrow>
4897                                                                </msub>
4898                                                             </mtd>
4899                                                             <mtd>
4900                                                                <msub>
4901                                                                   <mi>A</mi>
4902                                                                   <mrow class="MJX-TeXAtom-ORD">
4903                                                                      <mn>01</mn>
4904                                                                   </mrow>
4905                                                                </msub>
4906                                                             </mtd>
4907                                                             <mtd>
4908                                                                <msub>
4909                                                                   <mi>A</mi>
4910                                                                   <mrow class="MJX-TeXAtom-ORD">
4911                                                                      <mn>10</mn>
4912                                                                   </mrow>
4913                                                                </msub>
4914                                                             </mtd>
4915                                                             <mtd>
4916                                                                <msub>
4917                                                                   <mi>A</mi>
4918                                                                   <mrow class="MJX-TeXAtom-ORD">
4919                                                                      <mn>11</mn>
4920                                                                   </mrow>
4921                                                                </msub>
4922                                                             </mtd>
4923                                                             <mtd>
4924                                                                <msub>
4925                                                                   <mi>A</mi>
4926                                                                   <mrow class="MJX-TeXAtom-ORD">
4927                                                                      <mn>12</mn>
4928                                                                   </mrow>
4929                                                                </msub>
4930                                                             </mtd>
4931                                                          </mtr>
4932                                                       </mtable>
4933                                                    </mfenced>
4934                                                 </mtd>
4935                                              </mtr>
4936                                              <mtr>
4937                                                 <mtd>
4938                                                    <mtext>bsrRowPtrA of BSR</mtext>
4939                                                 </mtd>
4940                                                 <mtd>
4941                                                    <mo>=</mo>
4942                                                 </mtd>
4943                                                 <mtd>
4944                                                    <mfenced open="[" close="]">
4945                                                       <mtable rowspacing="4pt" columnspacing="1em">
4946                                                          <mtr>
4947                                                             <mtd>
4948                                                                <mn>0</mn>
4949                                                                <mrow class="MJX-TeXAtom-ORD">
4950                                                                   <mphantom>
4951                                                                      <mn>.0</mn>
4952                                                                   </mphantom>
4953                                                                </mrow>
4954                                                             </mtd>
4955                                                             <mtd>
4956                                                                <mn>2</mn>
4957                                                                <mrow class="MJX-TeXAtom-ORD">
4958                                                                   <mphantom>
4959                                                                      <mn>.0</mn>
4960                                                                   </mphantom>
4961                                                                </mrow>
4962                                                             </mtd>
4963                                                             <mtd>
4964                                                                <mn>5</mn>
4965                                                             </mtd>
4966                                                          </mtr>
4967                                                       </mtable>
4968                                                    </mfenced>
4969                                                 </mtd>
4970                                              </mtr>
4971                                              <mtr>
4972                                                 <mtd>
4973                                                    <mtext>bsrColIndA of BSR</mtext>
4974                                                 </mtd>
4975                                                 <mtd>
4976                                                    <mo>=</mo>
4977                                                 </mtd>
4978                                                 <mtd>
4979                                                    <mfenced open="[" close="]">
4980                                                       <mtable rowspacing="4pt" columnspacing="1em">
4981                                                          <mtr>
4982                                                             <mtd>
4983                                                                <mn>0</mn>
4984                                                                <mrow class="MJX-TeXAtom-ORD">
4985                                                                   <mphantom>
4986                                                                      <mn>.0</mn>
4987                                                                   </mphantom>
4988                                                                </mrow>
4989                                                             </mtd>
4990                                                             <mtd>
4991                                                                <mn>1</mn>
4992                                                                <mrow class="MJX-TeXAtom-ORD">
4993                                                                   <mphantom>
4994                                                                      <mn>.0</mn>
4995                                                                   </mphantom>
4996                                                                </mrow>
4997                                                             </mtd>
4998                                                             <mtd>
4999                                                                <mn>0</mn>
5000                                                                <mrow class="MJX-TeXAtom-ORD">
5001                                                                   <mphantom>
5002                                                                      <mn>.0</mn>
5003                                                                   </mphantom>
5004                                                                </mrow>
5005                                                             </mtd>
5006                                                             <mtd>
5007                                                                <mn>1</mn>
5008                                                                <mrow class="MJX-TeXAtom-ORD">
5009                                                                   <mphantom>
5010                                                                      <mn>.0</mn>
5011                                                                   </mphantom>
5012                                                                </mrow>
5013                                                             </mtd>
5014                                                             <mtd>
5015                                                                <mn>2</mn>
5016                                                             </mtd>
5017                                                          </mtr>
5018                                                       </mtable>
5019                                                    </mfenced>
5020                                                 </mtd>
5021                                              </mtr>
5022                                           </mtable>
5023                                        </math>
5024                                     </p>
5025                                  </td>
5026                               </tr>
5027                            </tbody>
5028                         </table>
5029                      </div>
5030                      <p class="p">The <samp class="ph codeph">bsrRowPtrA</samp> of the BSRX format is simply the first two elements of the
5031                         <samp class="ph codeph">bsrRowPtrA</samp> BSR format. The <samp class="ph codeph">bsrEndPtrA</samp> of BSRX format is
5032                         the last two elements of the <samp class="ph codeph">bsrRowPtrA</samp> of BSR format.
5033                      </p>
5034                      <div class="tablenoborder">
5035                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
5036                            <tbody class="tbody">
5037                               <tr class="row">
5038                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
5039                                     <p class="p d4p_eqn_block">
5040                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
5041                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
5042                                              <mtr>
5043                                                 <mtd>
5044                                                    <mtext>bsrRowPtrA of BSRX</mtext>
5045                                                 </mtd>
5046                                                 <mtd>
5047                                                    <mo>=</mo>
5048                                                 </mtd>
5049                                                 <mtd>
5050                                                    <mfenced open="[" close="]">
5051                                                       <mtable rowspacing="4pt" columnspacing="1em">
5052                                                          <mtr>
5053                                                             <mtd>
5054                                                                <mn>0</mn>
5055                                                                <mrow class="MJX-TeXAtom-ORD">
5056                                                                   <mphantom>
5057                                                                      <mn>.0</mn>
5058                                                                   </mphantom>
5059                                                                </mrow>
5060                                                             </mtd>
5061                                                             <mtd>
5062                                                                <mn>2</mn>
5063                                                             </mtd>
5064                                                          </mtr>
5065                                                       </mtable>
5066                                                    </mfenced>
5067                                                 </mtd>
5068                                              </mtr>
5069                                              <mtr>
5070                                                 <mtd>
5071                                                    <mtext>bsrEndPtrA of BSRX</mtext>
5072                                                 </mtd>
5073                                                 <mtd>
5074                                                    <mo>=</mo>
5075                                                 </mtd>
5076                                                 <mtd>
5077                                                    <mfenced open="[" close="]">
5078                                                       <mtable rowspacing="4pt" columnspacing="1em">
5079                                                          <mtr>
5080                                                             <mtd>
5081                                                                <mn>2</mn>
5082                                                                <mrow class="MJX-TeXAtom-ORD">
5083                                                                   <mphantom>
5084                                                                      <mn>.0</mn>
5085                                                                   </mphantom>
5086                                                                </mrow>
5087                                                             </mtd>
5088                                                             <mtd>
5089                                                                <mn>5</mn>
5090                                                             </mtd>
5091                                                          </mtr>
5092                                                       </mtable>
5093                                                    </mfenced>
5094                                                 </mtd>
5095                                              </mtr>
5096                                           </mtable>
5097                                        </math>
5098                                     </p>
5099                                  </td>
5100                               </tr>
5101                            </tbody>
5102                         </table>
5103                      </div>
5104                      <p class="p">The power of the BSRX format is that the developer can specify a submatrix in the original BSR
5105                         format by modifying <samp class="ph codeph">bsrRowPtrA</samp> and <samp class="ph codeph">bsrEndPtrA</samp> while keeping
5106                         <samp class="ph codeph">bsrColIndA</samp> and <samp class="ph codeph">bsrValA</samp> unchanged.
5107                      </p>
5108                      <p class="p">For example, to create another block matrix 
5109                         
5110                         <math xmlns="http://www.w3.org/1998/Math/MathML">
5111                            <mrow class="MJX-TeXAtom-ORD">
5112                               <mover>
5113                                  <mi>A</mi>
5114                                  <mo stretchy="false">˜</mo>
5115                               </mover>
5116                            </mrow>
5117                            <mo>=</mo>
5118                            <mfenced open="[" close="]">
5119                               <mtable rowspacing="4pt" columnspacing="1em">
5120                                  <mtr>
5121                                     <mtd>
5122                                        <mi>O</mi>
5123                                     </mtd>
5124                                     <mtd>
5125                                        <mi>O</mi>
5126                                     </mtd>
5127                                     <mtd>
5128                                        <mi>O</mi>
5129                                     </mtd>
5130                                  </mtr>
5131                                  <mtr>
5132                                     <mtd>
5133                                        <mi>O</mi>
5134                                     </mtd>
5135                                     <mtd>
5136                                        <msub>
5137                                           <mi>A</mi>
5138                                           <mrow class="MJX-TeXAtom-ORD">
5139                                              <mn>11</mn>
5140                                           </mrow>
5141                                        </msub>
5142                                     </mtd>
5143                                     <mtd>
5144                                        <mi>O</mi>
5145                                     </mtd>
5146                                  </mtr>
5147                               </mtable>
5148                            </mfenced>
5149                         </math>
5150                         that is slightly different from 
5151                         
5152                         <math xmlns="http://www.w3.org/1998/Math/MathML">
5153                            <mi>A</mi>
5154                         </math>
5155                         ,  the developer can keep <samp class="ph codeph">bsrColIndA</samp> and
5156                         <samp class="ph codeph">bsrValA</samp>, but reconstruct 
5157                         
5158                         <math xmlns="http://www.w3.org/1998/Math/MathML">
5159                            <mrow class="MJX-TeXAtom-ORD">
5160                               <mover>
5161                                  <mi>A</mi>
5162                                  <mo stretchy="false">˜</mo>
5163                               </mover>
5164                            </mrow>
5165                         </math>
5166                         by properly setting of <samp class="ph codeph">bsrRowPtrA</samp> and
5167                         <samp class="ph codeph">bsrEndPtrA</samp>. The following 4-vector characterizes 
5168                         
5169                         <math xmlns="http://www.w3.org/1998/Math/MathML">
5170                            <mrow class="MJX-TeXAtom-ORD">
5171                               <mover>
5172                                  <mi>A</mi>
5173                                  <mo stretchy="false">˜</mo>
5174                               </mover>
5175                            </mrow>
5176                         </math>
5177                         .
5178                      </p>
5179                      <div class="tablenoborder">
5180                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
5181                            <tbody class="tbody">
5182                               <tr class="row">
5183                                  <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
5184                                     <p class="p d4p_eqn_block">
5185                                        <math xmlns="http://www.w3.org/1998/Math/MathML">
5186                                           <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
5187                                              <mtr>
5188                                                 <mtd>
5189                                                    <mtext>bsrValA of&nbsp;</mtext>
5190                                                    <mrow class="MJX-TeXAtom-ORD">
5191                                                       <mover>
5192                                                          <mi>A</mi>
5193                                                          <mo stretchy="false">˜</mo>
5194                                                       </mover>
5195                                                    </mrow>
5196                                                 </mtd>
5197                                                 <mtd>
5198                                                    <mo>=</mo>
5199                                                 </mtd>
5200                                                 <mtd>
5201                                                    <mfenced open="[" close="]">
5202                                                       <mtable rowspacing="4pt" columnspacing="0.8em">
5203                                                          <mtr>
5204                                                             <mtd>
5205                                                                <msub>
5206                                                                   <mi>A</mi>
5207                                                                   <mrow class="MJX-TeXAtom-ORD">
5208                                                                      <mn>00</mn>
5209                                                                   </mrow>
5210                                                                </msub>
5211                                                             </mtd>
5212                                                             <mtd>
5213                                                                <msub>
5214                                                                   <mi>A</mi>
5215                                                                   <mrow class="MJX-TeXAtom-ORD">
5216                                                                      <mn>01</mn>
5217                                                                   </mrow>
5218                                                                </msub>
5219                                                             </mtd>
5220                                                             <mtd>
5221                                                                <msub>
5222                                                                   <mi>A</mi>
5223                                                                   <mrow class="MJX-TeXAtom-ORD">
5224                                                                      <mn>10</mn>
5225                                                                   </mrow>
5226                                                                </msub>
5227                                                             </mtd>
5228                                                             <mtd>
5229                                                                <msub>
5230                                                                   <mi>A</mi>
5231                                                                   <mrow class="MJX-TeXAtom-ORD">
5232                                                                      <mn>11</mn>
5233                                                                   </mrow>
5234                                                                </msub>
5235                                                             </mtd>
5236                                                             <mtd>
5237                                                                <msub>
5238                                                                   <mi>A</mi>
5239                                                                   <mrow class="MJX-TeXAtom-ORD">
5240                                                                      <mn>12</mn>
5241                                                                   </mrow>
5242                                                                </msub>
5243                                                             </mtd>
5244                                                          </mtr>
5245                                                       </mtable>
5246                                                    </mfenced>
5247                                                 </mtd>
5248                                              </mtr>
5249                                              <mtr>
5250                                                 <mtd>
5251                                                    <mtext>bsrColIndA of&nbsp;</mtext>
5252                                                    <mrow class="MJX-TeXAtom-ORD">
5253                                                       <mover>
5254                                                          <mi>A</mi>
5255                                                          <mo stretchy="false">˜</mo>
5256                                                       </mover>
5257                                                    </mrow>
5258                                                 </mtd>
5259                                                 <mtd>
5260                                                    <mo>=</mo>
5261                                                 </mtd>
5262                                                 <mtd>
5263                                                    <mfenced open="[" close="]">
5264                                                       <mtable rowspacing="4pt" columnspacing="1em">
5265                                                          <mtr>
5266                                                             <mtd>
5267                                                                <mn>0</mn>
5268                                                                <mrow class="MJX-TeXAtom-ORD">
5269                                                                   <mphantom>
5270                                                                      <mn>.0</mn>
5271                                                                   </mphantom>
5272                                                                </mrow>
5273                                                             </mtd>
5274                                                             <mtd>
5275                                                                <mn>1</mn>
5276                                                                <mrow class="MJX-TeXAtom-ORD">
5277                                                                   <mphantom>
5278                                                                      <mn>.0</mn>
5279                                                                   </mphantom>
5280                                                                </mrow>
5281                                                             </mtd>
5282                                                             <mtd>
5283                                                                <mn>0</mn>
5284                                                                <mrow class="MJX-TeXAtom-ORD">
5285                                                                   <mphantom>
5286                                                                      <mn>.0</mn>
5287                                                                   </mphantom>
5288                                                                </mrow>
5289                                                             </mtd>
5290                                                             <mtd>
5291                                                                <mn>1</mn>
5292                                                                <mrow class="MJX-TeXAtom-ORD">
5293                                                                   <mphantom>
5294                                                                      <mn>.0</mn>
5295                                                                   </mphantom>
5296                                                                </mrow>
5297                                                             </mtd>
5298                                                             <mtd>
5299                                                                <mn>2</mn>
5300                                                             </mtd>
5301                                                          </mtr>
5302                                                       </mtable>
5303                                                    </mfenced>
5304                                                 </mtd>
5305                                              </mtr>
5306                                              <mtr>
5307                                                 <mtd>
5308                                                    <mtext>bsrRowPtrA of&nbsp;</mtext>
5309                                                    <mrow class="MJX-TeXAtom-ORD">
5310                                                       <mover>
5311                                                          <mi>A</mi>
5312                                                          <mo stretchy="false">˜</mo>
5313                                                       </mover>
5314                                                    </mrow>
5315                                                 </mtd>
5316                                                 <mtd>
5317                                                    <mo>=</mo>
5318                                                 </mtd>
5319                                                 <mtd>
5320                                                    <mfenced open="[" close="]">
5321                                                       <mtable rowspacing="4pt" columnspacing="1em">
5322                                                          <mtr>
5323                                                             <mtd>
5324                                                                <mn>0</mn>
5325                                                                <mrow class="MJX-TeXAtom-ORD">
5326                                                                   <mphantom>
5327                                                                      <mn>.0</mn>
5328                                                                   </mphantom>
5329                                                                </mrow>
5330                                                             </mtd>
5331                                                             <mtd>
5332                                                                <mn>3</mn>
5333                                                             </mtd>
5334                                                          </mtr>
5335                                                       </mtable>
5336                                                    </mfenced>
5337                                                 </mtd>
5338                                              </mtr>
5339                                              <mtr>
5340                                                 <mtd>
5341                                                    <mtext>bsrEndPtrA of&nbsp;</mtext>
5342                                                    <mrow class="MJX-TeXAtom-ORD">
5343                                                       <mover>
5344                                                          <mi>A</mi>
5345                                                          <mo stretchy="false">˜</mo>
5346                                                       </mover>
5347                                                    </mrow>
5348                                                 </mtd>
5349                                                 <mtd>
5350                                                    <mo>=</mo>
5351                                                 </mtd>
5352                                                 <mtd>
5353                                                    <mfenced open="[" close="]">
5354                                                       <mtable rowspacing="4pt" columnspacing="1em">
5355                                                          <mtr>
5356                                                             <mtd>
5357                                                                <mn>0</mn>
5358                                                                <mrow class="MJX-TeXAtom-ORD">
5359                                                                   <mphantom>
5360                                                                      <mn>.0</mn>
5361                                                                   </mphantom>
5362                                                                </mrow>
5363                                                             </mtd>
5364                                                             <mtd>
5365                                                                <mn>4</mn>
5366                                                             </mtd>
5367                                                          </mtr>
5368                                                       </mtable>
5369                                                    </mfenced>
5370                                                 </mtd>
5371                                              </mtr>
5372                                           </mtable>
5373                                        </math>
5374                                     </p>
5375                                  </td>
5376                               </tr>
5377                            </tbody>
5378                         </table>
5379                      </div>
5380                   </div>
5381                </div>
5382             </div>
5383          </div>
5384          <div class="topic concept nested0" id="cusparse-types-reference"><a name="cusparse-types-reference" shape="rect">
5385                <!-- --></a><h2 class="title topictitle1"><a href="#cusparse-types-reference" name="cusparse-types-reference" shape="rect">4.&nbsp;CUSPARSE Types Reference</a></h2>
5386             <div class="topic concept nested1" id="data-types"><a name="data-types" shape="rect">
5387                   <!-- --></a><h3 class="title topictitle2"><a href="#data-types" name="data-types" shape="rect">4.1.&nbsp;Data types</a></h3>
5388                <div class="body conbody">
5389                   <p class="p">The <samp class="ph codeph">float</samp>, <samp class="ph codeph">double</samp>, <samp class="ph codeph">cuComplex</samp>, and <samp class="ph codeph">cuDoubleComplex</samp> data types are supported. The first two are standard C data types, while the last two are exported from <samp class="ph codeph">cuComplex.h</samp>.
5390                   </p>
5391                </div>
5392             </div>
5393             <div class="topic concept nested1" id="cusparseactiont"><a name="cusparseactiont" shape="rect">
5394                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparseactiont" name="cusparseactiont" shape="rect">4.2.&nbsp;cusparseAction_t</a></h3>
5395                <div class="body conbody">
5396                   <p class="p">This type indicates whether the operation is performed only on indices or on data and indices.</p>
5397                   <div class="tablenoborder">
5398                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
5399                         <thead class="thead" align="left">
5400                            <tr class="row">
5401                               <th class="entry" valign="top" width="50%" id="d54e10236" rowspan="1" colspan="1">
5402                                  Value
5403                                  
5404                               </th>
5405                               <th class="entry" valign="top" width="50%" id="d54e10239" rowspan="1" colspan="1">
5406                                  Meaning
5407                                  
5408                               </th>
5409                            </tr>
5410                         </thead>
5411                         <tbody class="tbody">
5412                            <tr class="row">
5413                               <td class="entry" valign="top" width="50%" headers="d54e10236" rowspan="1" colspan="1">
5414                                  <p class="p"><samp class="ph codeph">CUSPARSE_ACTION_SYMBOLIC</samp></p>
5415                               </td>
5416                               <td class="entry" valign="top" width="50%" headers="d54e10239" rowspan="1" colspan="1">
5417                                  <p class="p">the operation is performed only on indices.</p>
5418                               </td>
5419                            </tr>
5420                            <tr class="row">
5421                               <td class="entry" valign="top" width="50%" headers="d54e10236" rowspan="1" colspan="1">
5422                                  <p class="p"><samp class="ph codeph">CUSPARSE_ACTION_NUMERIC</samp></p>
5423                               </td>
5424                               <td class="entry" valign="top" width="50%" headers="d54e10239" rowspan="1" colspan="1">
5425                                  <p class="p">the operation is performed on data and indices.</p>
5426                               </td>
5427                            </tr>
5428                         </tbody>
5429                      </table>
5430                   </div>
5431                </div>
5432             </div>
5433             <div class="topic concept nested1" id="cusparsedirectiont"><a name="cusparsedirectiont" shape="rect">
5434                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsedirectiont" name="cusparsedirectiont" shape="rect">4.3.&nbsp;cusparseDirection_t</a></h3>
5435                <div class="body conbody">
5436                   <p class="p">This type indicates whether the elements of a dense matrix should be parsed by rows or by columns (assuming column-major storage
5437                      in memory of the dense matrix) in function cusparse[S|D|C|Z]nnz. Besides storage format of blocks in BSR format is also controlled
5438                      by this type.
5439                   </p>
5440                   <div class="tablenoborder">
5441                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
5442                         <thead class="thead" align="left">
5443                            <tr class="row">
5444                               <th class="entry" valign="top" width="50%" id="d54e10305" rowspan="1" colspan="1">
5445                                  Value
5446                                  
5447                               </th>
5448                               <th class="entry" valign="top" width="50%" id="d54e10308" rowspan="1" colspan="1">
5449                                  Meaning
5450                                  
5451                               </th>
5452                            </tr>
5453                         </thead>
5454                         <tbody class="tbody">
5455                            <tr class="row">
5456                               <td class="entry" valign="top" width="50%" headers="d54e10305" rowspan="1" colspan="1">
5457                                  <p class="p"><samp class="ph codeph">CUSPARSE_DIRECTION_ROW</samp></p>
5458                               </td>
5459                               <td class="entry" valign="top" width="50%" headers="d54e10308" rowspan="1" colspan="1">
5460                                  <p class="p">the matrix should be parsed by rows.</p>
5461                               </td>
5462                            </tr>
5463                            <tr class="row">
5464                               <td class="entry" valign="top" width="50%" headers="d54e10305" rowspan="1" colspan="1">
5465                                  <p class="p"><samp class="ph codeph">CUSPARSE_DIRECTION_COLUMN</samp></p>
5466                               </td>
5467                               <td class="entry" valign="top" width="50%" headers="d54e10308" rowspan="1" colspan="1">
5468                                  <p class="p">the matrix should be parsed by columns.</p>
5469                               </td>
5470                            </tr>
5471                         </tbody>
5472                      </table>
5473                   </div>
5474                </div>
5475             </div>
5476             <div class="topic concept nested1" id="cusparsehandlet"><a name="cusparsehandlet" shape="rect">
5477                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsehandlet" name="cusparsehandlet" shape="rect">4.4.&nbsp;cusparseHandle_t</a></h3>
5478                <div class="body conbody">
5479                   <p class="p">This is a pointer type to an opaque CUSPARSE context, which the user must initialize by calling prior to calling <samp class="ph codeph">cusparseCreate()</samp> any other library function. The handle created and returned by <samp class="ph codeph">cusparseCreate()</samp> must be passed to every CUSPARSE function.
5480                   </p>
5481                </div>
5482             </div>
5483             <div class="topic concept nested1" id="cusparsehybmatt"><a name="cusparsehybmatt" shape="rect">
5484                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsehybmatt" name="cusparsehybmatt" shape="rect">4.5.&nbsp;cusparseHybMat_t</a></h3>
5485                <div class="body conbody">
5486                   <p class="p">This is a pointer type to an opaque structure holding the matrix in HYB format, which is created by <samp class="ph codeph">cusparseCreateHybMat</samp> and destroyed by <samp class="ph codeph">cusparseDestroyHybMat</samp>.
5487                   </p>
5488                </div>
5489                <div class="topic concept nested2" id="cusparsehybpartitiont"><a name="cusparsehybpartitiont" shape="rect">
5490                      <!-- --></a><h3 class="title topictitle2"><a href="#cusparsehybpartitiont" name="cusparsehybpartitiont" shape="rect">4.5.1.&nbsp;cusparseHybPartition_t</a></h3>
5491                   <div class="body conbody">
5492                      <p class="p">This type indicates how to perform the partitioning of the matrix into regular (ELL) and irregular (COO) parts of the HYB
5493                         format.
5494                      </p>
5495                      <p class="p">The partitioning is performed during the conversion of the matrix from a dense or sparse format into the HYB format and is
5496                         governed by the following rules. When <samp class="ph codeph">CUSPARSE_HYB_PARTITION_AUTO</samp> is selected, the CUSPARSE library automatically decides how much data to put into the regular and irregular parts of the
5497                         HYB format. When <samp class="ph codeph">CUSPARSE_HYB_PARTITION_USER</samp> is selected, the width of the regular part of the HYB format should be specified by the caller. When <samp class="ph codeph">CUSPARSE_HYB_PARTITION_MAX</samp> is selected, the width of the regular part of the HYB format equals to the maximum number of non-zero elements per row, in
5498                         other words, the entire matrix is stored in the regular part of the HYB format.
5499                      </p>
5500                      <p class="p">The <em class="ph i">default</em> is to let the library automatically decide how to split the data.
5501                      </p>
5502                      <div class="tablenoborder">
5503                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
5504                            <thead class="thead" align="left">
5505                               <tr class="row">
5506                                  <th class="entry" valign="top" width="50%" id="d54e10429" rowspan="1" colspan="1">
5507                                     Value
5508                                     
5509                                  </th>
5510                                  <th class="entry" valign="top" width="50%" id="d54e10432" rowspan="1" colspan="1">
5511                                     Meaning
5512                                     
5513                                  </th>
5514                               </tr>
5515                            </thead>
5516                            <tbody class="tbody">
5517                               <tr class="row">
5518                                  <td class="entry" valign="top" width="50%" headers="d54e10429" rowspan="1" colspan="1">
5519                                     <p class="p"><samp class="ph codeph">CUSPARSE_HYB_PARTITION_AUTO</samp></p>
5520                                  </td>
5521                                  <td class="entry" valign="top" width="50%" headers="d54e10432" rowspan="1" colspan="1">
5522                                     <p class="p">the automatic partitioning is selected (<em class="ph i">default</em>).
5523                                     </p>
5524                                  </td>
5525                               </tr>
5526                               <tr class="row">
5527                                  <td class="entry" valign="top" width="50%" headers="d54e10429" rowspan="1" colspan="1">
5528                                     <p class="p"><samp class="ph codeph">CUSPARSE_HYB_PARTITION_USER</samp></p>
5529                                  </td>
5530                                  <td class="entry" valign="top" width="50%" headers="d54e10432" rowspan="1" colspan="1">
5531                                     <p class="p">the user specified treshold is used.</p>
5532                                  </td>
5533                               </tr>
5534                               <tr class="row">
5535                                  <td class="entry" valign="top" width="50%" headers="d54e10429" rowspan="1" colspan="1">
5536                                     <p class="p"><samp class="ph codeph">CUSPARSE_HYB_PARTITION_MAX</samp></p>
5537                                  </td>
5538                                  <td class="entry" valign="top" width="50%" headers="d54e10432" rowspan="1" colspan="1">
5539                                     <p class="p">the data is stored in ELL format.</p>
5540                                  </td>
5541                               </tr>
5542                            </tbody>
5543                         </table>
5544                      </div>
5545                   </div>
5546                </div>
5547             </div>
5548             <div class="topic concept nested1" id="cusparsematdescrt"><a name="cusparsematdescrt" shape="rect">
5549                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsematdescrt" name="cusparsematdescrt" shape="rect">4.6.&nbsp;cusparseMatDescr_t</a></h3>
5550                <div class="body conbody">
5551                   <p class="p">This structure is used to describe the shape and properties of a matrix.</p><pre xml:space="preserve">typedef struct {
5552     cusparseMatrixType_t MatrixType;
5553     cusparseFillMode_t FillMode;
5554     cusparseDiagType_t DiagType;
5555     cusparseIndexBase_t IndexBase;
5556 } cusparseMatDescr_t;</pre></div>
5557                <div class="topic concept nested2" id="cusparsediagtypet"><a name="cusparsediagtypet" shape="rect">
5558                      <!-- --></a><h3 class="title topictitle2"><a href="#cusparsediagtypet" name="cusparsediagtypet" shape="rect">4.6.1.&nbsp;cusparseDiagType_t</a></h3>
5559                   <div class="body conbody">
5560                      <p class="p">This type indicates if the matrix diagonal entries are unity. The diagonal elements are always assumed to be present, but
5561                         if <samp class="ph codeph">CUSPARSE_DIAG_TYPE_UNIT</samp> is passed to an API routine, then the routine will assume that all diagonal entries are unity and will not read or modify
5562                         those entries. Note that in this case the routine assumes the diagonal entries are equal to one, regardless of what those
5563                         entries are actuall set to in memory.
5564                      </p>
5565                      <div class="tablenoborder">
5566                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
5567                            <thead class="thead" align="left">
5568                               <tr class="row">
5569                                  <th class="entry" valign="top" width="50%" id="d54e10535" rowspan="1" colspan="1">
5570                                     Value
5571                                     
5572                                  </th>
5573                                  <th class="entry" valign="top" width="50%" id="d54e10538" rowspan="1" colspan="1">
5574                                     Meaning
5575                                     
5576                                  </th>
5577                               </tr>
5578                            </thead>
5579                            <tbody class="tbody">
5580                               <tr class="row">
5581                                  <td class="entry" valign="top" width="50%" headers="d54e10535" rowspan="1" colspan="1">
5582                                     <p class="p"><samp class="ph codeph">CUSPARSE_DIAG_TYPE_NON_UNIT</samp></p>
5583                                  </td>
5584                                  <td class="entry" valign="top" width="50%" headers="d54e10538" rowspan="1" colspan="1">
5585                                     <p class="p">the matrix diagonal has non-unit elements.</p>
5586                                  </td>
5587                               </tr>
5588                               <tr class="row">
5589                                  <td class="entry" valign="top" width="50%" headers="d54e10535" rowspan="1" colspan="1">
5590                                     <p class="p"><samp class="ph codeph">CUSPARSE_DIAG_TYPE_UNIT</samp></p>
5591                                  </td>
5592                                  <td class="entry" valign="top" width="50%" headers="d54e10538" rowspan="1" colspan="1">
5593                                     <p class="p">the matrix diagonal has unit elements.</p>
5594                                  </td>
5595                               </tr>
5596                            </tbody>
5597                         </table>
5598                      </div>
5599                   </div>
5600                </div>
5601                <div class="topic concept nested2" id="cusparsefillmodet"><a name="cusparsefillmodet" shape="rect">
5602                      <!-- --></a><h3 class="title topictitle2"><a href="#cusparsefillmodet" name="cusparsefillmodet" shape="rect">4.6.2.&nbsp;cusparseFillMode_t</a></h3>
5603                   <div class="body conbody">
5604                      <p class="p">This type indicates if the lower or upper part of a matrix is stored in sparse storage.</p>
5605                      <div class="tablenoborder">
5606                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
5607                            <thead class="thead" align="left">
5608                               <tr class="row">
5609                                  <th class="entry" valign="top" width="50%" id="d54e10604" rowspan="1" colspan="1">
5610                                     Value
5611                                     
5612                                  </th>
5613                                  <th class="entry" valign="top" width="50%" id="d54e10607" rowspan="1" colspan="1">
5614                                     Meaning
5615                                     
5616                                  </th>
5617                               </tr>
5618                            </thead>
5619                            <tbody class="tbody">
5620                               <tr class="row">
5621                                  <td class="entry" valign="top" width="50%" headers="d54e10604" rowspan="1" colspan="1">
5622                                     <p class="p"><samp class="ph codeph">CUSPARSE_FILL_MODE_LOWER</samp></p>
5623                                  </td>
5624                                  <td class="entry" valign="top" width="50%" headers="d54e10607" rowspan="1" colspan="1">
5625                                     <p class="p">the lower triangular part is stored.</p>
5626                                  </td>
5627                               </tr>
5628                               <tr class="row">
5629                                  <td class="entry" valign="top" width="50%" headers="d54e10604" rowspan="1" colspan="1">
5630                                     <p class="p"><samp class="ph codeph">CUSPARSE_FILL_MODE_UPPER</samp></p>
5631                                  </td>
5632                                  <td class="entry" valign="top" width="50%" headers="d54e10607" rowspan="1" colspan="1">
5633                                     <p class="p">the upper triangular part is stored.</p>
5634                                  </td>
5635                               </tr>
5636                            </tbody>
5637                         </table>
5638                      </div>
5639                   </div>
5640                </div>
5641                <div class="topic concept nested2" id="cusparseindexbaset"><a name="cusparseindexbaset" shape="rect">
5642                      <!-- --></a><h3 class="title topictitle2"><a href="#cusparseindexbaset" name="cusparseindexbaset" shape="rect">4.6.3.&nbsp;cusparseIndexBase_t</a></h3>
5643                   <div class="body conbody">
5644                      <p class="p">This type indicates if the base of the matrix indices is zero or one.</p>
5645                      <div class="tablenoborder">
5646                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
5647                            <thead class="thead" align="left">
5648                               <tr class="row">
5649                                  <th class="entry" valign="top" width="50%" id="d54e10673" rowspan="1" colspan="1">
5650                                     Value
5651                                     
5652                                  </th>
5653                                  <th class="entry" valign="top" width="50%" id="d54e10676" rowspan="1" colspan="1">
5654                                     Meaning
5655                                     
5656                                  </th>
5657                               </tr>
5658                            </thead>
5659                            <tbody class="tbody">
5660                               <tr class="row">
5661                                  <td class="entry" valign="top" width="50%" headers="d54e10673" rowspan="1" colspan="1">
5662                                     <p class="p"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp></p>
5663                                  </td>
5664                                  <td class="entry" valign="top" width="50%" headers="d54e10676" rowspan="1" colspan="1">
5665                                     <p class="p">the base index is zero.</p>
5666                                  </td>
5667                               </tr>
5668                               <tr class="row">
5669                                  <td class="entry" valign="top" width="50%" headers="d54e10673" rowspan="1" colspan="1">
5670                                     <p class="p"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp></p>
5671                                  </td>
5672                                  <td class="entry" valign="top" width="50%" headers="d54e10676" rowspan="1" colspan="1">
5673                                     <p class="p">the base index is one.</p>
5674                                  </td>
5675                               </tr>
5676                            </tbody>
5677                         </table>
5678                      </div>
5679                   </div>
5680                </div>
5681                <div class="topic concept nested2" id="cusparsematrixtypet"><a name="cusparsematrixtypet" shape="rect">
5682                      <!-- --></a><h3 class="title topictitle2"><a href="#cusparsematrixtypet" name="cusparsematrixtypet" shape="rect">4.6.4.&nbsp;cusparseMatrixType_t</a></h3>
5683                   <div class="body conbody">
5684                      <p class="p">This type indicates the type of matrix stored in sparse storage. Notice that for symmetric, Hermitian and triangular matrices
5685                         only their lower or upper part is assumed to be stored.
5686                      </p>
5687                      <div class="tablenoborder">
5688                         <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
5689                            <thead class="thead" align="left">
5690                               <tr class="row">
5691                                  <th class="entry" valign="top" width="50%" id="d54e10743" rowspan="1" colspan="1">
5692                                     Value
5693                                     
5694                                  </th>
5695                                  <th class="entry" valign="top" width="50%" id="d54e10746" rowspan="1" colspan="1">
5696                                     Meaning
5697                                     
5698                                  </th>
5699                               </tr>
5700                            </thead>
5701                            <tbody class="tbody">
5702                               <tr class="row">
5703                                  <td class="entry" valign="top" width="50%" headers="d54e10743" rowspan="1" colspan="1">
5704                                     <p class="p"><samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp></p>
5705                                  </td>
5706                                  <td class="entry" valign="top" width="50%" headers="d54e10746" rowspan="1" colspan="1">
5707                                     <p class="p">the matrix is general.</p>
5708                                  </td>
5709                               </tr>
5710                               <tr class="row">
5711                                  <td class="entry" valign="top" width="50%" headers="d54e10743" rowspan="1" colspan="1">
5712                                     <p class="p"><samp class="ph codeph">CUSPARSE_MATRIX_TYPE_SYMMETRIC</samp></p>
5713                                  </td>
5714                                  <td class="entry" valign="top" width="50%" headers="d54e10746" rowspan="1" colspan="1">
5715                                     <p class="p">the matrix is symmetric.</p>
5716                                  </td>
5717                               </tr>
5718                               <tr class="row">
5719                                  <td class="entry" valign="top" width="50%" headers="d54e10743" rowspan="1" colspan="1">
5720                                     <p class="p"><samp class="ph codeph">CUSPARSE_MATRIX_TYPE_HERMITIAN</samp></p>
5721                                  </td>
5722                                  <td class="entry" valign="top" width="50%" headers="d54e10746" rowspan="1" colspan="1">
5723                                     <p class="p">the matrix is Hermitian.</p>
5724                                  </td>
5725                               </tr>
5726                               <tr class="row">
5727                                  <td class="entry" valign="top" width="50%" headers="d54e10743" rowspan="1" colspan="1">
5728                                     <p class="p"><samp class="ph codeph">CUSPARSE_MATRIX_TYPE_TRIANGULAR</samp></p>
5729                                  </td>
5730                                  <td class="entry" valign="top" width="50%" headers="d54e10746" rowspan="1" colspan="1">
5731                                     <p class="p">the matrix is triangular.</p>
5732                                  </td>
5733                               </tr>
5734                            </tbody>
5735                         </table>
5736                      </div>
5737                   </div>
5738                </div>
5739             </div>
5740             <div class="topic concept nested1" id="cusparseoperationt"><a name="cusparseoperationt" shape="rect">
5741                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparseoperationt" name="cusparseoperationt" shape="rect">4.7.&nbsp;cusparseOperation_t</a></h3>
5742                <div class="body conbody">
5743                   <p class="p">This type indicates which operations need to be performed with the sparse matrix.</p>
5744                   <div class="tablenoborder">
5745                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
5746                         <thead class="thead" align="left">
5747                            <tr class="row">
5748                               <th class="entry" valign="top" width="50%" id="d54e10844" rowspan="1" colspan="1">
5749                                  Value
5750                                  
5751                               </th>
5752                               <th class="entry" valign="top" width="50%" id="d54e10847" rowspan="1" colspan="1">
5753                                  Meaning
5754                                  
5755                               </th>
5756                            </tr>
5757                         </thead>
5758                         <tbody class="tbody">
5759                            <tr class="row">
5760                               <td class="entry" valign="top" width="50%" headers="d54e10844" rowspan="1" colspan="1">
5761                                  <p class="p"><samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp></p>
5762                               </td>
5763                               <td class="entry" valign="top" width="50%" headers="d54e10847" rowspan="1" colspan="1">
5764                                  <p class="p">the non-transpose operation is selected.</p>
5765                               </td>
5766                            </tr>
5767                            <tr class="row">
5768                               <td class="entry" valign="top" width="50%" headers="d54e10844" rowspan="1" colspan="1">
5769                                  <p class="p"><samp class="ph codeph">CUSPARSE_OPERATION_TRANSPOSE</samp></p>
5770                               </td>
5771                               <td class="entry" valign="top" width="50%" headers="d54e10847" rowspan="1" colspan="1">
5772                                  <p class="p">the transpose operation is selected.</p>
5773                               </td>
5774                            </tr>
5775                            <tr class="row">
5776                               <td class="entry" valign="top" width="50%" headers="d54e10844" rowspan="1" colspan="1">
5777                                  <p class="p"><samp class="ph codeph">CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</samp></p>
5778                               </td>
5779                               <td class="entry" valign="top" width="50%" headers="d54e10847" rowspan="1" colspan="1">
5780                                  <p class="p"></p>
5781                                  <p class="p"></p>
5782                                  <p class="p">the conjugate transpose operation is selected.</p>
5783                               </td>
5784                            </tr>
5785                         </tbody>
5786                      </table>
5787                   </div>
5788                </div>
5789             </div>
5790             <div class="topic concept nested1" id="cusparsepointermode_t"><a name="cusparsepointermode_t" shape="rect">
5791                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsepointermode_t" name="cusparsepointermode_t" shape="rect">4.8.&nbsp;cusparsePointerMode_t</a></h3>
5792                <div class="body conbody">
5793                   <p class="p">This type indicates whether the scalar values are passed by reference on the host or device. It is important to point out
5794                      that if several scalar values are passed by reference in the function call, all of them will conform to the same single pointer
5795                      mode. The pointer mode can be set and retrieved using <samp class="ph codeph">cusparseSetPointerMode()</samp> and <samp class="ph codeph">cusparseGetPointerMode()</samp> routines, respectively.
5796                   </p>
5797                   <div class="tablenoborder">
5798                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
5799                         <thead class="thead" align="left">
5800                            <tr class="row">
5801                               <th class="entry" valign="top" width="50%" id="d54e10938" rowspan="1" colspan="1">
5802                                  Value
5803                                  
5804                               </th>
5805                               <th class="entry" valign="top" width="50%" id="d54e10941" rowspan="1" colspan="1">
5806                                  Meaning
5807                                  
5808                               </th>
5809                            </tr>
5810                         </thead>
5811                         <tbody class="tbody">
5812                            <tr class="row">
5813                               <td class="entry" valign="top" width="50%" headers="d54e10938" rowspan="1" colspan="1">
5814                                  <p class="p"><samp class="ph codeph">CUSPARSE_POINTER_MODE_HOST</samp></p>
5815                               </td>
5816                               <td class="entry" valign="top" width="50%" headers="d54e10941" rowspan="1" colspan="1">
5817                                  <p class="p">the scalars are passed by reference on the host.</p>
5818                               </td>
5819                            </tr>
5820                            <tr class="row">
5821                               <td class="entry" valign="top" width="50%" headers="d54e10938" rowspan="1" colspan="1">
5822                                  <p class="p"><samp class="ph codeph">CUSPARSE_POINTER_MODE_DEVICE</samp></p>
5823                               </td>
5824                               <td class="entry" valign="top" width="50%" headers="d54e10941" rowspan="1" colspan="1">
5825                                  <p class="p">the scalars are passed by reference on the device.</p>
5826                               </td>
5827                            </tr>
5828                         </tbody>
5829                      </table>
5830                   </div>
5831                </div>
5832             </div>
5833             <div class="topic concept nested1" id="cusparsesolveanalysisinfot"><a name="cusparsesolveanalysisinfot" shape="rect">
5834                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsesolveanalysisinfot" name="cusparsesolveanalysisinfot" shape="rect">4.9.&nbsp;cusparseSolveAnalysisInfo_t</a></h3>
5835                <div class="body conbody">
5836                   <p class="p">This is a pointer type to an opaque structure holding the information collected in the analysis phase of the solution of the
5837                      sparse triangular linear system. It is expected to be passed unchanged to the solution phase of the sparse triangular linear
5838                      system.
5839                   </p>
5840                </div>
5841             </div>
5842             <div class="topic concept nested1" id="cusparsestatust"><a name="cusparsestatust" shape="rect">
5843                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsestatust" name="cusparsestatust" shape="rect">4.10.&nbsp;cusparseStatus_t</a></h3>
5844                <div class="body conbody">
5845                   <p class="p">This is a status type returned by the library functions and it can have the following values.</p>
5846                   <div class="tablenoborder">
5847                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
5848                         <tbody class="tbody">
5849                            <tr class="row">
5850                               <td class="entry" valign="top" width="30%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
5851                               <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">
5852                                  <p class="p"></p>
5853                                  <p class="p"></p>
5854                                  <p class="p">The operation completed successfully.</p>
5855                               </td>
5856                            </tr>
5857                            <tr class="row">
5858                               <td class="entry" valign="top" width="30%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
5859                               <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">
5860                                  <p class="p"></p>
5861                                  <p class="p"></p>
5862                                  <p class="p">The CUSPARSE library was not initialized. This is usually caused by the lack of a prior call, an error in the CUDA Runtime
5863                                     API called by the CUSPARSE routine, or an error in the hardware setup.
5864                                  </p>
5865                                  <p class="p"><strong class="ph b">To correct:</strong> call <samp class="ph codeph">cusparseCreate()</samp> prior to the function call; and check that the hardware, an appropriate version of the driver, and the CUSPARSE library are
5866                                     correctly installed.
5867                                  </p>
5868                               </td>
5869                            </tr>
5870                            <tr class="row">
5871                               <td class="entry" valign="top" width="30%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
5872                               <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">
5873                                  <p class="p"></p>
5874                                  <p class="p"></p>
5875                                  <p class="p">Resource allocation failed inside the CUSPARSE library. This is usually caused by a <samp class="ph codeph">cudaMalloc()</samp> failure.
5876                                  </p>
5877                                  <p class="p"><strong class="ph b">To correct:</strong> prior to the function call, deallocate previously allocated memory as much as possible.
5878                                  </p>
5879                               </td>
5880                            </tr>
5881                            <tr class="row">
5882                               <td class="entry" valign="top" width="30%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
5883                               <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">
5884                                  <p class="p"></p>
5885                                  <p class="p"></p>
5886                                  <p class="p">An unsupported value or parameter was passed to the function (a negative vector size, for example).</p>
5887                                  <p class="p"><strong class="ph b">To correct:</strong> ensure that all the parameters being passed have valid values.
5888                                  </p>
5889                               </td>
5890                            </tr>
5891                            <tr class="row">
5892                               <td class="entry" valign="top" width="30%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
5893                               <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">
5894                                  <p class="p"></p>
5895                                  <p class="p"></p>
5896                                  <p class="p">The function requires a feature absent from the device architecture; usually caused by the lack of support for atomic operations
5897                                     or double precision.
5898                                  </p>
5899                                  <p class="p"><strong class="ph b">To correct:</strong> compile and run the application on a device with appropriate compute capability, which is 1.1 for 32-bit atomic operations
5900                                     and 1.3 for double precision.
5901                                  </p>
5902                               </td>
5903                            </tr>
5904                            <tr class="row">
5905                               <td class="entry" valign="top" width="30%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MAPPING_ERROR</samp></td>
5906                               <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">
5907                                  <p class="p"></p>
5908                                  <p class="p"></p>
5909                                  <p class="p">An access to GPU memory space failed, which is usually caused by a failure to bind a texture.</p>
5910                                  <p class="p"><strong class="ph b">To correct:</strong> prior to the function call, unbind any previously bound textures.
5911                                  </p>
5912                               </td>
5913                            </tr>
5914                            <tr class="row">
5915                               <td class="entry" valign="top" width="30%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
5916                               <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">
5917                                  <p class="p"></p>
5918                                  <p class="p"></p>
5919                                  <p class="p">The GPU program failed to execute. This is often caused by a launch failure of the kernel on the GPU, which can be caused
5920                                     by multiple reasons.
5921                                  </p>
5922                                  <p class="p"><strong class="ph b">To correct:</strong> check that the hardware, an appropriate version of the driver, and the CUSPARSE library are correctly installed.
5923                                  </p>
5924                               </td>
5925                            </tr>
5926                            <tr class="row">
5927                               <td class="entry" valign="top" width="30%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
5928                               <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">
5929                                  <p class="p"></p>
5930                                  <p class="p"></p>
5931                                  <p class="p">An internal CUSPARSE operation failed. This error is usually caused by a <samp class="ph codeph">cudaMemcpyAsync()
5932                                        </samp> failure.
5933                                  </p>
5934                                  <p class="p"><strong class="ph b">To correct:</strong> check that the hardware, an appropriate version of the driver, and the CUSPARSE library are correctly installed. Also, check
5935                                     that the memory passed as a parameter to the routine is not being deallocated prior to the routine’s completion.
5936                                  </p>
5937                               </td>
5938                            </tr>
5939                            <tr class="row">
5940                               <td class="entry" valign="top" width="30%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
5941                               <td class="entry" valign="top" width="70%" rowspan="1" colspan="1">
5942                                  <p class="p"></p>
5943                                  <p class="p"></p>
5944                                  <p class="p">The matrix type is not supported by this function. This is usually caused by passing an invalid matrix descriptor to the function.</p>
5945                                  <p class="p"><strong class="ph b">To correct:</strong> check that the fields in <samp class="ph codeph">cusparseMatDescr_t descrA</samp> were set correctly.
5946                                  </p>
5947                               </td>
5948                            </tr>
5949                         </tbody>
5950                      </table>
5951                   </div>
5952                </div>
5953             </div>
5954          </div>
5955          <div class="topic concept nested0" id="cusparse-helper-function-reference"><a name="cusparse-helper-function-reference" shape="rect">
5956                <!-- --></a><h2 class="title topictitle1"><a href="#cusparse-helper-function-reference" name="cusparse-helper-function-reference" shape="rect">5.&nbsp;CUSPARSE Helper Function Reference</a></h2>
5957             <div class="body conbody">
5958                <p class="p">The CUSPARSE helper functions are described in this section.</p>
5959             </div>
5960             <div class="topic concept nested1" id="cusparsecreate"><a name="cusparsecreate" shape="rect">
5961                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsecreate" name="cusparsecreate" shape="rect">5.1.&nbsp;cusparseCreate()</a></h3>
5962                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
5963 cusparseCreate(cusparseHandle_t *handle)</pre><p class="p">This function initializes the CUSPARSE library and creates a handle on the CUSPARSE context. It must be called before any
5964                      other CUSPARSE API function is invoked. It allocates hardware resources necessary for accessing the GPU.
5965                   </p>
5966                   <div class="tablenoborder">
5967                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
5968                            <tr class="row">
5969                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
5970                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the pointer to the handle to the CUSPARSE context.</td>
5971                            </tr>
5972                         </tbody>
5973                      </table>
5974                   </div>
5975                   <div class="tablenoborder">
5976                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
5977                            <tr class="row">
5978                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
5979                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the initialization succeeded.</td>
5980                            </tr>
5981                            <tr class="row">
5982                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
5983                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the CUDA Runtime initialization failed.</td>
5984                            </tr>
5985                            <tr class="row">
5986                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
5987                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
5988                            </tr>
5989                            <tr class="row">
5990                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
5991                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device compute capability (CC) is less than 1.1. The CC of at least 1.1 is required.</td>
5992                            </tr>
5993                         </tbody>
5994                      </table>
5995                   </div>
5996                </div>
5997             </div>
5998             <div class="topic concept nested1" id="cusparsecreatehybmat"><a name="cusparsecreatehybmat" shape="rect">
5999                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsecreatehybmat" name="cusparsecreatehybmat" shape="rect">5.2.&nbsp;cusparseCreateHybMat()</a></h3>
6000                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6001 cusparseCreateHybMat(cusparseHybMat_t *hybA)</pre><p class="p">This function creates and initializes the <samp class="ph codeph">hybA</samp> opaque data structure.
6002                   </p>
6003                   <div class="tablenoborder">
6004                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6005                            <tr class="row">
6006                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">hybA</samp></td>
6007                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the pointer to the hybrid format storage structure.</td>
6008                            </tr>
6009                         </tbody>
6010                      </table>
6011                   </div>
6012                   <div class="tablenoborder">
6013                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6014                            <tr class="row">
6015                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6016                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the structure was initialized successfully.</td>
6017                            </tr>
6018                            <tr class="row">
6019                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
6020                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
6021                            </tr>
6022                         </tbody>
6023                      </table>
6024                   </div>
6025                </div>
6026             </div>
6027             <div class="topic concept nested1" id="cusparsecreatematdescr"><a name="cusparsecreatematdescr" shape="rect">
6028                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsecreatematdescr" name="cusparsecreatematdescr" shape="rect">5.3.&nbsp;cusparseCreateMatDescr()</a></h3>
6029                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6030 cusparseCreateMatDescr(cusparseMatDescr_t *descrA)</pre><p class="p">This function initializes the matrix descriptor. It sets the fields <samp class="ph codeph">MatrixType</samp> and <samp class="ph codeph">IndexBase</samp> to the <em class="ph i">default</em> values <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> , respectively, while leaving other fields uninitialized.
6031                   </p>
6032                   <div class="tablenoborder">
6033                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6034                            <tr class="row">
6035                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
6036                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the pointer to the matrix descriptor.</td>
6037                            </tr>
6038                         </tbody>
6039                      </table>
6040                   </div>
6041                   <div class="tablenoborder">
6042                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6043                            <tr class="row">
6044                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6045                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor was initialized successfully.</td>
6046                            </tr>
6047                            <tr class="row">
6048                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
6049                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
6050                            </tr>
6051                         </tbody>
6052                      </table>
6053                   </div>
6054                </div>
6055             </div>
6056             <div class="topic concept nested1" id="cusparsecreatesolveanalysisinfo"><a name="cusparsecreatesolveanalysisinfo" shape="rect">
6057                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsecreatesolveanalysisinfo" name="cusparsecreatesolveanalysisinfo" shape="rect">5.4.&nbsp;cusparseCreateSolveAnalysisInfo()</a></h3>
6058                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6059 cusparseCreateSolveAnalysisInfo(cusparseSolveAnalysisInfo_t *info)</pre><p class="p">This function creates and initializes the solve and analysis structure to <em class="ph i">default</em> values.
6060                   </p>
6061                   <div class="tablenoborder">
6062                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6063                            <tr class="row">
6064                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
6065                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the pointer to the solve and analysis structure.</td>
6066                            </tr>
6067                         </tbody>
6068                      </table>
6069                   </div>
6070                   <div class="tablenoborder">
6071                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6072                            <tr class="row">
6073                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6074                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the structure was initialized successfully.</td>
6075                            </tr>
6076                            <tr class="row">
6077                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
6078                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
6079                            </tr>
6080                         </tbody>
6081                      </table>
6082                   </div>
6083                </div>
6084             </div>
6085             <div class="topic concept nested1" id="cusparsedestroy"><a name="cusparsedestroy" shape="rect">
6086                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsedestroy" name="cusparsedestroy" shape="rect">5.5.&nbsp;cusparseDestroy()</a></h3>
6087                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6088 cusparseDestroy(cusparseHandle_t handle)</pre><p class="p">This function releases CPU-side resources used by the CUSPARSE library. The release of GPU-side resources may be deferred
6089                      until the application shuts down.
6090                   </p>
6091                   <div class="tablenoborder">
6092                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6093                            <tr class="row">
6094                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
6095                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the handle to the CUSPARSE context.</td>
6096                            </tr>
6097                         </tbody>
6098                      </table>
6099                   </div>
6100                   <div class="tablenoborder">
6101                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6102                            <tr class="row">
6103                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6104                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the shutdown succeeded.</td>
6105                            </tr>
6106                            <tr class="row">
6107                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
6108                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
6109                            </tr>
6110                         </tbody>
6111                      </table>
6112                   </div>
6113                </div>
6114             </div>
6115             <div class="topic concept nested1" id="cusparsedestroyhybmat"><a name="cusparsedestroyhybmat" shape="rect">
6116                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsedestroyhybmat" name="cusparsedestroyhybmat" shape="rect">5.6.&nbsp;cusparseDestroyHybMat()</a></h3>
6117                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6118 cusparseDestroyHybMat(cusparseHybMat_t hybA)
6119 </pre><p class="p">This function destroys and releases any memory required by the <samp class="ph codeph">hybA</samp> structure.
6120                   </p>
6121                   <div class="tablenoborder">
6122                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6123                            <tr class="row">
6124                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">hybA</samp></td>
6125                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the hybrid format storage structure.</td>
6126                            </tr>
6127                         </tbody>
6128                      </table>
6129                   </div>
6130                   <div class="tablenoborder">
6131                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6132                            <tr class="row">
6133                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6134                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources were released successfully.</td>
6135                            </tr>
6136                         </tbody>
6137                      </table>
6138                   </div>
6139                </div>
6140             </div>
6141             <div class="topic concept nested1" id="cusparsedestroymatdescr"><a name="cusparsedestroymatdescr" shape="rect">
6142                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsedestroymatdescr" name="cusparsedestroymatdescr" shape="rect">5.7.&nbsp;cusparseDestroyMatDescr()</a></h3>
6143                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6144 cusparseDestroyMatDescr(cusparseMatDescr_t descrA)
6145 </pre><p class="p">This function releases the memory allocated for the matrix descriptor.</p>
6146                   <div class="tablenoborder">
6147                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6148                            <tr class="row">
6149                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
6150                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix descriptor.</td>
6151                            </tr>
6152                         </tbody>
6153                      </table>
6154                   </div>
6155                   <div class="tablenoborder">
6156                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6157                            <tr class="row">
6158                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6159                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources were released successfully.</td>
6160                            </tr>
6161                         </tbody>
6162                      </table>
6163                   </div>
6164                </div>
6165             </div>
6166             <div class="topic concept nested1" id="cusparsedestroysolveanalysisinfo"><a name="cusparsedestroysolveanalysisinfo" shape="rect">
6167                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsedestroysolveanalysisinfo" name="cusparsedestroysolveanalysisinfo" shape="rect">5.8.&nbsp;cusparseDestroySolveAnalysisInfo()</a></h3>
6168                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6169 cusparseDestroySolveAnalysisInfo(cusparseSolveAnalysisInfo_t info)</pre><p class="p">This function destroys and releases any memory required by the structure.</p>
6170                   <p class="p"><strong class="ph b">Input</strong></p>
6171                   <div class="tablenoborder">
6172                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
6173                         <tbody class="tbody">
6174                            <tr class="row">
6175                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
6176                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the solve and analysis structure.</td>
6177                            </tr>
6178                         </tbody>
6179                      </table>
6180                   </div>
6181                   <p class="p"><strong class="ph b">Status Returened</strong></p>
6182                   <div class="tablenoborder">
6183                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all">
6184                         <tbody class="tbody">
6185                            <tr class="row">
6186                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6187                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources were released successfully.</td>
6188                            </tr>
6189                         </tbody>
6190                      </table>
6191                   </div>
6192                </div>
6193             </div>
6194             <div class="topic concept nested1" id="cusparsegetlevelinfo"><a name="cusparsegetlevelinfo" shape="rect">
6195                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsegetlevelinfo" name="cusparsegetlevelinfo" shape="rect">5.9.&nbsp;cusparseGetLevelInfo()</a></h3>
6196                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
6197 cusparseGetLevelInfo(cusparseHandle_t handle, 
6198                      cusparseSolveAnalysisInfo_t info, 
6199                      int *nlevels, 
6200                      int **levelPtr, 
6201                      int **levelInd)</pre><p class="p">This function returns the number of levels and the assignment of rows into the levels computed by either the csrsv_analysis,
6202                      csrsm_analysis or hybsv_analysis routines.
6203                   </p>
6204                   <div class="tablenoborder">
6205                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6206                            <tr class="row">
6207                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
6208                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
6209                            </tr>
6210                            <tr class="row">
6211                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
6212                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the pointer to the solve and analysis structure.</td>
6213                            </tr>
6214                         </tbody>
6215                      </table>
6216                   </div>
6217                   <div class="tablenoborder">
6218                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
6219                            <tr class="row">
6220                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nlevels</samp></td>
6221                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of levels.</td>
6222                            </tr>
6223                            <tr class="row">
6224                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">levelPtr</samp></td>
6225                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">nlevels+1</samp> elements that contains the start of every level and the end of the last level plus one.
6226                               </td>
6227                            </tr>
6228                            <tr class="row">
6229                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">levelInd</samp></td>
6230                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of       <samp class="ph codeph">m</samp> (number of rows in the matrix) elements that contains the row indices belonging to every level.
6231                               </td>
6232                            </tr>
6233                         </tbody>
6234                      </table>
6235                   </div>
6236                   <div class="tablenoborder">
6237                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6238                            <tr class="row">
6239                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6240                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the structure was initialized successfully.</td>
6241                            </tr>
6242                            <tr class="row">
6243                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
6244                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library or the solve analysis structure was not initialized.</td>
6245                            </tr>
6246                         </tbody>
6247                      </table>
6248                   </div>
6249                </div>
6250             </div>
6251             <div class="topic concept nested1" id="cusparsegetmatdiagtype"><a name="cusparsegetmatdiagtype" shape="rect">
6252                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsegetmatdiagtype" name="cusparsegetmatdiagtype" shape="rect">5.10.&nbsp;cusparseGetMatDiagType()</a></h3>
6253                <div class="body conbody"><pre xml:space="preserve">cusparseDiagType_t
6254 cusparseGetMatDiagType(const cusparseMatDescr_t descrA)
6255 </pre><p class="p">This function returns the <samp class="ph codeph">DiagType</samp> field of the matrix descriptor <samp class="ph codeph">descrA</samp>.
6256                   </p>
6257                   <div class="tablenoborder">
6258                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6259                            <tr class="row">
6260                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
6261                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix descriptor.</td>
6262                            </tr>
6263                         </tbody>
6264                      </table>
6265                   </div>
6266                   <div class="tablenoborder">
6267                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Returned</strong></span><tbody class="tbody">
6268                            <tr class="row">
6269                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph"></samp></td>
6270                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">One of the enumerated diagType types.</td>
6271                            </tr>
6272                         </tbody>
6273                      </table>
6274                   </div>
6275                </div>
6276             </div>
6277             <div class="topic concept nested1" id="cusparsegetmatfillmode"><a name="cusparsegetmatfillmode" shape="rect">
6278                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsegetmatfillmode" name="cusparsegetmatfillmode" shape="rect">5.11.&nbsp;cusparseGetMatFillMode()</a></h3>
6279                <div class="body conbody"><pre xml:space="preserve">cusparseFillMode_t
6280 cusparseGetMatFillMode(const cusparseMatDescr_t descrA)
6281 </pre><p class="p">This function returns the <samp class="ph codeph">FillMode</samp> field of the matrix descriptor <samp class="ph codeph">descrA</samp>.
6282                   </p>
6283                   <div class="tablenoborder">
6284                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6285                            <tr class="row">
6286                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
6287                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix descriptor.</td>
6288                            </tr>
6289                         </tbody>
6290                      </table>
6291                   </div>
6292                   <div class="tablenoborder">
6293                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Returned</strong></span><tbody class="tbody">
6294                            <tr class="row">
6295                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph"></samp></td>
6296                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">One of the enumerated fillMode types.</td>
6297                            </tr>
6298                         </tbody>
6299                      </table>
6300                   </div>
6301                </div>
6302             </div>
6303             <div class="topic concept nested1" id="cusparsegetmatindexbase"><a name="cusparsegetmatindexbase" shape="rect">
6304                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsegetmatindexbase" name="cusparsegetmatindexbase" shape="rect">5.12.&nbsp;cusparseGetMatIndexBase()</a></h3>
6305                <div class="body conbody"><pre xml:space="preserve">cusparseIndexBase_t
6306 cusparseGetMatIndexBase(const cusparseMatDescr_t descrA)
6307 </pre><p class="p">This function returns the <samp class="ph codeph">IndexBase</samp> field of the matrix descriptor <samp class="ph codeph">descrA</samp>.
6308                   </p>
6309                   <div class="tablenoborder">
6310                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6311                            <tr class="row">
6312                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
6313                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix descriptor.</td>
6314                            </tr>
6315                         </tbody>
6316                      </table>
6317                   </div>
6318                   <div class="tablenoborder">
6319                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Returned</strong></span><tbody class="tbody">
6320                            <tr class="row">
6321                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph"></samp></td>
6322                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">One of the enumerated indexBase types.</td>
6323                            </tr>
6324                         </tbody>
6325                      </table>
6326                   </div>
6327                </div>
6328             </div>
6329             <div class="topic concept nested1" id="cusparsegetmattype"><a name="cusparsegetmattype" shape="rect">
6330                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsegetmattype" name="cusparsegetmattype" shape="rect">5.13.&nbsp;cusparseGetMatType()</a></h3>
6331                <div class="body conbody"><pre xml:space="preserve">cusparseMatrixType_t
6332 cusparseGetMatType(const cusparseMatDescr_t descrA)
6333 </pre><p class="p">This function returns the <samp class="ph codeph">MatrixType</samp> field of the matrix descriptor <samp class="ph codeph">descrA</samp>.
6334                   </p>
6335                   <div class="tablenoborder">
6336                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6337                            <tr class="row">
6338                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
6339                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix descriptor.</td>
6340                            </tr>
6341                         </tbody>
6342                      </table>
6343                   </div>
6344                   <div class="tablenoborder">
6345                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Returned</strong></span><tbody class="tbody">
6346                            <tr class="row">
6347                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph"></samp></td>
6348                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">One of the enumerated matrix types.</td>
6349                            </tr>
6350                         </tbody>
6351                      </table>
6352                   </div>
6353                </div>
6354             </div>
6355             <div class="topic concept nested1" id="cusparsegetpointermode"><a name="cusparsegetpointermode" shape="rect">
6356                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsegetpointermode" name="cusparsegetpointermode" shape="rect">5.14.&nbsp;cusparseGetPointerMode()</a></h3>
6357                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6358 cusparseGetPointerMode(cusparseHandlet handle, 
6359                        cusparsePointerMode_t *mode)
6360 </pre><p class="p">This function obtains the pointer mode used by the CUSPARSE library. Please see the section on the <samp class="ph codeph">cusparsePointerMode_t</samp> type for more details.
6361                   </p>
6362                   <div class="tablenoborder">
6363                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6364                            <tr class="row">
6365                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
6366                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the handle to the CUSPARSE context.</td>
6367                            </tr>
6368                         </tbody>
6369                      </table>
6370                   </div>
6371                   <div class="tablenoborder">
6372                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
6373                            <tr class="row">
6374                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">mode</samp></td>
6375                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">One of the enumerated pointer mode types.</td>
6376                            </tr>
6377                         </tbody>
6378                      </table>
6379                   </div>
6380                   <div class="tablenoborder">
6381                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6382                            <tr class="row">
6383                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6384                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the pointer mode was returned successfully.</td>
6385                            </tr>
6386                            <tr class="row">
6387                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
6388                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
6389                            </tr>
6390                         </tbody>
6391                      </table>
6392                   </div>
6393                </div>
6394             </div>
6395             <div class="topic concept nested1" id="cusparsegetversion"><a name="cusparsegetversion" shape="rect">
6396                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsegetversion" name="cusparsegetversion" shape="rect">5.15.&nbsp;cusparseGetVersion()</a></h3>
6397                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6398 cusparseGetVersion(cusparseHandle_t handle, int *version)
6399 </pre><p class="p">This function returns the version number of the CUSPARSE library.</p>
6400                   <div class="tablenoborder">
6401                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6402                            <tr class="row">
6403                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
6404                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the handle to the CUSPARSE context.</td>
6405                            </tr>
6406                         </tbody>
6407                      </table>
6408                   </div>
6409                   <div class="tablenoborder">
6410                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
6411                            <tr class="row">
6412                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">version</samp></td>
6413                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the version number of the library.</td>
6414                            </tr>
6415                         </tbody>
6416                      </table>
6417                   </div>
6418                   <div class="tablenoborder">
6419                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6420                            <tr class="row">
6421                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6422                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the version was returned successfully.</td>
6423                            </tr>
6424                            <tr class="row">
6425                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
6426                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
6427                            </tr>
6428                         </tbody>
6429                      </table>
6430                   </div>
6431                </div>
6432             </div>
6433             <div class="topic concept nested1" id="cusparsesetmatdiagtype"><a name="cusparsesetmatdiagtype" shape="rect">
6434                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsesetmatdiagtype" name="cusparsesetmatdiagtype" shape="rect">5.16.&nbsp;cusparseSetMatDiagType()</a></h3>
6435                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6436 cusparseSetMatDiagType(cusparseMatDescr_t descrA, 
6437                        cusparseDiagType_t diagType)
6438 </pre><p class="p">This function sets the <samp class="ph codeph">DiagType</samp> field of the matrix descriptor <samp class="ph codeph">descrA</samp>.
6439                   </p>
6440                   <div class="tablenoborder">
6441                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6442                            <tr class="row">
6443                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">diagType</samp></td>
6444                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">One of the enumerated diagType types.</td>
6445                            </tr>
6446                         </tbody>
6447                      </table>
6448                   </div>
6449                   <div class="tablenoborder">
6450                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
6451                            <tr class="row">
6452                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
6453                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix descriptor.</td>
6454                            </tr>
6455                         </tbody>
6456                      </table>
6457                   </div>
6458                   <div class="tablenoborder">
6459                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6460                            <tr class="row">
6461                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6462                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the field <samp class="ph codeph">DiagType</samp> was set successfully.
6463                               </td>
6464                            </tr>
6465                            <tr class="row">
6466                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
6467                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">An invalid <samp class="ph codeph">diagType</samp> parameter was passed.
6468                               </td>
6469                            </tr>
6470                         </tbody>
6471                      </table>
6472                   </div>
6473                </div>
6474             </div>
6475             <div class="topic concept nested1" id="cusparsesetmatfillmode"><a name="cusparsesetmatfillmode" shape="rect">
6476                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsesetmatfillmode" name="cusparsesetmatfillmode" shape="rect">5.17.&nbsp;cusparseSetMatFillMode()</a></h3>
6477                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6478 cusparseSetMatFillMode(cusparseMatDescr_t descrA, 
6479                        cusparseFillMode_t fillMode)
6480 </pre><p class="p">This function sets the <samp class="ph codeph">FillMode</samp> field of the matrix descriptor <samp class="ph codeph">descrA</samp>.
6481                   </p>
6482                   <div class="tablenoborder">
6483                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6484                            <tr class="row">
6485                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">fillMode</samp></td>
6486                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">One of the enumerated fillMode types.</td>
6487                            </tr>
6488                         </tbody>
6489                      </table>
6490                   </div>
6491                   <div class="tablenoborder">
6492                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
6493                            <tr class="row">
6494                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
6495                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix descriptor.</td>
6496                            </tr>
6497                         </tbody>
6498                      </table>
6499                   </div>
6500                   <div class="tablenoborder">
6501                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6502                            <tr class="row">
6503                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6504                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the <samp class="ph codeph">FillMode</samp> field was set successfully.
6505                               </td>
6506                            </tr>
6507                            <tr class="row">
6508                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
6509                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">An invalid <samp class="ph codeph">fillMode</samp> parameter was passed.
6510                               </td>
6511                            </tr>
6512                         </tbody>
6513                      </table>
6514                   </div>
6515                </div>
6516             </div>
6517             <div class="topic concept nested1" id="cusparsesetmatindexbase"><a name="cusparsesetmatindexbase" shape="rect">
6518                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsesetmatindexbase" name="cusparsesetmatindexbase" shape="rect">5.18.&nbsp;cusparseSetMatIndexBase()</a></h3>
6519                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6520 cusparseSetMatIndexBase(cusparseMatDescr_t descrA, 
6521                         cusparseIndexBase_t base)
6522 </pre><p class="p">This function sets the <samp class="ph codeph">IndexBase</samp> field of the matrix descriptor <samp class="ph codeph">descrA</samp>.
6523                   </p>
6524                   <div class="tablenoborder">
6525                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6526                            <tr class="row">
6527                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">base</samp></td>
6528                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">One of the enumerated indexBase types.</td>
6529                            </tr>
6530                         </tbody>
6531                      </table>
6532                   </div>
6533                   <div class="tablenoborder">
6534                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
6535                            <tr class="row">
6536                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
6537                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix descriptor.</td>
6538                            </tr>
6539                         </tbody>
6540                      </table>
6541                   </div>
6542                   <div class="tablenoborder">
6543                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6544                            <tr class="row">
6545                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6546                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the <samp class="ph codeph">IndexBase</samp> field was set successfully.
6547                               </td>
6548                            </tr>
6549                            <tr class="row">
6550                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
6551                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">An invalid <samp class="ph codeph">base</samp> parameter was passed.
6552                               </td>
6553                            </tr>
6554                         </tbody>
6555                      </table>
6556                   </div>
6557                </div>
6558             </div>
6559             <div class="topic concept nested1" id="cusparsesetmattype"><a name="cusparsesetmattype" shape="rect">
6560                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsesetmattype" name="cusparsesetmattype" shape="rect">5.19.&nbsp;cusparseSetMatType()</a></h3>
6561                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6562 cusparseSetMatType(cusparseMatDescr_t descrA, cusparseMatrixType_t type)
6563 </pre><p class="p">This function sets the <samp class="ph codeph">MatrixType</samp> field of the matrix descriptor <samp class="ph codeph">descrA</samp>.
6564                   </p>
6565                   <div class="tablenoborder">
6566                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6567                            <tr class="row">
6568                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">type</samp></td>
6569                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">One of the enumerated matrix types.</td>
6570                            </tr>
6571                         </tbody>
6572                      </table>
6573                   </div>
6574                   <div class="tablenoborder">
6575                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
6576                            <tr class="row">
6577                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
6578                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix descriptor.</td>
6579                            </tr>
6580                         </tbody>
6581                      </table>
6582                   </div>
6583                   <div class="tablenoborder">
6584                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6585                            <tr class="row">
6586                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6587                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the <samp class="ph codeph">MatrixType</samp> field was set successfully.
6588                               </td>
6589                            </tr>
6590                            <tr class="row">
6591                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
6592                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">An invalid <samp class="ph codeph">type</samp> parameter was passed.
6593                               </td>
6594                            </tr>
6595                         </tbody>
6596                      </table>
6597                   </div>
6598                </div>
6599             </div>
6600             <div class="topic concept nested1" id="cusparsesetpointermode"><a name="cusparsesetpointermode" shape="rect">
6601                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsesetpointermode" name="cusparsesetpointermode" shape="rect">5.20.&nbsp;cusparseSetPointerMode()</a></h3>
6602                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6603 cusparseSetPointerMode(cusparseHandle_t handle, 
6604                        cusparsePointerMode_t mode)
6605 </pre><p class="p">This function sets the pointer mode used by the CUSPARSE library. The <em class="ph i">default</em> is for the values to be passed by reference on the host. Please see the section on the <samp class="ph codeph">cublasPointerMode_t</samp> type for more details.
6606                   </p>
6607                   <div class="tablenoborder">
6608                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6609                            <tr class="row">
6610                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
6611                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the handle to the CUSPARSE context.</td>
6612                            </tr>
6613                            <tr class="row">
6614                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">mode</samp></td>
6615                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">One of the enumerated pointer mode types.</td>
6616                            </tr>
6617                         </tbody>
6618                      </table>
6619                   </div>
6620                   <div class="tablenoborder">
6621                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6622                            <tr class="row">
6623                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6624                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the pointer mode was set successfully.</td>
6625                            </tr>
6626                            <tr class="row">
6627                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
6628                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
6629                            </tr>
6630                         </tbody>
6631                      </table>
6632                   </div>
6633                </div>
6634             </div>
6635             <div class="topic concept nested1" id="cusparsesetstream"><a name="cusparsesetstream" shape="rect">
6636                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparsesetstream" name="cusparsesetstream" shape="rect">5.21.&nbsp;cusparseSetStream()</a></h3>
6637                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
6638 cusparseSetStream(cusparseHandle_t handle, cudaStream_t streamId)
6639 </pre><p class="p">This function sets the stream to be used by the CUSPARSE library to execute its routines.</p>
6640                   <div class="tablenoborder">
6641                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6642                            <tr class="row">
6643                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
6644                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the handle to the CUSPARSE context.</td>
6645                            </tr>
6646                            <tr class="row">
6647                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">streamId</samp></td>
6648                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the stream to be used by the library.</td>
6649                            </tr>
6650                         </tbody>
6651                      </table>
6652                   </div>
6653                   <div class="tablenoborder">
6654                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6655                            <tr class="row">
6656                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6657                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the stream was set successfully.</td>
6658                            </tr>
6659                            <tr class="row">
6660                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
6661                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
6662                            </tr>
6663                         </tbody>
6664                      </table>
6665                   </div>
6666                </div>
6667             </div>
6668          </div>
6669          <div class="topic concept nested0" id="cusparse-level-1-function-reference"><a name="cusparse-level-1-function-reference" shape="rect">
6670                <!-- --></a><h2 class="title topictitle1"><a href="#cusparse-level-1-function-reference" name="cusparse-level-1-function-reference" shape="rect">6.&nbsp;CUSPARSE Level 1 Function Reference</a></h2>
6671             <div class="body conbody">
6672                <p class="p">This chapter describes sparse linear algebra functions that perform operations between dense and sparse vectors.</p>
6673             </div>
6674             <div class="topic concept nested1" id="cusparse-lt-t-gt-axpyi"><a name="cusparse-lt-t-gt-axpyi" shape="rect">
6675                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-axpyi" name="cusparse-lt-t-gt-axpyi" shape="rect">6.1.&nbsp;cusparse&lt;t&gt;axpyi</a></h3>
6676                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
6677 cusparseSaxpyi(cusparseHandle_t handle, int nnz, 
6678                const float           *alpha, 
6679                const float           *xVal, const int *xInd, 
6680                float           *y, cusparseIndexBase_t idxBase)
6681 cusparseStatus_t 
6682 cusparseDaxpyi(cusparseHandle_t handle, int nnz, 
6683                const double          *alpha, 
6684                const double          *xVal, const int *xInd, 
6685                double          *y, cusparseIndexBase_t idxBase)
6686 cusparseStatus_t 
6687 cusparseCaxpyi(cusparseHandle_t handle, int nnz, 
6688                const cuComplex       *alpha, 
6689                const cuComplex       *xVal, const int *xInd, 
6690                cuComplex       *y, cusparseIndexBase_t idxBase)
6691 cusparseStatus_t 
6692 cusparseZaxpyi(cusparseHandle_t handle, int nnz, 
6693                const cuDoubleComplex *alpha, 
6694                const cuDoubleComplex *xVal, const int *xInd, 
6695                cuDoubleComplex *y, cusparseIndexBase_t idxBase)</pre><p class="p">This function multiplies the vector <samp class="ph codeph">x</samp> in sparse format by the constant
6696                      
6697                      
6698                      <math xmlns="http://www.w3.org/1998/Math/MathML">
6699                         <mi>α</mi>
6700                      </math>
6701                      
6702                      and adds the result to the vector <samp class="ph codeph">y</samp> in dense format. This operation can be written as
6703                   </p>
6704                   <div class="tablenoborder">
6705                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
6706                         <tbody class="tbody">
6707                            <tr class="row">
6708                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
6709                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
6710                                     <mi>y</mi>
6711                                     <mo>=</mo>
6712                                     <mi>y</mi>
6713                                     <mo>+</mo>
6714                                     <mi>α</mi>
6715                                     <mo>∗</mo>
6716                                     <mi>x</mi>
6717                                  </math>
6718                               </td>
6719                            </tr>
6720                         </tbody>
6721                      </table>
6722                   </div>
6723                   <p class="p">in other words,</p><pre xml:space="preserve">for i=0 to nnz-1
6724     y[xInd[i]-idxBase] = y[xInd[i]-idxBase] + alpha*xVal[i]</pre><p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
6725                      to the application on the host before the result is ready.
6726                   </p>
6727                   <div class="tablenoborder">
6728                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6729                            <tr class="row">
6730                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
6731                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
6732                            </tr>
6733                            <tr class="row">
6734                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
6735                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of elements in vector <samp class="ph codeph">x</samp>.
6736                               </td>
6737                            </tr>
6738                            <tr class="row">
6739                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">alpha</samp></td>
6740                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication.</td>
6741                            </tr>
6742                            <tr class="row">
6743                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xVal</samp></td>
6744                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector with <samp class="ph codeph">nnz</samp> non-zero values of vector <samp class="ph codeph">x</samp>.
6745                               </td>
6746                            </tr>
6747                            <tr class="row">
6748                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xInd</samp></td>
6749                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer vector with <samp class="ph codeph">nnz</samp> indices of the non-zero values of vector <samp class="ph codeph">x</samp>.
6750                               </td>
6751                            </tr>
6752                            <tr class="row">
6753                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
6754                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector in dense format.</td>
6755                            </tr>
6756                            <tr class="row">
6757                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">idxBase</samp></td>
6758                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> or <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp></td>
6759                            </tr>
6760                         </tbody>
6761                      </table>
6762                   </div>
6763                   <div class="tablenoborder">
6764                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
6765                            <tr class="row">
6766                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
6767                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; updated vector in dense format (that is unchanged if <samp class="ph codeph">nnz == 0</samp>).
6768                               </td>
6769                            </tr>
6770                         </tbody>
6771                      </table>
6772                   </div>
6773                   <div class="tablenoborder">
6774                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6775                            <tr class="row">
6776                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6777                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
6778                            </tr>
6779                            <tr class="row">
6780                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
6781                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
6782                            </tr>
6783                            <tr class="row">
6784                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
6785                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the <samp class="ph codeph">idxBase</samp> is neither <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> nor <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
6786                               </td>
6787                            </tr>
6788                            <tr class="row">
6789                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
6790                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
6791                            </tr>
6792                            <tr class="row">
6793                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
6794                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU.</td>
6795                            </tr>
6796                         </tbody>
6797                      </table>
6798                   </div>
6799                </div>
6800             </div>
6801             <div class="topic concept nested1" id="cusparse-lt-t-gt-doti"><a name="cusparse-lt-t-gt-doti" shape="rect">
6802                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-doti" name="cusparse-lt-t-gt-doti" shape="rect">6.2.&nbsp;cusparse&lt;t&gt;doti</a></h3>
6803                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
6804 cusparseSdoti(cusparseHandle_t handle, int nnz, 
6805               const float           *xVal, 
6806               const int *xInd, const float           *y, 
6807               float           *resultDevHostPtr, 
6808               cusparseIndexBase_t idxBase)
6809 cusparseStatus_t 
6810 cusparseDdoti(cusparseHandle_t handle, int nnz, 
6811               const double          *xVal, 
6812               const int *xInd, const double          *y, 
6813               double          *resultDevHostPtr, 
6814               cusparseIndexBase_t idxBase)
6815 cusparseStatus_t 
6816 cusparseCdoti(cusparseHandle_t handle, int nnz, 
6817               const cuComplex       *xVal, 
6818               const int *xInd, const cuComplex       *y, 
6819               cuComplex       *resultDevHostPtr, 
6820               cusparseIndexBase_t idxBase)
6821 cusparseStatus_t 
6822 cusparseZdoti(cusparseHandle_t handle, int nnz, const 
6823               cuDoubleComplex *xVal, 
6824               const int *xInd, const cuDoubleComplex *y, 
6825               cuDoubleComplex *resultDevHostPtr, 
6826               cusparseIndexBase_t idxBase)</pre><p class="p">This function returns the dot product of a vector <samp class="ph codeph">x</samp> in sparse format and vector <samp class="ph codeph">y</samp> in dense format. This operation can be written as
6827                   </p>
6828                   <div class="tablenoborder">
6829                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
6830                         <tbody class="tbody">
6831                            <tr class="row">
6832                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
6833                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
6834                                     <mi>r</mi>
6835                                     <mi>e</mi>
6836                                     <mi>s</mi>
6837                                     <mi>u</mi>
6838                                     <mi>l</mi>
6839                                     <mi>t</mi>
6840                                     <mo>=</mo>
6841                                     <msup>
6842                                        <mi>y</mi>
6843                                        <mi>T</mi>
6844                                     </msup>
6845                                     <mi>x</mi>
6846                                  </math>
6847                               </td>
6848                            </tr>
6849                         </tbody>
6850                      </table>
6851                   </div>
6852                   <p class="p">in other words,</p><pre xml:space="preserve">for i=0 to nnz-1
6853     resultDevHostPtr += xVal[i]*y[xInd[i-idxBase]]
6854 </pre><p class="p">This function requires some temporary extra storage that is allocated internally. It is executed asynchronously with respect
6855                      to the host and it may return control to the application on the host before the result is ready.
6856                   </p>
6857                   <div class="tablenoborder">
6858                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6859                            <tr class="row">
6860                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
6861                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
6862                            </tr>
6863                            <tr class="row">
6864                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
6865                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of elements in vector <samp class="ph codeph">x</samp>.
6866                               </td>
6867                            </tr>
6868                            <tr class="row">
6869                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xVal</samp></td>
6870                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector with <samp class="ph codeph">nnz</samp> non-zero values of vector <samp class="ph codeph">x</samp>.
6871                               </td>
6872                            </tr>
6873                            <tr class="row">
6874                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xInd</samp></td>
6875                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer vector with <samp class="ph codeph">nnz</samp> indices of the non-zero values of vector <samp class="ph codeph">x</samp>.
6876                               </td>
6877                            </tr>
6878                            <tr class="row">
6879                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
6880                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector in dense format.</td>
6881                            </tr>
6882                            <tr class="row">
6883                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">resultDevHostPtr</samp></td>
6884                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">pointer to the location of the result in the device or host memory.</td>
6885                            </tr>
6886                            <tr class="row">
6887                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">idxBase</samp></td>
6888                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> or <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp></td>
6889                            </tr>
6890                         </tbody>
6891                      </table>
6892                   </div>
6893                   <div class="tablenoborder">
6894                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
6895                            <tr class="row">
6896                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">resultDevHostPtr</samp></td>
6897                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">scalar result in the device or host memory (that is zero if <samp class="ph codeph">nnz == 0</samp>).
6898                               </td>
6899                            </tr>
6900                         </tbody>
6901                      </table>
6902                   </div>
6903                   <div class="tablenoborder">
6904                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
6905                            <tr class="row">
6906                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
6907                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
6908                            </tr>
6909                            <tr class="row">
6910                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
6911                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
6912                            </tr>
6913                            <tr class="row">
6914                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
6915                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the reduction buffer could not be allocated.</td>
6916                            </tr>
6917                            <tr class="row">
6918                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
6919                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the <samp class="ph codeph">idxBase</samp> is neither <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> nor <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
6920                               </td>
6921                            </tr>
6922                            <tr class="row">
6923                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
6924                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
6925                            </tr>
6926                            <tr class="row">
6927                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
6928                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU.</td>
6929                            </tr>
6930                            <tr class="row">
6931                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
6932                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
6933                            </tr>
6934                         </tbody>
6935                      </table>
6936                   </div>
6937                </div>
6938             </div>
6939             <div class="topic concept nested1" id="cusparse-lt-t-gt-dotci"><a name="cusparse-lt-t-gt-dotci" shape="rect">
6940                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-dotci" name="cusparse-lt-t-gt-dotci" shape="rect">6.3.&nbsp;cusparse&lt;t&gt;dotci</a></h3>
6941                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
6942 cusparseCdotci(cusparseHandle_t handle, int nnz, 
6943                const cuComplex       *xVal, 
6944                const int *xInd, const cuComplex       *y, 
6945                cuComplex       *resultDevHostPtr, cusparseIndexBase_t idxBase)
6946 cusparseStatus_t 
6947 cusparseZdotci(cusparseHandle_t handle, int nnz, 
6948                const cuDoubleComplex *xVal, 
6949                const int *xInd, const cuDoubleComplex *y, 
6950                cuDoubleComplex *resultDevHostPtr, cusparseIndexBase_t idxBase)</pre><p class="p">This function returns the dot product of a complex conjugate of vector <samp class="ph codeph">x</samp> in sparse format and vector <samp class="ph codeph">y</samp> in dense format. This operation can be written as
6951                   </p>
6952                   <div class="tablenoborder">
6953                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
6954                         <tbody class="tbody">
6955                            <tr class="row">
6956                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
6957                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
6958                                     <mi>r</mi>
6959                                     <mi>e</mi>
6960                                     <mi>s</mi>
6961                                     <mi>u</mi>
6962                                     <mi>l</mi>
6963                                     <mi>t</mi>
6964                                     <mo>=</mo>
6965                                     <msup>
6966                                        <mi>y</mi>
6967                                        <mi>H</mi>
6968                                     </msup>
6969                                     <mi>x</mi>
6970                                  </math>
6971                               </td>
6972                            </tr>
6973                         </tbody>
6974                      </table>
6975                   </div>
6976                   <p class="p">in other words,</p><pre xml:space="preserve">for i=0 to nnz-1
6977         resultDevHostPtr += <math xmlns="http://www.w3.org/1998/Math/MathML"><mover><mrow class="MJX-TeXAtom-ORD"><mrow class="MJX-TeXAtom-ORD"><mtext>xVal[i]</mtext></mrow></mrow><mo accent="false">¯</mo></mover></math>*y[xInd[i-idxBase]]
6978 </pre><p class="p">This function requires some temporary extra storage that is allocated internally. It is executed asynchronously with respect
6979                      to the host and it may return control to the application on the host before the result is ready.
6980                   </p>
6981                   <div class="tablenoborder">
6982                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
6983                            <tr class="row">
6984                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
6985                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
6986                            </tr>
6987                            <tr class="row">
6988                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
6989                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of elements in vector <samp class="ph codeph">x</samp>.
6990                               </td>
6991                            </tr>
6992                            <tr class="row">
6993                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xVal</samp></td>
6994                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector with <samp class="ph codeph">nnz</samp> non-zero values of vector <samp class="ph codeph">x</samp>.
6995                               </td>
6996                            </tr>
6997                            <tr class="row">
6998                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xInd</samp></td>
6999                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer vector with <samp class="ph codeph">nnz</samp> indices of the non-zero values of vector <samp class="ph codeph">x</samp>.
7000                               </td>
7001                            </tr>
7002                            <tr class="row">
7003                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
7004                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector in dense format.</td>
7005                            </tr>
7006                            <tr class="row">
7007                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">resultDevHostPtr</samp></td>
7008                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">pointer to the location of the result in the device or host memory.</td>
7009                            </tr>
7010                            <tr class="row">
7011                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">idxBase</samp></td>
7012                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> or <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp></td>
7013                            </tr>
7014                         </tbody>
7015                      </table>
7016                   </div>
7017                   <div class="tablenoborder">
7018                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
7019                            <tr class="row">
7020                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">resultDevHostPtr</samp></td>
7021                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">scalar result in the device or host memory (that is zero if <samp class="ph codeph">nnz == 0</samp>).
7022                               </td>
7023                            </tr>
7024                         </tbody>
7025                      </table>
7026                   </div>
7027                   <div class="tablenoborder">
7028                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
7029                            <tr class="row">
7030                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
7031                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
7032                            </tr>
7033                            <tr class="row">
7034                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
7035                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
7036                            </tr>
7037                            <tr class="row">
7038                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
7039                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the reduction buffer could not be allocated.</td>
7040                            </tr>
7041                            <tr class="row">
7042                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
7043                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the <samp class="ph codeph">idxBase</samp> is neither <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> nor <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
7044                               </td>
7045                            </tr>
7046                            <tr class="row">
7047                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
7048                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
7049                            </tr>
7050                            <tr class="row">
7051                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
7052                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU.</td>
7053                            </tr>
7054                            <tr class="row">
7055                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
7056                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
7057                            </tr>
7058                         </tbody>
7059                      </table>
7060                   </div>
7061                </div>
7062             </div>
7063             <div class="topic concept nested1" id="cusparse-lt-t-gt-gthr"><a name="cusparse-lt-t-gt-gthr" shape="rect">
7064                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-gthr" name="cusparse-lt-t-gt-gthr" shape="rect">6.4.&nbsp;cusparse&lt;t&gt;gthr</a></h3>
7065                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
7066 cusparseSgthr(cusparseHandle_t handle, int nnz, 
7067               const float           *y, 
7068               float           *xVal, const int *xInd, 
7069               cusparseIndexBase_t idxBase)
7070 cusparseStatus_t 
7071 cusparseDgthr(cusparseHandle_t handle, int nnz, 
7072               const double          *y, 
7073               double          *xVal, const int *xInd, 
7074               cusparseIndexBase_t idxBase)
7075 cusparseStatus_t 
7076 cusparseCgthr(cusparseHandle_t handle, int nnz, 
7077               const cuComplex       *y, 
7078               cuComplex       *xVal, const int *xInd, 
7079               cusparseIndexBase_t idxBase)
7080 cusparseStatus_t 
7081 cusparseZgthr(cusparseHandle_t handle, int nnz, 
7082               const cuDoubleComplex *y, 
7083               cuDoubleComplex *xVal, const int *xInd, 
7084               cusparseIndexBase_t idxBase)</pre><p class="p">This function gathers the elements of the vector <samp class="ph codeph">y</samp> listed in the index array <samp class="ph codeph">xInd</samp> into the data array <samp class="ph codeph">xVal</samp>.
7085                   </p>
7086                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
7087                      to the application on the host before the result is ready.
7088                   </p>
7089                   <div class="tablenoborder">
7090                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
7091                            <tr class="row">
7092                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
7093                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
7094                            </tr>
7095                            <tr class="row">
7096                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
7097                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of elements in vector <samp class="ph codeph">x</samp>.
7098                               </td>
7099                            </tr>
7100                            <tr class="row">
7101                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
7102                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector in dense format (of <samp class="ph codeph">size≥max(xInd)-idxBase+1</samp>).
7103                               </td>
7104                            </tr>
7105                            <tr class="row">
7106                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xInd</samp></td>
7107                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer vector with <samp class="ph codeph">nnz</samp> indices of the non-zero values of vector <samp class="ph codeph">x</samp>.
7108                               </td>
7109                            </tr>
7110                            <tr class="row">
7111                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">idxBase</samp></td>
7112                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> or <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp></td>
7113                            </tr>
7114                         </tbody>
7115                      </table>
7116                   </div>
7117                   <div class="tablenoborder">
7118                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
7119                            <tr class="row">
7120                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xVal</samp></td>
7121                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector with <samp class="ph codeph">nnz</samp> non-zero values that were gathered from vector <samp class="ph codeph">y</samp> (that is unchanged if <samp class="ph codeph">nnz == 0</samp>).
7122                               </td>
7123                            </tr>
7124                         </tbody>
7125                      </table>
7126                   </div>
7127                   <div class="tablenoborder">
7128                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
7129                            <tr class="row">
7130                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
7131                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
7132                            </tr>
7133                            <tr class="row">
7134                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
7135                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
7136                            </tr>
7137                            <tr class="row">
7138                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
7139                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the <samp class="ph codeph">idxBase</samp> is neither <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> nor <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
7140                               </td>
7141                            </tr>
7142                            <tr class="row">
7143                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
7144                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
7145                            </tr>
7146                            <tr class="row">
7147                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
7148                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU.</td>
7149                            </tr>
7150                         </tbody>
7151                      </table>
7152                   </div>
7153                </div>
7154             </div>
7155             <div class="topic concept nested1" id="cusparse-lt-t-gt-gthrz"><a name="cusparse-lt-t-gt-gthrz" shape="rect">
7156                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-gthrz" name="cusparse-lt-t-gt-gthrz" shape="rect">6.5.&nbsp;cusparse&lt;t&gt;gthrz</a></h3>
7157                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
7158 cusparseSgthrz(cusparseHandle_t handle, int nnz, float           *y, 
7159                float           *xVal, const int *xInd, 
7160                cusparseIndexBase_t idxBase)
7161 cusparseStatus_t 
7162 cusparseDgthrz(cusparseHandle_t handle, int nnz, double          *y, 
7163                double          *xVal, const int *xInd, 
7164                cusparseIndexBase_t idxBase)
7165 cusparseStatus_t 
7166 cusparseCgthrz(cusparseHandle_t handle, int nnz, cuComplex       *y, 
7167                cuComplex       *xVal, const int *xInd, 
7168                cusparseIndexBase_t idxBase)
7169 cusparseStatus_t 
7170 cusparseZgthrz(cusparseHandle_t handle, int nnz, cuDoubleComplex *y, 
7171                cuDoubleComplex *xVal, const int *xInd, 
7172                cusparseIndexBase_t idxBase)</pre><p class="p">This function gathers the elements of the vector <samp class="ph codeph">y</samp> listed in the index array <samp class="ph codeph">xInd</samp> into the data array <samp class="ph codeph">xVal</samp>. Also, it zeroes out the gathered elements in the vector <samp class="ph codeph">y</samp>.
7173                   </p>
7174                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
7175                      to the application on the host before the result is ready.
7176                   </p>
7177                   <div class="tablenoborder">
7178                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
7179                            <tr class="row">
7180                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
7181                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
7182                            </tr>
7183                            <tr class="row">
7184                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
7185                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of elements in vector <samp class="ph codeph">x</samp>.
7186                               </td>
7187                            </tr>
7188                            <tr class="row">
7189                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
7190                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector in dense format (of <samp class="ph codeph">size≥max(xInd)-idxBase+1</samp>).
7191                               </td>
7192                            </tr>
7193                            <tr class="row">
7194                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xInd</samp></td>
7195                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer vector with <samp class="ph codeph">nnz</samp> indices of the non-zero values of vector <samp class="ph codeph">x</samp>.
7196                               </td>
7197                            </tr>
7198                            <tr class="row">
7199                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">idxBase</samp></td>
7200                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> or <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp></td>
7201                            </tr>
7202                         </tbody>
7203                      </table>
7204                   </div>
7205                   <div class="tablenoborder">
7206                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
7207                            <tr class="row">
7208                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xVal</samp></td>
7209                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector with <samp class="ph codeph">nnz</samp> non-zero values that were gathered from vector <samp class="ph codeph">y</samp> (that is unchanged if <samp class="ph codeph">nnz == 0</samp>).
7210                               </td>
7211                            </tr>
7212                            <tr class="row">
7213                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
7214                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector in dense format with elements indexed by <samp class="ph codeph">xInd</samp> set to zero (it is unchanged if <samp class="ph codeph">nnz == 0</samp>).
7215                               </td>
7216                            </tr>
7217                         </tbody>
7218                      </table>
7219                   </div>
7220                   <div class="tablenoborder">
7221                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
7222                            <tr class="row">
7223                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
7224                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
7225                            </tr>
7226                            <tr class="row">
7227                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
7228                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
7229                            </tr>
7230                            <tr class="row">
7231                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
7232                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the <samp class="ph codeph">idxBase</samp> is neither <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> nor <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
7233                               </td>
7234                            </tr>
7235                            <tr class="row">
7236                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
7237                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
7238                            </tr>
7239                            <tr class="row">
7240                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
7241                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU.</td>
7242                            </tr>
7243                         </tbody>
7244                      </table>
7245                   </div>
7246                </div>
7247             </div>
7248             <div class="topic concept nested1" id="cusparse-lt-t-gt-roti"><a name="cusparse-lt-t-gt-roti" shape="rect">
7249                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-roti" name="cusparse-lt-t-gt-roti" shape="rect">6.6.&nbsp;cusparse&lt;t&gt;roti</a></h3>
7250                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
7251 cusparseSroti(cusparseHandle_t handle, int nnz, float  *xVal, 
7252               const int *xInd, 
7253               float  *y, const float  *c, const float  *s, 
7254               cusparseIndexBase_t idxBase)
7255 cusparseStatus_t 
7256 cusparseDroti(cusparseHandle_t handle, int nnz, double *xVal, 
7257               const int *xInd, 
7258               double *y, const double *c, const double *s, 
7259               cusparseIndexBase_t idxBase)</pre><p class="p">This function applies Givens rotation matrix</p>
7260                   <div class="tablenoborder">
7261                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
7262                         <tbody class="tbody">
7263                            <tr class="row">
7264                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
7265                                  <p class="p d4p_eqn_block">
7266                                     <math xmlns="http://www.w3.org/1998/Math/MathML">
7267                                        <mi>G</mi>
7268                                        <mo>=</mo>
7269                                        <mfenced open="(" close=")">
7270                                           <mtable columnalign="right right" rowspacing="4pt" columnspacing="1em">
7271                                              <mtr>
7272                                                 <mtd>
7273                                                    <mi>c</mi>
7274                                                 </mtd>
7275                                                 <mtd>
7276                                                    <mi>s</mi>
7277                                                 </mtd>
7278                                              </mtr>
7279                                              <mtr>
7280                                                 <mtd>
7281                                                    <mo>−</mo>
7282                                                    <mi>s</mi>
7283                                                 </mtd>
7284                                                 <mtd>
7285                                                    <mi>c</mi>
7286                                                 </mtd>
7287                                              </mtr>
7288                                           </mtable>
7289                                        </mfenced>
7290                                     </math>
7291                                  </p>
7292                               </td>
7293                            </tr>
7294                         </tbody>
7295                      </table>
7296                   </div>
7297                   <p class="p">to sparse <samp class="ph codeph">x</samp> and dense <samp class="ph codeph">y</samp> vectors. In other words,
7298                   </p><pre xml:space="preserve">for i=0 to nnz-1
7299     y[xInd[i]-idxBase] = c * y[xInd[i]-idxBase] - s*xVal[i]
7300     x[i]               = c * xVal[i]            + s * y[xInd[i]-idxBase]
7301 </pre><div class="tablenoborder">
7302                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
7303                            <tr class="row">
7304                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
7305                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
7306                            </tr>
7307                            <tr class="row">
7308                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
7309                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of elements in vector <samp class="ph codeph">x</samp>.
7310                               </td>
7311                            </tr>
7312                            <tr class="row">
7313                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xVal</samp></td>
7314                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector with <samp class="ph codeph">nnz</samp> non-zero values of vector <samp class="ph codeph">x</samp>.
7315                               </td>
7316                            </tr>
7317                            <tr class="row">
7318                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xInd</samp></td>
7319                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer vector with <samp class="ph codeph">nnz</samp> indices of the non-zero values of vector <samp class="ph codeph">x</samp>.
7320                               </td>
7321                            </tr>
7322                            <tr class="row">
7323                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
7324                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector in dense format.</td>
7325                            </tr>
7326                            <tr class="row">
7327                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">c</samp></td>
7328                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">cosine element of the rotation matrix.</td>
7329                            </tr>
7330                            <tr class="row">
7331                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">s</samp></td>
7332                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">sine element of the rotation matrix.</td>
7333                            </tr>
7334                            <tr class="row">
7335                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">idxBase</samp></td>
7336                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> or <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp></td>
7337                            </tr>
7338                         </tbody>
7339                      </table>
7340                   </div>
7341                   <div class="tablenoborder">
7342                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
7343                            <tr class="row">
7344                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xVal</samp></td>
7345                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; updated vector in sparse fomat (that is unchanged if <samp class="ph codeph">nnz == 0</samp>).
7346                               </td>
7347                            </tr>
7348                            <tr class="row">
7349                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
7350                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; updated vector in dense fomat (that is unchanged if <samp class="ph codeph">nnz == 0</samp>).
7351                               </td>
7352                            </tr>
7353                         </tbody>
7354                      </table>
7355                   </div>
7356                   <div class="tablenoborder">
7357                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
7358                            <tr class="row">
7359                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
7360                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
7361                            </tr>
7362                            <tr class="row">
7363                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
7364                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
7365                            </tr>
7366                            <tr class="row">
7367                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
7368                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the <samp class="ph codeph">idxBase</samp> is neither <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> nor <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
7369                               </td>
7370                            </tr>
7371                            <tr class="row">
7372                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
7373                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
7374                            </tr>
7375                            <tr class="row">
7376                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
7377                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU.</td>
7378                            </tr>
7379                         </tbody>
7380                      </table>
7381                   </div>
7382                </div>
7383             </div>
7384             <div class="topic concept nested1" id="cusparse-lt-t-gt-sctr"><a name="cusparse-lt-t-gt-sctr" shape="rect">
7385                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-sctr" name="cusparse-lt-t-gt-sctr" shape="rect">6.7.&nbsp;cusparse&lt;t&gt;sctr</a></h3>
7386                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
7387 cusparseSsctr(cusparseHandle_t handle, int nnz, 
7388               const float           *xVal, 
7389               const int *xInd, float           *y, 
7390               cusparseIndexBase_t idxBase)
7391 cusparseStatus_t 
7392 cusparseDsctr(cusparseHandle_t handle, int nnz, 
7393               const double          *xVal, 
7394               const int *xInd, double          *y, 
7395               cusparseIndexBase_t idxBase)
7396 cusparseStatus_t 
7397 cusparseCsctr(cusparseHandle_t handle, int nnz, 
7398               const cuComplex       *xVal, 
7399               const int *xInd, cuComplex       *y, 
7400               cusparseIndexBase_t idxBase)
7401 cusparseStatus_t 
7402 cusparseZsctr(cusparseHandle_t handle, int nnz, 
7403               const cuDoubleComplex *xVal, 
7404               const int *xInd, cuDoubleComplex *y, 
7405               cusparseIndexBase_t idxBase)</pre><p class="p">This function scatters the elements of the vector <samp class="ph codeph">x</samp> in sparse format into the vector <samp class="ph codeph">y</samp> in dense format. It modifies only the elements of <samp class="ph codeph">y</samp> whose indices are listed in the array <samp class="ph codeph">xInd</samp>.
7406                   </p>
7407                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
7408                      to the application on the host before the result is ready.
7409                   </p>
7410                   <div class="tablenoborder">
7411                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
7412                            <tr class="row">
7413                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
7414                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
7415                            </tr>
7416                            <tr class="row">
7417                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
7418                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of elements in vector <samp class="ph codeph">x</samp>.
7419                               </td>
7420                            </tr>
7421                            <tr class="row">
7422                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xVal</samp></td>
7423                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector with <samp class="ph codeph">nnz</samp> non-zero values of vector <samp class="ph codeph">x</samp>.
7424                               </td>
7425                            </tr>
7426                            <tr class="row">
7427                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">xInd</samp></td>
7428                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer vector with <samp class="ph codeph">nnz</samp> indices of the non-zero values of vector <samp class="ph codeph">x</samp>.
7429                               </td>
7430                            </tr>
7431                            <tr class="row">
7432                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
7433                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense vector (of <samp class="ph codeph">size≥max(xInd)-idxBase+1</samp>).
7434                               </td>
7435                            </tr>
7436                            <tr class="row">
7437                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">idxBase</samp></td>
7438                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> or <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp></td>
7439                            </tr>
7440                         </tbody>
7441                      </table>
7442                   </div>
7443                   <div class="tablenoborder">
7444                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
7445                            <tr class="row">
7446                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
7447                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector with <samp class="ph codeph">nnz</samp> non-zero values that were scattered from vector <samp class="ph codeph">x</samp> (that is unchanged if <samp class="ph codeph">nnz == 0</samp>).
7448                               </td>
7449                            </tr>
7450                         </tbody>
7451                      </table>
7452                   </div>
7453                   <div class="tablenoborder">
7454                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
7455                            <tr class="row">
7456                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
7457                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
7458                            </tr>
7459                            <tr class="row">
7460                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
7461                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
7462                            </tr>
7463                            <tr class="row">
7464                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
7465                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the <samp class="ph codeph">idxBase</samp> is neither <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> nor <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE.</samp>.
7466                               </td>
7467                            </tr>
7468                            <tr class="row">
7469                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
7470                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
7471                            </tr>
7472                            <tr class="row">
7473                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
7474                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU.</td>
7475                            </tr>
7476                         </tbody>
7477                      </table>
7478                   </div>
7479                </div>
7480             </div>
7481          </div>
7482          <div class="topic concept nested0" id="cusparse-level-2-function-reference"><a name="cusparse-level-2-function-reference" shape="rect">
7483                <!-- --></a><h2 class="title topictitle1"><a href="#cusparse-level-2-function-reference" name="cusparse-level-2-function-reference" shape="rect">7.&nbsp;CUSPARSE Level 2 Function Reference</a></h2>
7484             <div class="body conbody">
7485                <p class="p">This chapter describes the sparse linear algebra functions that perform operations between sparse matrices and dense vectors.</p>
7486                <p class="p">In particular, the solution of sparse triangular linear systems is implemented in two phases. First, during the analysis phase,
7487                   the sparse triangular matrix is analyzed to determine the dependencies between its elements by calling the appropriate <samp class="ph codeph">csrsv_analysis()</samp> function. The analysis is specific to the sparsity pattern of the given matrix and to the selected <samp class="ph codeph">cusparseOperation_t</samp> type. The information from the analysis phase is stored in the parameter of type <samp class="ph codeph">cusparseSolveAnalysisInfo_t</samp> that has been initialized previously with a call to <samp class="ph codeph">cusparseCreateSolveAnalysisInfo()</samp>.
7488                </p>
7489                <p class="p">Second, during the solve phase, the given sparse triangular linear system is solved using the information stored in the <samp class="ph codeph">cusparseSolveAnalysisInfo_t</samp> parameter by calling the appropriate <samp class="ph codeph">csrsv_solve()</samp> function. The solve phase may be performed multiple times with different right-hand-sides, while the analysis phase needs
7490                   to be performed only once. This is especially useful when a sparse triangular linear system must be solved for a set of different
7491                   right-hand-sides one at a time, while its coefficient matrix remains the same.
7492                </p>
7493                <p class="p">Finally, once all the solves have completed, the opaque data structure pointed to by the <samp class="ph codeph">cusparseSolveAnalysisInfo_t</samp> parameter can be released by calling <samp class="ph codeph">cusparseDestroySolveAnalysisInfo()</samp>. For more information please refer to [3].
7494                </p>
7495             </div>
7496             <div class="topic concept nested1" id="cusparse-lt-t-gt-bsrmv"><a name="cusparse-lt-t-gt-bsrmv" shape="rect">
7497                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-bsrmv" name="cusparse-lt-t-gt-bsrmv" shape="rect">7.1.&nbsp;cusparse&lt;t&gt;bsrmv</a></h3>
7498                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
7499 cusparseSbsrmv(cusparseHandle_t handle, cusparseDirection_t dir,
7500     cusparseOperation_t trans, int mb, int nb, int nnzb,
7501     const float *alpha, const cusparseMatDescr_t descr,
7502     const float *bsrVal, const int *bsrRowPtr, const int *bsrColInd,
7503     int  blockDim, const float *x, 
7504     const float *beta, float *y)
7505 cusparseStatus_t
7506 cusparseDbsrmv(cusparseHandle_t handle, cusparseDirection_t dir,
7507     cusparseOperation_t trans, int mb, int nb, int nnzb,
7508     const double *alpha, const cusparseMatDescr_t descr,
7509     const double *bsrVal, const int *bsrRowPtr, const int *bsrColInd,
7510     int  blockDim, const double *x, 
7511     const double *beta, double *y)
7512 cusparseStatus_t
7513 cusparseCbsrmv(cusparseHandle_t handle, cusparseDirection_t dir,
7514     cusparseOperation_t trans, int mb, int nb, int nnzb,
7515     const cuComplex *alpha, const cusparseMatDescr_t descr,
7516     const cuComplex *bsrVal, const int *bsrRowPtr, const int *bsrColInd,
7517     int  blockDim, const cuComplex *x, 
7518     const cuComplex *beta, cuComplex *y)
7519 cusparseStatus_t
7520 cusparseZbsrmv(cusparseHandle_t handle, cusparseDirection_t dir,
7521     cusparseOperation_t trans, int mb, int nb, int nnzb,
7522     const cuDoubleComplex *alpha, const cusparseMatDescr_t descr,
7523     const cuDoubleComplex *bsrVal, const int *bsrRowPtr, const int *bsrColInd,
7524     int  blockDim, const cuDoubleComplex *x, 
7525     const cuDoubleComplex *beta, cuDoubleComplex *y)</pre><p class="p">This function performs the matrix-vector operation</p>
7526                   <div class="tablenoborder">
7527                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
7528                         <tbody class="tbody">
7529                            <tr class="row">
7530                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
7531                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7532                                     <mrow class="MJX-TeXAtom-ORD">
7533                                        <mrow class="MJX-TeXAtom-ORD">
7534                                           <mtext>y</mtext>
7535                                        </mrow>
7536                                     </mrow>
7537                                     <mo>=</mo>
7538                                     <mi>α</mi>
7539                                     <mo>∗</mo>
7540                                     <mrow class="MJX-TeXAtom-ORD">
7541                                        <mrow class="MJX-TeXAtom-ORD">
7542                                           <mtext>op</mtext>
7543                                        </mrow>
7544                                     </mrow>
7545                                     <mo stretchy="false">(</mo>
7546                                     <mi>A</mi>
7547                                     <mo stretchy="false">)</mo>
7548                                     <mo>∗</mo>
7549                                     <mrow class="MJX-TeXAtom-ORD">
7550                                        <mrow class="MJX-TeXAtom-ORD">
7551                                           <mtext>x</mtext>
7552                                        </mrow>
7553                                     </mrow>
7554                                     <mo>+</mo>
7555                                     <mi>β</mi>
7556                                     <mo>∗</mo>
7557                                     <mrow class="MJX-TeXAtom-ORD">
7558                                        <mrow class="MJX-TeXAtom-ORD">
7559                                           <mtext>y</mtext>
7560                                        </mrow>
7561                                     </mrow>
7562                                  </math>
7563                               </td>
7564                            </tr>
7565                         </tbody>
7566                      </table>
7567                   </div>
7568                   <p class="p">where
7569                      
7570                      
7571                      <math xmlns="http://www.w3.org/1998/Math/MathML">
7572                         <mi>A</mi>
7573                         <mtext>&nbsp;is&nbsp;</mtext>
7574                         <mo stretchy="false">(</mo>
7575                         <mi>m</mi>
7576                         <mi>b</mi>
7577                         <mo>∗</mo>
7578                         <mi>b</mi>
7579                         <mi>l</mi>
7580                         <mi>o</mi>
7581                         <mi>c</mi>
7582                         <mi>k</mi>
7583                         <mi>D</mi>
7584                         <mi>i</mi>
7585                         <mi>m</mi>
7586                         <mo stretchy="false">)</mo>
7587                         <mo>×</mo>
7588                         <mo stretchy="false">(</mo>
7589                         <mi>n</mi>
7590                         <mi>b</mi>
7591                         <mo>∗</mo>
7592                         <mi>b</mi>
7593                         <mi>l</mi>
7594                         <mi>o</mi>
7595                         <mi>c</mi>
7596                         <mi>k</mi>
7597                         <mi>D</mi>
7598                         <mi>i</mi>
7599                         <mi>m</mi>
7600                         <mo stretchy="false">)</mo>
7601                      </math>
7602                      
7603                      sparse matrix (that is defined in BSR storage format by the three arrays <samp class="ph codeph">bsrVal</samp>, <samp class="ph codeph">bsrRowPtr</samp>, and <samp class="ph codeph">bsrColInd</samp>), <samp class="ph codeph">x</samp> and <samp class="ph codeph">y</samp> are vectors, 
7604                      
7605                      
7606                      <math xmlns="http://www.w3.org/1998/Math/MathML">
7607                         <mi>α</mi>
7608                         <mtext>&nbsp;and&nbsp;</mtext>
7609                         <mi>β</mi>
7610                      </math>
7611                      
7612                      are scalars, and
7613                   </p>
7614                   <math xmlns="http://www.w3.org/1998/Math/MathML">
7615                      <mrow class="MJX-TeXAtom-ORD">
7616                         <mrow class="MJX-TeXAtom-ORD">
7617                            <mtext>op</mtext>
7618                         </mrow>
7619                      </mrow>
7620                      <mo stretchy="false">(</mo>
7621                      <mi>A</mi>
7622                      <mo stretchy="false">)</mo>
7623                      <mo>=</mo>
7624                      <mfenced open="{" close="">
7625                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
7626                            <mtr>
7627                               <mtd>
7628                                  <mi>A</mi>
7629                               </mtd>
7630                               <mtd>
7631                                  <mtext>if trans == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
7632                               </mtd>
7633                            </mtr>
7634                            <mtr>
7635                               <mtd>
7636                                  <msup>
7637                                     <mi>A</mi>
7638                                     <mi>T</mi>
7639                                  </msup>
7640                               </mtd>
7641                               <mtd>
7642                                  <mtext>if trans == CUSPARSE_OPERATION_TRANSPOSE</mtext>
7643                               </mtd>
7644                            </mtr>
7645                            <mtr>
7646                               <mtd>
7647                                  <msup>
7648                                     <mi>A</mi>
7649                                     <mi>H</mi>
7650                                  </msup>
7651                               </mtd>
7652                               <mtd>
7653                                  <mtext>if trans == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</mtext>
7654                               </mtd>
7655                            </mtr>
7656                         </mtable>
7657                      </mfenced>
7658                   </math>
7659                   <p class="p">Several comments on bsrmv:</p>
7660                   <p class="p">1. Only <samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp> is supported, i.e.
7661                   </p>
7662                   <div class="tablenoborder">
7663                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
7664                         <tbody class="tbody">
7665                            <tr class="row">
7666                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
7667                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7668                                     <mrow class="MJX-TeXAtom-ORD">
7669                                        <mrow class="MJX-TeXAtom-ORD">
7670                                           <mtext>y</mtext>
7671                                        </mrow>
7672                                     </mrow>
7673                                     <mo>=</mo>
7674                                     <mi>α</mi>
7675                                     <mo>∗</mo>
7676                                     <mi>A</mi>
7677                                     <mo>∗</mo>
7678                                     <mrow class="MJX-TeXAtom-ORD">
7679                                        <mrow class="MJX-TeXAtom-ORD">
7680                                           <mtext>x</mtext>
7681                                        </mrow>
7682                                     </mrow>
7683                                     <mo>+</mo>
7684                                     <mi>β</mi>
7685                                     <mrow class="MJX-TeXAtom-ORD">
7686                                        <mrow class="MJX-TeXAtom-ORD">
7687                                           <mtext>op</mtext>
7688                                        </mrow>
7689                                     </mrow>
7690                                     <mo stretchy="false">(</mo>
7691                                     <mi>A</mi>
7692                                     <mo stretchy="false">)</mo>
7693                                     <mo>∗</mo>
7694                                     <mrow class="MJX-TeXAtom-ORD">
7695                                        <mrow class="MJX-TeXAtom-ORD">
7696                                           <mtext>y</mtext>
7697                                        </mrow>
7698                                     </mrow>
7699                                  </math>
7700                               </td>
7701                            </tr>
7702                         </tbody>
7703                      </table>
7704                   </div>
7705                   <p class="p">2. Only <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> is supported.
7706                   </p>
7707                   <p class="p">3. The size of vector <samp class="ph codeph">x</samp> should be
7708                      
7709                      
7710                      <math xmlns="http://www.w3.org/1998/Math/MathML">
7711                         <mo stretchy="false">(</mo>
7712                         <mi>n</mi>
7713                         <mi>b</mi>
7714                         <mo>∗</mo>
7715                         <mi>b</mi>
7716                         <mi>l</mi>
7717                         <mi>o</mi>
7718                         <mi>c</mi>
7719                         <mi>k</mi>
7720                         <mi>D</mi>
7721                         <mi>i</mi>
7722                         <mi>m</mi>
7723                         <mo stretchy="false">)</mo>
7724                      </math>
7725                      
7726                      at least and the size of vector <samp class="ph codeph">y</samp> should be
7727                      
7728                      
7729                      <math xmlns="http://www.w3.org/1998/Math/MathML">
7730                         <mo stretchy="false">(</mo>
7731                         <mi>m</mi>
7732                         <mi>b</mi>
7733                         <mo>∗</mo>
7734                         <mi>b</mi>
7735                         <mi>l</mi>
7736                         <mi>o</mi>
7737                         <mi>c</mi>
7738                         <mi>k</mi>
7739                         <mi>D</mi>
7740                         <mi>i</mi>
7741                         <mi>m</mi>
7742                         <mo stretchy="false">)</mo>
7743                      </math>
7744                      
7745                      at least. Otherwise the kernel may return <samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp> because of out-of-array-bound.
7746                   </p>
7747                   <p class="p">Example: suppose the user has a CSR format and wants to try bsrmv, the following code demonstrates csr2csc and csrmv on single
7748                      precision.
7749                   </p><pre xml:space="preserve"><span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// Suppose that A is m x n sparse matrix represented by CSR format, </span>
7750 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// hx is a host vector of size n, and hy is also a host vector of size m. </span>
7751 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// m and n are not multiple of blockDim.</span>
7752 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// step 1: transform CSR to BSR with column-major order </span>
7753 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> base, nnz;
7754 cusparseDirection_t dirA = CUSPARSE_DIRECTION_COLUMN;
7755 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> mb = (m + <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>-1)/<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>;
7756 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> nb = (n + <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>-1)/<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>;
7757 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;bsrRowPtrC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>) *(mb+1));
7758 cusparseXcsr2bsrNnz(handle, dirA, m, n, 
7759         descrA, csrRowPtrA, csrColIndA, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>, 
7760         descrC, bsrRowPtrC);
7761 cudaMemcpy(&amp;nnzb, bsrRowPtrC+mb, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>), cudaMemcpyDeviceToHost);
7762 cudaMemcpy(&amp;base, bsrRowPtrC   , <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>), cudaMemcpyDeviceToHost);
7763 nnzb -= base;
7764 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;bsrColIndC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>)*nnzb);
7765 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;bsrValC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">float</span>)*(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>)*nnzb);
7766 cusparseScsr2bsr(handle, dirA, m, n, 
7767         descrA, csrValA, csrRowPtrA, csrColIndA, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>,
7768         descrC, bsrValC, bsrRowPtrC, bsrColIndC);
7769 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// step 2: allocate vector x and vector y large enough for bsrmv </span>
7770 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;x, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">float</span>)*(nb*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>));
7771 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;y, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">float</span>)*(mb*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>));
7772 cudaMemcpy(x, hx, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">float</span>)*n, cudaMemcpyHostToDevice);
7773 cudaMemcpy(y, hy, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">float</span>)*m, cudaMemcpyHostToDevice);
7774 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// step 3: perform bsrmv</span>
7775 cusparseSbsrmv(handle, dirA, transA, mb, nb, alpha, descrC, bsrValC, bsrRowPtrC, bsrColIndC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>, x, beta, y);</pre><div class="tablenoborder">
7776                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
7777                            <tr class="row">
7778                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
7779                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
7780                            </tr>
7781                            <tr class="row">
7782                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">dir</samp></td>
7783                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">storage format of blocks, either <samp class="ph codeph">CUSPARSE_DIRECTION_ROW</samp> or <samp class="ph codeph">CUSPARSE_DIRECTION_COLUMN</samp> .
7784                               </td>
7785                            </tr>
7786                            <tr class="row">
7787                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">trans</samp></td>
7788                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
7789                                                 
7790                                                 
7791                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7792                                     <mrow class="MJX-TeXAtom-ORD">
7793                                        <mrow class="MJX-TeXAtom-ORD">
7794                                           <mtext>op</mtext>
7795                                        </mrow>
7796                                     </mrow>
7797                                     <mo stretchy="false">(</mo>
7798                                     <mi>A</mi>
7799                                     <mo stretchy="false">)</mo>
7800                                  </math>
7801                                                 
7802                                  . Only <samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp> is supported.
7803                               </td>
7804                            </tr>
7805                            <tr class="row">
7806                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">mb</samp></td>
7807                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of block rows of matrix 
7808                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7809                                     <mi>A</mi>
7810                                  </math>.
7811                               </td>
7812                            </tr>
7813                            <tr class="row">
7814                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nb</samp></td>
7815                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of block columns of matrix 
7816                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7817                                     <mi>A</mi>
7818                                  </math>.
7819                               </td>
7820                            </tr>
7821                            <tr class="row">
7822                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzb</samp></td>
7823                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero blocks of matrix 
7824                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7825                                     <mi>A</mi>
7826                                  </math>.
7827                               </td>
7828                            </tr>
7829                            <tr class="row">
7830                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">alpha</samp></td>
7831                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication.</td>
7832                            </tr>
7833                            <tr class="row">
7834                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descr</samp></td>
7835                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
7836                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7837                                     <mi>A</mi>
7838                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
7839                               </td>
7840                            </tr>
7841                            <tr class="row">
7842                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrVal</samp></td>
7843                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
7844                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
7845                                     <mo stretchy="false">(</mo>
7846                                     <mo>=</mo>
7847                                  </math><samp class="ph codeph">csrRowPtrA(mb)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
7848                                     <mo>-</mo>
7849                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
7850                                     <mo stretchy="false">)</mo>
7851                                  </math>
7852                                         non-zero blocks of matrix 
7853                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7854                                     <mi>A</mi>
7855                                  </math>.
7856                               </td>
7857                            </tr>
7858                            <tr class="row">
7859                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrRowPtr</samp></td>
7860                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">mb</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
7861                                     <mo>+</mo>
7862                                     <mn>1</mn>
7863                                  </math>
7864                                                 
7865                                         elements that contains the start of every block row and the end of the last block row plus one.
7866                               </td>
7867                            </tr>
7868                            <tr class="row">
7869                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrColInd</samp></td>
7870                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
7871                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
7872                                     <mo stretchy="false">(</mo>
7873                                     <mo>=</mo>
7874                                  </math><samp class="ph codeph">csrRowPtrA(mb)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
7875                                     <mo>-</mo>
7876                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
7877                                     <mo stretchy="false">)</mo>
7878                                  </math>
7879                                         column indices of the non-zero blocks of matrix 
7880                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7881                                     <mi>A</mi>
7882                                  </math>.
7883                               </td>
7884                            </tr>
7885                            <tr class="row">
7886                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">blockDim</samp></td>
7887                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">block dimension of sparse matrix 
7888                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7889                                     <mi>A</mi>
7890                                  </math>, larger than zero.
7891                               </td>
7892                            </tr>
7893                            <tr class="row">
7894                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">x</samp></td>
7895                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector of
7896                                                 
7897                                                 
7898                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7899                                     <mi>n</mi>
7900                                     <mi>b</mi>
7901                                     <mo>∗</mo>
7902                                     <mi>b</mi>
7903                                     <mi>l</mi>
7904                                     <mi>o</mi>
7905                                     <mi>c</mi>
7906                                     <mi>k</mi>
7907                                     <mi>D</mi>
7908                                     <mi>i</mi>
7909                                     <mi>m</mi>
7910                                  </math>
7911                                                 
7912                                         elements.
7913                               </td>
7914                            </tr>
7915                            <tr class="row">
7916                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">beta</samp></td>
7917                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication. If <samp class="ph codeph">beta</samp> is zero, <samp class="ph codeph">y</samp> does not have to be a valid input.
7918                               </td>
7919                            </tr>
7920                            <tr class="row">
7921                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
7922                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector of
7923                                                 
7924                                                 
7925                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7926                                     <mi>m</mi>
7927                                     <mi>b</mi>
7928                                     <mo>∗</mo>
7929                                     <mi>b</mi>
7930                                     <mi>l</mi>
7931                                     <mi>o</mi>
7932                                     <mi>c</mi>
7933                                     <mi>k</mi>
7934                                     <mi>D</mi>
7935                                     <mi>i</mi>
7936                                     <mi>m</mi>
7937                                  </math>
7938                                                 
7939                                         elements.
7940                               </td>
7941                            </tr>
7942                         </tbody>
7943                      </table>
7944                   </div>
7945                   <div class="tablenoborder">
7946                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
7947                            <tr class="row">
7948                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
7949                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; updated vector.</td>
7950                            </tr>
7951                         </tbody>
7952                      </table>
7953                   </div>
7954                   <div class="tablenoborder">
7955                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
7956                            <tr class="row">
7957                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
7958                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
7959                            </tr>
7960                            <tr class="row">
7961                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
7962                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
7963                            </tr>
7964                            <tr class="row">
7965                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
7966                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n,nnz&lt;0</samp>, <samp class="ph codeph">trans != CUSPARSE_OPERATION_NON_TRANSPOSE</samp>, 
7967                                  
7968                                  
7969                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
7970                                     <mi>b</mi>
7971                                     <mi>l</mi>
7972                                     <mi>o</mi>
7973                                     <mi>c</mi>
7974                                     <mi>k</mi>
7975                                     <mi>D</mi>
7976                                     <mi>i</mi>
7977                                     <mi>m</mi>
7978                                     <mo>&lt;</mo>
7979                                     <mn>1</mn>
7980                                  </math>
7981                                  
7982                                  , <samp class="ph codeph">dir</samp> is not row-major or column-major, or <samp class="ph codeph">IndexBase of descr</samp> is not base-0 or base-1 ).
7983                               </td>
7984                            </tr>
7985                            <tr class="row">
7986                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
7987                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
7988                            </tr>
7989                            <tr class="row">
7990                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
7991                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
7992                            </tr>
7993                            <tr class="row">
7994                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
7995                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
7996                            </tr>
7997                            <tr class="row">
7998                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
7999                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
8000                                  <p class="p"></p>
8001                                  <p class="p"></p>
8002                                  the matrix type is not supported.
8003                               </td>
8004                            </tr>
8005                         </tbody>
8006                      </table>
8007                   </div>
8008                </div>
8009             </div>
8010             <div class="topic concept nested1" id="cusparse-lt-t-gt-bsrxmv"><a name="cusparse-lt-t-gt-bsrxmv" shape="rect">
8011                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-bsrxmv" name="cusparse-lt-t-gt-bsrxmv" shape="rect">7.2.&nbsp;cusparse&lt;t&gt;bsrxmv</a></h3>
8012                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
8013 cusparseSbsrxmv(cusparseHandle_t handle, cusparseDirection_t dir,
8014    cusparseOperation_t trans, int sizeOfMask,
8015    int mb, int nb, int nnzb,
8016    const float *alpha, const cusparseMatDescr_t descr,
8017    const float *bsrVal, const int *bsrMaskPtr, 
8018    const int *bsrRowPtr, const int *bsrEndPtr, const int *bsrColInd,
8019    int blockDim, const float *x, 
8020    const float *beta, float *y)
8021 cusparseStatus_t 
8022 cusparseDbsrxmv(cusparseHandle_t handle, cusparseDirection_t dir,
8023    cusparseOperation_t trans, int sizeOfMask,
8024    int mb, int nb, int nnzb,
8025    const double *alpha, const cusparseMatDescr_t descr,
8026    const double *bsrVal, const int *bsrMaskPtr,
8027    const int *bsrRowPtr, const int *bsrEndPtr, const int *bsrColInd,
8028    int blockDim, const double *x, 
8029    const double *beta, double *y)
8030 cusparseStatus_t 
8031 cusparseCbsrxmv(cusparseHandle_t handle, cusparseDirection_t dir,
8032    cusparseOperation_t trans, int sizeOfMask,
8033    int mb, int nb, int nnzb,
8034    const cuComplex *alpha, const cusparseMatDescr_t descr,
8035    const cuComplex *bsrVal, const int *bsrMaskPtr,
8036    const int *bsrRowPtr, const int *bsrEndPtr, const int *bsrColInd,
8037    int blockDim, const cuComplex *x, 
8038    const cuComplex *beta, cuComplex *y)
8039 cusparseStatus_t 
8040 cusparseZbsrxmv(cusparseHandle_t handle, cusparseDirection_t dir,
8041    cusparseOperation_t trans, int sizeOfMask,
8042    int mb, int nb, int nnzb,
8043    const cuDoubleComplex *alpha, const cusparseMatDescr_t descr,
8044    const cuDoubleComplex *bsrVal, const int *bsrMaskPtr,
8045    const int *bsrRowPtr, const int *bsrEndPtr, const int *bsrColInd,
8046    int blockDim, const cuDoubleComplex *x, 
8047    const cuDoubleComplex *beta, cuDoubleComplex *y)</pre><p class="p">This function performs a bsrmv and a mask operation</p>
8048                   <div class="tablenoborder">
8049                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
8050                         <tbody class="tbody">
8051                            <tr class="row">
8052                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
8053                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8054                                     <mrow class="MJX-TeXAtom-ORD">
8055                                        <mrow class="MJX-TeXAtom-ORD">
8056                                           <mtext>y(mask)</mtext>
8057                                        </mrow>
8058                                     </mrow>
8059                                     <mo>=</mo>
8060                                     <mrow class="MJX-TeXAtom-ORD">
8061                                        <mo maxsize="1.2em" minsize="1.2em">(</mo>
8062                                     </mrow>
8063                                     <mi>α</mi>
8064                                     <mo>∗</mo>
8065                                     <mrow class="MJX-TeXAtom-ORD">
8066                                        <mrow class="MJX-TeXAtom-ORD">
8067                                           <mtext>op</mtext>
8068                                        </mrow>
8069                                     </mrow>
8070                                     <mo stretchy="false">(</mo>
8071                                     <mi>A</mi>
8072                                     <mo stretchy="false">)</mo>
8073                                     <mo>∗</mo>
8074                                     <mrow class="MJX-TeXAtom-ORD">
8075                                        <mrow class="MJX-TeXAtom-ORD">
8076                                           <mtext>x</mtext>
8077                                        </mrow>
8078                                     </mrow>
8079                                     <mo>+</mo>
8080                                     <mi>β</mi>
8081                                     <mo>∗</mo>
8082                                     <mrow class="MJX-TeXAtom-ORD">
8083                                        <mrow class="MJX-TeXAtom-ORD">
8084                                           <mtext>y</mtext>
8085                                        </mrow>
8086                                     </mrow>
8087                                     <mrow class="MJX-TeXAtom-ORD">
8088                                        <mo maxsize="1.2em" minsize="1.2em">)</mo>
8089                                     </mrow>
8090                                     <mrow class="MJX-TeXAtom-ORD">
8091                                        <mrow class="MJX-TeXAtom-ORD">
8092                                           <mtext>(mask)</mtext>
8093                                        </mrow>
8094                                     </mrow>
8095                                  </math>
8096                               </td>
8097                            </tr>
8098                         </tbody>
8099                      </table>
8100                   </div>
8101                   <p class="p">where
8102                      
8103                      
8104                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8105                         <mi>A</mi>
8106                         <mtext>&nbsp;is&nbsp;</mtext>
8107                         <mo stretchy="false">(</mo>
8108                         <mi>m</mi>
8109                         <mi>b</mi>
8110                         <mo>∗</mo>
8111                         <mi>b</mi>
8112                         <mi>l</mi>
8113                         <mi>o</mi>
8114                         <mi>c</mi>
8115                         <mi>k</mi>
8116                         <mi>D</mi>
8117                         <mi>i</mi>
8118                         <mi>m</mi>
8119                         <mo stretchy="false">)</mo>
8120                         <mo>×</mo>
8121                         <mo stretchy="false">(</mo>
8122                         <mi>n</mi>
8123                         <mi>b</mi>
8124                         <mo>∗</mo>
8125                         <mi>b</mi>
8126                         <mi>l</mi>
8127                         <mi>o</mi>
8128                         <mi>c</mi>
8129                         <mi>k</mi>
8130                         <mi>D</mi>
8131                         <mi>i</mi>
8132                         <mi>m</mi>
8133                         <mo stretchy="false">)</mo>
8134                      </math>
8135                      
8136                      sparse matrix (that is defined in BSRX storage format by the four arrays <samp class="ph codeph">bsrVal</samp>, <samp class="ph codeph">bsrRowPtr</samp>, <samp class="ph codeph">bsrEndPtr</samp>, and <samp class="ph codeph">bsrColInd</samp>), <samp class="ph codeph">x</samp> and <samp class="ph codeph">y</samp> are vectors,
8137                      
8138                      
8139                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8140                         <mi>α</mi>
8141                         <mtext>&nbsp;and&nbsp;</mtext>
8142                         <mi>β</mi>
8143                      </math>
8144                      
8145                      are scalars, and
8146                   </p>
8147                   <math xmlns="http://www.w3.org/1998/Math/MathML">
8148                      <mrow class="MJX-TeXAtom-ORD">
8149                         <mrow class="MJX-TeXAtom-ORD">
8150                            <mtext>op</mtext>
8151                         </mrow>
8152                      </mrow>
8153                      <mo stretchy="false">(</mo>
8154                      <mi>A</mi>
8155                      <mo stretchy="false">)</mo>
8156                      <mo>=</mo>
8157                      <mfenced open="{" close="">
8158                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
8159                            <mtr>
8160                               <mtd>
8161                                  <mi>A</mi>
8162                               </mtd>
8163                               <mtd>
8164                                  <mtext>if trans == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
8165                               </mtd>
8166                            </mtr>
8167                            <mtr>
8168                               <mtd>
8169                                  <msup>
8170                                     <mi>A</mi>
8171                                     <mi>T</mi>
8172                                  </msup>
8173                               </mtd>
8174                               <mtd>
8175                                  <mtext>if trans == CUSPARSE_OPERATION_TRANSPOSE</mtext>
8176                               </mtd>
8177                            </mtr>
8178                            <mtr>
8179                               <mtd>
8180                                  <msup>
8181                                     <mi>A</mi>
8182                                     <mi>H</mi>
8183                                  </msup>
8184                               </mtd>
8185                               <mtd>
8186                                  <mtext>if trans == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</mtext>
8187                               </mtd>
8188                            </mtr>
8189                         </mtable>
8190                      </mfenced>
8191                   </math>
8192                   <p class="p">The mask operation is defined by array <samp class="ph codeph">bsrMaskPtr</samp> which contains updated row indices of 
8193                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8194                         <mi>y</mi>
8195                      </math>. If row 
8196                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8197                         <mi>i</mi>
8198                      </math> is not specified in <samp class="ph codeph">bsrMaskPtr</samp>, then bsrxmv does not touch row block 
8199                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8200                         <mi>i</mi>
8201                      </math> of 
8202                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8203                         <mi>A</mi>
8204                      </math> and
8205                      
8206                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8207                         <mi>y</mi>
8208                         <mo stretchy="false">[</mo>
8209                         <mi>i</mi>
8210                         <mo stretchy="false">]</mo>
8211                      </math>
8212                      .
8213                   </p>
8214                   <p class="p">For example, consider the
8215                      
8216                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8217                         <mn>2</mn>
8218                         <mo>×</mo>
8219                         <mn>3</mn>
8220                      </math>
8221                      block matrix 
8222                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8223                         <mi>A</mi>
8224                      </math>:
8225                   </p>
8226                   <div class="tablenoborder">
8227                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
8228                         <tbody class="tbody">
8229                            <tr class="row">
8230                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
8231                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8232                                     <mtable columnalign="right left right left right left right left right left right left" rowspacing=".5em" columnspacing="0.2777777777777778em 2em 0.2777777777777778em 2em 0.2777777777777778em 2em 0.2777777777777778em 2em 0.2777777777777778em 2em 0.2777777777777778em">
8233                                        <mtr>
8234                                           <mtd>
8235                                              <mi>A</mi>
8236                                              <mo>=</mo>
8237                                              <mfenced open="[" close="]">
8238                                                 <mtable rowspacing="4pt" columnspacing="1em">
8239                                                    <mtr>
8240                                                       <mtd>
8241                                                          <msub>
8242                                                             <mi>A</mi>
8243                                                             <mrow class="MJX-TeXAtom-ORD">
8244                                                                <mn>11</mn>
8245                                                             </mrow>
8246                                                          </msub>
8247                                                       </mtd>
8248                                                       <mtd>
8249                                                          <msub>
8250                                                             <mi>A</mi>
8251                                                             <mrow class="MJX-TeXAtom-ORD">
8252                                                                <mn>12</mn>
8253                                                             </mrow>
8254                                                          </msub>
8255                                                       </mtd>
8256                                                       <mtd>
8257                                                          <mi>O</mi>
8258                                                       </mtd>
8259                                                    </mtr>
8260                                                    <mtr>
8261                                                       <mtd>
8262                                                          <msub>
8263                                                             <mi>A</mi>
8264                                                             <mrow class="MJX-TeXAtom-ORD">
8265                                                                <mn>21</mn>
8266                                                             </mrow>
8267                                                          </msub>
8268                                                       </mtd>
8269                                                       <mtd>
8270                                                          <msub>
8271                                                             <mi>A</mi>
8272                                                             <mrow class="MJX-TeXAtom-ORD">
8273                                                                <mn>22</mn>
8274                                                             </mrow>
8275                                                          </msub>
8276                                                       </mtd>
8277                                                       <mtd>
8278                                                          <msub>
8279                                                             <mi>A</mi>
8280                                                             <mrow class="MJX-TeXAtom-ORD">
8281                                                                <mn>23</mn>
8282                                                             </mrow>
8283                                                          </msub>
8284                                                       </mtd>
8285                                                    </mtr>
8286                                                 </mtable>
8287                                              </mfenced>
8288                                           </mtd>
8289                                        </mtr>
8290                                     </mtable>
8291                                  </math>
8292                               </td>
8293                            </tr>
8294                         </tbody>
8295                      </table>
8296                   </div>
8297                   <p class="p">and its one-based BSR format (three vector form) is</p>
8298                   <div class="tablenoborder">
8299                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
8300                         <tbody class="tbody">
8301                            <tr class="row">
8302                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
8303                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8304                                     <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
8305                                        <mtr>
8306                                           <mtd>
8307                                              <mtext>bsrVal</mtext>
8308                                           </mtd>
8309                                           <mtd>
8310                                              <mo>=</mo>
8311                                           </mtd>
8312                                           <mtd>
8313                                              <mfenced open="[" close="]">
8314                                                 <mtable rowspacing="4pt" columnspacing="1em">
8315                                                    <mtr>
8316                                                       <mtd>
8317                                                          <msub>
8318                                                             <mi>A</mi>
8319                                                             <mrow class="MJX-TeXAtom-ORD">
8320                                                                <mn>11</mn>
8321                                                             </mrow>
8322                                                          </msub>
8323                                                       </mtd>
8324                                                       <mtd>
8325                                                          <msub>
8326                                                             <mi>A</mi>
8327                                                             <mrow class="MJX-TeXAtom-ORD">
8328                                                                <mn>12</mn>
8329                                                             </mrow>
8330                                                          </msub>
8331                                                       </mtd>
8332                                                       <mtd>
8333                                                          <msub>
8334                                                             <mi>A</mi>
8335                                                             <mrow class="MJX-TeXAtom-ORD">
8336                                                                <mn>21</mn>
8337                                                             </mrow>
8338                                                          </msub>
8339                                                       </mtd>
8340                                                       <mtd>
8341                                                          <msub>
8342                                                             <mi>A</mi>
8343                                                             <mrow class="MJX-TeXAtom-ORD">
8344                                                                <mn>22</mn>
8345                                                             </mrow>
8346                                                          </msub>
8347                                                       </mtd>
8348                                                       <mtd>
8349                                                          <msub>
8350                                                             <mi>A</mi>
8351                                                             <mrow class="MJX-TeXAtom-ORD">
8352                                                                <mn>23</mn>
8353                                                             </mrow>
8354                                                          </msub>
8355                                                       </mtd>
8356                                                    </mtr>
8357                                                 </mtable>
8358                                              </mfenced>
8359                                           </mtd>
8360                                        </mtr>
8361                                        <mtr>
8362                                           <mtd>
8363                                              <mtext>bsrRowPtr</mtext>
8364                                           </mtd>
8365                                           <mtd>
8366                                              <mo>=</mo>
8367                                           </mtd>
8368                                           <mtd>
8369                                              <mfenced open="[" close="]">
8370                                                 <mtable rowspacing="4pt" columnspacing="1em">
8371                                                    <mtr>
8372                                                       <mtd>
8373                                                          <mn>1</mn>
8374                                                          <mrow class="MJX-TeXAtom-ORD">
8375                                                             <mphantom>
8376                                                                <mn>.0</mn>
8377                                                             </mphantom>
8378                                                          </mrow>
8379                                                       </mtd>
8380                                                       <mtd>
8381                                                          <mn>3</mn>
8382                                                          <mrow class="MJX-TeXAtom-ORD">
8383                                                             <mphantom>
8384                                                                <mn>.0</mn>
8385                                                             </mphantom>
8386                                                          </mrow>
8387                                                       </mtd>
8388                                                       <mtd>
8389                                                          <mn>6</mn>
8390                                                       </mtd>
8391                                                    </mtr>
8392                                                 </mtable>
8393                                              </mfenced>
8394                                           </mtd>
8395                                        </mtr>
8396                                        <mtr>
8397                                           <mtd>
8398                                              <mtext>bsrColInd</mtext>
8399                                           </mtd>
8400                                           <mtd>
8401                                              <mo>=</mo>
8402                                           </mtd>
8403                                           <mtd>
8404                                              <mfenced open="[" close="]">
8405                                                 <mtable rowspacing="4pt" columnspacing="1em">
8406                                                    <mtr>
8407                                                       <mtd>
8408                                                          <mn>1</mn>
8409                                                          <mrow class="MJX-TeXAtom-ORD">
8410                                                             <mphantom>
8411                                                                <mn>.0</mn>
8412                                                             </mphantom>
8413                                                          </mrow>
8414                                                       </mtd>
8415                                                       <mtd>
8416                                                          <mn>2</mn>
8417                                                          <mrow class="MJX-TeXAtom-ORD">
8418                                                             <mphantom>
8419                                                                <mn>.0</mn>
8420                                                             </mphantom>
8421                                                          </mrow>
8422                                                       </mtd>
8423                                                       <mtd>
8424                                                          <mn>1</mn>
8425                                                          <mrow class="MJX-TeXAtom-ORD">
8426                                                             <mphantom>
8427                                                                <mn>.0</mn>
8428                                                             </mphantom>
8429                                                          </mrow>
8430                                                       </mtd>
8431                                                       <mtd>
8432                                                          <mn>2</mn>
8433                                                          <mrow class="MJX-TeXAtom-ORD">
8434                                                             <mphantom>
8435                                                                <mn>.0</mn>
8436                                                             </mphantom>
8437                                                          </mrow>
8438                                                       </mtd>
8439                                                       <mtd>
8440                                                          <mn>3</mn>
8441                                                       </mtd>
8442                                                    </mtr>
8443                                                 </mtable>
8444                                              </mfenced>
8445                                           </mtd>
8446                                        </mtr>
8447                                     </mtable>
8448                                  </math>
8449                               </td>
8450                            </tr>
8451                         </tbody>
8452                      </table>
8453                   </div>
8454                   <p class="p">Suppose we want to do the following bsrmv operation on a matrix
8455                      
8456                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8457                         <mover>
8458                            <mi>A</mi>
8459                            <mo accent="false">¯</mo>
8460                         </mover>
8461                      </math>
8462                      which is slightly different from 
8463                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8464                         <mi>A</mi>
8465                      </math>. 
8466                   </p>
8467                   <div class="tablenoborder">
8468                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
8469                         <tbody class="tbody">
8470                            <tr class="row">
8471                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
8472                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8473                                     <mfenced open="[" close="]">
8474                                        <mtable rowspacing="4pt" columnspacing="1em">
8475                                           <mtr>
8476                                              <mtd>
8477                                                 <msub>
8478                                                    <mi>y</mi>
8479                                                    <mrow class="MJX-TeXAtom-ORD">
8480                                                       <mn>1</mn>
8481                                                    </mrow>
8482                                                 </msub>
8483                                              </mtd>
8484                                           </mtr>
8485                                           <mtr>
8486                                              <mtd>
8487                                                 <msub>
8488                                                    <mi>y</mi>
8489                                                    <mrow class="MJX-TeXAtom-ORD">
8490                                                       <mn>2</mn>
8491                                                    </mrow>
8492                                                 </msub>
8493                                              </mtd>
8494                                           </mtr>
8495                                        </mtable>
8496                                     </mfenced>
8497                                     <mo>:=</mo>
8498                                     <mi>a</mi>
8499                                     <mi>l</mi>
8500                                     <mi>p</mi>
8501                                     <mi>h</mi>
8502                                     <mi>a</mi>
8503                                     <mo>∗</mo>
8504                                     <mrow class="MJX-TeXAtom-ORD">
8505                                        <mo maxsize="2.470em" minsize="2.470em">(</mo>
8506                                     </mrow>
8507                                     <mrow class="MJX-TeXAtom-ORD">
8508                                        <mover>
8509                                           <mi>A</mi>
8510                                           <mo stretchy="false">˜</mo>
8511                                        </mover>
8512                                     </mrow>
8513                                     <mo>=</mo>
8514                                     <mfenced open="[" close="]">
8515                                        <mtable rowspacing="4pt" columnspacing="1em">
8516                                           <mtr>
8517                                              <mtd>
8518                                                 <mi>O</mi>
8519                                              </mtd>
8520                                              <mtd>
8521                                                 <mi>O</mi>
8522                                              </mtd>
8523                                              <mtd>
8524                                                 <mi>O</mi>
8525                                              </mtd>
8526                                           </mtr>
8527                                           <mtr>
8528                                              <mtd>
8529                                                 <mi>O</mi>
8530                                              </mtd>
8531                                              <mtd>
8532                                                 <msub>
8533                                                    <mi>A</mi>
8534                                                    <mrow class="MJX-TeXAtom-ORD">
8535                                                       <mn>22</mn>
8536                                                    </mrow>
8537                                                 </msub>
8538                                              </mtd>
8539                                              <mtd>
8540                                                 <mi>O</mi>
8541                                              </mtd>
8542                                           </mtr>
8543                                        </mtable>
8544                                     </mfenced>
8545                                     <mrow class="MJX-TeXAtom-ORD">
8546                                        <mo maxsize="2.470em" minsize="2.470em">)</mo>
8547                                     </mrow>
8548                                     <mo>∗</mo>
8549                                     <mfenced open="[" close="]">
8550                                        <mtable rowspacing="4pt" columnspacing="1em">
8551                                           <mtr>
8552                                              <mtd>
8553                                                 <msub>
8554                                                    <mi>x</mi>
8555                                                    <mrow class="MJX-TeXAtom-ORD">
8556                                                       <mn>1</mn>
8557                                                    </mrow>
8558                                                 </msub>
8559                                              </mtd>
8560                                           </mtr>
8561                                           <mtr>
8562                                              <mtd>
8563                                                 <msub>
8564                                                    <mi>x</mi>
8565                                                    <mrow class="MJX-TeXAtom-ORD">
8566                                                       <mn>2</mn>
8567                                                    </mrow>
8568                                                 </msub>
8569                                              </mtd>
8570                                           </mtr>
8571                                           <mtr>
8572                                              <mtd>
8573                                                 <msub>
8574                                                    <mi>x</mi>
8575                                                    <mrow class="MJX-TeXAtom-ORD">
8576                                                       <mn>3</mn>
8577                                                    </mrow>
8578                                                 </msub>
8579                                              </mtd>
8580                                           </mtr>
8581                                        </mtable>
8582                                     </mfenced>
8583                                     <mo>+</mo>
8584                                     <mfenced open="[" close="]">
8585                                        <mtable rowspacing="4pt" columnspacing="1em">
8586                                           <mtr>
8587                                              <mtd>
8588                                                 <msub>
8589                                                    <mi>y</mi>
8590                                                    <mrow class="MJX-TeXAtom-ORD">
8591                                                       <mn>1</mn>
8592                                                    </mrow>
8593                                                 </msub>
8594                                              </mtd>
8595                                           </mtr>
8596                                           <mtr>
8597                                              <mtd>
8598                                                 <mi>b</mi>
8599                                                 <mi>e</mi>
8600                                                 <mi>t</mi>
8601                                                 <mi>a</mi>
8602                                                 <mo>∗</mo>
8603                                                 <msub>
8604                                                    <mi>y</mi>
8605                                                    <mrow class="MJX-TeXAtom-ORD">
8606                                                       <mn>2</mn>
8607                                                    </mrow>
8608                                                 </msub>
8609                                              </mtd>
8610                                           </mtr>
8611                                        </mtable>
8612                                     </mfenced>
8613                                  </math>
8614                               </td>
8615                            </tr>
8616                         </tbody>
8617                      </table>
8618                   </div>
8619                   <p class="p">We don’t need to create another BSR format for the new matrix
8620                      
8621                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8622                         <mover>
8623                            <mi>A</mi>
8624                            <mo accent="false">¯</mo>
8625                         </mover>
8626                      </math>
8627                      , all that we should do is to keep <samp class="ph codeph">bsrVal</samp> and <samp class="ph codeph">bsrColInd</samp> unchanged, but modify <samp class="ph codeph">bsrRowPtr</samp> and add additional array <samp class="ph codeph">bsrEndPtr</samp> which points to last nonzero elements per row of
8628                      
8629                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8630                         <mover>
8631                            <mi>A</mi>
8632                            <mo accent="false">¯</mo>
8633                         </mover>
8634                      </math>
8635                      plus 1.
8636                   </p>
8637                   <p class="p">For example, the following <samp class="ph codeph">bsrRowPtr</samp> and <samp class="ph codeph">bsrEndPtr</samp> can represent matrix 
8638                      
8639                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8640                         <mover>
8641                            <mi>A</mi>
8642                            <mo accent="false">¯</mo>
8643                         </mover>
8644                      </math>
8645                      :
8646                   </p>
8647                   <div class="tablenoborder">
8648                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
8649                         <tbody class="tbody">
8650                            <tr class="row">
8651                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
8652                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8653                                     <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
8654                                        <mtr>
8655                                           <mtd>
8656                                              <mtext>bsrRowPtr</mtext>
8657                                           </mtd>
8658                                           <mtd>
8659                                              <mo>=</mo>
8660                                           </mtd>
8661                                           <mtd>
8662                                              <mfenced open="[" close="]">
8663                                                 <mtable rowspacing="4pt" columnspacing="1em">
8664                                                    <mtr>
8665                                                       <mtd>
8666                                                          <mn>1</mn>
8667                                                          <mrow class="MJX-TeXAtom-ORD">
8668                                                             <mphantom>
8669                                                                <mn>.0</mn>
8670                                                             </mphantom>
8671                                                          </mrow>
8672                                                       </mtd>
8673                                                       <mtd>
8674                                                          <mn>4</mn>
8675                                                       </mtd>
8676                                                    </mtr>
8677                                                 </mtable>
8678                                              </mfenced>
8679                                           </mtd>
8680                                        </mtr>
8681                                        <mtr>
8682                                           <mtd>
8683                                              <mtext>bsrEndPtr</mtext>
8684                                           </mtd>
8685                                           <mtd>
8686                                              <mo>=</mo>
8687                                           </mtd>
8688                                           <mtd>
8689                                              <mfenced open="[" close="]">
8690                                                 <mtable rowspacing="4pt" columnspacing="1em">
8691                                                    <mtr>
8692                                                       <mtd>
8693                                                          <mn>1</mn>
8694                                                          <mrow class="MJX-TeXAtom-ORD">
8695                                                             <mphantom>
8696                                                                <mn>.0</mn>
8697                                                             </mphantom>
8698                                                          </mrow>
8699                                                       </mtd>
8700                                                       <mtd>
8701                                                          <mn>5</mn>
8702                                                       </mtd>
8703                                                    </mtr>
8704                                                 </mtable>
8705                                              </mfenced>
8706                                           </mtd>
8707                                        </mtr>
8708                                     </mtable>
8709                                  </math>
8710                               </td>
8711                            </tr>
8712                         </tbody>
8713                      </table>
8714                   </div>
8715                   <p class="p">Further we can use mask operator (specified by array <samp class="ph codeph">bsrMaskPtr</samp>) to update particular row indices of 
8716                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8717                         <mi>y</mi>
8718                      </math> only because 
8719                      <math xmlns="http://www.w3.org/1998/Math/MathML">
8720                         <msub>
8721                            <mi>y</mi>
8722                            <mn>1</mn>
8723                         </msub>
8724                      </math> is never changed. In this case, <samp class="ph codeph">bsrMaskPtr</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
8725                         <mo>=</mo>
8726                      </math> [2] 
8727                   </p>
8728                   <p class="p">The mask operator is equivalent to the following operation (? stands for don’t care) </p>
8729                   <div class="tablenoborder">
8730                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
8731                         <tbody class="tbody">
8732                            <tr class="row">
8733                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
8734                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8735                                     <mfenced open="[" close="]">
8736                                        <mtable rowspacing="4pt" columnspacing="1em">
8737                                           <mtr>
8738                                              <mtd>
8739                                                 <mo>?</mo>
8740                                              </mtd>
8741                                           </mtr>
8742                                           <mtr>
8743                                              <mtd>
8744                                                 <msub>
8745                                                    <mi>y</mi>
8746                                                    <mrow class="MJX-TeXAtom-ORD">
8747                                                       <mn>2</mn>
8748                                                    </mrow>
8749                                                 </msub>
8750                                              </mtd>
8751                                           </mtr>
8752                                        </mtable>
8753                                     </mfenced>
8754                                     <mo>:=</mo>
8755                                     <mi>a</mi>
8756                                     <mi>l</mi>
8757                                     <mi>p</mi>
8758                                     <mi>h</mi>
8759                                     <mi>a</mi>
8760                                     <mo>∗</mo>
8761                                     <mfenced open="[" close="]">
8762                                        <mtable rowspacing="4pt" columnspacing="1em">
8763                                           <mtr>
8764                                              <mtd>
8765                                                 <mo>?</mo>
8766                                              </mtd>
8767                                              <mtd>
8768                                                 <mo>?</mo>
8769                                              </mtd>
8770                                              <mtd>
8771                                                 <mo>?</mo>
8772                                              </mtd>
8773                                           </mtr>
8774                                           <mtr>
8775                                              <mtd>
8776                                                 <mi>O</mi>
8777                                              </mtd>
8778                                              <mtd>
8779                                                 <msub>
8780                                                    <mi>A</mi>
8781                                                    <mrow class="MJX-TeXAtom-ORD">
8782                                                       <mn>22</mn>
8783                                                    </mrow>
8784                                                 </msub>
8785                                              </mtd>
8786                                              <mtd>
8787                                                 <mi>O</mi>
8788                                              </mtd>
8789                                           </mtr>
8790                                        </mtable>
8791                                     </mfenced>
8792                                     <mo>∗</mo>
8793                                     <mfenced open="[" close="]">
8794                                        <mtable rowspacing="4pt" columnspacing="1em">
8795                                           <mtr>
8796                                              <mtd>
8797                                                 <msub>
8798                                                    <mi>x</mi>
8799                                                    <mrow class="MJX-TeXAtom-ORD">
8800                                                       <mn>1</mn>
8801                                                    </mrow>
8802                                                 </msub>
8803                                              </mtd>
8804                                           </mtr>
8805                                           <mtr>
8806                                              <mtd>
8807                                                 <msub>
8808                                                    <mi>x</mi>
8809                                                    <mrow class="MJX-TeXAtom-ORD">
8810                                                       <mn>2</mn>
8811                                                    </mrow>
8812                                                 </msub>
8813                                              </mtd>
8814                                           </mtr>
8815                                           <mtr>
8816                                              <mtd>
8817                                                 <msub>
8818                                                    <mi>x</mi>
8819                                                    <mrow class="MJX-TeXAtom-ORD">
8820                                                       <mn>3</mn>
8821                                                    </mrow>
8822                                                 </msub>
8823                                              </mtd>
8824                                           </mtr>
8825                                        </mtable>
8826                                     </mfenced>
8827                                     <mo>+</mo>
8828                                     <mi>b</mi>
8829                                     <mi>e</mi>
8830                                     <mi>t</mi>
8831                                     <mi>a</mi>
8832                                     <mo>∗</mo>
8833                                     <mfenced open="[" close="]">
8834                                        <mtable rowspacing="4pt" columnspacing="1em">
8835                                           <mtr>
8836                                              <mtd>
8837                                                 <mo>?</mo>
8838                                              </mtd>
8839                                           </mtr>
8840                                           <mtr>
8841                                              <mtd>
8842                                                 <msub>
8843                                                    <mi>y</mi>
8844                                                    <mrow class="MJX-TeXAtom-ORD">
8845                                                       <mn>2</mn>
8846                                                    </mrow>
8847                                                 </msub>
8848                                              </mtd>
8849                                           </mtr>
8850                                        </mtable>
8851                                     </mfenced>
8852                                  </math>
8853                               </td>
8854                            </tr>
8855                         </tbody>
8856                      </table>
8857                   </div>
8858                   <p class="p">In other words, <samp class="ph codeph">bsrRowPtr[0]</samp> and <samp class="ph codeph">bsrEndPtr[0]</samp> are don’t care.
8859                   </p>
8860                   <div class="tablenoborder">
8861                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
8862                         <tbody class="tbody">
8863                            <tr class="row">
8864                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
8865                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8866                                     <mtable columnalign="right center left" rowspacing=".5em" columnspacing="thickmathspace">
8867                                        <mtr>
8868                                           <mtd>
8869                                              <mtext>bsrRowPtr</mtext>
8870                                           </mtd>
8871                                           <mtd>
8872                                              <mo>=</mo>
8873                                           </mtd>
8874                                           <mtd>
8875                                              <mfenced open="[" close="]">
8876                                                 <mtable rowspacing="4pt" columnspacing="1em">
8877                                                    <mtr>
8878                                                       <mtd>
8879                                                          <mo>?</mo>
8880                                                          <mrow class="MJX-TeXAtom-ORD">
8881                                                             <mphantom>
8882                                                                <mn>.0</mn>
8883                                                             </mphantom>
8884                                                          </mrow>
8885                                                       </mtd>
8886                                                       <mtd>
8887                                                          <mn>4</mn>
8888                                                       </mtd>
8889                                                    </mtr>
8890                                                 </mtable>
8891                                              </mfenced>
8892                                           </mtd>
8893                                        </mtr>
8894                                        <mtr>
8895                                           <mtd>
8896                                              <mtext>bsrEndPtr</mtext>
8897                                           </mtd>
8898                                           <mtd>
8899                                              <mo>=</mo>
8900                                           </mtd>
8901                                           <mtd>
8902                                              <mfenced open="[" close="]">
8903                                                 <mtable rowspacing="4pt" columnspacing="1em">
8904                                                    <mtr>
8905                                                       <mtd>
8906                                                          <mo>?</mo>
8907                                                          <mrow class="MJX-TeXAtom-ORD">
8908                                                             <mphantom>
8909                                                                <mn>.0</mn>
8910                                                             </mphantom>
8911                                                          </mrow>
8912                                                       </mtd>
8913                                                       <mtd>
8914                                                          <mn>5</mn>
8915                                                       </mtd>
8916                                                    </mtr>
8917                                                 </mtable>
8918                                              </mfenced>
8919                                           </mtd>
8920                                        </mtr>
8921                                     </mtable>
8922                                  </math>
8923                               </td>
8924                            </tr>
8925                         </tbody>
8926                      </table>
8927                   </div>
8928                   <p class="p">Several comments on bsrxmv:</p>
8929                   <p class="p">Only <samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp> and <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> are supported.
8930                   </p>
8931                   <p class="p"><samp class="ph codeph">bsrMaskPtr</samp>, <samp class="ph codeph">bsrRowPtr</samp>, <samp class="ph codeph">bsrEndPtr</samp> and <samp class="ph codeph">bsrColInd</samp> are consistent with base index, either one-based or zero-based. Above example is one-based.
8932                   </p>
8933                   <div class="tablenoborder">
8934                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
8935                            <tr class="row">
8936                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
8937                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
8938                            </tr>
8939                            <tr class="row">
8940                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">dir</samp></td>
8941                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">storage format of blocks, either <samp class="ph codeph">CUSPARSE_DIRECTION_ROW</samp> or <samp class="ph codeph">CUSPARSE_DIRECTION_COLUMN</samp> .
8942                               </td>
8943                            </tr>
8944                            <tr class="row">
8945                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">trans</samp></td>
8946                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
8947                                  
8948                                  
8949                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8950                                     <mrow class="MJX-TeXAtom-ORD">
8951                                        <mrow class="MJX-TeXAtom-ORD">
8952                                           <mtext>op</mtext>
8953                                        </mrow>
8954                                     </mrow>
8955                                     <mo stretchy="false">(</mo>
8956                                     <mi>A</mi>
8957                                     <mo stretchy="false">)</mo>
8958                                  </math>
8959                                  
8960                                  . Only <samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp> is supported.
8961                               </td>
8962                            </tr>
8963                            <tr class="row">
8964                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">sizeOfMask</samp></td>
8965                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of updated rows of 
8966                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8967                                     <mi>y</mi>
8968                                  </math>.
8969                               </td>
8970                            </tr>
8971                            <tr class="row">
8972                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">mb</samp></td>
8973                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of block rows of matrix 
8974                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8975                                     <mi>A</mi>
8976                                  </math>.
8977                               </td>
8978                            </tr>
8979                            <tr class="row">
8980                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nb</samp></td>
8981                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of block columns of matrix 
8982                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8983                                     <mi>A</mi>
8984                                  </math>.
8985                               </td>
8986                            </tr>
8987                            <tr class="row">
8988                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzb</samp></td>
8989                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero blocks of matrix 
8990                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
8991                                     <mi>A</mi>
8992                                  </math>.
8993                               </td>
8994                            </tr>
8995                            <tr class="row">
8996                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">alpha</samp></td>
8997                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication.</td>
8998                            </tr>
8999                            <tr class="row">
9000                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descr</samp></td>
9001                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
9002                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9003                                     <mi>A</mi>
9004                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
9005                               </td>
9006                            </tr>
9007                            <tr class="row">
9008                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrVal</samp></td>
9009                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of <samp class="ph codeph">nnz</samp> non-zero blocks of matrix 
9010                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9011                                     <mi>A</mi>
9012                                  </math>.
9013                               </td>
9014                            </tr>
9015                            <tr class="row">
9016                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrRowPtr</samp></td>
9017                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">mb</samp>
9018                                         elements that contains the start of every block row and the end of the last block row plus one.
9019                               </td>
9020                            </tr>
9021                            <tr class="row">
9022                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrEndPtr</samp></td>
9023                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">mb</samp>     elements that contains the end of the every block row plus one.
9024                               </td>
9025                            </tr>
9026                            <tr class="row">
9027                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrColInd</samp></td>
9028                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of       <samp class="ph codeph">nnzb</samp> column indices of the non-zero blocks of matrix 
9029                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9030                                     <mi>A</mi>
9031                                  </math>.
9032                               </td>
9033                            </tr>
9034                            <tr class="row">
9035                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">blockDim</samp></td>
9036                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">block dimension of sparse matrix 
9037                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9038                                     <mi>A</mi>
9039                                  </math>, larger than zero.
9040                               </td>
9041                            </tr>
9042                            <tr class="row">
9043                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">x</samp></td>
9044                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector of
9045                                                 
9046                                                 
9047                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9048                                     <mi>n</mi>
9049                                     <mi>b</mi>
9050                                     <mo>∗</mo>
9051                                     <mi>b</mi>
9052                                     <mi>l</mi>
9053                                     <mi>o</mi>
9054                                     <mi>c</mi>
9055                                     <mi>k</mi>
9056                                     <mi>D</mi>
9057                                     <mi>i</mi>
9058                                     <mi>m</mi>
9059                                  </math>
9060                                                 
9061                                         elements.
9062                               </td>
9063                            </tr>
9064                            <tr class="row">
9065                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">beta</samp></td>
9066                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication. If <samp class="ph codeph">beta</samp> is zero, <samp class="ph codeph">y</samp> does not have to be a valid input.
9067                               </td>
9068                            </tr>
9069                            <tr class="row">
9070                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
9071                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector of
9072                                                 
9073                                                 
9074                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9075                                     <mi>m</mi>
9076                                     <mi>b</mi>
9077                                     <mo>∗</mo>
9078                                     <mi>b</mi>
9079                                     <mi>l</mi>
9080                                     <mi>o</mi>
9081                                     <mi>c</mi>
9082                                     <mi>k</mi>
9083                                     <mi>D</mi>
9084                                     <mi>i</mi>
9085                                     <mi>m</mi>
9086                                  </math>
9087                                                 
9088                                         elements.
9089                               </td>
9090                            </tr>
9091                         </tbody>
9092                      </table>
9093                   </div>
9094                   <div class="tablenoborder">
9095                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
9096                            <tr class="row">
9097                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
9098                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
9099                            </tr>
9100                            <tr class="row">
9101                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
9102                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
9103                            </tr>
9104                            <tr class="row">
9105                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
9106                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n,nnz&lt;0</samp>, <samp class="ph codeph">trans != CUSPARSE_OPERATION_NON_TRANSPOSE</samp>, 
9107                                  
9108                                  
9109                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9110                                     <mi>b</mi>
9111                                     <mi>l</mi>
9112                                     <mi>o</mi>
9113                                     <mi>c</mi>
9114                                     <mi>k</mi>
9115                                     <mi>D</mi>
9116                                     <mi>i</mi>
9117                                     <mi>m</mi>
9118                                     <mo>&lt;</mo>
9119                                     <mn>1</mn>
9120                                  </math>
9121                                  
9122                                  , <samp class="ph codeph">dir</samp> is not row-major or column-major, or <samp class="ph codeph">IndexBase of descr</samp> is not base-0 or base-1 ).
9123                               </td>
9124                            </tr>
9125                            <tr class="row">
9126                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
9127                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
9128                            </tr>
9129                            <tr class="row">
9130                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
9131                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
9132                            </tr>
9133                            <tr class="row">
9134                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
9135                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
9136                            </tr>
9137                            <tr class="row">
9138                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
9139                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
9140                                  <p class="p"></p>
9141                                  <p class="p"></p>
9142                                  the matrix type is not supported.
9143                               </td>
9144                            </tr>
9145                         </tbody>
9146                      </table>
9147                   </div>
9148                </div>
9149             </div>
9150             <div class="topic concept nested1" id="cusparse-lt-t-gt-csrmv"><a name="cusparse-lt-t-gt-csrmv" shape="rect">
9151                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csrmv" name="cusparse-lt-t-gt-csrmv" shape="rect">7.3.&nbsp;cusparse&lt;t&gt;csrmv</a></h3>
9152                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
9153 cusparseScsrmv(cusparseHandle_t handle, cusparseOperation_t transA, 
9154                int m, int n, int nnz, const float           *alpha, 
9155                const cusparseMatDescr_t descrA, 
9156                const float           *csrValA, 
9157                const int *csrRowPtrA, const int *csrColIndA,
9158                const float           *x, const float           *beta, 
9159                float           *y)
9160 cusparseStatus_t 
9161 cusparseDcsrmv(cusparseHandle_t handle, cusparseOperation_t transA, 
9162                int m, int n, int nnz, const double          *alpha, 
9163                const cusparseMatDescr_t descrA, 
9164                const double          *csrValA, 
9165                const int *csrRowPtrA, const int *csrColIndA,
9166                const double          *x, const double          *beta, 
9167                double          *y)
9168 cusparseStatus_t 
9169 cusparseCcsrmv(cusparseHandle_t handle, cusparseOperation_t transA, 
9170                int m, int n, int nnz, const cuComplex       *alpha, 
9171                const cusparseMatDescr_t descrA, 
9172                const cuComplex       *csrValA, 
9173                const int *csrRowPtrA, const int *csrColIndA,
9174                const cuComplex       *x, const cuComplex       *beta, 
9175                cuComplex       *y)
9176 cusparseStatus_t 
9177 cusparseZcsrmv(cusparseHandle_t handle, cusparseOperation_t transA, 
9178                int m, int n, int nnz, const cuDoubleComplex *alpha, 
9179                const cusparseMatDescr_t descrA, 
9180                const cuDoubleComplex *csrValA, 
9181                const int *csrRowPtrA, const int *csrColIndA, 
9182                const cuDoubleComplex *x, const cuDoubleComplex *beta, 
9183                cuDoubleComplex *y)</pre><p class="p">This function performs the matrix-vector operation</p>
9184                   <div class="tablenoborder">
9185                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
9186                         <tbody class="tbody">
9187                            <tr class="row">
9188                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
9189                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9190                                     <mrow class="MJX-TeXAtom-ORD">
9191                                        <mrow class="MJX-TeXAtom-ORD">
9192                                           <mtext>y</mtext>
9193                                        </mrow>
9194                                     </mrow>
9195                                     <mo>=</mo>
9196                                     <mi>α</mi>
9197                                     <mo>∗</mo>
9198                                     <mrow class="MJX-TeXAtom-ORD">
9199                                        <mrow class="MJX-TeXAtom-ORD">
9200                                           <mtext>op</mtext>
9201                                        </mrow>
9202                                     </mrow>
9203                                     <mo stretchy="false">(</mo>
9204                                     <mi>A</mi>
9205                                     <mo stretchy="false">)</mo>
9206                                     <mo>∗</mo>
9207                                     <mrow class="MJX-TeXAtom-ORD">
9208                                        <mrow class="MJX-TeXAtom-ORD">
9209                                           <mtext>x</mtext>
9210                                        </mrow>
9211                                     </mrow>
9212                                     <mo>+</mo>
9213                                     <mi>β</mi>
9214                                     <mo>∗</mo>
9215                                     <mrow class="MJX-TeXAtom-ORD">
9216                                        <mrow class="MJX-TeXAtom-ORD">
9217                                           <mtext>y</mtext>
9218                                        </mrow>
9219                                     </mrow>
9220                                  </math>
9221                               </td>
9222                            </tr>
9223                         </tbody>
9224                      </table>
9225                   </div>
9226                   <p class="p">where 
9227                      <math xmlns="http://www.w3.org/1998/Math/MathML">
9228                         <mi>A</mi>
9229                      </math> is 
9230                      <samp class="ph codeph">m×n</samp> sparse matrix (that is defined in CSR storage format by the three arrays <samp class="ph codeph">csrValA</samp>, <samp class="ph codeph">csrRowPtrA</samp>, and <samp class="ph codeph">csrColIndA</samp>), <samp class="ph codeph">x</samp> and <samp class="ph codeph">y</samp> are vectors,
9231                      
9232                      
9233                      <math xmlns="http://www.w3.org/1998/Math/MathML">
9234                         <mi>α</mi>
9235                         <mtext>&nbsp;and&nbsp;</mtext>
9236                         <mi>β</mi>
9237                      </math>
9238                      
9239                      are scalars, and
9240                   </p>
9241                   <math xmlns="http://www.w3.org/1998/Math/MathML">
9242                      <mrow class="MJX-TeXAtom-ORD">
9243                         <mrow class="MJX-TeXAtom-ORD">
9244                            <mtext>op</mtext>
9245                         </mrow>
9246                      </mrow>
9247                      <mo stretchy="false">(</mo>
9248                      <mi>A</mi>
9249                      <mo stretchy="false">)</mo>
9250                      <mo>=</mo>
9251                      <mfenced open="{" close="">
9252                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
9253                            <mtr>
9254                               <mtd>
9255                                  <mi>A</mi>
9256                               </mtd>
9257                               <mtd>
9258                                  <mtext>if trans == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
9259                               </mtd>
9260                            </mtr>
9261                            <mtr>
9262                               <mtd>
9263                                  <msup>
9264                                     <mi>A</mi>
9265                                     <mi>T</mi>
9266                                  </msup>
9267                               </mtd>
9268                               <mtd>
9269                                  <mtext>if trans == CUSPARSE_OPERATION_TRANSPOSE</mtext>
9270                               </mtd>
9271                            </mtr>
9272                            <mtr>
9273                               <mtd>
9274                                  <msup>
9275                                     <mi>A</mi>
9276                                     <mi>H</mi>
9277                                  </msup>
9278                               </mtd>
9279                               <mtd>
9280                                  <mtext>if trans == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</mtext>
9281                               </mtd>
9282                            </mtr>
9283                         </mtable>
9284                      </mfenced>
9285                   </math>
9286                   <p class="p">When using the (conjugate) transpose of a general matrix or a Hermitian/symmetric matrix, this routine may produce slightly
9287                      different results during different runs of this function with the same input parameters. For these matrix types it uses atomic
9288                      operations to compute the final result, consequently many threads may be adding floating point numbers to the same memory
9289                      location without any specific ordering, which may produce slightly different results for each run.
9290                   </p>
9291                   <p class="p">If exactly the same output is required for any input when multiplying by the transpose of a general matrix, the following
9292                      procedure can be used:
9293                   </p>
9294                   <p class="p">1. Convert the matrix from CSR to CSC format using one of the <samp class="ph codeph">csr2csc()</samp> functions. Notice that by interchanging the rows and columns of the result you are implicitly transposing the matrix.
9295                   </p>
9296                   <p class="p">2. Call the <samp class="ph codeph">csrmv()</samp> function with the <samp class="ph codeph">cusparseOperation_t</samp> parameter set to <samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp> and with the interchanged rows and columns of the matrix stored in CSC format. This (implicitly) multiplies the vector by
9297                      the transpose of the matrix in the original CSR format.
9298                   </p>
9299                   <p class="p">This function requires no extra storage for the general matrices when operation <samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp> is selected. It requires some extra storage for Hermitian/symmetric matrices and for the general matrices when operation
9300                      different than <samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp> is selected. It is executed asynchronously with respect to the host and it may return control to the application on the host
9301                      before the result is ready.
9302                   </p>
9303                   <div class="tablenoborder">
9304                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
9305                            <tr class="row">
9306                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
9307                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
9308                            </tr>
9309                            <tr class="row">
9310                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">trans</samp></td>
9311                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
9312                                                 
9313                                                 
9314                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9315                                     <mrow class="MJX-TeXAtom-ORD">
9316                                        <mrow class="MJX-TeXAtom-ORD">
9317                                           <mtext>op</mtext>
9318                                        </mrow>
9319                                     </mrow>
9320                                     <mo stretchy="false">(</mo>
9321                                     <mi>A</mi>
9322                                     <mo stretchy="false">)</mo>
9323                                  </math>
9324                               </td>
9325                            </tr>
9326                            <tr class="row">
9327                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
9328                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
9329                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9330                                     <mi>A</mi>
9331                                  </math>.
9332                               </td>
9333                            </tr>
9334                            <tr class="row">
9335                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
9336                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
9337                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9338                                     <mi>A</mi>
9339                                  </math>.
9340                               </td>
9341                            </tr>
9342                            <tr class="row">
9343                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
9344                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero elements of matrix 
9345                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9346                                     <mi>A</mi>
9347                                  </math>.
9348                               </td>
9349                            </tr>
9350                            <tr class="row">
9351                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">alpha</samp></td>
9352                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication.</td>
9353                            </tr>
9354                            <tr class="row">
9355                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
9356                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
9357                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9358                                     <mi>A</mi>
9359                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>, <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_SYMMETRIC</samp>, and <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_HERMITIAN</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
9360                               </td>
9361                            </tr>
9362                            <tr class="row">
9363                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
9364                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
9365                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9366                                     <mo stretchy="false">(</mo>
9367                                     <mo>=</mo>
9368                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9369                                     <mo>-</mo>
9370                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9371                                     <mo stretchy="false">)</mo>
9372                                  </math>
9373                                         non-zero elements of matrix 
9374                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9375                                     <mi>A</mi>
9376                                  </math>.
9377                               </td>
9378                            </tr>
9379                            <tr class="row">
9380                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
9381                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every row and the end of the last row plus one.
9382                               </td>
9383                            </tr>
9384                            <tr class="row">
9385                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
9386                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
9387                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9388                                     <mo stretchy="false">(</mo>
9389                                     <mo>=</mo>
9390                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9391                                     <mo>-</mo>
9392                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9393                                     <mo stretchy="false">)</mo>
9394                                  </math>
9395                                         column indices of the non-zero elements of matrix 
9396                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9397                                     <mi>A</mi>
9398                                  </math>.
9399                               </td>
9400                            </tr>
9401                            <tr class="row">
9402                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">x</samp></td>
9403                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector of <samp class="ph codeph">n</samp> elements if
9404                                                 
9405                                                 
9406                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9407                                     <mrow class="MJX-TeXAtom-ORD">
9408                                        <mrow class="MJX-TeXAtom-ORD">
9409                                           <mtext>op</mtext>
9410                                        </mrow>
9411                                     </mrow>
9412                                     <mo stretchy="false">(</mo>
9413                                     <mi>A</mi>
9414                                     <mo stretchy="false">)</mo>
9415                                     <mo>=</mo>
9416                                     <mi>A</mi>
9417                                  </math>
9418                                                 
9419                                         , and <samp class="ph codeph">m</samp> elements if
9420                                                 
9421                                                 
9422                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9423                                     <mrow class="MJX-TeXAtom-ORD">
9424                                        <mrow class="MJX-TeXAtom-ORD">
9425                                           <mtext>op</mtext>
9426                                        </mrow>
9427                                     </mrow>
9428                                     <mo stretchy="false">(</mo>
9429                                     <mi>A</mi>
9430                                     <mo stretchy="false">)</mo>
9431                                     <mo>=</mo>
9432                                     <msup>
9433                                        <mi>A</mi>
9434                                        <mi>T</mi>
9435                                     </msup>
9436                                  </math>
9437                                                 
9438                                         or
9439                                                 
9440                                                 
9441                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9442                                     <mrow class="MJX-TeXAtom-ORD">
9443                                        <mrow class="MJX-TeXAtom-ORD">
9444                                           <mtext>op</mtext>
9445                                        </mrow>
9446                                     </mrow>
9447                                     <mo stretchy="false">(</mo>
9448                                     <mi>A</mi>
9449                                     <mo stretchy="false">)</mo>
9450                                     <mo>=</mo>
9451                                     <msup>
9452                                        <mi>A</mi>
9453                                        <mi>H</mi>
9454                                     </msup>
9455                                  </math>
9456                               </td>
9457                            </tr>
9458                            <tr class="row">
9459                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">beta</samp></td>
9460                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication. If <samp class="ph codeph">beta</samp> is zero, <samp class="ph codeph">y</samp> does not have to be a valid input.
9461                               </td>
9462                            </tr>
9463                            <tr class="row">
9464                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
9465                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector of <samp class="ph codeph">m</samp> elements if
9466                                                 
9467                                                 
9468                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9469                                     <mrow class="MJX-TeXAtom-ORD">
9470                                        <mrow class="MJX-TeXAtom-ORD">
9471                                           <mtext>op</mtext>
9472                                        </mrow>
9473                                     </mrow>
9474                                     <mo stretchy="false">(</mo>
9475                                     <mi>A</mi>
9476                                     <mo stretchy="false">)</mo>
9477                                     <mo>=</mo>
9478                                     <mi>A</mi>
9479                                  </math>
9480                                                 
9481                                         , and <samp class="ph codeph">n</samp> elements if
9482                                                 
9483                                                 
9484                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9485                                     <mrow class="MJX-TeXAtom-ORD">
9486                                        <mrow class="MJX-TeXAtom-ORD">
9487                                           <mtext>op</mtext>
9488                                        </mrow>
9489                                     </mrow>
9490                                     <mo stretchy="false">(</mo>
9491                                     <mi>A</mi>
9492                                     <mo stretchy="false">)</mo>
9493                                     <mo>=</mo>
9494                                     <msup>
9495                                        <mi>A</mi>
9496                                        <mi>T</mi>
9497                                     </msup>
9498                                  </math>
9499                                                 
9500                                         or
9501                                                 
9502                                                 
9503                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9504                                     <mrow class="MJX-TeXAtom-ORD">
9505                                        <mrow class="MJX-TeXAtom-ORD">
9506                                           <mtext>op</mtext>
9507                                        </mrow>
9508                                     </mrow>
9509                                     <mo stretchy="false">(</mo>
9510                                     <mi>A</mi>
9511                                     <mo stretchy="false">)</mo>
9512                                     <mo>=</mo>
9513                                     <msup>
9514                                        <mi>A</mi>
9515                                        <mi>H</mi>
9516                                     </msup>
9517                                  </math>
9518                               </td>
9519                            </tr>
9520                         </tbody>
9521                      </table>
9522                   </div>
9523                   <div class="tablenoborder">
9524                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
9525                            <tr class="row">
9526                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
9527                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; updated vector.</td>
9528                            </tr>
9529                         </tbody>
9530                      </table>
9531                   </div>
9532                   <div class="tablenoborder">
9533                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
9534                            <tr class="row">
9535                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
9536                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
9537                            </tr>
9538                            <tr class="row">
9539                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
9540                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
9541                            </tr>
9542                            <tr class="row">
9543                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
9544                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
9545                            </tr>
9546                            <tr class="row">
9547                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
9548                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n,nnz&lt;0</samp>).
9549                               </td>
9550                            </tr>
9551                            <tr class="row">
9552                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
9553                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision. (compute capability (c.c.) &gt;= 1.3), symmetric/Hermitian matrix (c.c. &gt;= 1.2)
9554                                  or transpose operation (c.c. &gt;= 1.1).
9555                               </td>
9556                            </tr>
9557                            <tr class="row">
9558                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
9559                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
9560                            </tr>
9561                            <tr class="row">
9562                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
9563                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
9564                                  <p class="p"></p>
9565                                  <p class="p"></p>
9566                                  the matrix type is not supported.
9567                               </td>
9568                            </tr>
9569                         </tbody>
9570                      </table>
9571                   </div>
9572                </div>
9573             </div>
9574             <div class="topic concept nested1" id="cusparse-lt-t-gt-csrsvanalysis"><a name="cusparse-lt-t-gt-csrsvanalysis" shape="rect">
9575                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csrsvanalysis" name="cusparse-lt-t-gt-csrsvanalysis" shape="rect">7.4.&nbsp;cusparse&lt;t&gt;csrsv_analysis</a></h3>
9576                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
9577 cusparseScsrsv_analysis(cusparseHandle_t handle, 
9578                         cusparseOperation_t transA, 
9579                         int m, int nnz, const cusparseMatDescr_t descrA,
9580                         const float           *csrValA, 
9581                         const int *csrRowPtrA, const int *csrColIndA, 
9582                         cusparseSolveAnalysisInfo_t info)    
9583 cusparseStatus_t 
9584 cusparseDcsrsv_analysis(cusparseHandle_t handle, 
9585                         cusparseOperation_t transA, 
9586                         int m, int nnz, const cusparseMatDescr_t descrA,
9587                         const double          *csrValA, 
9588                         const int *csrRowPtrA, const int *csrColIndA, 
9589                         cusparseSolveAnalysisInfo_t info)    
9590 cusparseStatus_t 
9591 cusparseCcsrsv_analysis(cusparseHandle_t handle, 
9592                         cusparseOperation_t transA, 
9593                         int m, int nnz, const cusparseMatDescr_t descrA,
9594                         const cuComplex       *csrValA, 
9595                         const int *csrRowPtrA, const int *csrColIndA, 
9596                         cusparseSolveAnalysisInfo_t info)    
9597 cusparseStatus_t 
9598 cusparseZcsrsv_analysis(cusparseHandle_t handle, 
9599                         cusparseOperation_t transA, 
9600                         int m, int nnz, const cusparseMatDescr_t descrA,
9601                         const cuDoubleComplex *csrValA, 
9602                         const int *csrRowPtrA, const int *csrColIndA, 
9603                         cusparseSolveAnalysisInfo_t info)</pre><p class="p">This function performs the analysis phase of the solution of a sparse triangular linear system</p>
9604                   <div class="tablenoborder">
9605                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
9606                         <tbody class="tbody">
9607                            <tr class="row">
9608                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
9609                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9610                                     <mrow class="MJX-TeXAtom-ORD">
9611                                        <mrow class="MJX-TeXAtom-ORD">
9612                                           <mtext>op</mtext>
9613                                        </mrow>
9614                                     </mrow>
9615                                     <mo stretchy="false">(</mo>
9616                                     <mi>A</mi>
9617                                     <mo stretchy="false">)</mo>
9618                                     <mo>∗</mo>
9619                                     <mrow class="MJX-TeXAtom-ORD">
9620                                        <mrow class="MJX-TeXAtom-ORD">
9621                                           <mtext>y</mtext>
9622                                        </mrow>
9623                                     </mrow>
9624                                     <mo>=</mo>
9625                                     <mi>α</mi>
9626                                     <mo>∗</mo>
9627                                     <mrow class="MJX-TeXAtom-ORD">
9628                                        <mrow class="MJX-TeXAtom-ORD">
9629                                           <mtext>x</mtext>
9630                                        </mrow>
9631                                     </mrow>
9632                                  </math>
9633                               </td>
9634                            </tr>
9635                         </tbody>
9636                      </table>
9637                   </div>
9638                   <p class="p">where 
9639                      <math xmlns="http://www.w3.org/1998/Math/MathML">
9640                         <mi>A</mi>
9641                      </math> is <samp class="ph codeph">m×m</samp> sparse matrix (that is defined in CSR storage format by the three arrays <samp class="ph codeph">csrValA</samp>, <samp class="ph codeph">csrRowPtrA</samp>, and <samp class="ph codeph">csrColIndA</samp>), <samp class="ph codeph">x</samp> and <samp class="ph codeph">y</samp> are the right-hand-side and the solution vectors, 
9642                      <math xmlns="http://www.w3.org/1998/Math/MathML">
9643                         <mi>α</mi>
9644                      </math> is a scalar, and
9645                   </p>
9646                   <math xmlns="http://www.w3.org/1998/Math/MathML">
9647                      <mrow class="MJX-TeXAtom-ORD">
9648                         <mrow class="MJX-TeXAtom-ORD">
9649                            <mtext>op</mtext>
9650                         </mrow>
9651                      </mrow>
9652                      <mo stretchy="false">(</mo>
9653                      <mi>A</mi>
9654                      <mo stretchy="false">)</mo>
9655                      <mo>=</mo>
9656                      <mfenced open="{" close="">
9657                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
9658                            <mtr>
9659                               <mtd>
9660                                  <mi>A</mi>
9661                               </mtd>
9662                               <mtd>
9663                                  <mtext>if trans == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
9664                               </mtd>
9665                            </mtr>
9666                            <mtr>
9667                               <mtd>
9668                                  <msup>
9669                                     <mi>A</mi>
9670                                     <mi>T</mi>
9671                                  </msup>
9672                               </mtd>
9673                               <mtd>
9674                                  <mtext>if trans == CUSPARSE_OPERATION_TRANSPOSE</mtext>
9675                               </mtd>
9676                            </mtr>
9677                            <mtr>
9678                               <mtd>
9679                                  <msup>
9680                                     <mi>A</mi>
9681                                     <mi>H</mi>
9682                                  </msup>
9683                               </mtd>
9684                               <mtd>
9685                                  <mtext>if trans == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</mtext>
9686                               </mtd>
9687                            </mtr>
9688                         </mtable>
9689                      </mfenced>
9690                   </math>
9691                   <p class="p">It is expected that this function will be executed only once for a given matrix and a particular operation type.</p>
9692                   <p class="p">This function requires significant amount of extra storage that is proportional to the matrix size. It is executed asynchronously
9693                      with respect to the host and it may return control to the application on the host before the result is ready.
9694                   </p>
9695                   <div class="tablenoborder">
9696                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
9697                            <tr class="row">
9698                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
9699                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
9700                            </tr>
9701                            <tr class="row">
9702                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">trans</samp></td>
9703                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
9704                                                 
9705                                                 
9706                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9707                                     <mrow class="MJX-TeXAtom-ORD">
9708                                        <mrow class="MJX-TeXAtom-ORD">
9709                                           <mtext>op</mtext>
9710                                        </mrow>
9711                                     </mrow>
9712                                     <mo stretchy="false">(</mo>
9713                                     <mi>A</mi>
9714                                     <mo stretchy="false">)</mo>
9715                                  </math>
9716                               </td>
9717                            </tr>
9718                            <tr class="row">
9719                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
9720                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
9721                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9722                                     <mi>A</mi>
9723                                  </math>.
9724                               </td>
9725                            </tr>
9726                            <tr class="row">
9727                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
9728                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero elements of matrix 
9729                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9730                                     <mi>A</mi>
9731                                  </math>.
9732                               </td>
9733                            </tr>
9734                            <tr class="row">
9735                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
9736                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
9737                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9738                                     <mi>A</mi>
9739                                  </math>. The supported matrix types are <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_TRIANGULAR</samp> and <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>, while the supported diagonal types are <samp class="ph codeph">CUSPARSE_DIAG_TYPE_UNIT</samp> and <samp class="ph codeph">CUSPARSE_DIAG_TYPE_NON_UNIT</samp>.
9740                               </td>
9741                            </tr>
9742                            <tr class="row">
9743                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
9744                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
9745                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9746                                     <mo stretchy="false">(</mo>
9747                                     <mo>=</mo>
9748                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9749                                     <mo>-</mo>
9750                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9751                                     <mo stretchy="false">)</mo>
9752                                  </math>
9753                                         non-zero elements of matrix 
9754                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9755                                     <mi>A</mi>
9756                                  </math>.
9757                               </td>
9758                            </tr>
9759                            <tr class="row">
9760                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
9761                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9762                                     <mo>+</mo>
9763                                     <mn>1</mn>
9764                                  </math>
9765                                                 
9766                                         elements that contains the start of every row and the end of the last row plus one.
9767                               </td>
9768                            </tr>
9769                            <tr class="row">
9770                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
9771                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
9772                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9773                                     <mo stretchy="false">(</mo>
9774                                     <mo>=</mo>
9775                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9776                                     <mo>-</mo>
9777                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
9778                                     <mo stretchy="false">)</mo>
9779                                  </math>
9780                                         column indices of the non-zero elements of matrix 
9781                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9782                                     <mi>A</mi>
9783                                  </math>.
9784                               </td>
9785                            </tr>
9786                            <tr class="row">
9787                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
9788                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">structure initialized using <samp class="ph codeph">cusparseCreateSolveAnalysisInfo</samp>.
9789                               </td>
9790                            </tr>
9791                         </tbody>
9792                      </table>
9793                   </div>
9794                   <div class="tablenoborder">
9795                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
9796                            <tr class="row">
9797                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
9798                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">structure filled with information collected during the analysis phase (that should be passed to the solve phase unchanged).</td>
9799                            </tr>
9800                         </tbody>
9801                      </table>
9802                   </div>
9803                   <div class="tablenoborder">
9804                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
9805                            <tr class="row">
9806                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
9807                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
9808                            </tr>
9809                            <tr class="row">
9810                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
9811                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
9812                            </tr>
9813                            <tr class="row">
9814                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
9815                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
9816                            </tr>
9817                            <tr class="row">
9818                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
9819                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,nnz&lt;0</samp>).
9820                               </td>
9821                            </tr>
9822                            <tr class="row">
9823                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
9824                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
9825                            </tr>
9826                            <tr class="row">
9827                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
9828                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
9829                            </tr>
9830                            <tr class="row">
9831                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
9832                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
9833                            </tr>
9834                            <tr class="row">
9835                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
9836                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
9837                                  <p class="p"></p>
9838                                  <p class="p"></p>
9839                                  the matrix type is not supported.
9840                               </td>
9841                            </tr>
9842                         </tbody>
9843                      </table>
9844                   </div>
9845                </div>
9846             </div>
9847             <div class="topic concept nested1" id="cusparse-lt-t-gt-csrsvsolve"><a name="cusparse-lt-t-gt-csrsvsolve" shape="rect">
9848                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csrsvsolve" name="cusparse-lt-t-gt-csrsvsolve" shape="rect">7.5.&nbsp;cusparse&lt;t&gt;csrsv_solve</a></h3>
9849                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
9850 cusparseScsrsv_solve(cusparseHandle_t handle, 
9851                      cusparseOperation_t transA, 
9852                      int m, const float           *alpha, 
9853                      const cusparseMatDescr_t descrA,
9854                      const float           *csrValA, 
9855                      const int *csrRowPtrA, const int *csrColIndA, 
9856                      cusparseSolveAnalysisInfo_t info,
9857                      const float           *x, float           *y)
9858 cusparseStatus_t 
9859 cusparseDcsrsv_solve(cusparseHandle_t handle, 
9860                      cusparseOperation_t transA, 
9861                      int m, const double          *alpha, 
9862                      const cusparseMatDescr_t descrA,
9863                      const double          *csrValA, 
9864                      const int *csrRowPtrA, const int *csrColIndA, 
9865                      cusparseSolveAnalysisInfo_t info,
9866                      const double          *x, double          *y)
9867 cusparseStatus_t 
9868 cusparseCcsrsv_solve(cusparseHandle_t handle, 
9869                      cusparseOperation_t transA, 
9870                      int m, const cuComplex       *alpha, 
9871                      const cusparseMatDescr_t descrA,
9872                      const cuComplex       *csrValA, 
9873                      const int *csrRowPtrA, const int *csrColIndA, 
9874                      cusparseSolveAnalysisInfo_t info,
9875                      const cuComplex       *x, cuComplex       *y)
9876 cusparseStatus_t 
9877 cusparseZcsrsv_solve(cusparseHandle_t handle, 
9878                      cusparseOperation_t transA, 
9879                      int m, const cuDoubleComplex *alpha, 
9880                      const cusparseMatDescr_t descrA,
9881                      const cuDoubleComplex *csrValA, 
9882                      const int *csrRowPtrA, const int *csrColIndA, 
9883                      cusparseSolveAnalysisInfo_t info,
9884                      const cuDoubleComplex *x, cuDoubleComplex *y)</pre><p class="p">This function performs the solve phase of the solution of a sparse triangular linear system</p>
9885                   <div class="tablenoborder">
9886                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
9887                         <tbody class="tbody">
9888                            <tr class="row">
9889                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
9890                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9891                                     <mrow class="MJX-TeXAtom-ORD">
9892                                        <mrow class="MJX-TeXAtom-ORD">
9893                                           <mtext>op</mtext>
9894                                        </mrow>
9895                                     </mrow>
9896                                     <mo stretchy="false">(</mo>
9897                                     <mi>A</mi>
9898                                     <mo stretchy="false">)</mo>
9899                                     <mo>∗</mo>
9900                                     <mrow class="MJX-TeXAtom-ORD">
9901                                        <mrow class="MJX-TeXAtom-ORD">
9902                                           <mtext>y</mtext>
9903                                        </mrow>
9904                                     </mrow>
9905                                     <mo>=</mo>
9906                                     <mi>α</mi>
9907                                     <mo>∗</mo>
9908                                     <mrow class="MJX-TeXAtom-ORD">
9909                                        <mrow class="MJX-TeXAtom-ORD">
9910                                           <mtext>x</mtext>
9911                                        </mrow>
9912                                     </mrow>
9913                                  </math>
9914                               </td>
9915                            </tr>
9916                         </tbody>
9917                      </table>
9918                   </div>
9919                   <p class="p">where 
9920                      <math xmlns="http://www.w3.org/1998/Math/MathML">
9921                         <mi>A</mi>
9922                      </math> is <samp class="ph codeph">m×m</samp> sparse matrix (that is defined in CSR storage format by the three arrays <samp class="ph codeph">csrValA</samp>, <samp class="ph codeph">csrRowPtrA</samp>, and <samp class="ph codeph">csrColIndA</samp>), <samp class="ph codeph">x</samp> and <samp class="ph codeph">y</samp> are the right-hand-side and the solution vectors, 
9923                      <math xmlns="http://www.w3.org/1998/Math/MathML">
9924                         <mi>α</mi>
9925                      </math> is a scalar, and
9926                   </p>
9927                   <math xmlns="http://www.w3.org/1998/Math/MathML">
9928                      <mrow class="MJX-TeXAtom-ORD">
9929                         <mrow class="MJX-TeXAtom-ORD">
9930                            <mtext>op</mtext>
9931                         </mrow>
9932                      </mrow>
9933                      <mo stretchy="false">(</mo>
9934                      <mi>A</mi>
9935                      <mo stretchy="false">)</mo>
9936                      <mo>=</mo>
9937                      <mfenced open="{" close="">
9938                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
9939                            <mtr>
9940                               <mtd>
9941                                  <mi>A</mi>
9942                               </mtd>
9943                               <mtd>
9944                                  <mtext>if trans == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
9945                               </mtd>
9946                            </mtr>
9947                            <mtr>
9948                               <mtd>
9949                                  <msup>
9950                                     <mi>A</mi>
9951                                     <mi>T</mi>
9952                                  </msup>
9953                               </mtd>
9954                               <mtd>
9955                                  <mtext>if trans == CUSPARSE_OPERATION_TRANSPOSE</mtext>
9956                               </mtd>
9957                            </mtr>
9958                            <mtr>
9959                               <mtd>
9960                                  <msup>
9961                                     <mi>A</mi>
9962                                     <mi>H</mi>
9963                                  </msup>
9964                               </mtd>
9965                               <mtd>
9966                                  <mtext>if trans == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</mtext>
9967                               </mtd>
9968                            </mtr>
9969                         </mtable>
9970                      </mfenced>
9971                   </math>
9972                   <p class="p">This function may be executed multiple times for a given matrix and a particular operation type.</p>
9973                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
9974                      to the application on the host before the result is ready.
9975                   </p>
9976                   <div class="tablenoborder">
9977                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
9978                            <tr class="row">
9979                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
9980                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
9981                            </tr>
9982                            <tr class="row">
9983                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">trans</samp></td>
9984                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
9985                                                 
9986                                                 
9987                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
9988                                     <mrow class="MJX-TeXAtom-ORD">
9989                                        <mrow class="MJX-TeXAtom-ORD">
9990                                           <mtext>op</mtext>
9991                                        </mrow>
9992                                     </mrow>
9993                                     <mo stretchy="false">(</mo>
9994                                     <mi>A</mi>
9995                                     <mo stretchy="false">)</mo>
9996                                  </math>
9997                               </td>
9998                            </tr>
9999                            <tr class="row">
10000                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
10001                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows and columns of matrix 
10002                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10003                                     <mi>A</mi>
10004                                  </math>.
10005                               </td>
10006                            </tr>
10007                            <tr class="row">
10008                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">alpha</samp></td>
10009                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication.</td>
10010                            </tr>
10011                            <tr class="row">
10012                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
10013                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
10014                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10015                                     <mi>A</mi>
10016                                  </math>. The supported matrix types are <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_TRIANGULAR</samp> and <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>, while the supported diagonal types are <samp class="ph codeph">CUSPARSE_DIAG_TYPE_UNIT</samp> and <samp class="ph codeph">CUSPARSE_DIAG_TYPE_NON_UNIT</samp>.
10017                               </td>
10018                            </tr>
10019                            <tr class="row">
10020                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
10021                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
10022                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
10023                                     <mo stretchy="false">(</mo>
10024                                     <mo>=</mo>
10025                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
10026                                     <mo>-</mo>
10027                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
10028                                     <mo stretchy="false">)</mo>
10029                                  </math>
10030                                         non-zero elements of matrix 
10031                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10032                                     <mi>A</mi>
10033                                  </math>.
10034                               </td>
10035                            </tr>
10036                            <tr class="row">
10037                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
10038                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
10039                                     <mo>+</mo>
10040                                     <mn>1</mn>
10041                                  </math>
10042                                                 
10043                                         elements that contains the start of every row and the end of the last row plus one.
10044                               </td>
10045                            </tr>
10046                            <tr class="row">
10047                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
10048                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
10049                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
10050                                     <mo stretchy="false">(</mo>
10051                                     <mo>=</mo>
10052                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
10053                                     <mo>-</mo>
10054                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
10055                                     <mo stretchy="false">)</mo>
10056                                  </math>
10057                                         column indices of the non-zero elements of matrix 
10058                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10059                                     <mi>A</mi>
10060                                  </math>.
10061                               </td>
10062                            </tr>
10063                            <tr class="row">
10064                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
10065                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">structure with information collected during the analysis phase (that should have been passed to the solve phase unchanged).</td>
10066                            </tr>
10067                            <tr class="row">
10068                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">x</samp></td>
10069                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; right-hand-side vector of size <samp class="ph codeph">m</samp>.
10070                               </td>
10071                            </tr>
10072                         </tbody>
10073                      </table>
10074                   </div>
10075                   <div class="tablenoborder">
10076                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
10077                            <tr class="row">
10078                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
10079                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; solution vector of size <samp class="ph codeph">m</samp>.
10080                               </td>
10081                            </tr>
10082                         </tbody>
10083                      </table>
10084                   </div>
10085                   <div class="tablenoborder">
10086                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
10087                            <tr class="row">
10088                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
10089                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
10090                            </tr>
10091                            <tr class="row">
10092                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
10093                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
10094                            </tr>
10095                            <tr class="row">
10096                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
10097                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m&lt;0</samp>).
10098                               </td>
10099                            </tr>
10100                            <tr class="row">
10101                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
10102                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
10103                            </tr>
10104                            <tr class="row">
10105                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MAPPING_ERROR</samp></td>
10106                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the texture binding failed.</td>
10107                            </tr>
10108                            <tr class="row">
10109                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
10110                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
10111                            </tr>
10112                            <tr class="row">
10113                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
10114                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
10115                            </tr>
10116                            <tr class="row">
10117                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
10118                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
10119                                  <p class="p"></p>
10120                                  <p class="p"></p>
10121                                  the matrix type is not supported.
10122                               </td>
10123                            </tr>
10124                         </tbody>
10125                      </table>
10126                   </div>
10127                </div>
10128             </div>
10129             <div class="topic concept nested1" id="cusparse-lt-t-gt-hybmv"><a name="cusparse-lt-t-gt-hybmv" shape="rect">
10130                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-hybmv" name="cusparse-lt-t-gt-hybmv" shape="rect">7.6.&nbsp;cusparse&lt;t&gt;hybmv</a></h3>
10131                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
10132 cusparseShybmv(cusparseHandle_t handle, cusparseOperation_t transA,
10133                const float           *alpha, 
10134                const cusparseMatDescr_t descrA,
10135                const cusparseHybMat_t hybA, const float           *x,
10136                const float           *beta, float           *y)
10137 cusparseStatus_t
10138 cusparseDhybmv(cusparseHandle_t handle, cusparseOperation_t transA,
10139                const double          *alpha, 
10140                const cusparseMatDescr_t descrA,
10141                const cusparseHybMat_t hybA, const double          *x,
10142                const double          *beta, double          *y)
10143 cusparseStatus_t
10144 cusparseChybmv(cusparseHandle_t handle, cusparseOperation_t transA,
10145                const cuComplex       *alpha, 
10146                const cusparseMatDescr_t descrA,
10147                const cusparseHybMat_t hybA, const cuComplex       *x,
10148                const cuComplex       *beta, cuComplex       *y)
10149 cusparseStatus_t
10150 cusparseZhybmv(cusparseHandle_t handle, cusparseOperation_t transA,
10151                const cuDoubleComplex *alpha, 
10152                const cusparseMatDescr_t descrA,
10153                const cusparseHybMat_t hybA, const cuDoubleComplex *x,
10154                const cuDoubleComplex *beta, cuDoubleComplex *y)</pre><p class="p">This function performs the matrix-vector operation</p>
10155                   <div class="tablenoborder">
10156                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
10157                         <tbody class="tbody">
10158                            <tr class="row">
10159                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
10160                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10161                                     <mrow class="MJX-TeXAtom-ORD">
10162                                        <mrow class="MJX-TeXAtom-ORD">
10163                                           <mtext>y</mtext>
10164                                        </mrow>
10165                                     </mrow>
10166                                     <mo>=</mo>
10167                                     <mi>α</mi>
10168                                     <mo>∗</mo>
10169                                     <mrow class="MJX-TeXAtom-ORD">
10170                                        <mrow class="MJX-TeXAtom-ORD">
10171                                           <mtext>op</mtext>
10172                                        </mrow>
10173                                     </mrow>
10174                                     <mo stretchy="false">(</mo>
10175                                     <mi>A</mi>
10176                                     <mo stretchy="false">)</mo>
10177                                     <mo>∗</mo>
10178                                     <mrow class="MJX-TeXAtom-ORD">
10179                                        <mrow class="MJX-TeXAtom-ORD">
10180                                           <mtext>x</mtext>
10181                                        </mrow>
10182                                     </mrow>
10183                                     <mo>+</mo>
10184                                     <mi>β</mi>
10185                                     <mo>∗</mo>
10186                                     <mrow class="MJX-TeXAtom-ORD">
10187                                        <mrow class="MJX-TeXAtom-ORD">
10188                                           <mtext>y</mtext>
10189                                        </mrow>
10190                                     </mrow>
10191                                  </math>
10192                               </td>
10193                            </tr>
10194                         </tbody>
10195                      </table>
10196                   </div>
10197                   <p class="p">where 
10198                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10199                         <mi>A</mi>
10200                      </math> is an <samp class="ph codeph">m×n</samp> sparse matrix (that is defined in the HYB storage format by an opaque data structure <samp class="ph codeph">hybA</samp>), <samp class="ph codeph">x</samp> and <samp class="ph codeph">y</samp> are vectors,
10201                      
10202                      
10203                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10204                         <mi>α</mi>
10205                         <mtext>&nbsp;and&nbsp;</mtext>
10206                         <mi>β</mi>
10207                      </math>
10208                      
10209                      are scalars, and
10210                   </p>
10211                   <math xmlns="http://www.w3.org/1998/Math/MathML">
10212                      <mrow class="MJX-TeXAtom-ORD">
10213                         <mrow class="MJX-TeXAtom-ORD">
10214                            <mtext>op</mtext>
10215                         </mrow>
10216                      </mrow>
10217                      <mo stretchy="false">(</mo>
10218                      <mi>A</mi>
10219                      <mo stretchy="false">)</mo>
10220                      <mo>=</mo>
10221                      <mfenced open="{" close="">
10222                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
10223                            <mtr>
10224                               <mtd>
10225                                  <mi>A</mi>
10226                               </mtd>
10227                               <mtd>
10228                                  <mtext>&nbsp;if transA == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
10229                               </mtd>
10230                            </mtr>
10231                         </mtable>
10232                      </mfenced>
10233                   </math>
10234                   <p class="p">Notice that currently only
10235                      
10236                         
10237                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10238                         <mrow class="MJX-TeXAtom-ORD">
10239                            <mrow class="MJX-TeXAtom-ORD">
10240                               <mtext>op</mtext>
10241                            </mrow>
10242                         </mrow>
10243                         <mo stretchy="false">(</mo>
10244                         <mi>A</mi>
10245                         <mo stretchy="false">)</mo>
10246                         <mo>=</mo>
10247                         <mi>A</mi>
10248                      </math>
10249                      
10250                      is supported.
10251                   </p>
10252                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
10253                      to the application on the host before the result is ready.
10254                   </p>
10255                   <div class="tablenoborder">
10256                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
10257                            <tr class="row">
10258                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
10259                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
10260                            </tr>
10261                            <tr class="row">
10262                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">transA</samp></td>
10263                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
10264                                                 
10265                                                 
10266                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10267                                     <mrow class="MJX-TeXAtom-ORD">
10268                                        <mrow class="MJX-TeXAtom-ORD">
10269                                           <mtext>op</mtext>
10270                                        </mrow>
10271                                     </mrow>
10272                                     <mo stretchy="false">(</mo>
10273                                     <mi>A</mi>
10274                                     <mo stretchy="false">)</mo>
10275                                  </math>
10276                                                 
10277                                         (currently only
10278                                                 
10279                                                         
10280                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10281                                     <mrow class="MJX-TeXAtom-ORD">
10282                                        <mrow class="MJX-TeXAtom-ORD">
10283                                           <mtext>op</mtext>
10284                                        </mrow>
10285                                     </mrow>
10286                                     <mo stretchy="false">(</mo>
10287                                     <mi>A</mi>
10288                                     <mo stretchy="false">)</mo>
10289                                     <mo>=</mo>
10290                                     <mi>A</mi>
10291                                  </math>
10292                                                 
10293                                         is supported).
10294                                         
10295                               </td>
10296                            </tr>
10297                            <tr class="row">
10298                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
10299                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
10300                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10301                                     <mi>A</mi>
10302                                  </math>.
10303                               </td>
10304                            </tr>
10305                            <tr class="row">
10306                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
10307                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
10308                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10309                                     <mi>A</mi>
10310                                  </math>.
10311                               </td>
10312                            </tr>
10313                            <tr class="row">
10314                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">alpha</samp></td>
10315                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication.</td>
10316                            </tr>
10317                            <tr class="row">
10318                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
10319                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
10320                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10321                                     <mi>A</mi>
10322                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>.
10323                               </td>
10324                            </tr>
10325                            <tr class="row">
10326                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">hybA</samp></td>
10327                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix 
10328                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10329                                     <mi>A</mi>
10330                                  </math> in HYB storage format.
10331                               </td>
10332                            </tr>
10333                            <tr class="row">
10334                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">x</samp></td>
10335                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector of <samp class="ph codeph">n</samp> elements.
10336                               </td>
10337                            </tr>
10338                            <tr class="row">
10339                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">beta</samp></td>
10340                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication. If <samp class="ph codeph">beta</samp> is zero, <samp class="ph codeph">y</samp> does not have to be a valid input.
10341                               </td>
10342                            </tr>
10343                            <tr class="row">
10344                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
10345                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; vector of <samp class="ph codeph">m</samp> elements.
10346                               </td>
10347                            </tr>
10348                         </tbody>
10349                      </table>
10350                   </div>
10351                   <div class="tablenoborder">
10352                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
10353                            <tr class="row">
10354                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
10355                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; updated vector.</td>
10356                            </tr>
10357                         </tbody>
10358                      </table>
10359                   </div>
10360                   <div class="tablenoborder">
10361                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
10362                            <tr class="row">
10363                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
10364                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
10365                            </tr>
10366                            <tr class="row">
10367                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
10368                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
10369                            </tr>
10370                            <tr class="row">
10371                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
10372                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
10373                            </tr>
10374                            <tr class="row">
10375                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
10376                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the internally stored hyb format parameters are invalid.</td>
10377                            </tr>
10378                            <tr class="row">
10379                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
10380                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
10381                            </tr>
10382                            <tr class="row">
10383                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
10384                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
10385                            </tr>
10386                            <tr class="row">
10387                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
10388                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
10389                            </tr>
10390                            <tr class="row">
10391                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
10392                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
10393                                  <p class="p"></p>
10394                                  <p class="p"></p>
10395                                  the matrix type is not supported.
10396                               </td>
10397                            </tr>
10398                         </tbody>
10399                      </table>
10400                   </div>
10401                </div>
10402             </div>
10403             <div class="topic concept nested1" id="cusparse-lt-t-gt-hybsvanalysis"><a name="cusparse-lt-t-gt-hybsvanalysis" shape="rect">
10404                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-hybsvanalysis" name="cusparse-lt-t-gt-hybsvanalysis" shape="rect">7.7.&nbsp;cusparse&lt;t&gt;hybsv_analysis</a></h3>
10405                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
10406 cusparseShybsv_analysis(cusparseHandle_t handle, 
10407                         cusparseOperation_t transA,
10408                         const cusparseMatDescr_t descrA, 
10409                         cusparseHybMat_t hybA,
10410                         cusparseSolveAnalysisInfo_t info)    
10411 cusparseStatus_t
10412 cusparseDhybsv_analysis(cusparseHandle_t handle, 
10413                         cusparseOperation_t transA,
10414                         const cusparseMatDescr_t descrA, 
10415                         cusparseHybMat_t hybA,
10416                         cusparseSolveAnalysisInfo_t info)    
10417 cusparseStatus_t
10418 cusparseChybsv_analysis(cusparseHandle_t handle, 
10419                         cusparseOperation_t transA,
10420                         const cusparseMatDescr_t descrA, 
10421                         cusparseHybMat_t hybA,
10422                         cusparseSolveAnalysisInfo_t info)    
10423 cusparseStatus_t
10424 cusparseZhybsv_analysis(cusparseHandle_t handle, 
10425                         cusparseOperation_t transA,
10426                         const cusparseMatDescr_t descrA, 
10427                         cusparseHybMat_t hybA,
10428                         cusparseSolveAnalysisInfo_t info) </pre><p class="p">This function performs the analysis phase of the solution of a sparse triangular linear system</p>
10429                   <div class="tablenoborder">
10430                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
10431                         <tbody class="tbody">
10432                            <tr class="row">
10433                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
10434                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10435                                     <mrow class="MJX-TeXAtom-ORD">
10436                                        <mrow class="MJX-TeXAtom-ORD">
10437                                           <mtext>op</mtext>
10438                                        </mrow>
10439                                     </mrow>
10440                                     <mo stretchy="false">(</mo>
10441                                     <mi>A</mi>
10442                                     <mo stretchy="false">)</mo>
10443                                     <mo>∗</mo>
10444                                     <mrow class="MJX-TeXAtom-ORD">
10445                                        <mrow class="MJX-TeXAtom-ORD">
10446                                           <mtext>y</mtext>
10447                                        </mrow>
10448                                     </mrow>
10449                                     <mo>=</mo>
10450                                     <mi>α</mi>
10451                                     <mo>∗</mo>
10452                                     <mrow class="MJX-TeXAtom-ORD">
10453                                        <mrow class="MJX-TeXAtom-ORD">
10454                                           <mtext>x</mtext>
10455                                        </mrow>
10456                                     </mrow>
10457                                  </math>
10458                               </td>
10459                            </tr>
10460                         </tbody>
10461                      </table>
10462                   </div>
10463                   <p class="p">where 
10464                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10465                         <mi>A</mi>
10466                      </math> is <samp class="ph codeph">m×m</samp> sparse matrix (that is defined in HYB storage format by an opaque data structure <samp class="ph codeph">hybA</samp>), <samp class="ph codeph">x</samp> and <samp class="ph codeph">y</samp> are the right-hand-side and the solution vectors, 
10467                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10468                         <mi>α</mi>
10469                      </math> is a scalar, and
10470                   </p>
10471                   <math xmlns="http://www.w3.org/1998/Math/MathML">
10472                      <mrow class="MJX-TeXAtom-ORD">
10473                         <mrow class="MJX-TeXAtom-ORD">
10474                            <mtext>op</mtext>
10475                         </mrow>
10476                      </mrow>
10477                      <mo stretchy="false">(</mo>
10478                      <mi>A</mi>
10479                      <mo stretchy="false">)</mo>
10480                      <mo>=</mo>
10481                      <mfenced open="{" close="">
10482                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
10483                            <mtr>
10484                               <mtd>
10485                                  <mi>A</mi>
10486                               </mtd>
10487                               <mtd>
10488                                  <mtext>&nbsp;if transA == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
10489                               </mtd>
10490                            </mtr>
10491                         </mtable>
10492                      </mfenced>
10493                   </math>
10494                   <p class="p">Notice that currently only
10495                      
10496                         
10497                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10498                         <mrow class="MJX-TeXAtom-ORD">
10499                            <mrow class="MJX-TeXAtom-ORD">
10500                               <mtext>op</mtext>
10501                            </mrow>
10502                         </mrow>
10503                         <mo stretchy="false">(</mo>
10504                         <mi>A</mi>
10505                         <mo stretchy="false">)</mo>
10506                         <mo>=</mo>
10507                         <mi>A</mi>
10508                      </math>
10509                      
10510                      is supported.
10511                   </p>
10512                   <p class="p">It is expected that this function will be executed only once for a given matrix and a particular operation type.</p>
10513                   <p class="p">This function requires significant amount of extra storage that is proportional to the matrix size. It is executed asynchronously
10514                      with respect to the host and it may return control to the application on the host before the result is ready.
10515                   </p>
10516                   <div class="tablenoborder">
10517                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
10518                            <tr class="row">
10519                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
10520                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
10521                            </tr>
10522                            <tr class="row">
10523                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">transA</samp></td>
10524                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
10525                                                 
10526                                                 
10527                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10528                                     <mrow class="MJX-TeXAtom-ORD">
10529                                        <mrow class="MJX-TeXAtom-ORD">
10530                                           <mtext>op</mtext>
10531                                        </mrow>
10532                                     </mrow>
10533                                     <mo stretchy="false">(</mo>
10534                                     <mi>A</mi>
10535                                     <mo stretchy="false">)</mo>
10536                                  </math>
10537                                                 
10538                                         (currently only
10539                                                 
10540                                                         
10541                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10542                                     <mrow class="MJX-TeXAtom-ORD">
10543                                        <mrow class="MJX-TeXAtom-ORD">
10544                                           <mtext>op</mtext>
10545                                        </mrow>
10546                                     </mrow>
10547                                     <mo stretchy="false">(</mo>
10548                                     <mi>A</mi>
10549                                     <mo stretchy="false">)</mo>
10550                                     <mo>=</mo>
10551                                     <mi>A</mi>
10552                                  </math>
10553                                                 
10554                                         is supported).
10555                                         
10556                               </td>
10557                            </tr>
10558                            <tr class="row">
10559                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
10560                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
10561                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10562                                     <mi>A</mi>
10563                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_TRIANGULAR</samp> and diagonal type <samp class="ph codeph">USPARSE_DIAG_TYPE_NON_UNIT</samp>.
10564                               </td>
10565                            </tr>
10566                            <tr class="row">
10567                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">hybA</samp></td>
10568                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix 
10569                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10570                                     <mi>A</mi>
10571                                  </math> in HYB storage format.
10572                               </td>
10573                            </tr>
10574                            <tr class="row">
10575                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
10576                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">structure initialized using <samp class="ph codeph">cusparseCreateSolveAnalysisInfo</samp>.
10577                               </td>
10578                            </tr>
10579                         </tbody>
10580                      </table>
10581                   </div>
10582                   <div class="tablenoborder">
10583                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
10584                            <tr class="row">
10585                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
10586                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">structure filled with information collected during the analysis phase (that should be passed to the solve phase unchanged).</td>
10587                            </tr>
10588                         </tbody>
10589                      </table>
10590                   </div>
10591                   <div class="tablenoborder">
10592                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
10593                            <tr class="row">
10594                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
10595                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
10596                            </tr>
10597                            <tr class="row">
10598                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
10599                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
10600                            </tr>
10601                            <tr class="row">
10602                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
10603                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
10604                            </tr>
10605                            <tr class="row">
10606                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
10607                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the internally stored hyb format parameters are invalid.</td>
10608                            </tr>
10609                            <tr class="row">
10610                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
10611                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
10612                            </tr>
10613                            <tr class="row">
10614                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
10615                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
10616                            </tr>
10617                            <tr class="row">
10618                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
10619                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
10620                            </tr>
10621                            <tr class="row">
10622                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
10623                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
10624                                  <p class="p"></p>
10625                                  <p class="p"></p>
10626                                  the matrix type is not supported.
10627                               </td>
10628                            </tr>
10629                         </tbody>
10630                      </table>
10631                   </div>
10632                </div>
10633             </div>
10634             <div class="topic concept nested1" id="cusparse-lt-t-gt-hybsvsolve"><a name="cusparse-lt-t-gt-hybsvsolve" shape="rect">
10635                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-hybsvsolve" name="cusparse-lt-t-gt-hybsvsolve" shape="rect">7.8.&nbsp;cusparse&lt;t&gt;hybsv_solve</a></h3>
10636                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
10637 cusparseShybsv_solve(cusparseHandle_t handle, 
10638                      cusparseOperation_t transA,
10639                      const float           *alpha, 
10640                      const cusparseMatDescr_t descrA,
10641                      cusparseHybMat_t hybA, 
10642                      cusparseSolveAnalysisInfo_t info,
10643                      const float           *x, float           *y)
10644 cusparseStatus_t 
10645 cusparseDhybsv_solve(cusparseHandle_t handle, 
10646                      cusparseOperation_t transA,
10647                      const double          *alpha, 
10648                      const cusparseMatDescr_t descrA,
10649                      cusparseHybMat_t hybA, 
10650                      cusparseSolveAnalysisInfo_t info,
10651                      const double          *x, double          *y)
10652 cusparseStatus_t 
10653 cusparseChybsv_solve(cusparseHandle_t handle, 
10654                      cusparseOperation_t transA,
10655                      const cuComplex       *alpha, 
10656                      const cusparseMatDescr_t descrA,
10657                      cusparseHybMat_t hybA, 
10658                      cusparseSolveAnalysisInfo_t info,
10659                      const cuComplex       *x, cuComplex       *y)
10660 cusparseStatus_t 
10661 cusparseZhybsv_solve(cusparseHandle_t handle, 
10662                      cusparseOperation_t transA,
10663                      const cuDoubleComplex *alpha, 
10664                      const cusparseMatDescr_t descrA,
10665                      cusparseHybMat_t hybA, 
10666                      cusparseSolveAnalysisInfo_t info,
10667                      const cuDoubleComplex *x, cuDoubleComplex *y)</pre><p class="p">This function performs the solve phase of the solution of a sparse triangular linear system</p>
10668                   <div class="tablenoborder">
10669                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
10670                         <tbody class="tbody">
10671                            <tr class="row">
10672                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
10673                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10674                                     <mrow class="MJX-TeXAtom-ORD">
10675                                        <mrow class="MJX-TeXAtom-ORD">
10676                                           <mtext>op</mtext>
10677                                        </mrow>
10678                                     </mrow>
10679                                     <mo stretchy="false">(</mo>
10680                                     <mi>A</mi>
10681                                     <mo stretchy="false">)</mo>
10682                                     <mo>∗</mo>
10683                                     <mrow class="MJX-TeXAtom-ORD">
10684                                        <mrow class="MJX-TeXAtom-ORD">
10685                                           <mtext>y</mtext>
10686                                        </mrow>
10687                                     </mrow>
10688                                     <mo>=</mo>
10689                                     <mi>α</mi>
10690                                     <mo>∗</mo>
10691                                     <mrow class="MJX-TeXAtom-ORD">
10692                                        <mrow class="MJX-TeXAtom-ORD">
10693                                           <mtext>x</mtext>
10694                                        </mrow>
10695                                     </mrow>
10696                                  </math>
10697                               </td>
10698                            </tr>
10699                         </tbody>
10700                      </table>
10701                   </div>
10702                   <p class="p">where 
10703                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10704                         <mi>A</mi>
10705                      </math> is <samp class="ph codeph">m×m</samp> sparse matrix (that is defined in HYB storage format by an opaque data structure <samp class="ph codeph">hybA</samp>), <samp class="ph codeph">x</samp> and <samp class="ph codeph">y</samp> are the right-hand-side and the solution vectors, 
10706                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10707                         <mi>α</mi>
10708                      </math> is a scalar, and
10709                   </p>
10710                   <math xmlns="http://www.w3.org/1998/Math/MathML">
10711                      <mrow class="MJX-TeXAtom-ORD">
10712                         <mrow class="MJX-TeXAtom-ORD">
10713                            <mtext>op</mtext>
10714                         </mrow>
10715                      </mrow>
10716                      <mo stretchy="false">(</mo>
10717                      <mi>A</mi>
10718                      <mo stretchy="false">)</mo>
10719                      <mo>=</mo>
10720                      <mfenced open="{" close="">
10721                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
10722                            <mtr>
10723                               <mtd>
10724                                  <mi>A</mi>
10725                               </mtd>
10726                               <mtd>
10727                                  <mtext>&nbsp;if transA == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
10728                               </mtd>
10729                            </mtr>
10730                         </mtable>
10731                      </mfenced>
10732                   </math>
10733                   <p class="p">Notice that currently only
10734                      
10735                         
10736                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10737                         <mrow class="MJX-TeXAtom-ORD">
10738                            <mrow class="MJX-TeXAtom-ORD">
10739                               <mtext>op</mtext>
10740                            </mrow>
10741                         </mrow>
10742                         <mo stretchy="false">(</mo>
10743                         <mi>A</mi>
10744                         <mo stretchy="false">)</mo>
10745                         <mo>=</mo>
10746                         <mi>A</mi>
10747                      </math>
10748                      
10749                      is supported.
10750                   </p>
10751                   <p class="p">This function may be executed multiple times for a given matrix and a particular operation type.</p>
10752                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
10753                      to the application on the host before the result is ready.
10754                   </p>
10755                   <div class="tablenoborder">
10756                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
10757                            <tr class="row">
10758                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
10759                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
10760                            </tr>
10761                            <tr class="row">
10762                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">transA</samp></td>
10763                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
10764                                                 
10765                                                 
10766                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10767                                     <mrow class="MJX-TeXAtom-ORD">
10768                                        <mrow class="MJX-TeXAtom-ORD">
10769                                           <mtext>op</mtext>
10770                                        </mrow>
10771                                     </mrow>
10772                                     <mo stretchy="false">(</mo>
10773                                     <mi>A</mi>
10774                                     <mo stretchy="false">)</mo>
10775                                  </math>
10776                                                 
10777                                         (currently only
10778                                                 
10779                                                         
10780                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10781                                     <mrow class="MJX-TeXAtom-ORD">
10782                                        <mrow class="MJX-TeXAtom-ORD">
10783                                           <mtext>op</mtext>
10784                                        </mrow>
10785                                     </mrow>
10786                                     <mo stretchy="false">(</mo>
10787                                     <mi>A</mi>
10788                                     <mo stretchy="false">)</mo>
10789                                     <mo>=</mo>
10790                                     <mi>A</mi>
10791                                  </math>
10792                                                 
10793                                         is supported).
10794                                         
10795                               </td>
10796                            </tr>
10797                            <tr class="row">
10798                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">alpha</samp></td>
10799                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication.</td>
10800                            </tr>
10801                            <tr class="row">
10802                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
10803                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
10804                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10805                                     <mi>A</mi>
10806                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_TRIANGULAR</samp> and diagonal type <samp class="ph codeph">CUSPARSE_DIAG_TYPE_NON_UNIT</samp>.
10807                               </td>
10808                            </tr>
10809                            <tr class="row">
10810                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">hybA</samp></td>
10811                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix 
10812                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10813                                     <mi>A</mi>
10814                                  </math> in HYB storage format.
10815                               </td>
10816                            </tr>
10817                            <tr class="row">
10818                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
10819                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">structure with information collected during the analysis phase (that should be passed to the solve phase unchanged).</td>
10820                            </tr>
10821                            <tr class="row">
10822                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">x</samp></td>
10823                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; right-hand-side vector of size <samp class="ph codeph">m</samp>.
10824                               </td>
10825                            </tr>
10826                         </tbody>
10827                      </table>
10828                   </div>
10829                   <div class="tablenoborder">
10830                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
10831                            <tr class="row">
10832                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">y</samp></td>
10833                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; solution vector of size <samp class="ph codeph">m</samp>.
10834                               </td>
10835                            </tr>
10836                         </tbody>
10837                      </table>
10838                   </div>
10839                   <div class="tablenoborder">
10840                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
10841                            <tr class="row">
10842                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
10843                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
10844                            </tr>
10845                            <tr class="row">
10846                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
10847                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
10848                            </tr>
10849                            <tr class="row">
10850                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
10851                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the internally stored hyb format parameters are invalid.</td>
10852                            </tr>
10853                            <tr class="row">
10854                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
10855                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
10856                            </tr>
10857                            <tr class="row">
10858                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MAPPING_ERROR</samp></td>
10859                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the texture binding failed.</td>
10860                            </tr>
10861                            <tr class="row">
10862                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
10863                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
10864                            </tr>
10865                            <tr class="row">
10866                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
10867                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
10868                            </tr>
10869                            <tr class="row">
10870                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
10871                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
10872                                  <p class="p"></p>
10873                                  <p class="p"></p>
10874                                  the matrix type is not supported.
10875                               </td>
10876                            </tr>
10877                         </tbody>
10878                      </table>
10879                   </div>
10880                </div>
10881             </div>
10882          </div>
10883          <div class="topic concept nested0" id="cusparse-level-3-function-reference"><a name="cusparse-level-3-function-reference" shape="rect">
10884                <!-- --></a><h2 class="title topictitle1"><a href="#cusparse-level-3-function-reference" name="cusparse-level-3-function-reference" shape="rect">8.&nbsp;CUSPARSE Level 3 Function Reference</a></h2>
10885             <div class="body conbody">
10886                <p class="p">This chapter describes sparse linear algebra functions that perform operations between sparse and (usually tall) dense matrices.</p>
10887                <p class="p">In particular, the solution of sparse triangular linear systems with multiple right-hand-sides is implemented in two phases.
10888                   First, during the analysis phase, the sparse triangular matrix is analyzed to determine the dependencies between its elements
10889                   by calling the appropriate <samp class="ph codeph">csrsm_analysis()</samp> function. The analysis is specific to the sparsity pattern of the given matrix and to the selected <samp class="ph codeph">cusparseOperation_t</samp> type. The information from the analysis phase is stored in the parameter of type <samp class="ph codeph">cusparseSolveAnalysisInfo_t</samp> that has been initialized previously with a call to <samp class="ph codeph">cusparseCreateSolveAnalysisInfo()</samp>.
10890                </p>
10891                <p class="p">Second, during the solve phase, the given sparse triangular linear system is solved using the information stored in the <samp class="ph codeph">cusparseSolveAnalysisInfo_t</samp> parameter by calling the appropriate <samp class="ph codeph">csrsm_solve()</samp> function. The solve phase may be performed multiple times with different multiple right-hand-sides, while the analysis phase
10892                   needs to be performed only once. This is especially useful when a sparse triangular linear system must be solved for different
10893                   sets of multiple right-hand-sides one at a time, while its coefficient matrix remains the same.
10894                </p>
10895                <p class="p">Finally, once all the solves have completed, the opaque data structure pointed to by the <samp class="ph codeph">cusparseSolveAnalysisInfo_t</samp> parameter can be released by calling <samp class="ph codeph">cusparseDestroySolveAnalysisInfo()</samp>. For more information please refer to [3].
10896                </p>
10897             </div>
10898             <div class="topic concept nested1" id="cusparse-lt-t-gt-csrmm"><a name="cusparse-lt-t-gt-csrmm" shape="rect">
10899                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csrmm" name="cusparse-lt-t-gt-csrmm" shape="rect">8.1.&nbsp;cusparse&lt;t&gt;csrmm</a></h3>
10900                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
10901 cusparseScsrmm(cusparseHandle_t handle, cusparseOperation_t transA, 
10902                int m, int n, int k, int nnz, 
10903                const float           *alpha, 
10904                const cusparseMatDescr_t descrA, 
10905                const float            *csrValA, 
10906                const int *csrRowPtrA, const int *csrColIndA,
10907                const float            *B, int ldb,
10908                const float            *beta, float          *C, int ldc)
10909 cusparseStatus_t 
10910 cusparseDcsrmm(cusparseHandle_t handle, cusparseOperation_t transA, 
10911                int m, int n, int k, int nnz, 
10912                const double          *alpha, 
10913                const cusparseMatDescr_t descrA, 
10914                const double          *csrValA, 
10915                const int *csrRowPtrA, const int *csrColIndA,
10916                const double           *B, int ldb,
10917                const double           *beta, double         *C, int ldc)
10918 cusparseStatus_t 
10919 cusparseCcsrmm(cusparseHandle_t handle, cusparseOperation_t transA, 
10920                int m, int n, int k, int nnz, 
10921                const cuComplex       *alpha, 
10922                const cusparseMatDescr_t descrA, 
10923                const cuComplex       *csrValA, 
10924                const int *csrRowPtrA, const int *csrColIndA,
10925                const cuComplex        *B, int ldb,
10926                const cuComplex        *beta, cuComplex      *C, int ldc)
10927 cusparseStatus_t 
10928 cusparseZcsrmm(cusparseHandle_t handle, cusparseOperation_t transA, 
10929                int m, int n, int k, int nnz, 
10930                const cuDoubleComplex *alpha, 
10931                const cusparseMatDescr_t descrA, 
10932                const cuDoubleComplex *csrValA, 
10933                const int *csrRowPtrA, const int *csrColIndA,
10934                const cuDoubleComplex *B, int ldb,
10935                const cuDoubleComplex *beta, cuDoubleComplex *C, int ldc)</pre><p class="p">This function performs one of the following matrix-matrix operation</p>
10936                   <div class="tablenoborder">
10937                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
10938                         <tbody class="tbody">
10939                            <tr class="row">
10940                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
10941                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
10942                                     <mi>C</mi>
10943                                     <mo>=</mo>
10944                                     <mi>α</mi>
10945                                     <mo>∗</mo>
10946                                     <mrow class="MJX-TeXAtom-ORD">
10947                                        <mrow class="MJX-TeXAtom-ORD">
10948                                           <mtext>op</mtext>
10949                                        </mrow>
10950                                     </mrow>
10951                                     <mo stretchy="false">(</mo>
10952                                     <mi>A</mi>
10953                                     <mo stretchy="false">)</mo>
10954                                     <mo>∗</mo>
10955                                     <mi>B</mi>
10956                                     <mo>+</mo>
10957                                     <mi>β</mi>
10958                                     <mo>∗</mo>
10959                                     <mi>C</mi>
10960                                  </math>
10961                               </td>
10962                            </tr>
10963                         </tbody>
10964                      </table>
10965                   </div>
10966                   <p class="p">where 
10967                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10968                         <mi>A</mi>
10969                      </math> is <samp class="ph codeph">m×k</samp> sparse matrix (that is defined in CSR storage format by the three arrays <samp class="ph codeph">csrValA</samp>, <samp class="ph codeph">csrRowPtrA</samp>, and <samp class="ph codeph">csrColIndA</samp>), 
10970                      
10971                      
10972                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10973                         <mi>B</mi>
10974                         <mtext>&nbsp;and&nbsp;</mtext>
10975                         <mi>C</mi>
10976                      </math>
10977                      
10978                      are dense matrices,
10979                      
10980                      
10981                      <math xmlns="http://www.w3.org/1998/Math/MathML">
10982                         <mi>α</mi>
10983                         <mtext>&nbsp;and&nbsp;</mtext>
10984                         <mi>β</mi>
10985                      </math>
10986                      
10987                      are scalars, and
10988                   </p>
10989                   <math xmlns="http://www.w3.org/1998/Math/MathML">
10990                      <mrow class="MJX-TeXAtom-ORD">
10991                         <mrow class="MJX-TeXAtom-ORD">
10992                            <mtext>op</mtext>
10993                         </mrow>
10994                      </mrow>
10995                      <mo stretchy="false">(</mo>
10996                      <mi>A</mi>
10997                      <mo stretchy="false">)</mo>
10998                      <mo>=</mo>
10999                      <mfenced open="{" close="">
11000                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
11001                            <mtr>
11002                               <mtd>
11003                                  <mi>A</mi>
11004                               </mtd>
11005                               <mtd>
11006                                  <mtext>if trans == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
11007                               </mtd>
11008                            </mtr>
11009                            <mtr>
11010                               <mtd>
11011                                  <msup>
11012                                     <mi>A</mi>
11013                                     <mi>T</mi>
11014                                  </msup>
11015                               </mtd>
11016                               <mtd>
11017                                  <mtext>if trans == CUSPARSE_OPERATION_TRANSPOSE</mtext>
11018                               </mtd>
11019                            </mtr>
11020                            <mtr>
11021                               <mtd>
11022                                  <msup>
11023                                     <mi>A</mi>
11024                                     <mi>H</mi>
11025                                  </msup>
11026                               </mtd>
11027                               <mtd>
11028                                  <mtext>if trans == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</mtext>
11029                               </mtd>
11030                            </mtr>
11031                         </mtable>
11032                      </mfenced>
11033                   </math>
11034                   <p class="p">When using the (conjugate) transpose of a general matrix or a Hermitian/symmetric matrix, this routine may produce slightly
11035                      different results during different runs of this function with the same input parameters. For these matrix types it uses atomic
11036                      operations to compute the final result, consequently many threads may be adding floating point numbers to the same memory
11037                      location without any specific ordering, which may produce slightly different results for each run.
11038                   </p>
11039                   <p class="p">If exactly the same output is required for any input when multiplying by the transpose of a general matrix, the following
11040                      procedure can be used:
11041                   </p>
11042                   <p class="p">1. Convert the matrix from CSR to CSC format using one of the <samp class="ph codeph">csr2csc()</samp> functions. Notice that by interchanging the rows and columns of the result you are implicitly transposing the matrix.
11043                   </p>
11044                   <p class="p">2. Call the <samp class="ph codeph">csrmm()</samp> function with the <samp class="ph codeph">cusparseOperation_t</samp> parameter set to <samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp> and with the interchanged rows and columns of the matrix stored in CSC format. This (implicitly) multiplies the vector by
11045                      the transpose of the matrix in the original CSR format.
11046                   </p>
11047                   <p class="p">This function requires no extra storage for the general matrices when operation <samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp> is selected. It requires some extra storage for Hermitian/symmetric matrices and for the general matrices when operation
11048                      different than <samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp> is selected. It is executed asynchronously with respect to the host and it may return control to the application on the host
11049                      before the result is ready.
11050                   </p>
11051                   <div class="tablenoborder">
11052                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
11053                            <tr class="row">
11054                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
11055                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
11056                            </tr>
11057                            <tr class="row">
11058                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">transA</samp></td>
11059                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
11060                                                 
11061                                                 
11062                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11063                                     <mrow class="MJX-TeXAtom-ORD">
11064                                        <mrow class="MJX-TeXAtom-ORD">
11065                                           <mtext>op</mtext>
11066                                        </mrow>
11067                                     </mrow>
11068                                     <mo stretchy="false">(</mo>
11069                                     <mi>A</mi>
11070                                     <mo stretchy="false">)</mo>
11071                                  </math>
11072                               </td>
11073                            </tr>
11074                            <tr class="row">
11075                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
11076                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of sparse matrix 
11077                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11078                                     <mi>A</mi>
11079                                  </math>.
11080                               </td>
11081                            </tr>
11082                            <tr class="row">
11083                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
11084                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of dense matrix 
11085                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11086                                     <mi>B</mi>
11087                                  </math> and 
11088                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11089                                     <mi>C</mi>
11090                                  </math>.
11091                               </td>
11092                            </tr>
11093                            <tr class="row">
11094                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">k</samp></td>
11095                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of sparse matrix 
11096                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11097                                     <mi>A</mi>
11098                                  </math>.
11099                               </td>
11100                            </tr>
11101                            <tr class="row">
11102                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
11103                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero elements of sparse matrix 
11104                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11105                                     <mi>A</mi>
11106                                  </math>.
11107                               </td>
11108                            </tr>
11109                            <tr class="row">
11110                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">alpha</samp></td>
11111                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication.</td>
11112                            </tr>
11113                            <tr class="row">
11114                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
11115                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
11116                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11117                                     <mi>A</mi>
11118                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>, <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_SYMMETRIC</samp>, and <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_HERMITIAN</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
11119                               </td>
11120                            </tr>
11121                            <tr class="row">
11122                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
11123                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
11124                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11125                                     <mo stretchy="false">(</mo>
11126                                     <mo>=</mo>
11127                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11128                                     <mo>-</mo>
11129                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11130                                     <mo stretchy="false">)</mo>
11131                                  </math>
11132                                         non-zero elements of matrix 
11133                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11134                                     <mi>A</mi>
11135                                  </math>.
11136                               </td>
11137                            </tr>
11138                            <tr class="row">
11139                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
11140                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11141                                     <mo>+</mo>
11142                                     <mn>1</mn>
11143                                  </math>
11144                                                 
11145                                         elements that contains the start of every row and the end of the last row plus one.
11146                               </td>
11147                            </tr>
11148                            <tr class="row">
11149                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
11150                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
11151                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11152                                     <mo stretchy="false">(</mo>
11153                                     <mo>=</mo>
11154                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11155                                     <mo>-</mo>
11156                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11157                                     <mo stretchy="false">)</mo>
11158                                  </math>
11159                                         column indices of the non-zero elements of matrix 
11160                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11161                                     <mi>A</mi>
11162                                  </math>.
11163                               </td>
11164                            </tr>
11165                            <tr class="row">
11166                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">B</samp></td>
11167                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of dimensions <samp class="ph codeph">(ldb, n)</samp>.
11168                               </td>
11169                            </tr>
11170                            <tr class="row">
11171                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">ldb</samp></td>
11172                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of <samp class="ph codeph">B</samp>. It must be at least
11173                                                 
11174                                                 
11175                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11176                                     <mo movablelimits="true">max</mo>
11177                                     <mrow class="MJX-TeXAtom-ORD">
11178                                        <mrow class="MJX-TeXAtom-ORD">
11179                                           <mtext>(1, k)</mtext>
11180                                        </mrow>
11181                                     </mrow>
11182                                  </math>
11183                                                 
11184                                         if
11185                                                 
11186                                                         
11187                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11188                                     <mrow class="MJX-TeXAtom-ORD">
11189                                        <mrow class="MJX-TeXAtom-ORD">
11190                                           <mtext>op</mtext>
11191                                        </mrow>
11192                                     </mrow>
11193                                     <mo stretchy="false">(</mo>
11194                                     <mi>A</mi>
11195                                     <mo stretchy="false">)</mo>
11196                                     <mo>=</mo>
11197                                     <mi>A</mi>
11198                                  </math>
11199                                                 
11200                                         and at least
11201                                                 
11202                                                 
11203                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11204                                     <mo movablelimits="true">max</mo>
11205                                     <mrow class="MJX-TeXAtom-ORD">
11206                                        <mrow class="MJX-TeXAtom-ORD">
11207                                           <mtext>(1, m)</mtext>
11208                                        </mrow>
11209                                     </mrow>
11210                                  </math>
11211                                                 
11212                                         otherwise.
11213                               </td>
11214                            </tr>
11215                            <tr class="row">
11216                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">beta</samp></td>
11217                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication. If <samp class="ph codeph">beta</samp> is zero, <samp class="ph codeph">C</samp> does not have to be a valid input.
11218                               </td>
11219                            </tr>
11220                            <tr class="row">
11221                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">C</samp></td>
11222                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of dimensions <samp class="ph codeph">(ldc, n)</samp>.
11223                               </td>
11224                            </tr>
11225                            <tr class="row">
11226                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">ldc</samp></td>
11227                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of <samp class="ph codeph">C</samp>. It must be at least
11228                                                 
11229                                                 
11230                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11231                                     <mo movablelimits="true">max</mo>
11232                                     <mrow class="MJX-TeXAtom-ORD">
11233                                        <mrow class="MJX-TeXAtom-ORD">
11234                                           <mtext>(1, k)</mtext>
11235                                        </mrow>
11236                                     </mrow>
11237                                  </math>
11238                                                 
11239                                         if
11240                                                 
11241                                                         
11242                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11243                                     <mrow class="MJX-TeXAtom-ORD">
11244                                        <mrow class="MJX-TeXAtom-ORD">
11245                                           <mtext>op</mtext>
11246                                        </mrow>
11247                                     </mrow>
11248                                     <mo stretchy="false">(</mo>
11249                                     <mi>A</mi>
11250                                     <mo stretchy="false">)</mo>
11251                                     <mo>=</mo>
11252                                     <mi>A</mi>
11253                                  </math>
11254                                                 
11255                                         and at least
11256                                                 
11257                                                 
11258                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11259                                     <mo movablelimits="true">max</mo>
11260                                     <mrow class="MJX-TeXAtom-ORD">
11261                                        <mrow class="MJX-TeXAtom-ORD">
11262                                           <mtext>(1, m)</mtext>
11263                                        </mrow>
11264                                     </mrow>
11265                                  </math>
11266                                                 
11267                                         otherwise.
11268                               </td>
11269                            </tr>
11270                         </tbody>
11271                      </table>
11272                   </div>
11273                   <div class="tablenoborder">
11274                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
11275                            <tr class="row">
11276                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">C</samp></td>
11277                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; updated array of dimensions <samp class="ph codeph">(ldc, n)</samp>.
11278                               </td>
11279                            </tr>
11280                         </tbody>
11281                      </table>
11282                   </div>
11283                   <div class="tablenoborder">
11284                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
11285                            <tr class="row">
11286                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
11287                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
11288                            </tr>
11289                            <tr class="row">
11290                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
11291                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
11292                            </tr>
11293                            <tr class="row">
11294                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
11295                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
11296                            </tr>
11297                            <tr class="row">
11298                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
11299                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n,k,nnz&lt;0</samp> or <samp class="ph codeph">ldb</samp> and <samp class="ph codeph">ldc</samp> are incorrect).
11300                               </td>
11301                            </tr>
11302                            <tr class="row">
11303                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
11304                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
11305                            </tr>
11306                            <tr class="row">
11307                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
11308                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
11309                            </tr>
11310                            <tr class="row">
11311                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
11312                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
11313                            </tr>
11314                            <tr class="row">
11315                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
11316                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
11317                                  <p class="p"></p>
11318                                  <p class="p"></p>
11319                                  the matrix type is not supported.
11320                               </td>
11321                            </tr>
11322                         </tbody>
11323                      </table>
11324                   </div>
11325                </div>
11326             </div>
11327             <div class="topic concept nested1" id="cusparse-lt-t-gt-csrmm2"><a name="cusparse-lt-t-gt-csrmm2" shape="rect">
11328                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csrmm2" name="cusparse-lt-t-gt-csrmm2" shape="rect">8.2.&nbsp;cusparse&lt;t&gt;csrmm2</a></h3>
11329                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
11330 cusparseScsrmm2(cusparseHandle_t         handle, 
11331                 cusparseOperation_t      transA,    
11332                 cusparseOperation_t      transB,    
11333                 int                      m,         
11334                 int                      n,         
11335                 int                      k,         
11336                 int                      nnz,       
11337                 const float              *alpha,    
11338                 const cusparseMatDescr_t descrA, 
11339                 const float              *csrValA, 
11340                 const int                *csrRowPtrA, 
11341                 const int                *csrColIndA,
11342                 const float              *B,
11343                 int                      ldb,
11344                 const float              *beta,
11345                 float                    *C,
11346                 int                      ldc)                
11347 cusparseStatus_t 
11348 cusparseDcsrmm2(cusparseHandle_t         handle, 
11349                 cusparseOperation_t      transA, 
11350                 cusparseOperation_t      transB,
11351                 int                      m,
11352                 int                      n,
11353                 int                      k,
11354                 int                      nnz, 
11355                 const double             *alpha, 
11356                 const cusparseMatDescr_t descrA, 
11357                 const double             *csrValA, 
11358                 const int                *csrRowPtrA,
11359                 const int                *csrColIndA,
11360                 const double             *B,
11361                 int                      ldb,
11362                 const double             *beta,
11363                 double                   *C,
11364                 int                      ldc)
11365 cusparseStatus_t 
11366 cusparseCcsrmm2(cusparseHandle_t         handle, 
11367                 cusparseOperation_t      transA, 
11368                 cusparseOperation_t      transB,
11369                 int                      m,
11370                 int                      n,
11371                 int                      k,
11372                 int                      nnz, 
11373                 const cuComplex          *alpha, 
11374                 const cusparseMatDescr_t descrA, 
11375                 const cuComplex          *csrValA, 
11376                 const int                *csrRowPtrA,
11377                 const int                *csrColIndA,
11378                 const cuComplex          *B,
11379                 int                      ldb,
11380                 const cuComplex          *beta,
11381                 cuComplex                *C,
11382                 int                      ldc)
11383 cusparseStatus_t 
11384 cusparseZcsrmm2(cusparseHandle_t         handle, 
11385                 cusparseOperation_t      transA, 
11386                 cusparseOperation_t      transB,
11387                 int                      m,
11388                 int                      n,
11389                 int                      k,
11390                 int                      nnz, 
11391                 const cuDoubleComplex    *alpha, 
11392                 const cusparseMatDescr_t descrA, 
11393                 const cuDoubleComplex    *csrValA, 
11394                 const int                *csrRowPtrA,
11395                 const int                *csrColIndA,
11396                 const cuDoubleComplex    *B,
11397                 int                      ldb,
11398                 const cuDoubleComplex    *beta,
11399                 cuDoubleComplex          *C,
11400                 int                      ldc)</pre><p class="p">This function performs one of the following matrix-matrix operation</p>
11401                   <div class="tablenoborder">
11402                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
11403                         <tbody class="tbody">
11404                            <tr class="row">
11405                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
11406                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11407                                     <mi>C</mi>
11408                                     <mo>=</mo>
11409                                     <mi>α</mi>
11410                                     <mo>∗</mo>
11411                                     <mrow class="MJX-TeXAtom-ORD">
11412                                        <mrow class="MJX-TeXAtom-ORD">
11413                                           <mtext>op</mtext>
11414                                        </mrow>
11415                                     </mrow>
11416                                     <mo stretchy="false">(</mo>
11417                                     <mi>A</mi>
11418                                     <mo stretchy="false">)</mo>
11419                                     <mo>∗</mo>
11420                                     <mrow class="MJX-TeXAtom-ORD">
11421                                        <mrow class="MJX-TeXAtom-ORD">
11422                                           <mtext>op</mtext>
11423                                        </mrow>
11424                                     </mrow>
11425                                     <mo stretchy="false">(</mo>
11426                                     <mi>B</mi>
11427                                     <mo stretchy="false">)</mo>
11428                                     <mo>+</mo>
11429                                     <mi>β</mi>
11430                                     <mo>∗</mo>
11431                                     <mi>C</mi>
11432                                  </math>
11433                               </td>
11434                            </tr>
11435                         </tbody>
11436                      </table>
11437                   </div>
11438                   <p class="p">where 
11439                      <math xmlns="http://www.w3.org/1998/Math/MathML">
11440                         <mi>A</mi>
11441                      </math> is <samp class="ph codeph">m×k</samp> sparse matrix (that is defined in CSR storage format by the three arrays <samp class="ph codeph">csrValA</samp>, <samp class="ph codeph">csrRowPtrA</samp>, and <samp class="ph codeph">csrColIndA</samp>), 
11442                      
11443                      
11444                      <math xmlns="http://www.w3.org/1998/Math/MathML">
11445                         <mi>B</mi>
11446                         <mtext>&nbsp;and&nbsp;</mtext>
11447                         <mi>C</mi>
11448                      </math>
11449                      
11450                      are dense matrices,
11451                      
11452                      
11453                      <math xmlns="http://www.w3.org/1998/Math/MathML">
11454                         <mi>α</mi>
11455                         <mtext>&nbsp;and&nbsp;</mtext>
11456                         <mi>β</mi>
11457                      </math>
11458                      
11459                      are scalars, and
11460                   </p>
11461                   <math xmlns="http://www.w3.org/1998/Math/MathML">
11462                      <mrow class="MJX-TeXAtom-ORD">
11463                         <mrow class="MJX-TeXAtom-ORD">
11464                            <mtext>op</mtext>
11465                         </mrow>
11466                      </mrow>
11467                      <mo stretchy="false">(</mo>
11468                      <mi>A</mi>
11469                      <mo stretchy="false">)</mo>
11470                      <mo>=</mo>
11471                      <mfenced open="{" close="">
11472                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
11473                            <mtr>
11474                               <mtd>
11475                                  <mi>A</mi>
11476                               </mtd>
11477                               <mtd>
11478                                  <mtext>if transA == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
11479                               </mtd>
11480                            </mtr>
11481                            <mtr>
11482                               <mtd>
11483                                  <msup>
11484                                     <mi>A</mi>
11485                                     <mi>T</mi>
11486                                  </msup>
11487                               </mtd>
11488                               <mtd>
11489                                  <mtext>if transA == CUSPARSE_OPERATION_TRANSPOSE</mtext>
11490                               </mtd>
11491                            </mtr>
11492                            <mtr>
11493                               <mtd>
11494                                  <msup>
11495                                     <mi>A</mi>
11496                                     <mi>H</mi>
11497                                  </msup>
11498                               </mtd>
11499                               <mtd>
11500                                  <mtext>if transA == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</mtext>
11501                               </mtd>
11502                            </mtr>
11503                         </mtable>
11504                      </mfenced>
11505                   </math>
11506                   <p class="p">, </p>
11507                   <math xmlns="http://www.w3.org/1998/Math/MathML">
11508                      <mrow class="MJX-TeXAtom-ORD">
11509                         <mrow class="MJX-TeXAtom-ORD">
11510                            <mtext>op</mtext>
11511                         </mrow>
11512                      </mrow>
11513                      <mo stretchy="false">(</mo>
11514                      <mi>B</mi>
11515                      <mo stretchy="false">)</mo>
11516                      <mo>=</mo>
11517                      <mfenced open="{" close="">
11518                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
11519                            <mtr>
11520                               <mtd>
11521                                  <mi>B</mi>
11522                               </mtd>
11523                               <mtd>
11524                                  <mtext>if transB == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
11525                               </mtd>
11526                            </mtr>
11527                            <mtr>
11528                               <mtd>
11529                                  <msup>
11530                                     <mi>B</mi>
11531                                     <mi>T</mi>
11532                                  </msup>
11533                               </mtd>
11534                               <mtd>
11535                                  <mtext>if transB == CUSPARSE_OPERATION_TRANSPOSE</mtext>
11536                               </mtd>
11537                            </mtr>
11538                            <mtr>
11539                               <mtd>
11540                                  <msup>
11541                                     <mi>B</mi>
11542                                     <mi>H</mi>
11543                                  </msup>
11544                               </mtd>
11545                               <mtd>
11546                                  <mtext>not supported</mtext>
11547                               </mtd>
11548                            </mtr>
11549                         </mtable>
11550                      </mfenced>
11551                   </math>
11552                   <p class="p">If <samp class="ph codeph">op(B)=B</samp>, cusparse&lt;t&gt;csrmm2 is the same as cusparse&lt;t&gt;csrmm. 
11553                      Otherwise only <samp class="ph codeph">op(A)=A</samp> is supported and matrix type must be <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>. 
11554                      
11555                   </p>
11556                   <p class="p"> The motivation of transpose(B) is to improve memory access of matrix B . 
11557                      The computational pattern of <samp class="ph codeph">A*transpose(B)</samp> with matrix B in column-major order is equivalent to
11558                      <samp class="ph codeph">A*B</samp> with matrix B in row-mjor order. 
11559                      
11560                   </p>
11561                   <p class="p">In practice, no operation in iterative solver or eigenvalue solver uses <samp class="ph codeph">A*transpose(B)</samp>. 
11562                      However we can perform <samp class="ph codeph">A*transpose(transpose(B))</samp> which is the same as <samp class="ph codeph">A*B</samp>. 
11563                      For example, suppose A is <samp class="ph codeph">m*k</samp>, B is <samp class="ph codeph">k*n</samp> and C is <samp class="ph codeph">m*n</samp>, the following code shows usage of cusparseDcsrmm.
11564                   </p><pre xml:space="preserve">
11565 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// A is m*k, B is k*n and C is m*n </span>
11566     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">const</span> <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> ldb_B = k ; <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// leading dimension of B</span>
11567     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">const</span> <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> ldc   = m ; <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// leading dimension of C</span>
11568 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// perform C:=alpha*A*B + beta*C</span>
11569     cusparseSetMatType(descrA, CUSPARSE_MATRIX_TYPE_GENERAL ) ;
11570     cusparseDcsrmm2(cusparse_handle, 
11571                CUSPARSE_OPERATION_NON_TRANSPOSE,
11572                m, n, k, nnz, alpha,
11573                descrA, csrValA, csrRowPtrA, csrColIndA,
11574                B, ldb_B,
11575                beta, C, ldc);
11576     </pre><p class="p">Instead of using <samp class="ph codeph">A*B</samp>, our proposal is to transpose B to Bt first by calling cublas&lt;t&gt;geam, then to perform <samp class="ph codeph">A*transpose(Bt)</samp>. 
11577                   </p><pre xml:space="preserve">
11578 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// step 1: Bt := transpose(B)</span>
11579     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> *Bt; 
11580     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">const</span> <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> ldb_Bt = n ; <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// leading dimension of Bt</span>
11581     cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;Bt, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span>)*ldb_Bt*k);
11582     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> one  = 1.0;
11583     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> zero = 0.0;
11584     cublasSetPointerMode(cublas_handle, CUBLAS_POINTER_MODE_HOST);
11585     cublasDgeam(cublas_handle, CUBLAS_OP_T, CUBLAS_OP_T,
11586         n, k, &amp;one, B, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> ldb_B, &amp;zero, B, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> ldb_B, Bt, ldb_Bt);
11587
11588 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// step 2: perform C:=alpha*A*transpose(Bt) + beta*C</span>
11589     cusparseDcsrmm2(cusparse_handle, 
11590                CUSPARSE_OPERATION_NON_TRANSPOSE,
11591                CUSPARSE_OPERATION_TRANSPOSE
11592                m, n, k, nnz, alpha,
11593                descrA, csrValA, csrRowPtrA, csrColIndA,
11594                Bt, ldb_Bt,
11595                beta, C, ldc);
11596     </pre><p class="p">Remark 1: cublas&lt;t&gt;geam and cusparse&lt;t&gt;csrmm2 are memory-bound. 
11597                      The complexity of cublas&lt;t&gt;geam is <samp class="ph codeph">2*n*k</samp> and the minimum complexity of cusparse&lt;t&gt;csrmm2 is about <samp class="ph codeph">(nnz + nnz*n + 2*m*n)</samp>.  
11598                      If nnz per column <samp class="ph codeph">(=nnz/k)</samp> is large, it is worth paying extra cost on transposition because '<samp class="ph codeph">A*transpose(B)</samp>' may be 2x faster than '<samp class="ph codeph">A*B</samp>' if sparsity pattern of A is not good.
11599                      
11600                   </p>
11601                   <p class="p">Remark 2: <samp class="ph codeph">A*transpose(B)</samp> is only supported on compute capability 2.0 and above.
11602                      
11603                   </p>
11604                   <div class="tablenoborder">
11605                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
11606                            <tr class="row">
11607                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
11608                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
11609                            </tr>
11610                            <tr class="row">
11611                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">transA</samp></td>
11612                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
11613                                                 
11614                                                 
11615                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11616                                     <mrow class="MJX-TeXAtom-ORD">
11617                                        <mrow class="MJX-TeXAtom-ORD">
11618                                           <mtext>op</mtext>
11619                                        </mrow>
11620                                     </mrow>
11621                                     <mo stretchy="false">(</mo>
11622                                     <mi>A</mi>
11623                                     <mo stretchy="false">)</mo>
11624                                  </math>
11625                               </td>
11626                            </tr>
11627                            <tr class="row">
11628                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">transB</samp></td>
11629                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
11630                                  
11631                                  
11632                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11633                                     <mrow class="MJX-TeXAtom-ORD">
11634                                        <mrow class="MJX-TeXAtom-ORD">
11635                                           <mtext>op</mtext>
11636                                        </mrow>
11637                                     </mrow>
11638                                     <mo stretchy="false">(</mo>
11639                                     <mi>B</mi>
11640                                     <mo stretchy="false">)</mo>
11641                                  </math>
11642                               </td>
11643                            </tr>
11644                            <tr class="row">
11645                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
11646                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of sparse matrix 
11647                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11648                                     <mi>A</mi>
11649                                  </math>.
11650                               </td>
11651                            </tr>
11652                            <tr class="row">
11653                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
11654                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of dense matrix 
11655                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11656                                     <mi>op(B)</mi>
11657                                  </math> and 
11658                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11659                                     <mi>C</mi>
11660                                  </math>.
11661                               </td>
11662                            </tr>
11663                            <tr class="row">
11664                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">k</samp></td>
11665                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of sparse matrix 
11666                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11667                                     <mi>A</mi>
11668                                  </math>.
11669                               </td>
11670                            </tr>
11671                            <tr class="row">
11672                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
11673                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero elements of sparse matrix 
11674                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11675                                     <mi>A</mi>
11676                                  </math>.
11677                               </td>
11678                            </tr>
11679                            <tr class="row">
11680                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">alpha</samp></td>
11681                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication.</td>
11682                            </tr>
11683                            <tr class="row">
11684                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
11685                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
11686                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11687                                     <mi>A</mi>
11688                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>, <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_SYMMETRIC</samp>, and <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_HERMITIAN</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
11689                               </td>
11690                            </tr>
11691                            <tr class="row">
11692                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
11693                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
11694                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11695                                     <mo stretchy="false">(</mo>
11696                                     <mo>=</mo>
11697                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11698                                     <mo>-</mo>
11699                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11700                                     <mo stretchy="false">)</mo>
11701                                  </math>
11702                                         non-zero elements of matrix 
11703                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11704                                     <mi>A</mi>
11705                                  </math>.
11706                               </td>
11707                            </tr>
11708                            <tr class="row">
11709                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
11710                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11711                                     <mo>+</mo>
11712                                     <mn>1</mn>
11713                                  </math>
11714                                                 
11715                                         elements that contains the start of every row and the end of the last row plus one.
11716                               </td>
11717                            </tr>
11718                            <tr class="row">
11719                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
11720                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
11721                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11722                                     <mo stretchy="false">(</mo>
11723                                     <mo>=</mo>
11724                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11725                                     <mo>-</mo>
11726                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
11727                                     <mo stretchy="false">)</mo>
11728                                  </math>
11729                                         column indices of the non-zero elements of matrix 
11730                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11731                                     <mi>A</mi>
11732                                  </math>.
11733                               </td>
11734                            </tr>
11735                            <tr class="row">
11736                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">B</samp></td>
11737                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of dimensions <samp class="ph codeph">(ldb, n)</samp> if op(B)=B and <samp class="ph codeph">(ldb, k)</samp> otherwise.
11738                               </td>
11739                            </tr>
11740                            <tr class="row">
11741                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">ldb</samp></td>
11742                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of <samp class="ph codeph">B</samp>. If op(B)=B, it must be at least
11743                                                 
11744                                                 
11745                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11746                                     <mo movablelimits="true">max</mo>
11747                                     <mrow class="MJX-TeXAtom-ORD">
11748                                        <mrow class="MJX-TeXAtom-ORD">
11749                                           <mtext>(1, k)</mtext>
11750                                        </mrow>
11751                                     </mrow>
11752                                  </math>
11753                                                 
11754                                         if
11755                                                 
11756                                                         
11757                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11758                                     <mrow class="MJX-TeXAtom-ORD">
11759                                        <mrow class="MJX-TeXAtom-ORD">
11760                                           <mtext>op</mtext>
11761                                        </mrow>
11762                                     </mrow>
11763                                     <mo stretchy="false">(</mo>
11764                                     <mi>A</mi>
11765                                     <mo stretchy="false">)</mo>
11766                                     <mo>=</mo>
11767                                     <mi>A</mi>
11768                                  </math>
11769                                                 
11770                                         and at least
11771                                                 
11772                                                 
11773                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11774                                     <mo movablelimits="true">max</mo>
11775                                     <mrow class="MJX-TeXAtom-ORD">
11776                                        <mrow class="MJX-TeXAtom-ORD">
11777                                           <mtext>(1, m)</mtext>
11778                                        </mrow>
11779                                     </mrow>
11780                                  </math>
11781                                                 
11782                                         otherwise.
11783                                  If op(B) != B, it must be at least max(1, n). 
11784                                  
11785                               </td>
11786                            </tr>
11787                            <tr class="row">
11788                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">beta</samp></td>
11789                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication. If <samp class="ph codeph">beta</samp> is zero, <samp class="ph codeph">C</samp> does not have to be a valid input.
11790                               </td>
11791                            </tr>
11792                            <tr class="row">
11793                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">C</samp></td>
11794                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of dimensions <samp class="ph codeph">(ldc, n)</samp>.
11795                               </td>
11796                            </tr>
11797                            <tr class="row">
11798                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">ldc</samp></td>
11799                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of <samp class="ph codeph">C</samp>. It must be at least
11800                                                 
11801                                                 
11802                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11803                                     <mo movablelimits="true">max</mo>
11804                                     <mrow class="MJX-TeXAtom-ORD">
11805                                        <mrow class="MJX-TeXAtom-ORD">
11806                                           <mtext>(1, k)</mtext>
11807                                        </mrow>
11808                                     </mrow>
11809                                  </math>
11810                                                 
11811                                         if
11812                                                 
11813                                                         
11814                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11815                                     <mrow class="MJX-TeXAtom-ORD">
11816                                        <mrow class="MJX-TeXAtom-ORD">
11817                                           <mtext>op</mtext>
11818                                        </mrow>
11819                                     </mrow>
11820                                     <mo stretchy="false">(</mo>
11821                                     <mi>A</mi>
11822                                     <mo stretchy="false">)</mo>
11823                                     <mo>=</mo>
11824                                     <mi>A</mi>
11825                                  </math>
11826                                                 
11827                                         and at least
11828                                                 
11829                                                 
11830                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11831                                     <mo movablelimits="true">max</mo>
11832                                     <mrow class="MJX-TeXAtom-ORD">
11833                                        <mrow class="MJX-TeXAtom-ORD">
11834                                           <mtext>(1, m)</mtext>
11835                                        </mrow>
11836                                     </mrow>
11837                                  </math>
11838                                                 
11839                                         otherwise.
11840                               </td>
11841                            </tr>
11842                         </tbody>
11843                      </table>
11844                   </div>
11845                   <div class="tablenoborder">
11846                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
11847                            <tr class="row">
11848                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">C</samp></td>
11849                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; updated array of dimensions <samp class="ph codeph">(ldc, n)</samp>.
11850                               </td>
11851                            </tr>
11852                         </tbody>
11853                      </table>
11854                   </div>
11855                   <div class="tablenoborder">
11856                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
11857                            <tr class="row">
11858                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
11859                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
11860                            </tr>
11861                            <tr class="row">
11862                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
11863                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
11864                            </tr>
11865                            <tr class="row">
11866                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
11867                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
11868                            </tr>
11869                            <tr class="row">
11870                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
11871                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n,k,nnz&lt;0</samp> or <samp class="ph codeph">ldb</samp> and <samp class="ph codeph">ldc</samp> are incorrect).
11872                               </td>
11873                            </tr>
11874                            <tr class="row">
11875                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
11876                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">if op(B)=B the device does not support double precision
11877                                  or if op(B)=transpose(B) the device is below compute capability 2.0.
11878                               </td>
11879                            </tr>
11880                            <tr class="row">
11881                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
11882                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
11883                            </tr>
11884                            <tr class="row">
11885                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
11886                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
11887                            </tr>
11888                            <tr class="row">
11889                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
11890                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
11891                                  <p class="p"></p>
11892                                  <p class="p"></p><samp class="ph codeph">CUSPARSE_MATRIX_TYPE_TRIANGULAR</samp> is not supported if op(B)=B and only <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> is supported otherwise.
11893                               </td>
11894                            </tr>
11895                         </tbody>
11896                      </table>
11897                   </div>
11898                </div>
11899             </div>
11900             <div class="topic concept nested1" id="cusparse-lt-t-gt-csrsmanalysis"><a name="cusparse-lt-t-gt-csrsmanalysis" shape="rect">
11901                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csrsmanalysis" name="cusparse-lt-t-gt-csrsmanalysis" shape="rect">8.3.&nbsp;cusparse&lt;t&gt;csrsm_analysis</a></h3>
11902                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
11903 cusparseScsrsm_analysis(cusparseHandle_t handle, 
11904                         cusparseOperation_t transA, 
11905                         int m, int nnz, 
11906                         const cusparseMatDescr_t descrA, 
11907                         const float           *csrValA, 
11908                         const int *csrRowPtrA, const int *csrColIndA, 
11909                         cusparseSolveAnalysisInfo_t info)
11910 cusparseStatus_t 
11911 cusparseDcsrsm_analysis(cusparseHandle_t handle, 
11912                         cusparseOperation_t transA, 
11913                         int m, int nnz, 
11914                         const cusparseMatDescr_t descrA, 
11915                         const double          *csrValA, 
11916                         const int *csrRowPtrA, const int *csrColIndA, 
11917                         cusparseSolveAnalysisInfo_t info)
11918 cusparseStatus_t 
11919 cusparseCcsrsm_analysis(cusparseHandle_t handle, 
11920                         cusparseOperation_t transA, 
11921                         int m, int nnz, 
11922                         const cusparseMatDescr_t descrA, 
11923                         const cuComplex       *csrValA, 
11924                         const int *csrRowPtrA, const int *csrColIndA, 
11925                         cusparseSolveAnalysisInfo_t info)
11926 cusparseStatus_t 
11927 cusparseZcsrsm_analysis(cusparseHandle_t handle, 
11928                         cusparseOperation_t transA, 
11929                         int m, int nnz, 
11930                         const cusparseMatDescr_t descrA, 
11931                         const cuDoubleComplex *csrValA, 
11932                         const int *csrRowPtrA, const int *csrColIndA, 
11933                         cusparseSolveAnalysisInfo_t info) </pre><p class="p">This function performs the analysis phase of the solution of a sparse triangular linear system</p>
11934                   <div class="tablenoborder">
11935                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
11936                         <tbody class="tbody">
11937                            <tr class="row">
11938                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
11939                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
11940                                     <mrow class="MJX-TeXAtom-ORD">
11941                                        <mrow class="MJX-TeXAtom-ORD">
11942                                           <mtext>op</mtext>
11943                                        </mrow>
11944                                     </mrow>
11945                                     <mo stretchy="false">(</mo>
11946                                     <mi>A</mi>
11947                                     <mo stretchy="false">)</mo>
11948                                     <mo>∗</mo>
11949                                     <mrow class="MJX-TeXAtom-ORD">
11950                                        <mrow class="MJX-TeXAtom-ORD">
11951                                           <mtext>Y</mtext>
11952                                        </mrow>
11953                                     </mrow>
11954                                     <mo>=</mo>
11955                                     <mi>α</mi>
11956                                     <mo>∗</mo>
11957                                     <mrow class="MJX-TeXAtom-ORD">
11958                                        <mrow class="MJX-TeXAtom-ORD">
11959                                           <mtext>X</mtext>
11960                                        </mrow>
11961                                     </mrow>
11962                                  </math>
11963                               </td>
11964                            </tr>
11965                         </tbody>
11966                      </table>
11967                   </div>
11968                   <p class="p">with multiple right-hand-sides, where 
11969                      <math xmlns="http://www.w3.org/1998/Math/MathML">
11970                         <mi>A</mi>
11971                      </math> is <samp class="ph codeph">m×m</samp> sparse matrix (that is defined in CSR storage format by the three arrays <samp class="ph codeph">csrValA</samp>, <samp class="ph codeph">csrRowPtrA</samp>, and <samp class="ph codeph">csrColIndA</samp>), 
11972                      
11973                      
11974                      <math xmlns="http://www.w3.org/1998/Math/MathML">
11975                         <mi>X</mi>
11976                         <mtext>&nbsp;and&nbsp;</mtext>
11977                         <mi>Y</mi>
11978                      </math>
11979                      
11980                      are the right-hand-side and the solution dense matrices, 
11981                      <math xmlns="http://www.w3.org/1998/Math/MathML">
11982                         <mi>α</mi>
11983                      </math> is a scalar, and
11984                   </p>
11985                   <math xmlns="http://www.w3.org/1998/Math/MathML">
11986                      <mrow class="MJX-TeXAtom-ORD">
11987                         <mrow class="MJX-TeXAtom-ORD">
11988                            <mtext>op</mtext>
11989                         </mrow>
11990                      </mrow>
11991                      <mo stretchy="false">(</mo>
11992                      <mi>A</mi>
11993                      <mo stretchy="false">)</mo>
11994                      <mo>=</mo>
11995                      <mfenced open="{" close="">
11996                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
11997                            <mtr>
11998                               <mtd>
11999                                  <mi>A</mi>
12000                               </mtd>
12001                               <mtd>
12002                                  <mtext>if trans == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
12003                               </mtd>
12004                            </mtr>
12005                            <mtr>
12006                               <mtd>
12007                                  <msup>
12008                                     <mi>A</mi>
12009                                     <mi>T</mi>
12010                                  </msup>
12011                               </mtd>
12012                               <mtd>
12013                                  <mtext>if trans == CUSPARSE_OPERATION_TRANSPOSE</mtext>
12014                               </mtd>
12015                            </mtr>
12016                            <mtr>
12017                               <mtd>
12018                                  <msup>
12019                                     <mi>A</mi>
12020                                     <mi>H</mi>
12021                                  </msup>
12022                               </mtd>
12023                               <mtd>
12024                                  <mtext>if trans == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</mtext>
12025                               </mtd>
12026                            </mtr>
12027                         </mtable>
12028                      </mfenced>
12029                   </math>
12030                   <p class="p">It is expected that this function will be executed only once for a given matrix and a particular operation type.</p>
12031                   <p class="p">This function requires significant amount of extra storage that is proportional to the matrix size. It is executed asynchronously
12032                      with respect to the host and it may return control to the application on the host before the result is ready.
12033                   </p>
12034                   <div class="tablenoborder">
12035                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
12036                            <tr class="row">
12037                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
12038                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
12039                            </tr>
12040                            <tr class="row">
12041                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">transA</samp></td>
12042                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
12043                                                 
12044                                                 
12045                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12046                                     <mrow class="MJX-TeXAtom-ORD">
12047                                        <mrow class="MJX-TeXAtom-ORD">
12048                                           <mtext>op</mtext>
12049                                        </mrow>
12050                                     </mrow>
12051                                     <mo stretchy="false">(</mo>
12052                                     <mi>A</mi>
12053                                     <mo stretchy="false">)</mo>
12054                                  </math>
12055                               </td>
12056                            </tr>
12057                            <tr class="row">
12058                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
12059                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
12060                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12061                                     <mi>A</mi>
12062                                  </math>.
12063                               </td>
12064                            </tr>
12065                            <tr class="row">
12066                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
12067                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero elements of matrix 
12068                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12069                                     <mi>A</mi>
12070                                  </math>.
12071                               </td>
12072                            </tr>
12073                            <tr class="row">
12074                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
12075                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
12076                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12077                                     <mi>A</mi>
12078                                  </math>. The supported matrix types are <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_TRIANGULAR</samp> and <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>, while the supported diagonal types are <samp class="ph codeph">CUSPARSE_DIAG_TYPE_UNIT</samp> and <samp class="ph codeph">CUSPARSE_DIAG_TYPE_NON_UNIT</samp>.
12079                               </td>
12080                            </tr>
12081                            <tr class="row">
12082                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
12083                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
12084                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12085                                     <mo stretchy="false">(</mo>
12086                                     <mo>=</mo>
12087                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12088                                     <mo>-</mo>
12089                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12090                                     <mo stretchy="false">)</mo>
12091                                  </math>
12092                                         non-zero elements of matrix 
12093                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12094                                     <mi>A</mi>
12095                                  </math>.
12096                               </td>
12097                            </tr>
12098                            <tr class="row">
12099                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
12100                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12101                                     <mo>+</mo>
12102                                     <mn>1</mn>
12103                                  </math>
12104                                                 
12105                                         elements that contains the start of every row and the end of the last row plus one.
12106                               </td>
12107                            </tr>
12108                            <tr class="row">
12109                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
12110                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
12111                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12112                                     <mo stretchy="false">(</mo>
12113                                     <mo>=</mo>
12114                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12115                                     <mo>-</mo>
12116                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12117                                     <mo stretchy="false">)</mo>
12118                                  </math>
12119                                         column indices of the non-zero elements of matrix 
12120                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12121                                     <mi>A</mi>
12122                                  </math>.
12123                               </td>
12124                            </tr>
12125                            <tr class="row">
12126                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info </samp></td>
12127                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">structure initialized using <samp class="ph codeph">cusparseCreateSolveAnalysisInfo</samp>.
12128                               </td>
12129                            </tr>
12130                         </tbody>
12131                      </table>
12132                   </div>
12133                   <div class="tablenoborder">
12134                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
12135                            <tr class="row">
12136                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
12137                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">structure filled with information collected during the analysis phase (that should be passed to the solve phase unchanged).</td>
12138                            </tr>
12139                         </tbody>
12140                      </table>
12141                   </div>
12142                   <div class="tablenoborder">
12143                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
12144                            <tr class="row">
12145                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
12146                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
12147                            </tr>
12148                            <tr class="row">
12149                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
12150                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
12151                            </tr>
12152                            <tr class="row">
12153                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
12154                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
12155                            </tr>
12156                            <tr class="row">
12157                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
12158                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,nnz&lt;0</samp>).
12159                               </td>
12160                            </tr>
12161                            <tr class="row">
12162                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
12163                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
12164                            </tr>
12165                            <tr class="row">
12166                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
12167                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
12168                            </tr>
12169                            <tr class="row">
12170                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
12171                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
12172                            </tr>
12173                            <tr class="row">
12174                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
12175                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
12176                                  <p class="p"></p>
12177                                  <p class="p"></p>
12178                                  the matrix type is not supported.
12179                               </td>
12180                            </tr>
12181                         </tbody>
12182                      </table>
12183                   </div>
12184                </div>
12185             </div>
12186             <div class="topic concept nested1" id="cusparse-lt-t-gt-csrsmsolve"><a name="cusparse-lt-t-gt-csrsmsolve" shape="rect">
12187                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csrsmsolve" name="cusparse-lt-t-gt-csrsmsolve" shape="rect">8.4.&nbsp;cusparse&lt;t&gt;csrsm_solve</a></h3>
12188                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
12189 cusparseScsrsm_solve(cusparseHandle_t handle, 
12190                      cusparseOperation_t transA, 
12191                      int m, int n, const float *alpha, 
12192                      const cusparseMatDescr_t descrA, 
12193                      const float           *csrValA, 
12194                      const int *csrRowPtrA, const int *csrColIndA, 
12195                      cusparseSolveAnalysisInfo_t info, 
12196                      const float           *X, int ldx,
12197                      float           *Y, int ldy)
12198 cusparseStatus_t 
12199 cusparseDcsrsm_solve(cusparseHandle_t handle, 
12200                      cusparseOperation_t transA, 
12201                      int m, int n, const double *alpha, 
12202                      const cusparseMatDescr_t descrA, 
12203                      const double          *csrValA, 
12204                      const int *csrRowPtrA, const int *csrColIndA, 
12205                      cusparseSolveAnalysisInfo_t info, 
12206                      const double          *X, int ldx,
12207                      double          *Y, int ldy)
12208 cusparseStatus_t 
12209 cusparseCcsrsm_solve(cusparseHandle_t handle, 
12210                      cusparseOperation_t transA, 
12211                      int m, int n, const cuComplex *alpha, 
12212                      const cusparseMatDescr_t descrA, 
12213                      const cuComplex       *csrValA, 
12214                      const int *csrRowPtrA, const int *csrColIndA, 
12215                      cusparseSolveAnalysisInfo_t info, 
12216                      const cuComplex       *X, int ldx,
12217                      cuComplex       *Y, int ldy)
12218 cusparseStatus_t 
12219 cusparseZcsrsm_solve(cusparseHandle_t handle, 
12220                      cusparseOperation_t transA, 
12221                      int m, int n, const cuDoubleComplex *alpha, 
12222                      const cusparseMatDescr_t descrA, 
12223                      const cuDoubleComplex *csrValA, 
12224                      const int *csrRowPtrA, const int *csrColIndA, 
12225                      cusparseSolveAnalysisInfo_t info, 
12226                      const cuDoubleComplex *X, int ldx,
12227                      cuDoubleComplex *Y, int ldy)</pre><p class="p">This function performs the solve phase of the solution of a sparse triangular linear system</p>
12228                   <div class="tablenoborder">
12229                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
12230                         <tbody class="tbody">
12231                            <tr class="row">
12232                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
12233                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12234                                     <mrow class="MJX-TeXAtom-ORD">
12235                                        <mrow class="MJX-TeXAtom-ORD">
12236                                           <mtext>op</mtext>
12237                                        </mrow>
12238                                     </mrow>
12239                                     <mo stretchy="false">(</mo>
12240                                     <mi>A</mi>
12241                                     <mo stretchy="false">)</mo>
12242                                     <mo>∗</mo>
12243                                     <mrow class="MJX-TeXAtom-ORD">
12244                                        <mrow class="MJX-TeXAtom-ORD">
12245                                           <mtext>Y</mtext>
12246                                        </mrow>
12247                                     </mrow>
12248                                     <mo>=</mo>
12249                                     <mi>α</mi>
12250                                     <mo>∗</mo>
12251                                     <mrow class="MJX-TeXAtom-ORD">
12252                                        <mrow class="MJX-TeXAtom-ORD">
12253                                           <mtext>X</mtext>
12254                                        </mrow>
12255                                     </mrow>
12256                                  </math>
12257                               </td>
12258                            </tr>
12259                         </tbody>
12260                      </table>
12261                   </div>
12262                   <p class="p">with multiple right-hand-sides, where 
12263                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12264                         <mi>A</mi>
12265                      </math> is <samp class="ph codeph">m×n</samp> sparse matrix (that is defined in CSR storage format by the three arrays <samp class="ph codeph">csrValA</samp>, <samp class="ph codeph">csrRowPtrA</samp>, and <samp class="ph codeph">csrColIndA</samp>), 
12266                      
12267                      
12268                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12269                         <mi>X</mi>
12270                         <mtext>&nbsp;and&nbsp;</mtext>
12271                         <mi>Y</mi>
12272                      </math>
12273                      
12274                      are the right-hand-side and the solution dense matrices, 
12275                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12276                         <mi>α</mi>
12277                      </math> is a scalar, and
12278                   </p>
12279                   <math xmlns="http://www.w3.org/1998/Math/MathML">
12280                      <mrow class="MJX-TeXAtom-ORD">
12281                         <mrow class="MJX-TeXAtom-ORD">
12282                            <mtext>op</mtext>
12283                         </mrow>
12284                      </mrow>
12285                      <mo stretchy="false">(</mo>
12286                      <mi>A</mi>
12287                      <mo stretchy="false">)</mo>
12288                      <mo>=</mo>
12289                      <mfenced open="{" close="">
12290                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
12291                            <mtr>
12292                               <mtd>
12293                                  <mi>A</mi>
12294                               </mtd>
12295                               <mtd>
12296                                  <mtext>if trans == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
12297                               </mtd>
12298                            </mtr>
12299                            <mtr>
12300                               <mtd>
12301                                  <msup>
12302                                     <mi>A</mi>
12303                                     <mi>T</mi>
12304                                  </msup>
12305                               </mtd>
12306                               <mtd>
12307                                  <mtext>if trans == CUSPARSE_OPERATION_TRANSPOSE</mtext>
12308                               </mtd>
12309                            </mtr>
12310                            <mtr>
12311                               <mtd>
12312                                  <msup>
12313                                     <mi>A</mi>
12314                                     <mi>H</mi>
12315                                  </msup>
12316                               </mtd>
12317                               <mtd>
12318                                  <mtext>if trans == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</mtext>
12319                               </mtd>
12320                            </mtr>
12321                         </mtable>
12322                      </mfenced>
12323                   </math>
12324                   <p class="p">This function may be executed multiple times for a given matrix and a particular operation type.</p>
12325                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
12326                      to the application on the host before the result is ready.
12327                   </p>
12328                   <div class="tablenoborder">
12329                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
12330                            <tr class="row">
12331                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
12332                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
12333                            </tr>
12334                            <tr class="row">
12335                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">transA</samp></td>
12336                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
12337                                                 
12338                                                 
12339                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12340                                     <mrow class="MJX-TeXAtom-ORD">
12341                                        <mrow class="MJX-TeXAtom-ORD">
12342                                           <mtext>op</mtext>
12343                                        </mrow>
12344                                     </mrow>
12345                                     <mo stretchy="false">(</mo>
12346                                     <mi>A</mi>
12347                                     <mo stretchy="false">)</mo>
12348                                  </math>
12349                               </td>
12350                            </tr>
12351                            <tr class="row">
12352                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
12353                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows and columns of matrix 
12354                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12355                                     <mi>A</mi>
12356                                  </math>.
12357                               </td>
12358                            </tr>
12359                            <tr class="row">
12360                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
12361                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
12362                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12363                                     <mi>X</mi>
12364                                  </math> and 
12365                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12366                                     <mi>Y</mi>
12367                                  </math>.
12368                               </td>
12369                            </tr>
12370                            <tr class="row">
12371                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">alpha</samp></td>
12372                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication.</td>
12373                            </tr>
12374                            <tr class="row">
12375                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
12376                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
12377                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12378                                     <mi>A</mi>
12379                                  </math>. The supported matrix types are <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_TRIANGULAR</samp> and <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>, while the supported diagonal types are <samp class="ph codeph">CUSPARSE_DIAG_TYPE_UNIT</samp> and <samp class="ph codeph">CUSPARSE_DIAG_TYPE_NON_UNIT</samp>.
12380                               </td>
12381                            </tr>
12382                            <tr class="row">
12383                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
12384                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
12385                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12386                                     <mo stretchy="false">(</mo>
12387                                     <mo>=</mo>
12388                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12389                                     <mo>-</mo>
12390                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12391                                     <mo stretchy="false">)</mo>
12392                                  </math>
12393                                         non-zero elements of matrix 
12394                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12395                                     <mi>A</mi>
12396                                  </math>.
12397                               </td>
12398                            </tr>
12399                            <tr class="row">
12400                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
12401                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12402                                     <mo>+</mo>
12403                                     <mn>1</mn>
12404                                  </math>
12405                                                 
12406                                         elements that contains the start of every row and the end of the last row plus one.
12407                               </td>
12408                            </tr>
12409                            <tr class="row">
12410                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
12411                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
12412                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12413                                     <mo stretchy="false">(</mo>
12414                                     <mo>=</mo>
12415                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12416                                     <mo>-</mo>
12417                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12418                                     <mo stretchy="false">)</mo>
12419                                  </math>
12420                                         column indices of the non-zero elements of matrix 
12421                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12422                                     <mi>A</mi>
12423                                  </math>.
12424                               </td>
12425                            </tr>
12426                            <tr class="row">
12427                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info </samp></td>
12428                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">structure with information collected during the analysis phase (that should be passed to the solve phase unchanged).</td>
12429                            </tr>
12430                            <tr class="row">
12431                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">X</samp></td>
12432                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; right-hand-side array of dimensions <samp class="ph codeph">(ldx, n)</samp>.
12433                               </td>
12434                            </tr>
12435                            <tr class="row">
12436                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">ldx</samp></td>
12437                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of <samp class="ph codeph">X</samp>. (that is ≥
12438                                                 
12439                                                 
12440                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12441                                     <mo movablelimits="true">max</mo>
12442                                     <mrow class="MJX-TeXAtom-ORD">
12443                                        <mrow class="MJX-TeXAtom-ORD">
12444                                           <mtext>(1, m)</mtext>
12445                                        </mrow>
12446                                     </mrow>
12447                                  </math>
12448                                                 
12449                                         ).
12450                               </td>
12451                            </tr>
12452                         </tbody>
12453                      </table>
12454                   </div>
12455                   <div class="tablenoborder">
12456                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
12457                            <tr class="row">
12458                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">Y</samp></td>
12459                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; solution array of dimensions <samp class="ph codeph">(ldy, n)</samp>.
12460                               </td>
12461                            </tr>
12462                            <tr class="row">
12463                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">ldy</samp></td>
12464                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of <samp class="ph codeph">Y</samp>. (that is ≥
12465                                                 
12466                                                 
12467                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12468                                     <mo movablelimits="true">max</mo>
12469                                     <mrow class="MJX-TeXAtom-ORD">
12470                                        <mrow class="MJX-TeXAtom-ORD">
12471                                           <mtext>(1, m)</mtext>
12472                                        </mrow>
12473                                     </mrow>
12474                                  </math>
12475                                                 
12476                                         ).
12477                               </td>
12478                            </tr>
12479                         </tbody>
12480                      </table>
12481                   </div>
12482                   <div class="tablenoborder">
12483                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
12484                            <tr class="row">
12485                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
12486                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
12487                            </tr>
12488                            <tr class="row">
12489                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
12490                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
12491                            </tr>
12492                            <tr class="row">
12493                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
12494                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m&lt;0</samp>).
12495                               </td>
12496                            </tr>
12497                            <tr class="row">
12498                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
12499                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
12500                            </tr>
12501                            <tr class="row">
12502                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MAPPING_ERROR</samp></td>
12503                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the texture binding failed.</td>
12504                            </tr>
12505                            <tr class="row">
12506                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
12507                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
12508                            </tr>
12509                            <tr class="row">
12510                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
12511                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
12512                            </tr>
12513                            <tr class="row">
12514                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
12515                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
12516                                  <p class="p"></p>
12517                                  <p class="p"></p>
12518                                  the matrix type is not supported.
12519                               </td>
12520                            </tr>
12521                         </tbody>
12522                      </table>
12523                   </div>
12524                </div>
12525             </div>
12526          </div>
12527          <div class="topic concept nested0" id="cusparse-extra-function-reference"><a name="cusparse-extra-function-reference" shape="rect">
12528                <!-- --></a><h2 class="title topictitle1"><a href="#cusparse-extra-function-reference" name="cusparse-extra-function-reference" shape="rect">9.&nbsp;CUSPARSE Extra Function Reference</a></h2>
12529             <div class="body conbody">
12530                <p class="p">This chapter describes the extra routines used to manipulate sparse matrices.</p>
12531             </div>
12532             <div class="topic concept nested1" id="cusparse-lt-t-gt-csrgeam"><a name="cusparse-lt-t-gt-csrgeam" shape="rect">
12533                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csrgeam" name="cusparse-lt-t-gt-csrgeam" shape="rect">9.1.&nbsp;cusparse&lt;t&gt;csrgeam</a></h3>
12534                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
12535 cusparseXcsrgeamNnz(cusparseHandle_t handle, int m, int n,
12536     const cusparseMatDescr_t descrA, int nnzA,
12537     const int *csrRowPtrA, const int *csrColIndA,
12538     const cusparseMatDescr_t descrB, int nnzB,
12539     const int *csrRowPtrB, const int *csrColIndB,
12540     const cusparseMatDescr_t descrC, int *csrRowPtrC,
12541     int *nnzTotalDevHostPtr)
12542 cusparseStatus_t
12543 cusparseScsrgeam(cusparseHandle_t handle, int m, int n,
12544     const float *alpha,
12545     const cusparseMatDescr_t descrA, int nnzA,
12546     const float *csrValA, const int *csrRowPtrA, const int *csrColIndA,
12547     const float *beta,
12548     const cusparseMatDescr_t descrB, int nnzB,
12549     const float *csrValB, const int *csrRowPtrB, const int *csrColIndB,
12550     const cusparseMatDescr_t descrC,
12551     float *csrValC, int *csrRowPtrC, int *csrColIndC)
12552 cusparseStatus_t
12553 cusparseDcsrgeam(cusparseHandle_t handle, int m, int n,
12554     const double *alpha,
12555     const cusparseMatDescr_t descrA, int nnzA,
12556     const double *csrValA, const int *csrRowPtrA, const int *csrColIndA,
12557     const double *beta,
12558     const cusparseMatDescr_t descrB, int nnzB,
12559     const double *csrValB, const int *csrRowPtrB, const int *csrColIndB,
12560     const cusparseMatDescr_t descrC,
12561     double *csrValC, int *csrRowPtrC, int *csrColIndC)
12562 cusparseStatus_t
12563 cusparseCcsrgeam(cusparseHandle_t handle, int m, int n,
12564     const cuComplex *alpha,
12565     const cusparseMatDescr_t descrA, int nnzA,
12566     const cuComplex *csrValA, const int *csrRowPtrA, const int *csrColIndA,
12567     const cuComplex *beta,
12568     const cusparseMatDescr_t descrB, int nnzB,
12569     const cuComplex *csrValB, const int *csrRowPtrB, const int *csrColIndB,
12570     const cusparseMatDescr_t descrC,
12571     cuComplex *csrValC, int *csrRowPtrC, int *csrColIndC)
12572 cusparseStatus_t
12573 cusparseZcsrgeam(cusparseHandle_t handle, int m, int n,
12574     const cuDoubleComplex *alpha,
12575     const cusparseMatDescr_t descrA, int nnzA,
12576     const cuDoubleComplex *csrValA, const int *csrRowPtrA, 
12577     const int *csrColIndA,
12578     const cuDoubleComplex *beta,
12579     const cusparseMatDescr_t descrB, int nnzB,
12580     const cuDoubleComplex *csrValB, const int *csrRowPtrB, 
12581     const int *csrColIndB,
12582     const cusparseMatDescr_t descrC,
12583     cuDoubleComplex *csrValC, int *csrRowPtrC, int *csrColIndC)</pre><p class="p">This function performs following matrix-matrix operation</p>
12584                   <div class="tablenoborder">
12585                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
12586                         <tbody class="tbody">
12587                            <tr class="row">
12588                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
12589                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12590                                     <mi>C</mi>
12591                                     <mo>=</mo>
12592                                     <mi>α</mi>
12593                                     <mo>∗</mo>
12594                                     <mi>A</mi>
12595                                     <mo>+</mo>
12596                                     <mi>β</mi>
12597                                     <mo>∗</mo>
12598                                     <mi>B</mi>
12599                                  </math>
12600                               </td>
12601                            </tr>
12602                         </tbody>
12603                      </table>
12604                   </div>
12605                   <p class="p">where 
12606                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12607                         <mi>A</mi>
12608                      </math>, 
12609                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12610                         <mi>B</mi>
12611                      </math> and 
12612                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12613                         <mi>C</mi>
12614                      </math> are <samp class="ph codeph">m×n</samp> sparse matrices (defined in CSR storage format by the three arrays <samp class="ph codeph">csrValA|csrValB|csrValC</samp>, <samp class="ph codeph">csrRowPtrA|csrRowPtrB|csrRowPtrC</samp>, and <samp class="ph codeph">csrColIndA|csrColIndB|csrcolIndC</samp> respectively), and
12615                      
12616                      
12617                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12618                         <mi>α</mi>
12619                         <mtext>&nbsp;and&nbsp;</mtext>
12620                         <mi>β</mi>
12621                      </math>
12622                      
12623                      are scalars. Since 
12624                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12625                         <mi>A</mi>
12626                      </math> and 
12627                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12628                         <mi>B</mi>
12629                      </math> have different sparsity patterns, CUSPARSE adopts two-step approach to complete sparse matrix C. In the first step, the user
12630                      allocates <samp class="ph codeph">csrRowPtrC</samp> of <samp class="ph codeph">m+1</samp>elements and uses function cusparseXcsrgeamNnz to determine <samp class="ph codeph">csrRowPtrC</samp> and total number of nonzero elements. In the second step, the user gathers nnzC (number of non-zero elements of matrix C)
12631                      from either <samp class="ph codeph">(nnzC=*nnzTotalDevHostPtr)</samp> or <samp class="ph codeph">(nnzC=csrRowPtrC(m)-csrRowPtrC(0))</samp> 
12632                      and allocates <samp class="ph codeph">csrValC, csrColIndC</samp> of nnzC elements respectively, then finally calls function cusparse[S|D|C|Z]csrgeam to complete matrix C.
12633                   </p>
12634                   <p class="p">The general procedure is as follows:</p><pre xml:space="preserve"><span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> baseC, nnzC;
12635 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// nnzTotalDevHostPtr points to host memory</span>
12636 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *nnzTotalDevHostPtr = &amp;nnzC;
12637 cusparseSetPointerNode(handle, CUSPARSE_POINTER_MODE_HOST);
12638 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;csrRowPtrC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>)*(m+1));
12639 cusparseXcsrgeamNnz(handle, m, n,
12640         descrA, nnzA, csrRowPtrA, csrColIndA,
12641         descrB, nnzB, csrRowPtrB, csrColIndB,
12642         descrC, csrRowPtrC, nnzTotalDevHostPtr);
12643 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (NULL != nnzTotalDevHostPtr){
12644     nnzC = *nnzTotalDevHostPtr;
12645 }<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">else</span>{
12646     cudaMemcpy(&amp;nnzC , csrRowPtrC+m, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>), cudaMemcpyDeviceToHost);
12647     cudaMemcpy(&amp;baseC, csrRowPtrC  , <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>), cudaMemcpyDeviceToHost);
12648     nnzC -= baseC;
12649 }
12650 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;csrColIndC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>)*nnzC);
12651 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;csrValC   , <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">float</span>)*nnzC);
12652 cusparseScsrgeam(handle, m, n,
12653         alpha,
12654         descrA, nnzA,
12655         csrValA, csrRowPtrA, csrColIndA,
12656         beta,
12657         descrB, nnzB,
12658         csrValB, csrRowPtrB, csrColIndB,
12659         descrC,
12660         csrValC, csrRowPtrC, csrColIndC);</pre><p class="p">Several comments on csrgeam:</p>
12661                   <p class="p">1. CUSPARSE does not support other three combinations, NT, TN and TT. In order to do any one of above three, the user should
12662                      use the routine csr2csc to convert 
12663                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12664                         <mi>A</mi>
12665                      </math>|
12666                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12667                         <mi>B</mi>
12668                      </math> to 
12669                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12670                         <msup>
12671                            <mi>A</mi>
12672                            <mi>T</mi>
12673                         </msup>
12674                      </math>|
12675                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12676                         <msup>
12677                            <mi>B</mi>
12678                            <mi>T</mi>
12679                         </msup>
12680                      </math>.
12681                   </p>
12682                   <p class="p">2. Only <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> is supported, if either 
12683                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12684                         <mi>A</mi>
12685                      </math> or 
12686                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12687                         <mi>B</mi>
12688                      </math> is symmetric or hermitian, then the user must extend the matrix to a full one and reconfigure MatrixType field of descriptor
12689                      to <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>.
12690                   </p>
12691                   <p class="p">3. If the sparsity pattern of matrix C is known, then the user can skip the call to function cusparseXcsrgeamNnz. For example,
12692                      suppose that the user has an iterative algorithm which would  update 
12693                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12694                         <mi>A</mi>
12695                      </math> and 
12696                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12697                         <mi>B</mi>
12698                      </math> iteratively but keep sparsity patterns. The user can call function cusparseXcsrgeamNnz once to setup sparsity pattern of
12699                      C, then call function cusparse[S|D|C|Z]geam only for each iteration.
12700                   </p>
12701                   <p class="p">4. The pointers, alpha and beta, must be valid.</p>
12702                   <p class="p">5. CUSPARSE would not consider special case when alpha or beta is zero. The sparsity pattern of C is independent of value
12703                      of alpha and beta. If the user want
12704                      
12705                      
12706                      <math xmlns="http://www.w3.org/1998/Math/MathML">
12707                         <mi>C</mi>
12708                         <mo>=</mo>
12709                         <mn>0</mn>
12710                         <mo>×</mo>
12711                         <mi>A</mi>
12712                         <mo>+</mo>
12713                         <mn>1</mn>
12714                         <mo>×</mo>
12715                         <msup>
12716                            <mi>B</mi>
12717                            <mrow class="MJX-TeXAtom-ORD">
12718                               <mi>T</mi>
12719                            </mrow>
12720                         </msup>
12721                      </math>
12722                      
12723                      , then csr2csc is better than csrgeam.
12724                   </p>
12725                   <div class="tablenoborder">
12726                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
12727                            <tr class="row">
12728                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
12729                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
12730                            </tr>
12731                            <tr class="row">
12732                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
12733                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of sparse matrix <samp class="ph codeph">A,B,C</samp>.
12734                               </td>
12735                            </tr>
12736                            <tr class="row">
12737                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
12738                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of sparse matrix <samp class="ph codeph">A,B,C</samp>.
12739                               </td>
12740                            </tr>
12741                            <tr class="row">
12742                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">alpha</samp></td>
12743                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication.</td>
12744                            </tr>
12745                            <tr class="row">
12746                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
12747                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
12748                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12749                                     <mi>A</mi>
12750                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> only.
12751                               </td>
12752                            </tr>
12753                            <tr class="row">
12754                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzA</samp></td>
12755                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero elements of sparse matrix <samp class="ph codeph">A</samp>.
12756                               </td>
12757                            </tr>
12758                            <tr class="row">
12759                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
12760                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
12761                                                 <samp class="ph codeph">nnzA</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12762                                     <mo stretchy="false">(</mo>
12763                                     <mo>=</mo>
12764                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12765                                     <mo>-</mo>
12766                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12767                                     <mo stretchy="false">)</mo>
12768                                  </math>
12769                                         non-zero elements of matrix 
12770                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12771                                     <mi>A</mi>
12772                                  </math>.
12773                               </td>
12774                            </tr>
12775                            <tr class="row">
12776                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
12777                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12778                                     <mo>+</mo>
12779                                     <mn>1</mn>
12780                                  </math>
12781                                                 
12782                                         elements that contains the start of every row and the end of the last row plus one.
12783                               </td>
12784                            </tr>
12785                            <tr class="row">
12786                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
12787                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
12788                                                 <samp class="ph codeph">nnzA</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12789                                     <mo stretchy="false">(</mo>
12790                                     <mo>=</mo>
12791                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12792                                     <mo>-</mo>
12793                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12794                                     <mo stretchy="false">)</mo>
12795                                  </math>
12796                                         column indices of the non-zero elements of matrix 
12797                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12798                                     <mi>A</mi>
12799                                  </math>.
12800                               </td>
12801                            </tr>
12802                            <tr class="row">
12803                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">beta</samp></td>
12804                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; scalar used for multiplication. If <samp class="ph codeph">beta</samp> is zero, <samp class="ph codeph">y</samp> does not have to be a valid input.
12805                               </td>
12806                            </tr>
12807                            <tr class="row">
12808                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrB</samp></td>
12809                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
12810                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12811                                     <mi>B</mi>
12812                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> only.
12813                               </td>
12814                            </tr>
12815                            <tr class="row">
12816                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzB</samp></td>
12817                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero elements of sparse matrix <samp class="ph codeph">B</samp>.
12818                               </td>
12819                            </tr>
12820                            <tr class="row">
12821                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValB</samp></td>
12822                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
12823                                                 <samp class="ph codeph">nnzB</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12824                                     <mo stretchy="false">(</mo>
12825                                     <mo>=</mo>
12826                                  </math><samp class="ph codeph">csrRowPtrB(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12827                                     <mo>-</mo>
12828                                  </math><samp class="ph codeph">csrRowPtrB(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12829                                     <mo stretchy="false">)</mo>
12830                                  </math>
12831                                         non-zero elements of matrix 
12832                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12833                                     <mi>B</mi>
12834                                  </math>.
12835                               </td>
12836                            </tr>
12837                            <tr class="row">
12838                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrB</samp></td>
12839                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12840                                     <mo>+</mo>
12841                                     <mn>1</mn>
12842                                  </math>
12843                                                 
12844                                         elements that contains the start of every row and the end of the last row plus one.
12845                               </td>
12846                            </tr>
12847                            <tr class="row">
12848                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndB</samp></td>
12849                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
12850                                                 <samp class="ph codeph">nnzB</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12851                                     <mo stretchy="false">(</mo>
12852                                     <mo>=</mo>
12853                                  </math><samp class="ph codeph">csrRowPtrB(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12854                                     <mo>-</mo>
12855                                  </math><samp class="ph codeph">csrRowPtrB(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12856                                     <mo stretchy="false">)</mo>
12857                                  </math>
12858                                         column indices of the non-zero elements of matrix 
12859                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12860                                     <mi>B</mi>
12861                                  </math>.
12862                               </td>
12863                            </tr>
12864                            <tr class="row">
12865                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrC</samp></td>
12866                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
12867                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12868                                     <mi>C</mi>
12869                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> only.
12870                               </td>
12871                            </tr>
12872                         </tbody>
12873                      </table>
12874                   </div>
12875                   <div class="tablenoborder">
12876                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
12877                            <tr class="row">
12878                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValC</samp></td>
12879                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
12880                                                 <samp class="ph codeph">nnzC</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12881                                     <mo stretchy="false">(</mo>
12882                                     <mo>=</mo>
12883                                  </math><samp class="ph codeph">csrRowPtrC(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12884                                     <mo>-</mo>
12885                                  </math><samp class="ph codeph">csrRowPtrC(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12886                                     <mo stretchy="false">)</mo>
12887                                  </math>
12888                                         non-zero elements of matrix 
12889                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12890                                     <mi>C</mi>
12891                                  </math>.
12892                               </td>
12893                            </tr>
12894                            <tr class="row">
12895                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrC</samp></td>
12896                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12897                                     <mo>+</mo>
12898                                     <mn>1</mn>
12899                                  </math>
12900                                                 
12901                                         elements that contains the start of every row and the end of the last row plus one.
12902                               </td>
12903                            </tr>
12904                            <tr class="row">
12905                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndC</samp></td>
12906                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
12907                                                 <samp class="ph codeph">nnzC</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12908                                     <mo stretchy="false">(</mo>
12909                                     <mo>=</mo>
12910                                  </math><samp class="ph codeph">csrRowPtrC(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12911                                     <mo>-</mo>
12912                                  </math><samp class="ph codeph">csrRowPtrC(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
12913                                     <mo stretchy="false">)</mo>
12914                                  </math>
12915                                         column indices of the non-zero elements of matrix 
12916                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
12917                                     <mi>C</mi>
12918                                  </math>.
12919                               </td>
12920                            </tr>
12921                            <tr class="row">
12922                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzTotalDevHostPtr</samp></td>
12923                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">total number of nonzero elements in device or host memory.It is equal to <samp class="ph codeph">(csrRowPtrC(m)-csrRowPtrC(0))</samp>.
12924                               </td>
12925                            </tr>
12926                         </tbody>
12927                      </table>
12928                   </div>
12929                   <div class="tablenoborder">
12930                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
12931                            <tr class="row">
12932                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
12933                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
12934                            </tr>
12935                            <tr class="row">
12936                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
12937                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
12938                            </tr>
12939                            <tr class="row">
12940                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
12941                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
12942                            </tr>
12943                            <tr class="row">
12944                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
12945                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n,nnz&lt;0</samp>, <samp class="ph codeph">IndexBase</samp> of <samp class="ph codeph">descrA,descrB,descrC</samp> is not base-0 or base-1, or alpha or beta is nil )).
12946                               </td>
12947                            </tr>
12948                            <tr class="row">
12949                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
12950                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
12951                            </tr>
12952                            <tr class="row">
12953                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
12954                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
12955                            </tr>
12956                            <tr class="row">
12957                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
12958                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
12959                                  <p class="p"></p>
12960                                  <p class="p"></p>
12961                                  the matrix type is not supported.
12962                               </td>
12963                            </tr>
12964                            <tr class="row">
12965                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
12966                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
12967                            </tr>
12968                         </tbody>
12969                      </table>
12970                   </div>
12971                </div>
12972             </div>
12973             <div class="topic concept nested1" id="cusparse-lt-t-gt-csrgemm"><a name="cusparse-lt-t-gt-csrgemm" shape="rect">
12974                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csrgemm" name="cusparse-lt-t-gt-csrgemm" shape="rect">9.2.&nbsp;cusparse&lt;t&gt;csrgemm</a></h3>
12975                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
12976 cusparseXcsrgemmNnz(cusparseHandle_t handle,
12977     cusparseOperation_t transA, cusparseOperation_t transB,
12978     int m, int n, int k,
12979     const cusparseMatDescr_t descrA, const int nnzA,                                     
12980     const int *csrRowPtrA, const int *csrColIndA,
12981     const cusparseMatDescr_t descrB, const int nnzB,                                     
12982     const int *csrRowPtrB, const int *csrColIndB,
12983     const cusparseMatDescr_t descrC, int *csrRowPtrC,
12984     int *nnzTotalDevHostPtr ) 
12985 cusparseStatus_t
12986 cusparseScsrgemm(cusparseHandle_t handle,
12987     cusparseOperation_t transA, cusparseOperation_t transB,
12988     int m, int n, int k,
12989     const cusparseMatDescr_t descrA, const int nnzA,
12990     const float *csrValA,
12991     const int *csrRowPtrA, const int *csrColIndA,
12992     const cusparseMatDescr_t descrB, const int nnzB,                                     
12993     const float *csrValB, 
12994     const int *csrRowPtrB, const int *csrColIndB,
12995     const cusparseMatDescr_t descrC,
12996     float *csrValC,
12997     const int *csrRowPtrC, int *csrColIndC )
12998 cusparseStatus_t
12999 cusparseDcsrgemm(cusparseHandle_t handle,
13000     cusparseOperation_t transA, cusparseOperation_t transB,
13001     int m, int n, int k,
13002     const cusparseMatDescr_t descrA, const int nnzA,
13003     const double *csrValA,
13004     const int *csrRowPtrA, const int *csrColIndA,
13005     const cusparseMatDescr_t descrB, const int nnzB,                            
13006     const double *csrValB, 
13007     const int *csrRowPtrB, const int *csrColIndB,
13008     const cusparseMatDescr_t descrC,
13009     double *csrValC,
13010     const int *csrRowPtrC, int *csrColIndC )
13011 cusparseStatus_t
13012 cusparseCcsrgemm(cusparseHandle_t handle,
13013     cusparseOperation_t transA, cusparseOperation_t transB,
13014     int m, int n, int k,
13015     const cusparseMatDescr_t descrA, const int nnzA,
13016     const cuComplex *csrValA,
13017     const int *csrRowPtrA, const int *csrColIndA,
13018     const cusparseMatDescr_t descrB, const int nnzB,                            
13019     const cuComplex *csrValB, 
13020     const int *csrRowPtrB, const int *csrColIndB,
13021     const cusparseMatDescr_t descrC,
13022     cuComplex *csrValC,
13023     const int *csrRowPtrC, int *csrColIndC )
13024 cusparseStatus_t
13025 cusparseZcsrgemm(cusparseHandle_t handle,
13026     cusparseOperation_t transA, cusparseOperation_t transB,
13027     int m, int n, int k,
13028     const cusparseMatDescr_t descrA, const int nnzA,
13029     const cuDoubleComplex *csrValA,
13030     const int *csrRowPtrA, const int *csrColIndA,
13031     const cusparseMatDescr_t descrB, const int nnzB,     
13032     const cuDoubleComplex *csrValB,
13033     const int *csrRowPtrB, const int *csrColIndB,
13034     const cusparseMatDescr_t descrC,
13035     cuDoubleComplex *csrValC,
13036     const int *csrRowPtrC, int *csrColIndC )</pre><p class="p">This function performs following matrix-matrix operation</p>
13037                   <div class="tablenoborder">
13038                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
13039                         <tbody class="tbody">
13040                            <tr class="row">
13041                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
13042                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13043                                     <mrow class="MJX-TeXAtom-ORD">
13044                                        <mrow class="MJX-TeXAtom-ORD">
13045                                           <mtext>C</mtext>
13046                                        </mrow>
13047                                     </mrow>
13048                                     <mo>=</mo>
13049                                     <mrow class="MJX-TeXAtom-ORD">
13050                                        <mrow class="MJX-TeXAtom-ORD">
13051                                           <mtext>op</mtext>
13052                                        </mrow>
13053                                     </mrow>
13054                                     <mo stretchy="false">(</mo>
13055                                     <mi>A</mi>
13056                                     <mo stretchy="false">)</mo>
13057                                     <mo>∗</mo>
13058                                     <mrow class="MJX-TeXAtom-ORD">
13059                                        <mrow class="MJX-TeXAtom-ORD">
13060                                           <mtext>op</mtext>
13061                                        </mrow>
13062                                     </mrow>
13063                                     <mo stretchy="false">(</mo>
13064                                     <mi>B</mi>
13065                                     <mo stretchy="false">)</mo>
13066                                  </math>
13067                               </td>
13068                            </tr>
13069                         </tbody>
13070                      </table>
13071                   </div>
13072                   <p class="p">where 
13073                         
13074                                 
13075                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13076                         <mrow class="MJX-TeXAtom-ORD">
13077                            <mrow class="MJX-TeXAtom-ORD">
13078                               <mtext>op</mtext>
13079                            </mrow>
13080                         </mrow>
13081                         <mo stretchy="false">(</mo>
13082                         <mi>A</mi>
13083                         <mo stretchy="false">)</mo>
13084                      </math>
13085                         
13086                      , 
13087                         
13088                                 
13089                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13090                         <mrow class="MJX-TeXAtom-ORD">
13091                            <mrow class="MJX-TeXAtom-ORD">
13092                               <mtext>op</mtext>
13093                            </mrow>
13094                         </mrow>
13095                         <mo stretchy="false">(</mo>
13096                         <mi>B</mi>
13097                         <mo stretchy="false">)</mo>
13098                      </math>
13099                         
13100                      and 
13101                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13102                         <mi>C</mi>
13103                      </math> are <samp class="ph codeph">m×k</samp>, <samp class="ph codeph">k×n</samp>, and <samp class="ph codeph">m×n</samp> sparse matrices (defined in CSR storage format by the three arrays <samp class="ph codeph">csrValA|csrValB|csrValC</samp>, <samp class="ph codeph">csrRowPtrA|csrRowPtrB|csrRowPtrC</samp>, and <samp class="ph codeph">csrColIndA|csrColIndB|csrcolIndC</samp> respectively. The operation is defined by
13104                   </p>
13105                   <math xmlns="http://www.w3.org/1998/Math/MathML">
13106                      <mrow class="MJX-TeXAtom-ORD">
13107                         <mrow class="MJX-TeXAtom-ORD">
13108                            <mtext>op</mtext>
13109                         </mrow>
13110                      </mrow>
13111                      <mo stretchy="false">(</mo>
13112                      <mi>A</mi>
13113                      <mo stretchy="false">)</mo>
13114                      <mo>=</mo>
13115                      <mfenced open="{" close="">
13116                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
13117                            <mtr>
13118                               <mtd>
13119                                  <mi>A</mi>
13120                               </mtd>
13121                               <mtd>
13122                                  <mtext>if trans == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
13123                               </mtd>
13124                            </mtr>
13125                            <mtr>
13126                               <mtd>
13127                                  <msup>
13128                                     <mi>A</mi>
13129                                     <mrow class="MJX-TeXAtom-ORD">
13130                                        <mi>T</mi>
13131                                     </mrow>
13132                                  </msup>
13133                               </mtd>
13134                               <mtd>
13135                                  <mtext>if trans != CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
13136                               </mtd>
13137                            </mtr>
13138                         </mtable>
13139                      </mfenced>
13140                   </math>
13141                   <p class="p">There are four versions, NN, NT, TN and TT. NN stands for
13142                         
13143                                 
13144                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13145                         <mi>C</mi>
13146                         <mo>=</mo>
13147                         <mi>A</mi>
13148                         <mo>*</mo>
13149                         <mi>B</mi>
13150                      </math>
13151                         
13152                      , NT stands for
13153                         
13154                                 
13155                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13156                         <mi>C</mi>
13157                         <mo>=</mo>
13158                         <mi>A</mi>
13159                         <mo>*</mo>
13160                         <msup>
13161                            <mi>B</mi>
13162                            <mi>T</mi>
13163                         </msup>
13164                      </math>
13165                         
13166                      , TN stands for
13167                         
13168                                 
13169                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13170                         <mi>C</mi>
13171                         <mo>=</mo>
13172                         <msup>
13173                            <mi>A</mi>
13174                            <mi>T</mi>
13175                         </msup>
13176                         <mo>*</mo>
13177                         <mi>B</mi>
13178                      </math>
13179                         
13180                      and TT stands for
13181                         
13182                                 
13183                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13184                         <mi>C</mi>
13185                         <mo>=</mo>
13186                         <msup>
13187                            <mi>A</mi>
13188                            <mi>T</mi>
13189                         </msup>
13190                         <mo>*</mo>
13191                         <msup>
13192                            <mi>A</mi>
13193                            <mi>T</mi>
13194                         </msup>
13195                      </math>
13196                         
13197                      .
13198                   </p>
13199                   <p class="p">CUSPARSE adopts two-step approach to complete sparse matrix . In the first step, the user allocates <samp class="ph codeph">csrRowPtrC</samp> of <samp class="ph codeph">m+1</samp> elements and uses function cusparseXcsrgemmNnz to determine <samp class="ph codeph">csrRowPtrC</samp> and total number of nonzero elements. In the second step, the user gathers nnzC (number of nonzero elements of matrix C)
13200                      from either <samp class="ph codeph">(nnzC=*nnzTotalDevHostPtr)</samp> or <samp class="ph codeph">(nnzC=csrRowPtrC(m)-csrRowPtrC(0))</samp>
13201                      and allocates <samp class="ph codeph">csrValC, csrColIndC</samp> of nnzC elements respectively, then finally calls function cusparse[S|D|C|Z]csrgemm to complete matrix C.
13202                   </p>
13203                   <p class="p">The general procedure is as follows:</p><pre xml:space="preserve"><span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> baseC, nnzC;
13204 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// nnzTotalDevHostPtr points to host memory</span>
13205 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *nnzTotalDevHostPtr = &amp;nnzC;
13206 cusparseSetPointerMode(handle, CUSPARSE_POINTER_MODE_HOST);
13207 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;csrRowPtrC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>)*(m+1));
13208 cusparseXcsrgemmNnz(handle, m, n, k, 
13209         descrA, nnzA, csrRowPtrA, csrColIndA,
13210         descrB, nnzB, csrRowPtrB, csrColIndB,
13211         descrC, csrRowPtrC, nnzTotalDevHostPtr );
13212 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (NULL != nnzTotalDevHostPtr){
13213     nnzC = *nnzTotalDevHostPtr;
13214 }<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">else</span>{
13215     cudaMemcpy(&amp;nnzC , csrRowPtrC+m, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>), cudaMemcpyDeviceToHost);
13216     cudaMemcpy(&amp;baseC, csrRowPtrC  , <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>), cudaMemcpyDeviceToHost);
13217     nnzC -= baseC;
13218 }
13219 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;csrColIndC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>)*nnzC);
13220 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;csrValC   , <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">float</span>)*nnzC);
13221 cusparseScsrgemm(handle, transA, transB, m, n, k,
13222         descrA, nnzA,
13223         csrValA, csrRowPtrA, csrColIndA,
13224         descrB, nnzB,
13225         csrValB, csrRowPtrB, csrColIndB,
13226         descrC,
13227         csrValC, csrRowPtrC, csrColIndC);</pre><p class="p">Several comments on csrgemm:</p>
13228                   <p class="p">1. Only NN version is implemented. For NT version, matrix 
13229                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13230                         <mi>B</mi>
13231                      </math> is converted to 
13232                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13233                         <msup>
13234                            <mi>B</mi>
13235                            <mi>T</mi>
13236                         </msup>
13237                      </math> by csr2csc and call NN version. The same technique applies to TN and TT. The csr2csc routine would allocate working space
13238                      implicitly, if the user needs memory management, then NN version is better.
13239                   </p>
13240                   <p class="p">2. NN version needs working space of size <samp class="ph codeph">nnzA</samp> integers at least.
13241                   </p>
13242                   <p class="p">3. Only <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> is supported, if either 
13243                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13244                         <mi>A</mi>
13245                      </math> or 
13246                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13247                         <mi>B</mi>
13248                      </math> is symmetric or hermitian, then the user must extend the matrix to a full one and reconfigure MatrixType field of descriptor
13249                      to <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>.
13250                   </p>
13251                   <p class="p">4. Only support devices of compute capability 2.0 or above.</p>
13252                   <div class="tablenoborder">
13253                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
13254                            <tr class="row">
13255                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
13256                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
13257                            </tr>
13258                            <tr class="row">
13259                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">transA</samp></td>
13260                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
13261                                                 
13262                                                 
13263                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13264                                     <mrow class="MJX-TeXAtom-ORD">
13265                                        <mrow class="MJX-TeXAtom-ORD">
13266                                           <mtext>op</mtext>
13267                                        </mrow>
13268                                     </mrow>
13269                                     <mo stretchy="false">(</mo>
13270                                     <mi>A</mi>
13271                                     <mo stretchy="false">)</mo>
13272                                  </math>
13273                               </td>
13274                            </tr>
13275                            <tr class="row">
13276                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">transB</samp></td>
13277                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation
13278                                                 
13279                                                 
13280                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13281                                     <mrow class="MJX-TeXAtom-ORD">
13282                                        <mrow class="MJX-TeXAtom-ORD">
13283                                           <mtext>op</mtext>
13284                                        </mrow>
13285                                     </mrow>
13286                                     <mo stretchy="false">(</mo>
13287                                     <mi>B</mi>
13288                                     <mo stretchy="false">)</mo>
13289                                  </math>
13290                               </td>
13291                            </tr>
13292                            <tr class="row">
13293                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
13294                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of sparse matrix
13295                                                 
13296                                                 
13297                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13298                                     <mrow class="MJX-TeXAtom-ORD">
13299                                        <mrow class="MJX-TeXAtom-ORD">
13300                                           <mtext>op</mtext>
13301                                        </mrow>
13302                                     </mrow>
13303                                     <mo stretchy="false">(</mo>
13304                                     <mi>A</mi>
13305                                     <mo stretchy="false">)</mo>
13306                                  </math>
13307                                                 
13308                                         and <samp class="ph codeph">C</samp>.
13309                               </td>
13310                            </tr>
13311                            <tr class="row">
13312                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
13313                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of sparse matrix
13314                                                 
13315                                                 
13316                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13317                                     <mrow class="MJX-TeXAtom-ORD">
13318                                        <mrow class="MJX-TeXAtom-ORD">
13319                                           <mtext>op</mtext>
13320                                        </mrow>
13321                                     </mrow>
13322                                     <mo stretchy="false">(</mo>
13323                                     <mi>B</mi>
13324                                     <mo stretchy="false">)</mo>
13325                                  </math>
13326                                                 
13327                                         and <samp class="ph codeph">C</samp>.
13328                               </td>
13329                            </tr>
13330                            <tr class="row">
13331                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">k</samp></td>
13332                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns/rows of sparse matrix
13333                                                 
13334                                                 
13335                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13336                                     <mrow class="MJX-TeXAtom-ORD">
13337                                        <mrow class="MJX-TeXAtom-ORD">
13338                                           <mtext>op</mtext>
13339                                        </mrow>
13340                                     </mrow>
13341                                     <mo stretchy="false">(</mo>
13342                                     <mi>A</mi>
13343                                     <mo stretchy="false">)</mo>
13344                                  </math>
13345                                                 
13346                                         /
13347                                                 
13348                                                 
13349                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13350                                     <mrow class="MJX-TeXAtom-ORD">
13351                                        <mrow class="MJX-TeXAtom-ORD">
13352                                           <mtext>op</mtext>
13353                                        </mrow>
13354                                     </mrow>
13355                                     <mo stretchy="false">(</mo>
13356                                     <mi>B</mi>
13357                                     <mo stretchy="false">)</mo>
13358                                  </math>
13359                                                 
13360                                         .
13361                               </td>
13362                            </tr>
13363                            <tr class="row">
13364                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
13365                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
13366                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13367                                     <mi>A</mi>
13368                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> only.
13369                               </td>
13370                            </tr>
13371                            <tr class="row">
13372                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzA</samp></td>
13373                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero elements of sparse matrix <samp class="ph codeph">A</samp>.
13374                               </td>
13375                            </tr>
13376                            <tr class="row">
13377                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
13378                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
13379                                                 <samp class="ph codeph">nnzA</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13380                                     <mo stretchy="false">(</mo>
13381                                     <mo>=</mo>
13382                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13383                                     <mo>-</mo>
13384                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13385                                     <mo stretchy="false">)</mo>
13386                                  </math>
13387                                         non-zero elements of matrix 
13388                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13389                                     <mi>A</mi>
13390                                  </math>.
13391                               </td>
13392                            </tr>
13393                            <tr class="row">
13394                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
13395                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
13396                                                 
13397                                                 
13398                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13399                                     <mrow class="MJX-TeXAtom-ORD">
13400                                        <mover>
13401                                           <mi>m</mi>
13402                                           <mo stretchy="false">˜</mo>
13403                                        </mover>
13404                                     </mrow>
13405                                     <mo>+</mo>
13406                                     <mn>1</mn>
13407                                  </math>
13408                                                 
13409                                         elements that contains the start of every row and the end of the last row plus one.
13410                                                 
13411                                                         
13412                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13413                                     <mrow class="MJX-TeXAtom-ORD">
13414                                        <mover>
13415                                           <mi>m</mi>
13416                                           <mo stretchy="false">˜</mo>
13417                                        </mover>
13418                                     </mrow>
13419                                     <mo>=</mo>
13420                                     <mi>m</mi>
13421                                  </math>
13422                                                                 
13423                                         if <samp class="ph codeph">transA</samp> == <samp class="ph codeph">CUSPARSE_OPERATION_NON_TRANSPOSE</samp>, otherwise 
13424                                                 
13425                                                         
13426                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13427                                     <mrow class="MJX-TeXAtom-ORD">
13428                                        <mover>
13429                                           <mi>m</mi>
13430                                           <mo stretchy="false">˜</mo>
13431                                        </mover>
13432                                     </mrow>
13433                                     <mo>=</mo>
13434                                     <mi>k</mi>
13435                                  </math>
13436                                                 
13437                                         .
13438                               </td>
13439                            </tr>
13440                            <tr class="row">
13441                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
13442                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
13443                                                 <samp class="ph codeph">nnzA</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13444                                     <mo stretchy="false">(</mo>
13445                                     <mo>=</mo>
13446                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13447                                     <mo>-</mo>
13448                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13449                                     <mo stretchy="false">)</mo>
13450                                  </math>
13451                                         column indices of the non-zero elements of matrix 
13452                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13453                                     <mi>A</mi>
13454                                  </math>.
13455                               </td>
13456                            </tr>
13457                            <tr class="row">
13458                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrB</samp></td>
13459                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
13460                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13461                                     <mi>B</mi>
13462                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> only.
13463                               </td>
13464                            </tr>
13465                            <tr class="row">
13466                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzB</samp></td>
13467                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero elements of sparse matrix <samp class="ph codeph">B</samp>.
13468                               </td>
13469                            </tr>
13470                            <tr class="row">
13471                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValB</samp></td>
13472                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
13473                                                 <samp class="ph codeph">nnzB</samp>
13474                                         non-zero elements of matrix 
13475                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13476                                     <mi>B</mi>
13477                                  </math>.
13478                               </td>
13479                            </tr>
13480                            <tr class="row">
13481                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrB</samp></td>
13482                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
13483                                                 
13484                                                 
13485                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13486                                     <mrow class="MJX-TeXAtom-ORD">
13487                                        <mover>
13488                                           <mi>k</mi>
13489                                           <mo stretchy="false">˜</mo>
13490                                        </mover>
13491                                     </mrow>
13492                                     <mo>+</mo>
13493                                     <mn>1</mn>
13494                                  </math>
13495                                                 
13496                                         elements that contains the start of every row and the end of the last row plus one.
13497                                                 
13498                                                         
13499                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13500                                     <mrow class="MJX-TeXAtom-ORD">
13501                                        <mover>
13502                                           <mi>k</mi>
13503                                           <mo stretchy="false">˜</mo>
13504                                        </mover>
13505                                     </mrow>
13506                                     <mo>=</mo>
13507                                     <mi>k</mi>
13508                                  </math>
13509                                                 
13510                                         if <samp class="ph codeph">transB == CUSPARSE_OPERATION_NON_TRANSPOSE</samp>, otherwise
13511                                                 
13512                                                         
13513                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13514                                     <mrow class="MJX-TeXAtom-ORD">
13515                                        <mover>
13516                                           <mi>k</mi>
13517                                           <mo stretchy="false">˜</mo>
13518                                        </mover>
13519                                     </mrow>
13520                                     <mo>=</mo>
13521                                     <mi>n</mi>
13522                                  </math>
13523                               </td>
13524                            </tr>
13525                            <tr class="row">
13526                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndB</samp></td>
13527                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of       <samp class="ph codeph">nnzB</samp> column indices of the non-zero elements of matrix 
13528                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13529                                     <mi>B</mi>
13530                                  </math>.
13531                               </td>
13532                            </tr>
13533                            <tr class="row">
13534                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrC</samp></td>
13535                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
13536                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13537                                     <mi>C</mi>
13538                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp> only.
13539                               </td>
13540                            </tr>
13541                         </tbody>
13542                      </table>
13543                   </div>
13544                   <div class="tablenoborder">
13545                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
13546                            <tr class="row">
13547                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValC</samp></td>
13548                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
13549                                                 <samp class="ph codeph">nnzC</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13550                                     <mo stretchy="false">(</mo>
13551                                     <mo>=</mo>
13552                                  </math><samp class="ph codeph">csrRowPtrC(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13553                                     <mo>-</mo>
13554                                  </math><samp class="ph codeph">csrRowPtrC(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13555                                     <mo stretchy="false">)</mo>
13556                                  </math>
13557                                         non-zero elements of matrix 
13558                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13559                                     <mi>C</mi>
13560                                  </math>.
13561                               </td>
13562                            </tr>
13563                            <tr class="row">
13564                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrC</samp></td>
13565                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every row and the end of the last row plus one.
13566                               </td>
13567                            </tr>
13568                            <tr class="row">
13569                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndC</samp></td>
13570                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
13571                                                 <samp class="ph codeph">nnzC</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13572                                     <mo stretchy="false">(</mo>
13573                                     <mo>=</mo>
13574                                  </math><samp class="ph codeph">csrRowPtrC(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13575                                     <mo>-</mo>
13576                                  </math><samp class="ph codeph">csrRowPtrC(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13577                                     <mo stretchy="false">)</mo>
13578                                  </math>
13579                                         column indices of the non-zero elements of matrix 
13580                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13581                                     <mi>C</mi>
13582                                  </math>.
13583                               </td>
13584                            </tr>
13585                            <tr class="row">
13586                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzTotalDevHostPtr</samp></td>
13587                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">total number of nonzero elements in device or host memory. It is equal to <samp class="ph codeph">(csrRowPtrC(m)-csrRowPtrC(0))</samp>.
13588                               </td>
13589                            </tr>
13590                         </tbody>
13591                      </table>
13592                   </div>
13593                   <div class="tablenoborder">
13594                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
13595                            <tr class="row">
13596                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
13597                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
13598                            </tr>
13599                            <tr class="row">
13600                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
13601                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
13602                            </tr>
13603                            <tr class="row">
13604                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
13605                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
13606                            </tr>
13607                            <tr class="row">
13608                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
13609                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n,k&lt;0</samp>, <samp class="ph codeph">IndexBase</samp> of <samp class="ph codeph">descrA,descrB,descrC</samp> is not base-0 or base-1, or alpha or beta is nil )).
13610                               </td>
13611                            </tr>
13612                            <tr class="row">
13613                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
13614                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
13615                            </tr>
13616                            <tr class="row">
13617                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
13618                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
13619                            </tr>
13620                            <tr class="row">
13621                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
13622                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
13623                                  <p class="p"></p>
13624                                  <p class="p"></p>
13625                                  the matrix type is not supported.
13626                               </td>
13627                            </tr>
13628                            <tr class="row">
13629                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
13630                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
13631                            </tr>
13632                         </tbody>
13633                      </table>
13634                   </div>
13635                </div>
13636             </div>
13637          </div>
13638          <div class="topic concept nested0" id="cusparse-preconditioners-reference"><a name="cusparse-preconditioners-reference" shape="rect">
13639                <!-- --></a><h2 class="title topictitle1"><a href="#cusparse-preconditioners-reference" name="cusparse-preconditioners-reference" shape="rect">10.&nbsp;CUSPARSE Preconditioners Reference</a></h2>
13640             <div class="body conbody">
13641                <p class="p">This chapter describes the routines that implement different preconditioners.</p>
13642                <p class="p">In particular, the incomplete factorizations are implemented in two phases. First, during the analysis phase, the sparse triangular
13643                   matrix is analyzed to determine the dependencies between its elements by calling the appropriate <samp class="ph codeph">csrsv_analysis()</samp> function. The analysis is specific to the sparsity pattern of the given matrix and selected <samp class="ph codeph">cusparseOperation_t</samp> type. The information from the analysis phase is stored in the parameter of type <samp class="ph codeph">cusparseSolveAnalysisInfo_t</samp> that has been initialized previously with a call to <samp class="ph codeph">cusparseCreateSolveAnalysisInfo()</samp>.
13644                </p>
13645                <p class="p">Second, during the numerical factorization phase, the given coefficient matrix is factorized using the information stored
13646                   in the <samp class="ph codeph">cusparseSolveAnalysisInfo_t</samp> parameter by calling the appropriate <samp class="ph codeph">csrilu0</samp> or <samp class="ph codeph">csric0</samp> function.
13647                </p>
13648                <p class="p">The analysis phase is shared across the sparse triangular solve and the incomplete factorization and must be performed only
13649                   once. While the resulting information can be passed to the numerical factorization and the sparse triangular solve multiple
13650                   times.
13651                </p>
13652                <p class="p">Finally, once the incomplete factorization and all the sparse triangular solves have completed, the opaque data structure
13653                   pointed to by the <samp class="ph codeph">cusparseSolveAnalysisInfo_t</samp> parameter can be released by calling <samp class="ph codeph">cusparseDestroySolveAnalysisInfo()</samp>.
13654                </p>
13655             </div>
13656             <div class="topic concept nested1" id="cusparse-lt-t-gt-csric0"><a name="cusparse-lt-t-gt-csric0" shape="rect">
13657                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csric0" name="cusparse-lt-t-gt-csric0" shape="rect">10.1.&nbsp;cusparse&lt;t&gt;csric0</a></h3>
13658                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
13659 cusparseScsric0(cusparseHandle_t handle, cusparseOperation_t trans, 
13660                 int m, const cusparseMatDescr_t descrA, 
13661                 float           *csrValM,
13662                 const int *csrRowPtrA, const int *csrColIndA, 
13663                 cusparseSolveAnalysisInfo_t info)
13664 cusparseStatus_t 
13665 cusparseDcsric0(cusparseHandle_t handle, cusparseOperation_t trans, 
13666                 int m, const cusparseMatDescr_t descrA, 
13667                 double          *csrValM,
13668                 const int *csrRowPtrA, const int *csrColIndA,  
13669                 cusparseSolveAnalysisInfo_t info)
13670 cusparseStatus_t 
13671 cusparseCcsric0(cusparseHandle_t handle, cusparseOperation_t trans, 
13672                 int m, const cusparseMatDescr_t descrA, 
13673                 cuComplex       *csrValM,
13674                 const int *csrRowPtrA, const int *csrColIndA,  
13675                 cusparseSolveAnalysisInfo_t info)
13676 cusparseStatus_t 
13677 cusparseZcsric0(cusparseHandle_t handle, cusparseOperation_t trans, 
13678                 int m, const cusparseMatDescr_t descrA, 
13679                 cuDoubleComplex *csrValM,
13680                 const int *csrRowPtrA, const int *csrColIndA,  
13681                 cusparseSolveAnalysisInfo_t info)</pre><p class="p">This function computes the incomplete-Cholesky factorization with 
13682                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13683                         <mn>0</mn>
13684                      </math> fill-in and no pivoting
13685                   </p>
13686                   <div class="tablenoborder">
13687                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
13688                         <tbody class="tbody">
13689                            <tr class="row">
13690                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
13691                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13692                                     <mi>o</mi>
13693                                     <mi>p</mi>
13694                                     <mo stretchy="false">(</mo>
13695                                     <mi>A</mi>
13696                                     <mo stretchy="false">)</mo>
13697                                     <mo>≈</mo>
13698                                     <msup>
13699                                        <mi>R</mi>
13700                                        <mrow class="MJX-TeXAtom-ORD">
13701                                           <mi>T</mi>
13702                                        </mrow>
13703                                     </msup>
13704                                     <mi>R</mi>
13705                                  </math>
13706                               </td>
13707                            </tr>
13708                         </tbody>
13709                      </table>
13710                   </div>
13711                   <p class="p">where 
13712                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13713                         <mi>A</mi>
13714                      </math> is <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13715                         <mo>×</mo>
13716                      </math><samp class="ph codeph">m</samp> Hermitian/symmetric positive definite sparse matrix (that is defined in CSR storage format by the three arrays <samp class="ph codeph">csrValM</samp>, <samp class="ph codeph">csrRowPtrA</samp> and <samp class="ph codeph">csrColIndA</samp>) and
13717                   </p>
13718                   <math xmlns="http://www.w3.org/1998/Math/MathML">
13719                      <mrow class="MJX-TeXAtom-ORD">
13720                         <mrow class="MJX-TeXAtom-ORD">
13721                            <mtext>op</mtext>
13722                         </mrow>
13723                      </mrow>
13724                      <mo stretchy="false">(</mo>
13725                      <mi>A</mi>
13726                      <mo stretchy="false">)</mo>
13727                      <mo>=</mo>
13728                      <mfenced open="{" close="">
13729                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
13730                            <mtr>
13731                               <mtd>
13732                                  <mi>A</mi>
13733                               </mtd>
13734                               <mtd>
13735                                  <mtext>if trans == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
13736                               </mtd>
13737                            </mtr>
13738                            <mtr>
13739                               <mtd>
13740                                  <msup>
13741                                     <mi>A</mi>
13742                                     <mi>T</mi>
13743                                  </msup>
13744                               </mtd>
13745                               <mtd>
13746                                  <mtext>if trans == CUSPARSE_OPERATION_TRANSPOSE</mtext>
13747                               </mtd>
13748                            </mtr>
13749                            <mtr>
13750                               <mtd>
13751                                  <msup>
13752                                     <mi>A</mi>
13753                                     <mi>H</mi>
13754                                  </msup>
13755                               </mtd>
13756                               <mtd>
13757                                  <mtext>if trans == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</mtext>
13758                               </mtd>
13759                            </mtr>
13760                         </mtable>
13761                      </mfenced>
13762                   </math>
13763                   <p class="p">Notice that only a lower or upper Hermitian/symmetric part of the matrix 
13764                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13765                         <mi>A</mi>
13766                      </math> is actually stored. It is overwritten by the lower or upper triangular factor 
13767                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13768                         <msup>
13769                            <mi>R</mi>
13770                            <mi>T</mi>
13771                         </msup>
13772                      </math> or 
13773                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13774                         <mi>R</mi>
13775                      </math>
13776                      , respectively.
13777                   </p>
13778                   <p class="p">A call to this routine must be preceeded by a call to the <samp class="ph codeph">csrsv_analysis</samp> routine.
13779                   </p>
13780                   <p class="p">This function requires some extra storage. It is executed asynchronously with respect to the host and it may return control
13781                      to the application on the host before the result is ready.
13782                   </p>
13783                   <div class="tablenoborder">
13784                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
13785                            <tr class="row">
13786                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
13787                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
13788                            </tr>
13789                            <tr class="row">
13790                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">trans</samp></td>
13791                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation <samp class="ph codeph">op</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13792                                     <mo stretchy="false">(</mo>
13793                                     <mi>A</mi>
13794                                     <mo stretchy="false">)</mo>
13795                                  </math>
13796                               </td>
13797                            </tr>
13798                            <tr class="row">
13799                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
13800                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows and columns of matrix 
13801                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13802                                     <mi>A</mi>
13803                                  </math>.
13804                               </td>
13805                            </tr>
13806                            <tr class="row">
13807                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
13808                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
13809                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13810                                     <mi>A</mi>
13811                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_SYMMETRIC</samp> and <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_HERMITIAN</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
13812                               </td>
13813                            </tr>
13814                            <tr class="row">
13815                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValM</samp></td>
13816                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
13817                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13818                                     <mo stretchy="false">(</mo>
13819                                     <mo>=</mo>
13820                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13821                                     <mo>-</mo>
13822                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13823                                     <mo stretchy="false">)</mo>
13824                                  </math>
13825                                         non-zero elements of matrix 
13826                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13827                                     <mi>A</mi>
13828                                  </math>.
13829                               </td>
13830                            </tr>
13831                            <tr class="row">
13832                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
13833                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13834                                     <mo>+</mo>
13835                                     <mn>1</mn>
13836                                  </math>
13837                                                 
13838                                         elements that contains the start of every row and the end of the last row plus one.
13839                               </td>
13840                            </tr>
13841                            <tr class="row">
13842                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
13843                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
13844                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13845                                     <mo stretchy="false">(</mo>
13846                                     <mo>=</mo>
13847                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13848                                     <mo>-</mo>
13849                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13850                                     <mo stretchy="false">)</mo>
13851                                  </math>
13852                                         column indices of the non-zero elements of matrix 
13853                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13854                                     <mi>A</mi>
13855                                  </math>.
13856                               </td>
13857                            </tr>
13858                            <tr class="row">
13859                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
13860                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">structure with information collected during the analysis phase (that should have been passed to the solve phase unchanged).</td>
13861                            </tr>
13862                         </tbody>
13863                      </table>
13864                   </div>
13865                   <div class="tablenoborder">
13866                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
13867                            <tr class="row">
13868                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValM</samp></td>
13869                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; matrix containg the incomplete-Cholesky lower or upper triangular factor.</td>
13870                            </tr>
13871                         </tbody>
13872                      </table>
13873                   </div>
13874                   <div class="tablenoborder">
13875                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
13876                            <tr class="row">
13877                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
13878                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
13879                            </tr>
13880                            <tr class="row">
13881                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
13882                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
13883                            </tr>
13884                            <tr class="row">
13885                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
13886                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
13887                            </tr>
13888                            <tr class="row">
13889                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
13890                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m&lt;0</samp>).
13891                               </td>
13892                            </tr>
13893                            <tr class="row">
13894                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
13895                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
13896                            </tr>
13897                            <tr class="row">
13898                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
13899                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
13900                            </tr>
13901                            <tr class="row">
13902                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
13903                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
13904                            </tr>
13905                            <tr class="row">
13906                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
13907                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
13908                                  <p class="p"></p>
13909                                  <p class="p"></p>
13910                                  the matrix type is not supported.
13911                               </td>
13912                            </tr>
13913                         </tbody>
13914                      </table>
13915                   </div>
13916                </div>
13917             </div>
13918             <div class="topic concept nested1" id="cusparse-lt-t-gt-csrilu0"><a name="cusparse-lt-t-gt-csrilu0" shape="rect">
13919                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csrilu0" name="cusparse-lt-t-gt-csrilu0" shape="rect">10.2.&nbsp;cusparse&lt;t&gt;csrilu0</a></h3>
13920                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
13921 cusparseScsrilu0(cusparseHandle_t handle, cusparseOperation_t trans, 
13922                  int m, const cusparseMatDescr_t descrA, 
13923                  float           *csrValM,
13924                  const int *csrRowPtrA, const int *csrColIndA, 
13925                  cusparseSolveAnalysisInfo_t info)
13926 cusparseStatus_t 
13927 cusparseDcsrilu0(cusparseHandle_t handle, cusparseOperation_t trans, 
13928                  int m, const cusparseMatDescr_t descrA, 
13929                  double          *csrValM,
13930                  const int *csrRowPtrA, const int *csrColIndA,  
13931                  cusparseSolveAnalysisInfo_t info)
13932 cusparseStatus_t 
13933 cusparseCcsrilu0(cusparseHandle_t handle, cusparseOperation_t trans, 
13934                  int m, const cusparseMatDescr_t descrA, 
13935                  cuComplex       *csrValM,
13936                  const int *csrRowPtrA, const int *csrColIndA,  
13937                  cusparseSolveAnalysisInfo_t info)
13938 cusparseStatus_t 
13939 cusparseZcsrilu0(cusparseHandle_t handle, cusparseOperation_t trans, 
13940                  int m, const cusparseMatDescr_t descrA, 
13941                  cuDoubleComplex *csrValM,
13942                  const int *csrRowPtrA, const int *csrColIndA, 
13943                  cusparseSolveAnalysisInfo_t info)</pre><p class="p">This function computes the incomplete-LU factorization with 
13944                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13945                         <mn>0</mn>
13946                      </math> fill-in and no pivoting
13947                   </p>
13948                   <div class="tablenoborder">
13949                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
13950                         <tbody class="tbody">
13951                            <tr class="row">
13952                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
13953                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
13954                                     <mi>o</mi>
13955                                     <mi>p</mi>
13956                                     <mo stretchy="false">(</mo>
13957                                     <mi>A</mi>
13958                                     <mo stretchy="false">)</mo>
13959                                     <mo>≈</mo>
13960                                     <mi>L</mi>
13961                                     <mi>U</mi>
13962                                  </math>
13963                               </td>
13964                            </tr>
13965                         </tbody>
13966                      </table>
13967                   </div>
13968                   <p class="p">where 
13969                      <math xmlns="http://www.w3.org/1998/Math/MathML">
13970                         <mi>A</mi>
13971                      </math> is <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
13972                         <mo>×</mo>
13973                      </math><samp class="ph codeph">m</samp> sparse matrix (that is defined in CSR storage format by the three arrays <samp class="ph codeph">csrValM</samp>, <samp class="ph codeph">csrRowPtrA</samp> and <samp class="ph codeph">csrColIndA</samp>) and
13974                   </p>
13975                   <math xmlns="http://www.w3.org/1998/Math/MathML">
13976                      <mrow class="MJX-TeXAtom-ORD">
13977                         <mrow class="MJX-TeXAtom-ORD">
13978                            <mtext>op</mtext>
13979                         </mrow>
13980                      </mrow>
13981                      <mo stretchy="false">(</mo>
13982                      <mi>A</mi>
13983                      <mo stretchy="false">)</mo>
13984                      <mo>=</mo>
13985                      <mfenced open="{" close="">
13986                         <mtable columnalign="left left" rowspacing=".1em" columnspacing="1em">
13987                            <mtr>
13988                               <mtd>
13989                                  <mi>A</mi>
13990                               </mtd>
13991                               <mtd>
13992                                  <mtext>if trans == CUSPARSE_OPERATION_NON_TRANSPOSE</mtext>
13993                               </mtd>
13994                            </mtr>
13995                            <mtr>
13996                               <mtd>
13997                                  <msup>
13998                                     <mi>A</mi>
13999                                     <mi>T</mi>
14000                                  </msup>
14001                               </mtd>
14002                               <mtd>
14003                                  <mtext>if trans == CUSPARSE_OPERATION_TRANSPOSE</mtext>
14004                               </mtd>
14005                            </mtr>
14006                            <mtr>
14007                               <mtd>
14008                                  <msup>
14009                                     <mi>A</mi>
14010                                     <mi>H</mi>
14011                                  </msup>
14012                               </mtd>
14013                               <mtd>
14014                                  <mtext>if trans == CUSPARSE_OPERATION_CONJUGATE_TRANSPOSE</mtext>
14015                               </mtd>
14016                            </mtr>
14017                         </mtable>
14018                      </mfenced>
14019                   </math>
14020                   <p class="p">Notice that the diagonal of lower triangular factor 
14021                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14022                         <mi>L</mi>
14023                      </math> is unitary and need not be stored. Therefore the input matrix is ovewritten with the resulting lower and upper triangular
14024                      factor 
14025                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14026                         <mi>L</mi>
14027                      </math> and 
14028                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14029                         <mi>U</mi>
14030                      </math>, respectively.
14031                   </p>
14032                   <p class="p">A call to this routine must be preceeded by a call to the <samp class="ph codeph">csrsv_analysis</samp> routine.
14033                   </p>
14034                   <p class="p">This function requires some extra storage. It is executed asynchronously with respect to the host and it may return control
14035                      to the application on the host before the result is ready.
14036                   </p>
14037                   <div class="tablenoborder">
14038                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
14039                            <tr class="row">
14040                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
14041                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
14042                            </tr>
14043                            <tr class="row">
14044                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">trans</samp></td>
14045                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation <samp class="ph codeph">op</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
14046                                     <mo stretchy="false">(</mo>
14047                                     <mi>A</mi>
14048                                     <mo stretchy="false">)</mo>
14049                                  </math>
14050                               </td>
14051                            </tr>
14052                            <tr class="row">
14053                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
14054                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows and columns of matrix 
14055                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14056                                     <mi>A</mi>
14057                                  </math>.
14058                               </td>
14059                            </tr>
14060                            <tr class="row">
14061                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
14062                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
14063                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14064                                     <mi>A</mi>
14065                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
14066                               </td>
14067                            </tr>
14068                            <tr class="row">
14069                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValM</samp></td>
14070                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
14071                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
14072                                     <mo stretchy="false">(</mo>
14073                                     <mo>=</mo>
14074                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
14075                                     <mo>-</mo>
14076                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
14077                                     <mo stretchy="false">)</mo>
14078                                  </math>
14079                                         non-zero elements of matrix 
14080                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14081                                     <mi>A</mi>
14082                                  </math>.
14083                               </td>
14084                            </tr>
14085                            <tr class="row">
14086                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
14087                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
14088                                     <mo>+</mo>
14089                                     <mn>1</mn>
14090                                  </math>
14091                                                 
14092                                         elements that contains the start of every row and the end of the last row plus one.
14093                               </td>
14094                            </tr>
14095                            <tr class="row">
14096                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
14097                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
14098                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
14099                                     <mo stretchy="false">(</mo>
14100                                     <mo>=</mo>
14101                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
14102                                     <mo>-</mo>
14103                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
14104                                     <mo stretchy="false">)</mo>
14105                                  </math>
14106                                         column indices of the non-zero elements of matrix 
14107                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14108                                     <mi>A</mi>
14109                                  </math>.
14110                               </td>
14111                            </tr>
14112                            <tr class="row">
14113                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">info</samp></td>
14114                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">structure with information collected during the analysis phase (that should have been passed to the solve phase unchanged).</td>
14115                            </tr>
14116                         </tbody>
14117                      </table>
14118                   </div>
14119                   <div class="tablenoborder">
14120                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
14121                            <tr class="row">
14122                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValM</samp></td>
14123                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; matrix containg the incomplete-LU lower and upper triangular factors.</td>
14124                            </tr>
14125                         </tbody>
14126                      </table>
14127                   </div>
14128                   <div class="tablenoborder">
14129                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
14130                            <tr class="row">
14131                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
14132                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
14133                            </tr>
14134                            <tr class="row">
14135                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
14136                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
14137                            </tr>
14138                            <tr class="row">
14139                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
14140                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
14141                            </tr>
14142                            <tr class="row">
14143                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
14144                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m&lt;0</samp>).
14145                               </td>
14146                            </tr>
14147                            <tr class="row">
14148                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
14149                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
14150                            </tr>
14151                            <tr class="row">
14152                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
14153                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
14154                            </tr>
14155                            <tr class="row">
14156                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
14157                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
14158                            </tr>
14159                            <tr class="row">
14160                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
14161                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
14162                                  <p class="p"></p>
14163                                  <p class="p"></p>
14164                                  the matrix type is not supported.
14165                               </td>
14166                            </tr>
14167                         </tbody>
14168                      </table>
14169                   </div>
14170                </div>
14171             </div>
14172             <div class="topic concept nested1" id="cusparse-lt-t-gt-gtsv"><a name="cusparse-lt-t-gt-gtsv" shape="rect">
14173                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-gtsv" name="cusparse-lt-t-gt-gtsv" shape="rect">10.3.&nbsp;cusparse&lt;t&gt;gtsv</a></h3>
14174                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
14175 cusparseSgtsv(cusparseHandle_t handle, int m, int n,        
14176               const float           *dl, const float            *d,   
14177               const float           *du, float *B, int ldb)                                
14178 cusparseStatus_t
14179 cusparseDgtsv(cusparseHandle_t handle, int m, int n,       
14180               const double          *dl, const double           *d,   
14181               const double          *du, double *B, int ldb)
14182 cusparseStatus_t 
14183 cusparseCgtsv(cusparseHandle_t handle, int m, int n,       
14184               const cuComplex       *dl, const cuComplex        *d,  
14185               const cuComplex       *du, cuComplex       *B, int ldb)
14186 cusparseStatus_t 
14187 cusparseZgtsv(cusparseHandle_t handle, int m, int n,       
14188               const cuDoubleComplex *dl, const cuDoubleComplex  *d,  
14189               const cuDoubleComplex *du, cuDoubleComplex *B, int ldb)</pre><p class="p">This function computes the solution of a tridiagonal linear system</p>
14190                   <div class="tablenoborder">
14191                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
14192                         <tbody class="tbody">
14193                            <tr class="row">
14194                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
14195                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14196                                     <mi>A</mi>
14197                                     <mo>∗</mo>
14198                                     <mi>Y</mi>
14199                                     <mo>=</mo>
14200                                     <mi>α</mi>
14201                                     <mo>∗</mo>
14202                                     <mi>X</mi>
14203                                  </math>
14204                               </td>
14205                            </tr>
14206                         </tbody>
14207                      </table>
14208                   </div>
14209                   <p class="p">with multiple right-hand-sides.</p>
14210                   <p class="p">The coefficient matrix 
14211                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14212                         <mi>A</mi>
14213                      </math> of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (<strong class="ph b">ld</strong>), main (<strong class="ph b">d</strong>) and upper (<strong class="ph b">ud</strong>) matrix diagonals, while the right-hand-sides are stored in the dense matrix 
14214                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14215                         <mi>X</mi>
14216                      </math>. Notice that the solutions 
14217                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14218                         <mi>Y</mi>
14219                      </math> overwrite the right-hand-sides 
14220                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14221                         <mi>X</mi>
14222                      </math> on exit.
14223                   </p>
14224                   <p class="p">The routine does perform pivoting, which usually results in more accurate and more stable results than cusparse&lt;t&gt;gtsv_nopivot
14225                      at the expense of some execution time 
14226                   </p>
14227                   <p class="p">This routine requires significant amount of temporary extra storage (<samp class="ph codeph">min(m,8) ×(3+n)×sizeof(&lt;type&gt;)</samp>). It is executed asynchronously with respect to the host and it may return control to the application on the host before
14228                      the result is ready.
14229                   </p>
14230                   <div class="tablenoborder">
14231                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
14232                            <tr class="row">
14233                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
14234                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
14235                            </tr>
14236                            <tr class="row">
14237                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
14238                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the size of the linear system (must be ≥ 3).</td>
14239                            </tr>
14240                            <tr class="row">
14241                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
14242                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of right-hand-sides, columns of matrix <samp class="ph codeph">B</samp>.
14243                               </td>
14244                            </tr>
14245                            <tr class="row">
14246                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">dl</samp></td>
14247                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense array containing the lower diagonal of the tri-diagonal linear system. The first element of each lower diagonal
14248                                  must be zero.
14249                               </td>
14250                            </tr>
14251                            <tr class="row">
14252                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">d</samp></td>
14253                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense array containing the main diagonal of the tri-diagonal linear system.</td>
14254                            </tr>
14255                            <tr class="row">
14256                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">du</samp></td>
14257                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense array containing the upper diagonal of the tri-diagonal linear system. The last element of each upper diagonal
14258                                  must be zero.
14259                               </td>
14260                            </tr>
14261                            <tr class="row">
14262                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">B</samp></td>
14263                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense right-hand-side array of dimensions <samp class="ph codeph">(ldb, n)</samp>.
14264                               </td>
14265                            </tr>
14266                            <tr class="row">
14267                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">ldb</samp></td>
14268                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of <samp class="ph codeph">B</samp>. (that is ≥
14269                                                 
14270                                                 
14271                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14272                                     <mo movablelimits="true">max</mo>
14273                                     <mrow class="MJX-TeXAtom-ORD">
14274                                        <mrow class="MJX-TeXAtom-ORD">
14275                                           <mtext>(1, m))</mtext>
14276                                        </mrow>
14277                                     </mrow>
14278                                  </math>
14279                               </td>
14280                            </tr>
14281                         </tbody>
14282                      </table>
14283                   </div>
14284                   <div class="tablenoborder">
14285                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
14286                            <tr class="row">
14287                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">B</samp></td>
14288                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense solution array of dimensions <samp class="ph codeph">(ldb, n)</samp>.
14289                               </td>
14290                            </tr>
14291                         </tbody>
14292                      </table>
14293                   </div>
14294                   <div class="tablenoborder">
14295                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
14296                            <tr class="row">
14297                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
14298                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
14299                            </tr>
14300                            <tr class="row">
14301                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
14302                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
14303                            </tr>
14304                            <tr class="row">
14305                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
14306                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
14307                            </tr>
14308                            <tr class="row">
14309                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
14310                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m&lt;3, n&lt;0</samp>).
14311                               </td>
14312                            </tr>
14313                            <tr class="row">
14314                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
14315                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
14316                            </tr>
14317                            <tr class="row">
14318                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
14319                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
14320                            </tr>
14321                            <tr class="row">
14322                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
14323                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
14324                            </tr>
14325                            <tr class="row">
14326                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
14327                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
14328                                  <p class="p"></p>
14329                                  <p class="p"></p>
14330                                  the matrix type is not supported.
14331                               </td>
14332                            </tr>
14333                         </tbody>
14334                      </table>
14335                   </div>
14336                </div>
14337             </div>
14338             <div class="topic concept nested1" id="cusparse-lt-t-gt-gtsv_nopivot"><a name="cusparse-lt-t-gt-gtsv_nopivot" shape="rect">
14339                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-gtsv_nopivot" name="cusparse-lt-t-gt-gtsv_nopivot" shape="rect">10.4.&nbsp;cusparse&lt;t&gt;gtsv_nopivot</a></h3>
14340                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
14341 cusparseSgtsv_nopivot(cusparseHandle_t handle, int m, int n,        
14342               const float           *dl, const float            *d,   
14343               const float           *du, float *B, int ldb)                                
14344 cusparseStatus_t
14345 cusparseDgtsv_nopivot(cusparseHandle_t handle, int m, int n,       
14346               const double          *dl, const double           *d,   
14347               const double          *du, double *B, int ldb)
14348 cusparseStatus_t 
14349 cusparseCgtsv_nopivot(cusparseHandle_t handle, int m, int n,       
14350               const cuComplex       *dl, const cuComplex        *d,  
14351               const cuComplex       *du, cuComplex       *B, int ldb)
14352 cusparseStatus_t 
14353 cusparseZgtsv_nopivot(cusparseHandle_t handle, int m, int n,       
14354               const cuDoubleComplex *dl, const cuDoubleComplex  *d,  
14355               const cuDoubleComplex *du, cuDoubleComplex *B, int ldb)</pre><p class="p">This function computes the solution of a tridiagonal linear system</p>
14356                   <div class="tablenoborder">
14357                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
14358                         <tbody class="tbody">
14359                            <tr class="row">
14360                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
14361                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14362                                     <mi>A</mi>
14363                                     <mo>∗</mo>
14364                                     <mi>Y</mi>
14365                                     <mo>=</mo>
14366                                     <mi>α</mi>
14367                                     <mo>∗</mo>
14368                                     <mi>X</mi>
14369                                  </math>
14370                               </td>
14371                            </tr>
14372                         </tbody>
14373                      </table>
14374                   </div>
14375                   <p class="p">with multiple right-hand-sides.</p>
14376                   <p class="p">The coefficient matrix 
14377                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14378                         <mi>A</mi>
14379                      </math> of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (<strong class="ph b">ld</strong>), main (<strong class="ph b">d</strong>) and upper (<strong class="ph b">ud</strong>) matrix diagonals, while the right-hand-sides are stored in the dense matrix 
14380                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14381                         <mi>X</mi>
14382                      </math>. Notice that the solutions 
14383                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14384                         <mi>Y</mi>
14385                      </math> overwrite the right-hand-sides 
14386                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14387                         <mi>X</mi>
14388                      </math> on exit.
14389                   </p>
14390                   <p class="p">The routine does not perform any pivoting and uses a combination of the Cyclic Reduction (CR) and Parallel Cyclic Reduction
14391                      (PCR) algorithms to find the solution. It achieves better performance when <samp class="ph codeph">m</samp> is a power of 2.
14392                   </p>
14393                   <p class="p">This routine requires significant amount of temporary extra storage (<samp class="ph codeph">m×(3+n)×sizeof(&lt;type&gt;)</samp>). It is executed asynchronously with respect to the host and it may return control to the application on the host before
14394                      the result is ready.
14395                   </p>
14396                   <div class="tablenoborder">
14397                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
14398                            <tr class="row">
14399                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
14400                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
14401                            </tr>
14402                            <tr class="row">
14403                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
14404                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the size of the linear system (must be ≥ 3).</td>
14405                            </tr>
14406                            <tr class="row">
14407                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
14408                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of right-hand-sides, columns of matrix <samp class="ph codeph">B</samp>.
14409                               </td>
14410                            </tr>
14411                            <tr class="row">
14412                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">dl</samp></td>
14413                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense array containing the lower diagonal of the tri-diagonal linear system. The first element of each lower diagonal
14414                                  must be zero.
14415                               </td>
14416                            </tr>
14417                            <tr class="row">
14418                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">d</samp></td>
14419                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense array containing the main diagonal of the tri-diagonal linear system.</td>
14420                            </tr>
14421                            <tr class="row">
14422                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">du</samp></td>
14423                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense array containing the upper diagonal of the tri-diagonal linear system. The last element of each upper diagonal
14424                                  must be zero.
14425                               </td>
14426                            </tr>
14427                            <tr class="row">
14428                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">B</samp></td>
14429                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense right-hand-side array of dimensions <samp class="ph codeph">(ldb, n)</samp>.
14430                               </td>
14431                            </tr>
14432                            <tr class="row">
14433                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">ldb</samp></td>
14434                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of <samp class="ph codeph">B</samp>. (that is ≥
14435                                                 
14436                                                 
14437                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14438                                     <mo movablelimits="true">max</mo>
14439                                     <mrow class="MJX-TeXAtom-ORD">
14440                                        <mrow class="MJX-TeXAtom-ORD">
14441                                           <mtext>(1, m))</mtext>
14442                                        </mrow>
14443                                     </mrow>
14444                                  </math>
14445                               </td>
14446                            </tr>
14447                         </tbody>
14448                      </table>
14449                   </div>
14450                   <div class="tablenoborder">
14451                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
14452                            <tr class="row">
14453                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">B</samp></td>
14454                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense solution array of dimensions <samp class="ph codeph">(ldb, n)</samp>.
14455                               </td>
14456                            </tr>
14457                         </tbody>
14458                      </table>
14459                   </div>
14460                   <div class="tablenoborder">
14461                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
14462                            <tr class="row">
14463                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
14464                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
14465                            </tr>
14466                            <tr class="row">
14467                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
14468                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
14469                            </tr>
14470                            <tr class="row">
14471                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
14472                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
14473                            </tr>
14474                            <tr class="row">
14475                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
14476                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m&lt;3, n&lt;0</samp>).
14477                               </td>
14478                            </tr>
14479                            <tr class="row">
14480                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
14481                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
14482                            </tr>
14483                            <tr class="row">
14484                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
14485                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
14486                            </tr>
14487                            <tr class="row">
14488                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
14489                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
14490                            </tr>
14491                            <tr class="row">
14492                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
14493                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
14494                                  <p class="p"></p>
14495                                  <p class="p"></p>
14496                                  the matrix type is not supported.
14497                               </td>
14498                            </tr>
14499                         </tbody>
14500                      </table>
14501                   </div>
14502                </div>
14503             </div>
14504             <div class="topic concept nested1" id="cusparse-lt-t-gt-gtsvstridedbatch"><a name="cusparse-lt-t-gt-gtsvstridedbatch" shape="rect">
14505                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-gtsvstridedbatch" name="cusparse-lt-t-gt-gtsvstridedbatch" shape="rect">10.5.&nbsp;cusparse&lt;t&gt;gtsvStridedBatch</a></h3>
14506                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
14507 cusparseSgtsvStridedBatch(cusparseHandle_t handle, int m,              
14508                           const float           *dl, 
14509                           const float            *d,   
14510                           const float           *du, float           *x,    
14511                           int batchCount, int batchStride)
14512 cusparseStatus_t
14513 cusparseDgtsvStridedBatch(cusparseHandle_t handle, int m,             
14514                           const double          *dl, 
14515                           const double           *d,   
14516                           const double          *du, double          *x,    
14517                           int batchCount, int batchStride)                                                                 
14518 cusparseStatus_t 
14519 cusparseCgtsvStridedBatch(cusparseHandle_t handle, int m,           
14520                           const cuComplex       *dl, 
14521                           const cuComplex        *d,  
14522                           const cuComplex       *du, cuComplex       *x,     
14523                           int batchCount, int batchStride)
14524 cusparseStatus_t 
14525 cusparseZgtsvStridedBatch(cusparseHandle_t handle, int m,         
14526                           const cuDoubleComplex *dl, 
14527                           const cuDoubleComplex  *d,  
14528                           const cuDoubleComplex *du, cuDoubleComplex *x,     
14529                           int batchCount, int batchStride)</pre><p class="p">This function computes the solution of multiple tridiagonal linear systems</p>
14530                   <div class="tablenoborder">
14531                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="void" border="1" rules="all">
14532                         <tbody class="tbody">
14533                            <tr class="row">
14534                               <td class="entry" align="center" valign="top" rowspan="1" colspan="1">
14535                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14536                                     <msup>
14537                                        <mi>A</mi>
14538                                        <mrow class="MJX-TeXAtom-ORD">
14539                                           <mo stretchy="false">(</mo>
14540                                           <mi>i</mi>
14541                                           <mo stretchy="false">)</mo>
14542                                        </mrow>
14543                                     </msup>
14544                                     <mo>∗</mo>
14545                                     <msup>
14546                                        <mrow class="MJX-TeXAtom-ORD">
14547                                           <mrow class="MJX-TeXAtom-ORD">
14548                                              <mtext>y</mtext>
14549                                           </mrow>
14550                                        </mrow>
14551                                        <mrow class="MJX-TeXAtom-ORD">
14552                                           <mo stretchy="false">(</mo>
14553                                           <mi>i</mi>
14554                                           <mo stretchy="false">)</mo>
14555                                        </mrow>
14556                                     </msup>
14557                                     <mo>=</mo>
14558                                     <mi>α</mi>
14559                                     <mo>∗</mo>
14560                                     <msup>
14561                                        <mrow class="MJX-TeXAtom-ORD">
14562                                           <mrow class="MJX-TeXAtom-ORD">
14563                                              <mtext>x</mtext>
14564                                           </mrow>
14565                                        </mrow>
14566                                        <mrow class="MJX-TeXAtom-ORD">
14567                                           <mo stretchy="false">(</mo>
14568                                           <mi>i</mi>
14569                                           <mo stretchy="false">)</mo>
14570                                        </mrow>
14571                                     </msup>
14572                                  </math>
14573                               </td>
14574                            </tr>
14575                         </tbody>
14576                      </table>
14577                   </div>
14578                   <p class="p">for <em class="ph i">i</em>=0,\ldots,<samp class="ph codeph">batchCount</samp>.
14579                   </p>
14580                   <p class="p">The coefficient matrix 
14581                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14582                         <mi>A</mi>
14583                      </math> of each of these tri-diagonal linear system is defined with three vectors corresponding to its lower (<strong class="ph b">ld</strong>), main (<strong class="ph b">d</strong>) and upper (<strong class="ph b">ud</strong>) matrix diagonals, while the right-hand-side is stored in the vector <samp class="ph codeph">x</samp>. Notice that the solution <samp class="ph codeph">y</samp> overwrites the right-hand-side <samp class="ph codeph">x</samp> on exit. The different matrices are assumed to be of the same size and are stored with a fixed <samp class="ph codeph">batchStride</samp> in memory.
14584                   </p>
14585                   <p class="p">The routine does not perform any pivoting and uses a combination of the Cyclic Reduction (CR) and Parallel Cyclic Reduction
14586                      (PCR) algorithms to find the solution. It achieves better performance when <samp class="ph codeph">m</samp> is a power of 2.
14587                   </p>
14588                   <p class="p">This routine requires significant amount of temporary extra storage ((<samp class="ph codeph">batchCount×(4×m+2048)×sizeof(&lt;type&gt;)</samp>)). It is executed asynchronously with respect to the host and it may return control to the application on the host before
14589                      the result is ready.
14590                   </p>
14591                   <div class="tablenoborder">
14592                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
14593                            <tr class="row">
14594                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
14595                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
14596                            </tr>
14597                            <tr class="row">
14598                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
14599                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the size of the linear system (must be ≥ 3).</td>
14600                            </tr>
14601                            <tr class="row">
14602                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">dl</samp></td>
14603                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense array containing the lower diagonal of the tri-diagonal linear system. The lower diagonal
14604                                         
14605                                         
14606                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14607                                     <mi>d</mi>
14608                                     <msup>
14609                                        <mi>l</mi>
14610                                        <mrow class="MJX-TeXAtom-ORD">
14611                                           <mo stretchy="false">(</mo>
14612                                           <mi>i</mi>
14613                                           <mo stretchy="false">)</mo>
14614                                        </mrow>
14615                                     </msup>
14616                                  </math>
14617                                         
14618                                  that corresponds to the <em class="ph i">i</em>th linear system starts at location <samp class="ph codeph">dl+batchStride×i</samp> in memory. Also, the first element of each lower diagonal must be zero.
14619                               </td>
14620                            </tr>
14621                            <tr class="row">
14622                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">d</samp></td>
14623                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense array containing the main diagonal of the tri-diagonal linear system. The main diagonal
14624                                         
14625                                         
14626                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14627                                     <msup>
14628                                        <mi>d</mi>
14629                                        <mrow class="MJX-TeXAtom-ORD">
14630                                           <mo stretchy="false">(</mo>
14631                                           <mi>i</mi>
14632                                           <mo stretchy="false">)</mo>
14633                                        </mrow>
14634                                     </msup>
14635                                  </math>
14636                                         
14637                                  that corresponds to the <em class="ph i">i</em>th linear system starts at location <samp class="ph codeph">d+batchStride×i</samp> in memory.
14638                               </td>
14639                            </tr>
14640                            <tr class="row">
14641                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">du</samp></td>
14642                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense array containing the upper diagonal of the tri-diagonal linear system. The upper diagonal
14643                                         
14644                                         
14645                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14646                                     <mi>d</mi>
14647                                     <msup>
14648                                        <mi>u</mi>
14649                                        <mrow class="MJX-TeXAtom-ORD">
14650                                           <mo stretchy="false">(</mo>
14651                                           <mi>i</mi>
14652                                           <mo stretchy="false">)</mo>
14653                                        </mrow>
14654                                     </msup>
14655                                  </math>
14656                                         
14657                                  that corresponds to the <em class="ph i">i</em>th linear system starts at location <samp class="ph codeph">du+batchStride×i</samp> in memory. Also, the last element of each upper diagonal must be zero.
14658                               </td>
14659                            </tr>
14660                            <tr class="row">
14661                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">x</samp></td>
14662                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense array that contains the right-hand-side of the tri-diagonal linear system. The right-hand-side
14663                                         
14664                                         
14665                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14666                                     <msup>
14667                                        <mi>x</mi>
14668                                        <mrow class="MJX-TeXAtom-ORD">
14669                                           <mo stretchy="false">(</mo>
14670                                           <mi>i</mi>
14671                                           <mo stretchy="false">)</mo>
14672                                        </mrow>
14673                                     </msup>
14674                                  </math>
14675                                         
14676                                  that corresponds to the <em class="ph i">i</em>th linear system starts at location <samp class="ph codeph">x+batchStride×i</samp>in memory.
14677                               </td>
14678                            </tr>
14679                            <tr class="row">
14680                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">batchCount</samp></td>
14681                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">Number of systems to solve.</td>
14682                            </tr>
14683                            <tr class="row">
14684                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">batchStride</samp></td>
14685                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">stride (number of elements) that separates the vectors of every system (must be at least <samp class="ph codeph">m</samp>).
14686                               </td>
14687                            </tr>
14688                         </tbody>
14689                      </table>
14690                   </div>
14691                   <div class="tablenoborder">
14692                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
14693                            <tr class="row">
14694                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">x</samp></td>
14695                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; dense array that contains the solution of the tri-diagonal linear system. The solution
14696                                         
14697                                         
14698                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14699                                     <msup>
14700                                        <mi>x</mi>
14701                                        <mrow class="MJX-TeXAtom-ORD">
14702                                           <mo stretchy="false">(</mo>
14703                                           <mi>i</mi>
14704                                           <mo stretchy="false">)</mo>
14705                                        </mrow>
14706                                     </msup>
14707                                  </math>
14708                                         
14709                                  that corresponds to the <em class="ph i">i</em>th linear system starts at location <samp class="ph codeph">x+batchStride×i</samp>in memory.
14710                               </td>
14711                            </tr>
14712                         </tbody>
14713                      </table>
14714                   </div>
14715                   <div class="tablenoborder">
14716                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
14717                            <tr class="row">
14718                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
14719                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
14720                            </tr>
14721                            <tr class="row">
14722                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
14723                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
14724                            </tr>
14725                            <tr class="row">
14726                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
14727                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
14728                            </tr>
14729                            <tr class="row">
14730                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
14731                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m&lt;3, batchCount≤0, batchStride&lt;m</samp>).
14732                               </td>
14733                            </tr>
14734                            <tr class="row">
14735                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
14736                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
14737                            </tr>
14738                            <tr class="row">
14739                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
14740                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
14741                            </tr>
14742                            <tr class="row">
14743                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
14744                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
14745                            </tr>
14746                         </tbody>
14747                      </table>
14748                   </div>
14749                </div>
14750             </div>
14751          </div>
14752          <div class="topic concept nested0" id="cusparse-format-conversion-reference"><a name="cusparse-format-conversion-reference" shape="rect">
14753                <!-- --></a><h2 class="title topictitle1"><a href="#cusparse-format-conversion-reference" name="cusparse-format-conversion-reference" shape="rect">11.&nbsp;CUSPARSE Format Conversion Reference</a></h2>
14754             <div class="body conbody">
14755                <p class="p">This chapter describes the conversion routines between different sparse and dense storage formats.</p>
14756             </div>
14757             <div class="topic concept nested1" id="cusparse-lt-t-gt-bsr2csr"><a name="cusparse-lt-t-gt-bsr2csr" shape="rect">
14758                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-bsr2csr" name="cusparse-lt-t-gt-bsr2csr" shape="rect">11.1.&nbsp;cusparse&lt;t&gt;bsr2csr</a></h3>
14759                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
14760 cusparseSbsr2csr(cusparseHandle_t handle, cusparseDirection_t dirA,
14761      int mb, int nb,
14762      const cusparseMatDescr_t descrA, const float *bsrValA, 
14763      const int *bsrRowPtrA, const int *bsrColIndA,
14764      int blockDim,
14765      const cusparseMatDescr_t descrC,
14766      float *csrValC, int *csrRowPtrC, int *csrColIndC)
14767 cusparseStatus_t
14768 cusparseDbsr2csr(cusparseHandle_t handle, cusparseDirection_t dirA,
14769       int mb, int nb,
14770       const cusparseMatDescr_t descrA, const double *bsrValA, 
14771       const int *bsrRowPtrA, const int *bsrColIndA,
14772       int blockDim,
14773       const cusparseMatDescr_t descrC,
14774       double *csrValC, int *csrRowPtrC, int *csrColIndC)
14775 cusparseStatus_t
14776 cusparseCbsr2csr(cusparseHandle_t handle, cusparseDirection_t dirA,
14777       int mb, int nb,
14778       const cusparseMatDescr_t descrA, const cuComplex *bsrValA, 
14779       const int *bsrRowPtrA, const int *bsrColIndA,
14780       int blockDim,
14781       const cusparseMatDescr_t descrC,
14782       cuComplex *csrValC, int *csrRowPtrC, int *csrColIndC)
14783 cusparseStatus_t
14784 cusparseZbsr2csr(cusparseHandle_t handle, cusparseDirection_t dirA,
14785       int mb, int nb,
14786       const cusparseMatDescr_t descrA, const cuDoubleComplex *bsrValA, 
14787       const int *bsrRowPtrA, const int *bsrColIndA,
14788       int blockDim,
14789       const cusparseMatDescr_t descrC,
14790       cuDoubleComplex *csrValC, int *csrRowPtrC, int *csrColIndC)</pre><p class="p">This function converts a sparse matrix in BSR format (that is defined by the three arrays <samp class="ph codeph">bsrValA</samp>, <samp class="ph codeph">bsrRowPtrA</samp>, and <samp class="ph codeph">bsrColIndA</samp>) into a sparse matrix in CSR format (that is defined by arrays <samp class="ph codeph">csrValC</samp>, <samp class="ph codeph">csrRowPtrC</samp>, and <samp class="ph codeph">csrColIndC</samp>).
14791                   </p>
14792                   <p class="p">Let
14793                      
14794                      
14795                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14796                         <mi>m</mi>
14797                         <mo stretchy="false">(</mo>
14798                         <mo>=</mo>
14799                         <mi>m</mi>
14800                         <mi>b</mi>
14801                         <mo>∗</mo>
14802                         <mi>b</mi>
14803                         <mi>l</mi>
14804                         <mi>o</mi>
14805                         <mi>c</mi>
14806                         <mi>k</mi>
14807                         <mi>D</mi>
14808                         <mi>i</mi>
14809                         <mi>m</mi>
14810                         <mo stretchy="false">)</mo>
14811                      </math>
14812                      
14813                      be number of rows of 
14814                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14815                         <mi>A</mi>
14816                      </math> and
14817                      
14818                      
14819                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14820                         <mi>n</mi>
14821                         <mo stretchy="false">(</mo>
14822                         <mo>=</mo>
14823                         <mi>n</mi>
14824                         <mi>b</mi>
14825                         <mo>∗</mo>
14826                         <mi>b</mi>
14827                         <mi>l</mi>
14828                         <mi>o</mi>
14829                         <mi>c</mi>
14830                         <mi>k</mi>
14831                         <mi>D</mi>
14832                         <mi>i</mi>
14833                         <mi>m</mi>
14834                         <mo stretchy="false">)</mo>
14835                      </math>
14836                      
14837                      be number of columns of 
14838                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14839                         <mi>A</mi>
14840                      </math>, then 
14841                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14842                         <mi>A</mi>
14843                      </math> and 
14844                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14845                         <mi>C</mi>
14846                      </math> are <samp class="ph codeph">m×n</samp> sparse matricies. BSR format of 
14847                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14848                         <mi>A</mi>
14849                      </math> contains 
14850                         
14851                         
14852                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14853                         <mi>n</mi>
14854                         <mi>n</mi>
14855                         <mi>z</mi>
14856                         <mi>b</mi>
14857                         <mo stretchy="false">(</mo>
14858                         <mo>=</mo>
14859                      </math><samp class="ph codeph">csrRowPtrC(mb) − csrRowPtrC(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
14860                         <mo stretchy="false">)</mo>
14861                      </math>
14862                      
14863                      non-zero blocks whereas sparse matrix 
14864                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14865                         <mi>A</mi>
14866                      </math> contains
14867                      
14868                      
14869                      <math xmlns="http://www.w3.org/1998/Math/MathML">
14870                         <mi>n</mi>
14871                         <mi>n</mi>
14872                         <mi>z</mi>
14873                         <mo stretchy="false">(</mo>
14874                         <mo>=</mo>
14875                         <mi>n</mi>
14876                         <mi>n</mi>
14877                         <mi>z</mi>
14878                         <mi>b</mi>
14879                         <mo>∗</mo>
14880                         <mi>b</mi>
14881                         <mi>l</mi>
14882                         <mi>o</mi>
14883                         <mi>c</mi>
14884                         <mi>k</mi>
14885                         <mi>D</mi>
14886                         <mi>i</mi>
14887                         <msup>
14888                            <mi>m</mi>
14889                            <mn>2</mn>
14890                         </msup>
14891                         <mo stretchy="false">)</mo>
14892                      </math>
14893                      
14894                      elements. The user must allocate enough space for arrays <samp class="ph codeph">csrRowPtrC</samp>, <samp class="ph codeph">csrColIndC</samp> and <samp class="ph codeph">csrValC</samp>. The requirements are
14895                   </p>
14896                   <p class="p"><samp class="ph codeph">csrRowPtrC</samp> of <samp class="ph codeph">m+1</samp> elements,
14897                   </p>
14898                   <p class="p"><samp class="ph codeph">csrValC</samp> of nnz elements, and
14899                   </p>
14900                   <p class="p"><samp class="ph codeph">csrColIndC</samp> of nnz elements.
14901                   </p>
14902                   <p class="p">The general procedure is as follows:</p><pre xml:space="preserve"><span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// Given BSR format (bsrRowPtrA, bsrcolIndA, bsrValA) and </span>
14903 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// blocks of BSR format are stored in column-major order.</span>
14904 cusparseDirection_t dirA = CUSPARSE_DIRECTION_COLUMN;
14905 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> m = mb*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>;
14906 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> nnzb = bsrRowPtrA[mb] - bsrRowPtrA[0]; <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// number of blocks</span>
14907 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> nnz  = nnzb * <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span> * <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>; <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// number of elements</span>
14908 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;csrRowPtrC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>)*(m+1));
14909 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;csrColIndC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>)*nnz);
14910 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;csrValC   , <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">float</span>)*nnz);
14911 cusparseSbsr2csr(handle, dirA, mb, nb,
14912         descrA, 
14913         bsrValA, bsrRowPtrA, bsrColIndA,
14914         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>,
14915         descrC,
14916         csrValC, csrRowPtrC, csrColIndC);</pre><div class="tablenoborder">
14917                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
14918                            <tr class="row">
14919                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
14920                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
14921                            </tr>
14922                            <tr class="row">
14923                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">dirA</samp></td>
14924                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">storage format of blocks, either <samp class="ph codeph">CUSPARSE_DIRECTION_ROW</samp> or <samp class="ph codeph">CUSPARSE_DIRECTION_COLUMN</samp>.
14925                               </td>
14926                            </tr>
14927                            <tr class="row">
14928                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">mb</samp></td>
14929                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of block rows of sparse matrix <samp class="ph codeph">A</samp>. The number of rows of sparse matrix C is <dfn class="term">m</dfn> (= <dfn class="term">mb</dfn> * <dfn class="term">blockDim</dfn>)
14930                               </td>
14931                            </tr>
14932                            <tr class="row">
14933                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nb</samp></td>
14934                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of block columns of sparse matrix <samp class="ph codeph">A</samp>. The number of columns of sparse matrix C is <dfn class="term">n</dfn> (= <dfn class="term">nb</dfn> * <dfn class="term">blockDim</dfn>)
14935                               </td>
14936                            </tr>
14937                            <tr class="row">
14938                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
14939                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
14940                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14941                                     <mi>A</mi>
14942                                  </math>.
14943                               </td>
14944                            </tr>
14945                            <tr class="row">
14946                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrValA</samp></td>
14947                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of <samp class="ph codeph">nnzb</samp>*
14948                                                 
14949                                                 
14950                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14951                                     <mi>b</mi>
14952                                     <mi>l</mi>
14953                                     <mi>o</mi>
14954                                     <mi>c</mi>
14955                                     <mi>k</mi>
14956                                     <mi>D</mi>
14957                                     <mi>i</mi>
14958                                     <msup>
14959                                        <mi>m</mi>
14960                                        <mn>2</mn>
14961                                     </msup>
14962                                  </math>
14963                                                 
14964                                         non-zero elements of matrix <samp class="ph codeph">A</samp>.
14965                               </td>
14966                            </tr>
14967                            <tr class="row">
14968                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrRowPtrA</samp></td>
14969                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of<samp class="ph codeph">mb+1</samp> elements that contains the start of every block row and the end of the last block row plus one.
14970                               </td>
14971                            </tr>
14972                            <tr class="row">
14973                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrColIndA</samp></td>
14974                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">nnzb</samp> column indices of the non-zero blocks of matrix <samp class="ph codeph">A</samp>.
14975                               </td>
14976                            </tr>
14977                            <tr class="row">
14978                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">blockDim</samp></td>
14979                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">block dimension of sparse matrix <samp class="ph codeph">A</samp>, larger than zero.
14980                               </td>
14981                            </tr>
14982                            <tr class="row">
14983                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrC</samp></td>
14984                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
14985                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
14986                                     <mi>C</mi>
14987                                  </math>.
14988                               </td>
14989                            </tr>
14990                         </tbody>
14991                      </table>
14992                   </div>
14993                   <div class="tablenoborder">
14994                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
14995                            <tr class="row">
14996                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValC</samp></td>
14997                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
14998                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
14999                                     <mo stretchy="false">(</mo>
15000                                     <mo>=</mo>
15001                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15002                                     <mo>-</mo>
15003                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15004                                     <mo stretchy="false">)</mo>
15005                                  </math>
15006                                         non-zero elements of matrix 
15007                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15008                                     <mi>C</mi>
15009                                  </math>.
15010                               </td>
15011                            </tr>
15012                            <tr class="row">
15013                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrC</samp></td>
15014                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every row and the end of the last row plus one.
15015                               </td>
15016                            </tr>
15017                            <tr class="row">
15018                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndC</samp></td>
15019                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">nnz</samp> column indices of the non-zero elements of matrix 
15020                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15021                                     <mi>C</mi>
15022                                  </math>.
15023                               </td>
15024                            </tr>
15025                         </tbody>
15026                      </table>
15027                   </div>
15028                   <div class="tablenoborder">
15029                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
15030                            <tr class="row">
15031                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
15032                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
15033                            </tr>
15034                            <tr class="row">
15035                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
15036                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
15037                            </tr>
15038                            <tr class="row">
15039                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
15040                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
15041                            </tr>
15042                            <tr class="row">
15043                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
15044                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">mb,nb&lt;0</samp>, <samp class="ph codeph">IndexBase</samp> of <samp class="ph codeph">descrA, descrC</samp> is not base-0 or base-1, <samp class="ph codeph">dirA</samp> is not row-major or column-major, or <dfn class="term">blockDim</dfn>&lt;1).
15045                               </td>
15046                            </tr>
15047                            <tr class="row">
15048                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
15049                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
15050                            </tr>
15051                            <tr class="row">
15052                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
15053                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
15054                            </tr>
15055                            <tr class="row">
15056                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
15057                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
15058                                  <p class="p"></p>
15059                                  <p class="p"></p>
15060                                  the matrix type is not supported.
15061                               </td>
15062                            </tr>
15063                            <tr class="row">
15064                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
15065                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
15066                            </tr>
15067                         </tbody>
15068                      </table>
15069                   </div>
15070                </div>
15071             </div>
15072             <div class="topic concept nested1" id="cusparse-lt-t-gt-coo2csr"><a name="cusparse-lt-t-gt-coo2csr" shape="rect">
15073                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-coo2csr" name="cusparse-lt-t-gt-coo2csr" shape="rect">11.2.&nbsp;cusparse&lt;t&gt;coo2csr</a></h3>
15074                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
15075 cusparseXcoo2csr(cusparseHandle_t handle, const int *cooRowInd,
15076                  int nnz, int m, int *csrRowPtr, cusparseIndexBase_t idxBase)</pre><p class="p">This function converts the array containing the uncompressed row indices (corresponding to COO format) into an array of compressed
15077                      row pointers (corresponding to CSR format).
15078                   </p>
15079                   <p class="p">It can also be used to convert the array containing the uncompressed column indices (corresponding to COO format) into an
15080                      array of column pointers (corresponding to CSC format).
15081                   </p>
15082                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
15083                      to the application on the host before the result is ready.
15084                   </p>
15085                   <div class="tablenoborder">
15086                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
15087                            <tr class="row">
15088                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
15089                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
15090                            </tr>
15091                            <tr class="row">
15092                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cooRowInd</samp></td>
15093                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">nnz</samp> uncompressed row indices.
15094                               </td>
15095                            </tr>
15096                            <tr class="row">
15097                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
15098                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of non-zeros of the sparse matrix (that is also the length of array <samp class="ph codeph">cooRowInd</samp>).
15099                               </td>
15100                            </tr>
15101                            <tr class="row">
15102                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
15103                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
15104                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15105                                     <mi>A</mi>
15106                                  </math>.
15107                               </td>
15108                            </tr>
15109                            <tr class="row">
15110                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">idxBase</samp></td>
15111                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> or <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
15112                               </td>
15113                            </tr>
15114                         </tbody>
15115                      </table>
15116                   </div>
15117                   <div class="tablenoborder">
15118                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
15119                            <tr class="row">
15120                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtr</samp></td>
15121                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every row and the end of the last row plus one.
15122                               </td>
15123                            </tr>
15124                         </tbody>
15125                      </table>
15126                   </div>
15127                   <div class="tablenoborder">
15128                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
15129                            <tr class="row">
15130                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
15131                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
15132                            </tr>
15133                            <tr class="row">
15134                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
15135                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
15136                            </tr>
15137                            <tr class="row">
15138                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
15139                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">IndexBase</samp> is neither <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> nor <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
15140                               </td>
15141                            </tr>
15142                            <tr class="row">
15143                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
15144                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
15145                            </tr>
15146                         </tbody>
15147                      </table>
15148                   </div>
15149                </div>
15150             </div>
15151             <div class="topic concept nested1" id="cusparse-lt-t-gt-csc2dense"><a name="cusparse-lt-t-gt-csc2dense" shape="rect">
15152                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csc2dense" name="cusparse-lt-t-gt-csc2dense" shape="rect">11.3.&nbsp;cusparse&lt;t&gt;csc2dense</a></h3>
15153                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
15154 cusparseScsc2dense(cusparseHandle_t handle, int m, int n, 
15155                    const cusparseMatDescr_t descrA, 
15156                    const float           *cscValA, 
15157                    const int *cscRowIndA, const int *cscColPtrA,
15158                    float           *A, int lda)
15159 cusparseStatus_t 
15160 cusparseDcsc2dense(cusparseHandle_t handle, int m, int n, 
15161                    const cusparseMatDescr_t descrA, 
15162                    const double          *cscValA, 
15163                    const int *cscRowIndA, const int *cscColPtrA,
15164                   double          *A, int lda)
15165 cusparseStatus_t 
15166 cusparseCcsc2dense(cusparseHandle_t handle, int m, int n, 
15167                    const cusparseMatDescr_t descrA, 
15168                    const cuComplex       *cscValA, 
15169                    const int *cscRowIndA, const int *cscColPtrA,
15170                    cuComplex       *A, int lda)
15171 cusparseStatus_t 
15172 cusparseZcsc2dense(cusparseHandle_t handle, int m, int n, 
15173                    const cusparseMatDescr_t descrA, 
15174                    const cuDoubleComplex *cscValA, 
15175                    const int *cscRowIndA, const int *cscColPtrA,
15176                    cuDoubleComplex *A, int lda)</pre><p class="p">This function converts the sparse matrix in CSC format (that is defined by the three arrays <samp class="ph codeph">cscValA</samp>, <samp class="ph codeph">cscColPtrA</samp> and <samp class="ph codeph">cscRowIndA</samp>) into the matrix <samp class="ph codeph">A</samp> in dense format. The dense matrix <samp class="ph codeph">A</samp> is filled in with the values of the sparse matrix and with zeros elsewhere.
15177                   </p>
15178                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
15179                      to the application on the host before the result is ready.
15180                   </p>
15181                   <div class="tablenoborder">
15182                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
15183                            <tr class="row">
15184                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
15185                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
15186                            </tr>
15187                            <tr class="row">
15188                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
15189                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
15190                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15191                                     <mi>A</mi>
15192                                  </math>.
15193                               </td>
15194                            </tr>
15195                            <tr class="row">
15196                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
15197                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
15198                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15199                                     <mi>A</mi>
15200                                  </math>.
15201                               </td>
15202                            </tr>
15203                            <tr class="row">
15204                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
15205                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
15206                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15207                                     <mi>A</mi>
15208                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
15209                               </td>
15210                            </tr>
15211                            <tr class="row">
15212                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscValA</samp></td>
15213                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
15214                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15215                                     <mo stretchy="false">(</mo>
15216                                     <mo>=</mo>
15217                                  </math><samp class="ph codeph">cscColPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15218                                     <mo>-</mo>
15219                                  </math><samp class="ph codeph">cscColPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15220                                     <mo stretchy="false">)</mo>
15221                                  </math>
15222                                         non-zero elements of matrix 
15223                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15224                                     <mi>A</mi>
15225                                  </math>.
15226                               </td>
15227                            </tr>
15228                            <tr class="row">
15229                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscRowIndA</samp></td>
15230                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
15231                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15232                                     <mo stretchy="false">(</mo>
15233                                     <mo>=</mo>
15234                                  </math><samp class="ph codeph">cscColPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15235                                     <mo>-</mo>
15236                                  </math><samp class="ph codeph">cscColPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15237                                     <mo stretchy="false">)</mo>
15238                                  </math>
15239                                         row indices of the non-zero elements of matrix 
15240                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15241                                     <mi>A</mi>
15242                                  </math>.
15243                               </td>
15244                            </tr>
15245                            <tr class="row">
15246                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscColPtrA</samp></td>
15247                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">n+1</samp> elements that contains the start of every row and the end of the last column plus one.
15248                               </td>
15249                            </tr>
15250                            <tr class="row">
15251                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">lda</samp></td>
15252                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of dense array <samp class="ph codeph">A</samp>.
15253                               </td>
15254                            </tr>
15255                         </tbody>
15256                      </table>
15257                   </div>
15258                   <div class="tablenoborder">
15259                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
15260                            <tr class="row">
15261                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">A</samp></td>
15262                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of dimensions <samp class="ph codeph">(lda, n)</samp> that is filled in with the values of the sparse matrix.
15263                               </td>
15264                            </tr>
15265                         </tbody>
15266                      </table>
15267                   </div>
15268                   <div class="tablenoborder">
15269                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
15270                            <tr class="row">
15271                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
15272                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
15273                            </tr>
15274                            <tr class="row">
15275                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
15276                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
15277                            </tr>
15278                            <tr class="row">
15279                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
15280                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n&lt;0</samp>).
15281                               </td>
15282                            </tr>
15283                            <tr class="row">
15284                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
15285                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
15286                            </tr>
15287                            <tr class="row">
15288                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
15289                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
15290                            </tr>
15291                            <tr class="row">
15292                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
15293                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
15294                                  <p class="p"></p>
15295                                  <p class="p"></p>
15296                                  the matrix type is not supported.
15297                               </td>
15298                            </tr>
15299                         </tbody>
15300                      </table>
15301                   </div>
15302                </div>
15303             </div>
15304             <div class="topic concept nested1" id="cusparse-lt-t-gt-csc2hyb"><a name="cusparse-lt-t-gt-csc2hyb" shape="rect">
15305                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csc2hyb" name="cusparse-lt-t-gt-csc2hyb" shape="rect">11.4.&nbsp;cusparse&lt;t&gt;csc2hyb</a></h3>
15306                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
15307 cusparseScsc2hyb(cusparseHandle_t handle, int m, int n, 
15308             const cusparseMatDescr_t descrA, 
15309             const float           *cscValA,
15310             const int *cscRowIndA, const int *cscColPtrA, 
15311             cusparseHybMat_t hybA, int userEllWidth, 
15312             cusparseHybPartition_t partitionType)
15313 cusparseStatus_t 
15314 cusparseDcsc2hyb(cusparseHandle_t handle, int m, int n,
15315             const cusparseMatDescr_t descrA, 
15316             const double          *cscValA,
15317             const int *cscRowIndA, const int *cscColPtrA, 
15318             cusparseHybMat_t hybA, int userEllWidth, 
15319             cusparseHybPartition_t partitionType)
15320 cusparseStatus_t 
15321 cusparseCcsc2hyb(cusparseHandle_t handle, int m, int n, 
15322             const cusparseMatDescr_t descrA, 
15323             const cuComplex       *cscValA, 
15324             const int *cscRowIndA, const int *cscColPtrA, 
15325             cusparseHybMat_t hybA, int userEllWidth, 
15326             cusparseHybPartition_t partitionType)
15327 cusparseStatus_t 
15328 cusparseZcsc2hyb(cusparseHandle_t handle, int m, int n, 
15329             const cusparseMatDescr_t descrA, 
15330             const cuDoubleComplex *cscValA, 
15331             const int *cscRowIndA, const int *cscColPtrA, 
15332             cusparseHybMat_t hybA, int userEllWidth, 
15333             cusparseHybPartition_t partitionType)</pre><p class="p">This function converts a sparse matrix in CSC format into a sparse matrix in HYB format. It assumes that the <samp class="ph codeph">hybA</samp> parameter has been initialized with <samp class="ph codeph">cusparseCreateHybMat</samp> routine before calling this function.
15334                   </p>
15335                   <p class="p">This function requires some amount of temporary storage and a significant amount of storage for the matrix in HYB format.
15336                      It is executed asynchronously with respect to the host and it may return control to the application on the host before the
15337                      result is ready.
15338                   </p>
15339                   <div class="tablenoborder">
15340                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
15341                            <tr class="row">
15342                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
15343                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
15344                            </tr>
15345                            <tr class="row">
15346                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
15347                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
15348                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15349                                     <mi>A</mi>
15350                                  </math>.
15351                               </td>
15352                            </tr>
15353                            <tr class="row">
15354                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
15355                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
15356                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15357                                     <mi>A</mi>
15358                                  </math>.
15359                               </td>
15360                            </tr>
15361                            <tr class="row">
15362                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
15363                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
15364                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15365                                     <mi>A</mi>
15366                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
15367                               </td>
15368                            </tr>
15369                            <tr class="row">
15370                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscValA</samp></td>
15371                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
15372                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15373                                     <mo stretchy="false">(</mo>
15374                                     <mo>=</mo>
15375                                  </math><samp class="ph codeph">cscColPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15376                                     <mo>-</mo>
15377                                  </math><samp class="ph codeph">cscColPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15378                                     <mo stretchy="false">)</mo>
15379                                  </math>
15380                                         non-zero elements of matrix 
15381                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15382                                     <mi>A</mi>
15383                                  </math>.
15384                               </td>
15385                            </tr>
15386                            <tr class="row">
15387                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscRowIndA</samp></td>
15388                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
15389                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15390                                     <mo stretchy="false">(</mo>
15391                                     <mo>=</mo>
15392                                  </math><samp class="ph codeph">cscColPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15393                                     <mo>-</mo>
15394                                  </math><samp class="ph codeph">cscColPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15395                                     <mo stretchy="false">)</mo>
15396                                  </math>
15397                                         column indices of the non-zero elements of matrix 
15398                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15399                                     <mi>A</mi>
15400                                  </math>.
15401                               </td>
15402                            </tr>
15403                            <tr class="row">
15404                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscColPtrA</samp></td>
15405                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every row and the end of the last row plus one.
15406                               </td>
15407                            </tr>
15408                            <tr class="row">
15409                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">userEllWidth</samp></td>
15410                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">width of the regular (ELL) part of the matrix in HYB format, which should be less than maximum number of non-zeros per row
15411                                  and is only required if <samp class="ph codeph">partitionType</samp> == <samp class="ph codeph">CUSPARSE_HYB_PARTITION_USER</samp>.
15412                               </td>
15413                            </tr>
15414                            <tr class="row">
15415                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">partitionType</samp></td>
15416                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">partitioning method to be used in the conversion (please refer to <samp class="ph codeph">cusparseHybPartition_t</samp> on page ?? for details).
15417                               </td>
15418                            </tr>
15419                         </tbody>
15420                      </table>
15421                   </div>
15422                   <div class="tablenoborder">
15423                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
15424                            <tr class="row">
15425                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">hybA</samp></td>
15426                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix <samp class="ph codeph">A</samp> in HYB storage format.
15427                               </td>
15428                            </tr>
15429                         </tbody>
15430                      </table>
15431                   </div>
15432                   <div class="tablenoborder">
15433                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
15434                            <tr class="row">
15435                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
15436                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
15437                            </tr>
15438                            <tr class="row">
15439                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
15440                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
15441                            </tr>
15442                            <tr class="row">
15443                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
15444                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
15445                            </tr>
15446                            <tr class="row">
15447                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
15448                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n&lt;0</samp>).
15449                               </td>
15450                            </tr>
15451                            <tr class="row">
15452                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
15453                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
15454                            </tr>
15455                            <tr class="row">
15456                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
15457                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
15458                            </tr>
15459                            <tr class="row">
15460                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
15461                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
15462                            </tr>
15463                            <tr class="row">
15464                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
15465                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
15466                                  <p class="p"></p>
15467                                  <p class="p"></p>
15468                                  the matrix type is not supported.
15469                               </td>
15470                            </tr>
15471                         </tbody>
15472                      </table>
15473                   </div>
15474                </div>
15475             </div>
15476             <div class="topic concept nested1" id="cusparse-lt-t-gt-csr2bsr"><a name="cusparse-lt-t-gt-csr2bsr" shape="rect">
15477                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csr2bsr" name="cusparse-lt-t-gt-csr2bsr" shape="rect">11.5.&nbsp;cusparse&lt;t&gt;csr2bsr</a></h3>
15478                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
15479 cusparseXcsr2bsrNnz(cusparseHandle_t handle, cusparseDirection_t dirA,
15480       int m, int n,
15481       const cusparseMatDescr_t descrA,
15482       const int *csrRowPtrA, const int *csrColIndA,
15483       int blockDim,
15484       const cusparseMatDescr_t descrC,
15485       int *bsrRowPtrC,
15486       int *nnzTotalDevHostPtr)
15487 cusparseStatus_t
15488 cusparseScsr2bsr(cusparseHandle_t handle, cusparseDirection_t dirA,
15489       int m, int n,
15490       const cusparseMatDescr_t descrA, const float *csrValA, 
15491       const int *csrRowPtrA, const int *csrColIndA,
15492       int blockDim,
15493       const cusparseMatDescr_t descrC,
15494       float *bsrValC, int *bsrRowPtrC, int *bsrColIndC)
15495 cusparseStatus_t
15496 cusparseDcsr2bsr(cusparseHandle_t handle, cusparseDirection_t dirA,
15497       int m, int n,
15498       const cusparseMatDescr_t descrA, const double *csrValA, 
15499       const int *csrRowPtrA, const int *csrColIndA,
15500       int blockDim,
15501       const cusparseMatDescr_t descrC,
15502       double *bsrValC, int *bsrRowPtrC, int *bsrColIndC)
15503 cusparseStatus_t
15504 cusparseCcsr2bsr(cusparseHandle_t handle, cusparseDirection_t dirA,
15505       int m, int n,
15506       const cusparseMatDescr_t descrA, const cuComplex *csrValA, 
15507       const int *csrRowPtrA, const int *csrColIndA,
15508       int blockDim,
15509       const cusparseMatDescr_t descrC,
15510       cuComplex *bsrValC, int *bsrRowPtrC, int *bsrColIndC)
15511 cusparseStatus_t
15512 cusparseZcsr2bsr(cusparseHandle_t handle, cusparseDirection_t dirA,
15513       int m, int n,
15514       const cusparseMatDescr_t descrA, const cuDoubleComplex *csrValA, 
15515       const int *csrRowPtrA, const int *csrColIndA,
15516       int blockDim,
15517       const cusparseMatDescr_t descrC,
15518       cuDoubleComplex *bsrValC, int *bsrRowPtrC, int *bsrColIndC)</pre><p class="p">This function converts a sparse matrix in CSR format (that is defined by the three arrays <samp class="ph codeph">csrValA</samp>, <samp class="ph codeph">csrRowPtrA</samp> and <samp class="ph codeph">csrColIndA</samp>) into a sparse matrix in BSR format (that is defined by arrays <samp class="ph codeph">bsrValC</samp>, <samp class="ph codeph">bsrRowPtrC</samp> and <samp class="ph codeph">bsrColIndC</samp>).
15519                   </p>
15520                   <p class="p">
15521                      <math xmlns="http://www.w3.org/1998/Math/MathML">
15522                         <mi>A</mi>
15523                      </math> is <samp class="ph codeph">m×n</samp>  sparse matrix and  is (mb*blockDim)  (nb*blockDim) sparse matrix.
15524                   </p>
15525                   <p class="p">where
15526                         
15527                         
15528                      <math xmlns="http://www.w3.org/1998/Math/MathML">
15529                         <mi>m</mi>
15530                         <mi>b</mi>
15531                         <mo stretchy="false">(</mo>
15532                         <mo>=</mo>
15533                         <mfrac>
15534                            <mrow>
15535                               <mi>m</mi>
15536                               <mo>+</mo>
15537                               <mi>b</mi>
15538                               <mi>l</mi>
15539                               <mi>o</mi>
15540                               <mi>c</mi>
15541                               <mi>k</mi>
15542                               <mi>D</mi>
15543                               <mi>i</mi>
15544                               <mi>m</mi>
15545                               <mo>−</mo>
15546                               <mn>1</mn>
15547                            </mrow>
15548                            <mrow>
15549                               <mi>b</mi>
15550                               <mi>l</mi>
15551                               <mi>o</mi>
15552                               <mi>c</mi>
15553                               <mi>k</mi>
15554                               <mi>D</mi>
15555                               <mi>i</mi>
15556                               <mi>m</mi>
15557                            </mrow>
15558                         </mfrac>
15559                         <mo stretchy="false">)</mo>
15560                      </math>
15561                         
15562                      is number of block rows of A and
15563                         
15564                         
15565                      <math xmlns="http://www.w3.org/1998/Math/MathML">
15566                         <mi>n</mi>
15567                         <mi>b</mi>
15568                         <mo stretchy="false">(</mo>
15569                         <mo>=</mo>
15570                         <mfrac>
15571                            <mrow>
15572                               <mi>n</mi>
15573                               <mo>+</mo>
15574                               <mi>b</mi>
15575                               <mi>l</mi>
15576                               <mi>o</mi>
15577                               <mi>c</mi>
15578                               <mi>k</mi>
15579                               <mi>D</mi>
15580                               <mi>i</mi>
15581                               <mi>m</mi>
15582                               <mo>−</mo>
15583                               <mn>1</mn>
15584                            </mrow>
15585                            <mrow>
15586                               <mi>b</mi>
15587                               <mi>l</mi>
15588                               <mi>o</mi>
15589                               <mi>c</mi>
15590                               <mi>k</mi>
15591                               <mi>D</mi>
15592                               <mi>i</mi>
15593                               <mi>m</mi>
15594                            </mrow>
15595                         </mfrac>
15596                         <mo stretchy="false">)</mo>
15597                      </math>
15598                         
15599                      is number of block columns of A. 
15600                      <math xmlns="http://www.w3.org/1998/Math/MathML">
15601                         <mi>m</mi>
15602                      </math> and 
15603                      <math xmlns="http://www.w3.org/1998/Math/MathML">
15604                         <mi>n</mi>
15605                      </math> need not be multiple of 
15606                      <math xmlns="http://www.w3.org/1998/Math/MathML">
15607                         <mi>b</mi>
15608                         <mi>l</mi>
15609                         <mi>o</mi>
15610                         <mi>c</mi>
15611                         <mi>k</mi>
15612                         <mi>D</mi>
15613                         <mi>i</mi>
15614                         <mi>m</mi>
15615                      </math>. If so, then zeros are filled in.
15616                   </p>
15617                   <p class="p">CUSPARSE adopts two-step approach to do the conversion. First, the user allocates <samp class="ph codeph">bsrRowPtrC</samp> of <samp class="ph codeph">mb+1</samp> elements and uses function cusparseXcsr2bsrNnz to determine number of non-zero block columns per block row. Second, the user
15618                      gathers nnzb (number of non-zero block columns of matrix A) from either <samp class="ph codeph">(nnzb=*nnzTotalDevHostPtr)</samp> or <samp class="ph codeph">(nnzb=bsrRowPtrC(mb)-bsrRowPtrC(0))</samp> 
15619                      and allocates <samp class="ph codeph">bsrValC</samp> of
15620                         
15621                      <math xmlns="http://www.w3.org/1998/Math/MathML">
15622                         <mi>n</mi>
15623                         <mi>n</mi>
15624                         <mi>z</mi>
15625                         <mi>b</mi>
15626                         <mo>∗</mo>
15627                         <mi>b</mi>
15628                         <mi>l</mi>
15629                         <mi>o</mi>
15630                         <mi>c</mi>
15631                         <mi>k</mi>
15632                         <mi>D</mi>
15633                         <mi>i</mi>
15634                         <msup>
15635                            <mi>m</mi>
15636                            <mrow class="MJX-TeXAtom-ORD">
15637                               <mn>2</mn>
15638                            </mrow>
15639                         </msup>
15640                      </math>
15641                         
15642                      elements and <samp class="ph codeph">bsrColIndC</samp> of 
15643                      <math xmlns="http://www.w3.org/1998/Math/MathML">
15644                         <mi>n</mi>
15645                         <mi>n</mi>
15646                         <mi>z</mi>
15647                         <mi>b</mi>
15648                      </math> elements. Finally function cusparse[S|D|C|Z]csr2bsr is called to complete the conversion.
15649                   </p>
15650                   <p class="p">The general procedure is as follows:</p><pre xml:space="preserve"><span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// Given CSR format (csrRowPtrA, csrcolIndA, csrValA) and </span>
15651 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// blocks of BSR format are stored in column-major order.</span>
15652 cusparseDirection_t dirA = CUSPARSE_DIRECTION_COLUMN;
15653 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> base, nnzb;
15654 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> mb = (m + <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>-1)/<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>;
15655 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">// nnzTotalDevHostPtr points to host memory</span>
15656 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *nnzTotalDevHostPtr = &amp;nnzb;
15657 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;bsrRowPtrC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>) *(mb+1));
15658 cusparseXcsr2bsrNnz(handle, dirA, m, n,
15659         descrA, csrRowPtrA, csrColIndA,
15660         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>,
15661         descrC, bsrRowPtrC,
15662         nnzTotalDevHostPtr);
15663 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (NULL != nnzTotalDevHostPtr){
15664     nnzb = *nnzTotalDevHostPtr;
15665 }<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">else</span>{
15666     cudaMemcpy(&amp;nnzb, bsrRowPtrC+mb, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>), cudaMemcpyDeviceToHost);
15667     cudaMemcpy(&amp;base, bsrRowPtrC   , <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>), cudaMemcpyDeviceToHost);
15668     nnzb -= base;
15669 }
15670 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;bsrColIndC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>)*nnzb);
15671 cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;bsrValC, <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">float</span>)*(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>)*nnzb);
15672 cusparseScsr2bsr(handle, dirA, m, n,
15673         descrA, 
15674         csrValA, csrRowPtrA, csrColIndA,
15675         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-attribute">blockDim</span>,
15676         descrC,
15677         bsrValC, bsrRowPtrC, bsrColIndC);</pre><p class="p">If 
15678                      <math xmlns="http://www.w3.org/1998/Math/MathML">
15679                         <mi>b</mi>
15680                         <mi>l</mi>
15681                         <mi>o</mi>
15682                         <mi>c</mi>
15683                         <mi>k</mi>
15684                         <mi>D</mi>
15685                         <mi>i</mi>
15686                         <mi>m</mi>
15687                      </math> is large (typically a block cannot fit into shared memory), then csr2bsr routines will allocate temporary integer array of
15688                      size
15689                      
15690                      <math xmlns="http://www.w3.org/1998/Math/MathML">
15691                         <mi>m</mi>
15692                         <mi>b</mi>
15693                         <mo>*</mo>
15694                         <mi>b</mi>
15695                         <mi>l</mi>
15696                         <mi>o</mi>
15697                         <mi>c</mi>
15698                         <mi>k</mi>
15699                         <mi>D</mi>
15700                         <mi>i</mi>
15701                         <mi>m</mi>
15702                      </math>
15703                      . If device memory is not available, then CUSPARSE_STATUS_ALLOC_FAILED is returned.
15704                   </p>
15705                   <div class="tablenoborder">
15706                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
15707                            <tr class="row">
15708                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
15709                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
15710                            </tr>
15711                            <tr class="row">
15712                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">dirA</samp></td>
15713                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">storage format of blocks, either <samp class="ph codeph">CUSPARSE_DIRECTION_ROW</samp> or <samp class="ph codeph">CUSPARSE_DIRECTION_COLUMN</samp>.
15714                               </td>
15715                            </tr>
15716                            <tr class="row">
15717                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
15718                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of sparse matrix 
15719                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15720                                     <mi>A</mi>
15721                                  </math>.
15722                               </td>
15723                            </tr>
15724                            <tr class="row">
15725                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
15726                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of sparse matrix 
15727                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15728                                     <mi>A</mi>
15729                                  </math>.
15730                               </td>
15731                            </tr>
15732                            <tr class="row">
15733                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
15734                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
15735                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15736                                     <mi>A</mi>
15737                                  </math>.
15738                               </td>
15739                            </tr>
15740                            <tr class="row">
15741                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzA</samp></td>
15742                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero elements of sparse matrix 
15743                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15744                                     <mi>A</mi>
15745                                  </math>.
15746                               </td>
15747                            </tr>
15748                            <tr class="row">
15749                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
15750                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
15751                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15752                                     <mo stretchy="false">(</mo>
15753                                     <mo>=</mo>
15754                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15755                                     <mo>-</mo>
15756                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15757                                     <mo stretchy="false">)</mo>
15758                                  </math>
15759                                         non-zero elements of matrix 
15760                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15761                                     <mi>A</mi>
15762                                  </math>.
15763                               </td>
15764                            </tr>
15765                            <tr class="row">
15766                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
15767                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every row and the end of the last row plus one.
15768                               </td>
15769                            </tr>
15770                            <tr class="row">
15771                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
15772                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
15773                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15774                                     <mo stretchy="false">(</mo>
15775                                     <mo>=</mo>
15776                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15777                                     <mo>-</mo>
15778                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
15779                                     <mo stretchy="false">)</mo>
15780                                  </math>
15781                                         column indices of the non-zero elements of matrix 
15782                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15783                                     <mi>A</mi>
15784                                  </math>.
15785                               </td>
15786                            </tr>
15787                            <tr class="row">
15788                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">blockDim</samp></td>
15789                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">block dimension of sparse matrix <samp class="ph codeph">A</samp>. The range of 
15790                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15791                                     <mi>b</mi>
15792                                     <mi>l</mi>
15793                                     <mi>o</mi>
15794                                     <mi>c</mi>
15795                                     <mi>k</mi>
15796                                     <mi>D</mi>
15797                                     <mi>i</mi>
15798                                     <mi>m</mi>
15799                                  </math> is between 1 and
15800                                                 
15801                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15802                                     <mi>m</mi>
15803                                     <mi>i</mi>
15804                                     <mi>n</mi>
15805                                     <mo stretchy="false">(</mo>
15806                                     <mi>m</mi>
15807                                     <mo>,</mo>
15808                                     <mi>n</mi>
15809                                     <mo stretchy="false">)</mo>
15810                                  </math>
15811                                                 
15812                                         .
15813                               </td>
15814                            </tr>
15815                            <tr class="row">
15816                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrC</samp></td>
15817                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
15818                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15819                                     <mi>C</mi>
15820                                  </math>.
15821                               </td>
15822                            </tr>
15823                         </tbody>
15824                      </table>
15825                   </div>
15826                   <div class="tablenoborder">
15827                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
15828                            <tr class="row">
15829                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrValC</samp></td>
15830                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of <samp class="ph codeph">nnzb</samp> *
15831                                         
15832                                         
15833                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15834                                     <mi>b</mi>
15835                                     <mi>l</mi>
15836                                     <mi>o</mi>
15837                                     <mi>c</mi>
15838                                     <mi>k</mi>
15839                                     <mi>D</mi>
15840                                     <mi>i</mi>
15841                                     <msup>
15842                                        <mi>m</mi>
15843                                        <mrow class="MJX-TeXAtom-ORD">
15844                                           <mn>2</mn>
15845                                        </mrow>
15846                                     </msup>
15847                                  </math>
15848                                         
15849                                  non-zero elements of matrix .
15850                               </td>
15851                            </tr>
15852                            <tr class="row">
15853                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrRowPtrC</samp></td>
15854                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">mb+1</samp> elements that contains the start of every block row and the end of the last block row plus one.
15855                               </td>
15856                            </tr>
15857                            <tr class="row">
15858                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">bsrColIndC</samp></td>
15859                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">nnzb</samp> column indices of the non-zero blocks of matrix 
15860                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15861                                     <mi>C</mi>
15862                                  </math>.
15863                               </td>
15864                            </tr>
15865                            <tr class="row">
15866                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzTotalDevHostPtr</samp></td>
15867                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">total number of nonzero elements in device or host memory. It is equal to 
15868                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15869                                     <mi>(bsrRowPtrC(mb)-bsrRowPtrC(0))</mi>
15870                                  </math>.
15871                               </td>
15872                            </tr>
15873                         </tbody>
15874                      </table>
15875                   </div>
15876                   <div class="tablenoborder">
15877                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
15878                            <tr class="row">
15879                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
15880                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
15881                            </tr>
15882                            <tr class="row">
15883                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
15884                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
15885                            </tr>
15886                            <tr class="row">
15887                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
15888                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
15889                            </tr>
15890                            <tr class="row">
15891                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
15892                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n&lt;0</samp>).  IndexBase field of <samp class="ph codeph">descrA, descrC</samp> is not base-0 or base-1, <samp class="ph codeph">dirA</samp> is not row-major or column-major, or 
15893                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15894                                     <mi>b</mi>
15895                                     <mi>l</mi>
15896                                     <mi>o</mi>
15897                                     <mi>c</mi>
15898                                     <mi>k</mi>
15899                                     <mi>D</mi>
15900                                     <mi>i</mi>
15901                                     <mi>m</mi>
15902                                  </math> is not between 1 and min(
15903                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15904                                     <mi>m</mi>
15905                                  </math>,
15906                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15907                                     <mi>n</mi>
15908                                  </math>)).
15909                               </td>
15910                            </tr>
15911                            <tr class="row">
15912                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
15913                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
15914                            </tr>
15915                            <tr class="row">
15916                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
15917                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
15918                            </tr>
15919                            <tr class="row">
15920                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
15921                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
15922                                  <p class="p"></p>
15923                                  <p class="p"></p>
15924                                  the matrix type is not supported.
15925                               </td>
15926                            </tr>
15927                            <tr class="row">
15928                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
15929                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
15930                            </tr>
15931                         </tbody>
15932                      </table>
15933                   </div>
15934                </div>
15935             </div>
15936             <div class="topic concept nested1" id="cusparse-lt-t-gt-csr2coo"><a name="cusparse-lt-t-gt-csr2coo" shape="rect">
15937                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csr2coo" name="cusparse-lt-t-gt-csr2coo" shape="rect">11.6.&nbsp;cusparse&lt;t&gt;csr2coo</a></h3>
15938                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
15939 cusparseXcsr2coo(cusparseHandle_t handle, const int *csrRowPtr,
15940                  int nnz, int m, int *cooRowInd, 
15941                  cusparseIndexBase_t idxBase)</pre><p class="p">This function converts the array containing the compressed row pointers (corresponding to CSR format) into an array of uncompressed
15942                      row indices (corresponding to COO format).
15943                   </p>
15944                   <p class="p">It can also be used to convert the array containing the compressed column indices (corresponding to CSC format) into an array
15945                      of uncompressed column indices (corresponding to COO format).
15946                   </p>
15947                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
15948                      to the application on the host before the result is ready.
15949                   </p>
15950                   <div class="tablenoborder">
15951                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
15952                            <tr class="row">
15953                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
15954                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
15955                            </tr>
15956                            <tr class="row">
15957                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtr</samp></td>
15958                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every row and the end of the last row plus one.
15959                               </td>
15960                            </tr>
15961                            <tr class="row">
15962                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
15963                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of non-zeros of the sparse matrix (that is also the length of array <samp class="ph codeph">cooRowInd</samp>).
15964                               </td>
15965                            </tr>
15966                            <tr class="row">
15967                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
15968                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
15969                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
15970                                     <mi>A</mi>
15971                                  </math>.
15972                               </td>
15973                            </tr>
15974                            <tr class="row">
15975                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">idxBase</samp></td>
15976                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> or <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
15977                               </td>
15978                            </tr>
15979                         </tbody>
15980                      </table>
15981                   </div>
15982                   <div class="tablenoborder">
15983                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
15984                            <tr class="row">
15985                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cooRowInd</samp></td>
15986                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">nnz</samp> uncompressed row indices.
15987                               </td>
15988                            </tr>
15989                         </tbody>
15990                      </table>
15991                   </div>
15992                   <div class="tablenoborder">
15993                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
15994                            <tr class="row">
15995                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
15996                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
15997                            </tr>
15998                            <tr class="row">
15999                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
16000                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
16001                            </tr>
16002                            <tr class="row">
16003                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
16004                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">IndexBase</samp> is neither <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> nor <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
16005                               </td>
16006                            </tr>
16007                            <tr class="row">
16008                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
16009                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
16010                            </tr>
16011                         </tbody>
16012                      </table>
16013                   </div>
16014                </div>
16015             </div>
16016             <div class="topic concept nested1" id="cusparse-lt-t-gt-csr2csc"><a name="cusparse-lt-t-gt-csr2csc" shape="rect">
16017                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csr2csc" name="cusparse-lt-t-gt-csr2csc" shape="rect">11.7.&nbsp;cusparse&lt;t&gt;csr2csc</a></h3>
16018                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
16019 cusparseScsr2csc(cusparseHandle_t handle, int m, int n, int nnz,
16020                  const float *csrVal, const int *csrRowPtr, 
16021                  const int *csrColInd, float           *cscVal,
16022                  int *cscRowInd, int *cscColPtr, 
16023                  cusparseAction_t copyValues, 
16024                  cusparseIndexBase_t idxBase)
16025 cusparseStatus_t 
16026 cusparseDcsr2csc(cusparseHandle_t handle, int m, int n, int nnz,
16027                  const double *csrVal, const int *csrRowPtr, 
16028                  const int *csrColInd, double          *cscVal,
16029                  int *cscRowInd, int *cscColPtr, 
16030                  cusparseAction_t copyValues, 
16031                  cusparseIndexBase_t idxBase)
16032 cusparseStatus_t 
16033 cusparseCcsr2csc(cusparseHandle_t handle, int m, int n, int nnz,
16034                  const cuComplex *csrVal, const int *csrRowPtr, 
16035                  const int *csrColInd, cuComplex       *cscVal,
16036                  int *cscRowInd, int *cscColPtr, 
16037                  cusparseAction_t copyValues, 
16038                  cusparseIndexBase_t idxBase)
16039 cusparseStatus_t 
16040 cusparseZcsr2csc(cusparseHandle_t handle, int m, int n, int nnz,
16041                  const cuDoubleComplex *csrVal, const int *csrRowPtr, 
16042                  const int *csrColInd, cuDoubleComplex *cscVal, 
16043                  int *cscRowInd, int *cscColPtr, 
16044                  cusparseAction_t copyValues, 
16045                  cusparseIndexBase_t idxBase)</pre><p class="p">This function converts a sparse matrix in CSR format (that is defined by the three arrays <samp class="ph codeph">csrVal</samp>, <samp class="ph codeph">csrRowPtr</samp> and <samp class="ph codeph">csrColInd</samp>) into a sparse matrix in CSC format (that is defined by arrays <samp class="ph codeph">cscVal</samp>, <samp class="ph codeph">cscRowInd</samp>, and <samp class="ph codeph">cscColPtr</samp>). The resulting matrix can also be seen as the transpose of the original sparse matrix. Notice that this routine can also
16046                      be used to convert a matrix in CSC format into a matrix in CSR format.
16047                   </p>
16048                   <p class="p">This function requires significant amount of extra storage that is proportional to the matrix size. It is executed asynchronously
16049                      with respect to the host and it may return control to the application on the host before the result is ready.
16050                   </p>
16051                   <div class="tablenoborder">
16052                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
16053                            <tr class="row">
16054                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
16055                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
16056                            </tr>
16057                            <tr class="row">
16058                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
16059                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
16060                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16061                                     <mi>A</mi>
16062                                  </math>.
16063                               </td>
16064                            </tr>
16065                            <tr class="row">
16066                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
16067                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
16068                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16069                                     <mi>A</mi>
16070                                  </math>.
16071                               </td>
16072                            </tr>
16073                            <tr class="row">
16074                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnz</samp></td>
16075                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of nonz-zero elements of matrix 
16076                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16077                                     <mi>A</mi>
16078                                  </math>.
16079                               </td>
16080                            </tr>
16081                            <tr class="row">
16082                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrVal</samp></td>
16083                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
16084                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16085                                     <mo stretchy="false">(</mo>
16086                                     <mo>=</mo>
16087                                  </math><samp class="ph codeph">csrRowPtr(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16088                                     <mo>-</mo>
16089                                  </math><samp class="ph codeph">csrRowPtr(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16090                                     <mo stretchy="false">)</mo>
16091                                  </math>
16092                                         non-zero elements of matrix 
16093                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16094                                     <mi>A</mi>
16095                                  </math>.
16096                               </td>
16097                            </tr>
16098                            <tr class="row">
16099                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtr</samp></td>
16100                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every row and the end of the last row plus one.
16101                               </td>
16102                            </tr>
16103                            <tr class="row">
16104                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColInd</samp></td>
16105                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
16106                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16107                                     <mo stretchy="false">(</mo>
16108                                     <mo>=</mo>
16109                                  </math><samp class="ph codeph">csrRowPtr(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16110                                     <mo>-</mo>
16111                                  </math><samp class="ph codeph">csrRowPtr(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16112                                     <mo stretchy="false">)</mo>
16113                                  </math>
16114                                         column indices of the non-zero elements of matrix 
16115                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16116                                     <mi>A</mi>
16117                                  </math>.
16118                               </td>
16119                            </tr>
16120                            <tr class="row">
16121                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">copyValues</samp></td>
16122                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_ACTION_SYMBOLIC</samp> or <samp class="ph codeph">CUSPARSE_ACTION_NUMERIC</samp>.
16123                               </td>
16124                            </tr>
16125                            <tr class="row">
16126                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">idxBase</samp></td>
16127                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> or <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
16128                               </td>
16129                            </tr>
16130                         </tbody>
16131                      </table>
16132                   </div>
16133                   <div class="tablenoborder">
16134                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
16135                            <tr class="row">
16136                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscVal</samp></td>
16137                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of 
16138                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16139                                     <mo stretchy="false">(</mo>
16140                                     <mo>=</mo>
16141                                  </math><samp class="ph codeph">cscColPtr(n)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16142                                     <mo>-</mo>
16143                                  </math><samp class="ph codeph">cscColPtr(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16144                                     <mo stretchy="false">)</mo>
16145                                  </math> 
16146                                         non-zero elements of matrix 
16147                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16148                                     <mi>A</mi>
16149                                  </math>. It is only filled-in if copyValues is set to <samp class="ph codeph">CUSPARSE_ACTION_NUMERIC</samp>.
16150                               </td>
16151                            </tr>
16152                            <tr class="row">
16153                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscRowInd</samp></td>
16154                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16155                                     <mo stretchy="false">(</mo>
16156                                     <mo>=</mo>
16157                                  </math><samp class="ph codeph">cscColPtr(n)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16158                                     <mo>-</mo>
16159                                  </math><samp class="ph codeph">cscColPtr(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16160                                     <mo stretchy="false">)</mo>
16161                                  </math> column indices of the non-zero elements of matrix 
16162                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16163                                     <mi>A</mi>
16164                                  </math>.
16165                               </td>
16166                            </tr>
16167                            <tr class="row">
16168                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscColPtr</samp></td>
16169                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">n+1</samp> elements that contains the start of every column and the end of the last column plus one.
16170                               </td>
16171                            </tr>
16172                         </tbody>
16173                      </table>
16174                   </div>
16175                   <div class="tablenoborder">
16176                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
16177                            <tr class="row">
16178                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
16179                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
16180                            </tr>
16181                            <tr class="row">
16182                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
16183                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
16184                            </tr>
16185                            <tr class="row">
16186                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
16187                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
16188                            </tr>
16189                            <tr class="row">
16190                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
16191                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n,nnz&lt;0</samp>).
16192                               </td>
16193                            </tr>
16194                            <tr class="row">
16195                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
16196                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
16197                            </tr>
16198                            <tr class="row">
16199                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
16200                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
16201                            </tr>
16202                            <tr class="row">
16203                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
16204                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
16205                            </tr>
16206                         </tbody>
16207                      </table>
16208                   </div>
16209                </div>
16210             </div>
16211             <div class="topic concept nested1" id="cusparse-lt-t-gt-csr2dense"><a name="cusparse-lt-t-gt-csr2dense" shape="rect">
16212                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csr2dense" name="cusparse-lt-t-gt-csr2dense" shape="rect">11.8.&nbsp;cusparse&lt;t&gt;csr2dense</a></h3>
16213                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
16214 cusparseScsr2csc(cusparseHandle_t handle, int m, int n, int nnz,
16215                  const float *csrVal, const int *csrRowPtr, 
16216                  const int *csrColInd, float           *cscVal,
16217                  int *cscRowInd, int *cscColPtr, 
16218                  cusparseAction_t copyValues, 
16219                  cusparseIndexBase_t idxBase)
16220 cusparseStatus_t 
16221 cusparseDcsr2csc(cusparseHandle_t handle, int m, int n, int nnz,
16222                  const double *csrVal, const int *csrRowPtr, 
16223                  const int *csrColInd, double          *cscVal,
16224                  int *cscRowInd, int *cscColPtr, 
16225                  cusparseAction_t copyValues, 
16226                  cusparseIndexBase_t idxBase)
16227 cusparseStatus_t 
16228 cusparseCcsr2csc(cusparseHandle_t handle, int m, int n, int nnz,
16229                  const cuComplex *csrVal, const int *csrRowPtr, 
16230                  const int *csrColInd, cuComplex       *cscVal,
16231                  int *cscRowInd, int *cscColPtr, 
16232                  cusparseAction_t copyValues, 
16233                  cusparseIndexBase_t idxBase)
16234 cusparseStatus_t 
16235 cusparseZcsr2csc(cusparseHandle_t handle, int m, int n, int nnz,
16236                  const cuDoubleComplex *csrVal, const int *csrRowPtr, 
16237                  const int *csrColInd, cuDoubleComplex *cscVal, 
16238                  int *cscRowInd, int *cscColPtr, 
16239                  cusparseAction_t copyValues, 
16240                  cusparseIndexBase_t idxBase)</pre><p class="p">This function converts the sparse matrix in CSR format (that is defined by the three arrays <samp class="ph codeph">csrValA</samp>, <samp class="ph codeph">csrRowPtrA</samp> and <samp class="ph codeph">csrColIndA</samp>) into the matrix <samp class="ph codeph">A</samp> in dense format. The dense matrix <samp class="ph codeph">A</samp> is filled in with the values of the sparse matrix and with zeros elsewhere.
16241                   </p>
16242                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
16243                      to the application on the host before the result is ready.
16244                   </p>
16245                   <div class="tablenoborder">
16246                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
16247                            <tr class="row">
16248                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
16249                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
16250                            </tr>
16251                            <tr class="row">
16252                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
16253                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
16254                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16255                                     <mi>A</mi>
16256                                  </math>.
16257                               </td>
16258                            </tr>
16259                            <tr class="row">
16260                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
16261                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
16262                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16263                                     <mi>A</mi>
16264                                  </math>.
16265                               </td>
16266                            </tr>
16267                            <tr class="row">
16268                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
16269                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
16270                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16271                                     <mi>A</mi>
16272                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
16273                               </td>
16274                            </tr>
16275                            <tr class="row">
16276                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
16277                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
16278                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16279                                     <mo stretchy="false">(</mo>
16280                                     <mo>=</mo>
16281                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16282                                     <mo>-</mo>
16283                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16284                                     <mo stretchy="false">)</mo>
16285                                  </math>
16286                                         non-zero elements of matrix 
16287                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16288                                     <mi>A</mi>
16289                                  </math>.
16290                               </td>
16291                            </tr>
16292                            <tr class="row">
16293                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
16294                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every row and the end of the last row plus one.
16295                               </td>
16296                            </tr>
16297                            <tr class="row">
16298                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
16299                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
16300                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16301                                     <mo stretchy="false">(</mo>
16302                                     <mo>=</mo>
16303                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16304                                     <mo>-</mo>
16305                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16306                                     <mo stretchy="false">)</mo>
16307                                  </math>
16308                                         column indices of the non-zero elements of matrix 
16309                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16310                                     <mi>A</mi>
16311                                  </math>.
16312                               </td>
16313                            </tr>
16314                            <tr class="row">
16315                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">lda</samp></td>
16316                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of array matrix<samp class="ph codeph">A</samp>.
16317                               </td>
16318                            </tr>
16319                         </tbody>
16320                      </table>
16321                   </div>
16322                   <div class="tablenoborder">
16323                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
16324                            <tr class="row">
16325                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">A</samp></td>
16326                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of dimensions <samp class="ph codeph">(lda,n)</samp> that is filled in with the values of the sparse matrix.
16327                               </td>
16328                            </tr>
16329                         </tbody>
16330                      </table>
16331                   </div>
16332                   <div class="tablenoborder">
16333                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
16334                            <tr class="row">
16335                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
16336                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
16337                            </tr>
16338                            <tr class="row">
16339                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
16340                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
16341                            </tr>
16342                            <tr class="row">
16343                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
16344                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n&lt;0</samp>).
16345                               </td>
16346                            </tr>
16347                            <tr class="row">
16348                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
16349                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
16350                            </tr>
16351                            <tr class="row">
16352                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
16353                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
16354                            </tr>
16355                            <tr class="row">
16356                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
16357                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
16358                                  <p class="p"></p>
16359                                  <p class="p"></p>
16360                                  the matrix type is not supported.
16361                               </td>
16362                            </tr>
16363                         </tbody>
16364                      </table>
16365                   </div>
16366                </div>
16367             </div>
16368             <div class="topic concept nested1" id="cusparse-lt-t-gt-csr2hyb"><a name="cusparse-lt-t-gt-csr2hyb" shape="rect">
16369                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-csr2hyb" name="cusparse-lt-t-gt-csr2hyb" shape="rect">11.9.&nbsp;cusparse&lt;t&gt;csr2hyb</a></h3>
16370                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
16371 cusparseScsr2hyb(cusparseHandle_t handle, int m, int n, 
16372             const cusparseMatDescr_t descrA, 
16373             const float           *csrValA,
16374             const int *csrRowPtrA, const int *csrColIndA, 
16375             cusparseHybMat_t hybA, int userEllWidth, 
16376             cusparseHybPartition_t partitionType)
16377 cusparseStatus_t 
16378 cusparseDcsr2hyb(cusparseHandle_t handle, int m, int n,
16379             const cusparseMatDescr_t descrA, 
16380             const double          *csrValA,
16381             const int *csrRowPtrA, const int *csrColIndA, 
16382             cusparseHybMat_t hybA, int userEllWidth, 
16383             cusparseHybPartition_t partitionType)
16384 cusparseStatus_t 
16385 cusparseCcsr2hyb(cusparseHandle_t handle, int m, int n, 
16386             const cusparseMatDescr_t descrA, 
16387             const cuComplex       *csrValA, 
16388             const int *csrRowPtrA, const int *csrColIndA, 
16389             cusparseHybMat_t hybA, int userEllWidth, 
16390             cusparseHybPartition_t partitionType)
16391 cusparseStatus_t 
16392 cusparseZcsr2hyb(cusparseHandle_t handle, int m, int n, 
16393             const cusparseMatDescr_t descrA, 
16394             const cuDoubleComplex *csrValA, 
16395             const int *csrRowPtrA, const int *csrColIndA, 
16396             cusparseHybMat_t hybA, int userEllWidth, 
16397             cusparseHybPartition_t partitionType)</pre><p class="p">This function converts a sparse matrix in CSR format into a sparse matrix in HYB format. It assumes that the <samp class="ph codeph">hybA</samp> parameter has been initialized with <samp class="ph codeph">cusparseCreateHybMat</samp> routine before calling this function.
16398                   </p>
16399                   <p class="p">This function requires some amount of temporary storage and a significant amount of storage for the matrix in HYB format.
16400                      It is executed asynchronously with respect to the host and it may return control to the application on the host before the
16401                      result is ready.
16402                   </p>
16403                   <div class="tablenoborder">
16404                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
16405                            <tr class="row">
16406                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
16407                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
16408                            </tr>
16409                            <tr class="row">
16410                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
16411                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
16412                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16413                                     <mi>A</mi>
16414                                  </math>.
16415                               </td>
16416                            </tr>
16417                            <tr class="row">
16418                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
16419                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
16420                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16421                                     <mi>A</mi>
16422                                  </math>.
16423                               </td>
16424                            </tr>
16425                            <tr class="row">
16426                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
16427                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
16428                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16429                                     <mi>A</mi>
16430                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
16431                               </td>
16432                            </tr>
16433                            <tr class="row">
16434                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
16435                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of
16436                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16437                                     <mo stretchy="false">(</mo>
16438                                     <mo>=</mo>
16439                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16440                                     <mo>-</mo>
16441                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16442                                     <mo stretchy="false">)</mo>
16443                                  </math>
16444                                         non-zero elements of matrix 
16445                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16446                                     <mi>A</mi>
16447                                  </math>.
16448                               </td>
16449                            </tr>
16450                            <tr class="row">
16451                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
16452                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every row and the end of the last row plus one.
16453                               </td>
16454                            </tr>
16455                            <tr class="row">
16456                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
16457                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of
16458                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16459                                     <mo stretchy="false">(</mo>
16460                                     <mo>=</mo>
16461                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16462                                     <mo>-</mo>
16463                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16464                                     <mo stretchy="false">)</mo>
16465                                  </math>
16466                                         column indices of the non-zero elements of matrix 
16467                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16468                                     <mi>A</mi>
16469                                  </math>.
16470                               </td>
16471                            </tr>
16472                            <tr class="row">
16473                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">userEllWidth</samp></td>
16474                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">width of the regular (ELL) part of the matrix in HYB format, which should be less than maximum number of non-zeros per row
16475                                  and is only required if <samp class="ph codeph">partitionType</samp> == <samp class="ph codeph">CUSPARSE_HYB_PARTITION_USER</samp>.
16476                               </td>
16477                            </tr>
16478                            <tr class="row">
16479                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">partitionType</samp></td>
16480                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">partitioning method to be used in the conversion (please refer to <samp class="ph codeph">cusparseHybPartition_t</samp> on page ?? for details).
16481                               </td>
16482                            </tr>
16483                         </tbody>
16484                      </table>
16485                   </div>
16486                   <div class="tablenoborder">
16487                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
16488                            <tr class="row">
16489                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">hybA</samp></td>
16490                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix <samp class="ph codeph">A</samp> in HYB storage format.
16491                               </td>
16492                            </tr>
16493                         </tbody>
16494                      </table>
16495                   </div>
16496                   <div class="tablenoborder">
16497                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
16498                            <tr class="row">
16499                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
16500                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
16501                            </tr>
16502                            <tr class="row">
16503                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
16504                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
16505                            </tr>
16506                            <tr class="row">
16507                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
16508                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
16509                            </tr>
16510                            <tr class="row">
16511                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
16512                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n&lt;0</samp>).
16513                               </td>
16514                            </tr>
16515                            <tr class="row">
16516                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
16517                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
16518                            </tr>
16519                            <tr class="row">
16520                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
16521                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
16522                            </tr>
16523                            <tr class="row">
16524                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
16525                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
16526                            </tr>
16527                            <tr class="row">
16528                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
16529                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
16530                                  <p class="p"></p>
16531                                  <p class="p"></p>
16532                                  the matrix type is not supported.
16533                               </td>
16534                            </tr>
16535                         </tbody>
16536                      </table>
16537                   </div>
16538                </div>
16539             </div>
16540             <div class="topic concept nested1" id="cusparse-lt-t-gt-dense2csc"><a name="cusparse-lt-t-gt-dense2csc" shape="rect">
16541                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-dense2csc" name="cusparse-lt-t-gt-dense2csc" shape="rect">11.10.&nbsp;cusparse&lt;t&gt;dense2csc</a></h3>
16542                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
16543 cusparseSdense2csc(cusparseHandle_t handle, int m, int n, 
16544                 const cusparseMatDescr_t descrA, 
16545                 const float           *A, 
16546                 int lda, const int *nnzPerCol, 
16547                 float           *cscValA, 
16548                 int *cscRowIndA, int *cscColPtrA)
16549 cusparseStatus_t 
16550 cusparseDdense2csc(cusparseHandle_t handle, int m, int n, 
16551                 const cusparseMatDescr_t descrA, 
16552                 const double          *A, 
16553                 int lda, const int *nnzPerCol, 
16554                 double          *cscValA, 
16555                 int *cscRowIndA, int *cscColPtrA)
16556 cusparseStatus_t 
16557 cusparseCdense2csc(cusparseHandle_t handle, int m, int n, 
16558                 const cusparseMatDescr_t descrA, 
16559                 const cuComplex       *A, 
16560                 int lda, const int *nnzPerCol, 
16561                 cuComplex       *cscValA, 
16562                 int *cscRowIndA, int *cscColPtrA)
16563 cusparseStatus_t 
16564 cusparseZdense2csc(cusparseHandle_t handle, int m, int n, 
16565                 const cusparseMatDescr_t descrA, 
16566                 const cuDoubleComplex *A, 
16567                 int lda, const int *nnzPerCol, 
16568                 cuDoubleComplex *cscValA, 
16569                 int *cscRowIndA, int *cscColPtrA)</pre><p class="p">This function converts the matrix <samp class="ph codeph">A</samp> in dense format into a sparse matrix in CSC format. All the parameters are assumed to have been pre-allocated by the user
16570                      and the arrays are filled in based on <samp class="ph codeph">nnzPerCol</samp>, which can be pre-computed with <samp class="ph codeph">cusparse&lt;t&gt;nnz()</samp>.
16571                   </p>
16572                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
16573                      to the application on the host before the result is ready.
16574                   </p>
16575                   <div class="tablenoborder">
16576                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
16577                            <tr class="row">
16578                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
16579                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
16580                            </tr>
16581                            <tr class="row">
16582                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
16583                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
16584                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16585                                     <mi>A</mi>
16586                                  </math>.
16587                               </td>
16588                            </tr>
16589                            <tr class="row">
16590                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
16591                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
16592                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16593                                     <mi>A</mi>
16594                                  </math>.
16595                               </td>
16596                            </tr>
16597                            <tr class="row">
16598                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
16599                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
16600                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16601                                     <mi>A</mi>
16602                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
16603                               </td>
16604                            </tr>
16605                            <tr class="row">
16606                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">A</samp></td>
16607                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of dimensions <samp class="ph codeph">(lda, n)</samp>.
16608                               </td>
16609                            </tr>
16610                            <tr class="row">
16611                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">lda</samp></td>
16612                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of dense array<samp class="ph codeph">A</samp>.
16613                               </td>
16614                            </tr>
16615                            <tr class="row">
16616                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzPerCol</samp></td>
16617                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of size <samp class="ph codeph">n</samp> containing the number of non-zero elements per column.
16618                               </td>
16619                            </tr>
16620                         </tbody>
16621                      </table>
16622                   </div>
16623                   <div class="tablenoborder">
16624                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
16625                            <tr class="row">
16626                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscValA</samp></td>
16627                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of 
16628                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16629                                     <mo stretchy="false">(</mo>
16630                                     <mo>=</mo>
16631                                  </math><samp class="ph codeph">cscRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16632                                     <mo>-</mo>
16633                                  </math><samp class="ph codeph">cscRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16634                                     <mo stretchy="false">)</mo>
16635                                  </math> 
16636                                         non-zero elements of matrix 
16637                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16638                                     <mi>A</mi>
16639                                  </math>. It is only filled-in if copyValues is set to <samp class="ph codeph">CUSPARSE_ACTION_NUMERIC</samp>.
16640                               </td>
16641                            </tr>
16642                            <tr class="row">
16643                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscRowIndA</samp></td>
16644                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16645                                     <mo stretchy="false">(</mo>
16646                                     <mo>=</mo>
16647                                  </math><samp class="ph codeph">cscRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16648                                     <mo>-</mo>
16649                                  </math><samp class="ph codeph">cscRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16650                                     <mo stretchy="false">)</mo>
16651                                  </math> row indices of the non-zero elements of matrix 
16652                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16653                                     <mi>A</mi>
16654                                  </math>.
16655                               </td>
16656                            </tr>
16657                            <tr class="row">
16658                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscColPtrA</samp></td>
16659                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">n+1</samp> elements that contains the start of every column and the end of the last column plus one.
16660                               </td>
16661                            </tr>
16662                         </tbody>
16663                      </table>
16664                   </div>
16665                   <div class="tablenoborder">
16666                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
16667                            <tr class="row">
16668                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
16669                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
16670                            </tr>
16671                            <tr class="row">
16672                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
16673                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
16674                            </tr>
16675                            <tr class="row">
16676                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
16677                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n&lt;0</samp>).
16678                               </td>
16679                            </tr>
16680                            <tr class="row">
16681                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
16682                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
16683                            </tr>
16684                            <tr class="row">
16685                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
16686                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
16687                            </tr>
16688                            <tr class="row">
16689                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
16690                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
16691                                  <p class="p"></p>
16692                                  <p class="p"></p>
16693                                  the matrix type is not supported.
16694                               </td>
16695                            </tr>
16696                         </tbody>
16697                      </table>
16698                   </div>
16699                </div>
16700             </div>
16701             <div class="topic concept nested1" id="cusparse-lt-t-gt-dense2csr"><a name="cusparse-lt-t-gt-dense2csr" shape="rect">
16702                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-dense2csr" name="cusparse-lt-t-gt-dense2csr" shape="rect">11.11.&nbsp;cusparse&lt;t&gt;dense2csr</a></h3>
16703                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
16704 cusparseSdense2csr(cusparseHandle_t handle, int m, int n, 
16705                 const cusparseMatDescr_t descrA, 
16706                 const float           *A, 
16707                 int lda, const int *nnzPerRow, 
16708                 float           *csrValA, 
16709                 int *csrRowPtrA, int *csrColIndA) 
16710 cusparseStatus_t 
16711 cusparseDdense2csr(cusparseHandle_t handle, int m, int n, 
16712                 const cusparseMatDescr_t descrA, 
16713                 const double          *A, 
16714                 int lda, const int *nnzPerRow, 
16715                 double          *csrValA, 
16716                 int *csrRowPtrA, int *csrColIndA) 
16717 cusparseStatus_t 
16718 cusparseCdense2csr(cusparseHandle_t handle, int m, int n, 
16719                 const cusparseMatDescr_t descrA, 
16720                 const cuComplex       *A, 
16721                 int lda, const int *nnzPerRow, 
16722                 cuComplex       *csrValA, 
16723                 int *csrRowPtrA, int *csrColIndA) 
16724 cusparseStatus_t 
16725 cusparseZdense2csr(cusparseHandle_t handle, int m, int n, 
16726                 const cusparseMatDescr_t descrA, 
16727                 const cuDoubleComplex *A, 
16728                 int lda, const int *nnzPerRow, 
16729                 cuDoubleComplex *csrValA, 
16730                 int *csrRowPtrA, int *csrColIndA) </pre><p class="p">This function converts the matrix <samp class="ph codeph">A</samp> in dense format into a sparse matrix in CSR format. All the parameters are assumed to have been pre-allocated by the user
16731                      and the arrays are filled in based on the <samp class="ph codeph">nnzPerRow</samp>, which can be pre-computed with <samp class="ph codeph">cusparse&lt;t&gt;nnz()</samp>.
16732                   </p>
16733                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
16734                      to the application on the host before the result is ready.
16735                   </p>
16736                   <div class="tablenoborder">
16737                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
16738                            <tr class="row">
16739                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
16740                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
16741                            </tr>
16742                            <tr class="row">
16743                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
16744                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
16745                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16746                                     <mi>A</mi>
16747                                  </math>.
16748                               </td>
16749                            </tr>
16750                            <tr class="row">
16751                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
16752                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
16753                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16754                                     <mi>A</mi>
16755                                  </math>.
16756                               </td>
16757                            </tr>
16758                            <tr class="row">
16759                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
16760                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
16761                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16762                                     <mi>A</mi>
16763                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
16764                               </td>
16765                            </tr>
16766                            <tr class="row">
16767                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">A</samp></td>
16768                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of dimensions <samp class="ph codeph">(lda, n)</samp>.
16769                               </td>
16770                            </tr>
16771                            <tr class="row">
16772                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">lda</samp></td>
16773                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of dense array<samp class="ph codeph">A</samp>.
16774                               </td>
16775                            </tr>
16776                            <tr class="row">
16777                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzPerRow</samp></td>
16778                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of size <samp class="ph codeph">n</samp> containing the number of non-zero elements per row.
16779                               </td>
16780                            </tr>
16781                         </tbody>
16782                      </table>
16783                   </div>
16784                   <div class="tablenoborder">
16785                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
16786                            <tr class="row">
16787                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
16788                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of 
16789                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16790                                     <mo stretchy="false">(</mo>
16791                                     <mo>=</mo>
16792                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16793                                     <mo>-</mo>
16794                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16795                                     <mo stretchy="false">)</mo>
16796                                  </math> 
16797                                         non-zero elements of matrix 
16798                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16799                                     <mi>A</mi>
16800                                  </math>.
16801                               </td>
16802                            </tr>
16803                            <tr class="row">
16804                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
16805                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every column and the end of the last column plus one.
16806                               </td>
16807                            </tr>
16808                            <tr class="row">
16809                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
16810                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16811                                     <mo stretchy="false">(</mo>
16812                                     <mo>=</mo>
16813                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16814                                     <mo>-</mo>
16815                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
16816                                     <mo stretchy="false">)</mo>
16817                                  </math> column indices of the non-zero elements of matrix 
16818                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16819                                     <mi>A</mi>
16820                                  </math>.
16821                               </td>
16822                            </tr>
16823                         </tbody>
16824                      </table>
16825                   </div>
16826                   <div class="tablenoborder">
16827                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
16828                            <tr class="row">
16829                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
16830                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
16831                            </tr>
16832                            <tr class="row">
16833                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
16834                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
16835                            </tr>
16836                            <tr class="row">
16837                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
16838                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
16839                            </tr>
16840                            <tr class="row">
16841                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
16842                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n&lt;0</samp>).
16843                               </td>
16844                            </tr>
16845                            <tr class="row">
16846                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
16847                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
16848                            </tr>
16849                            <tr class="row">
16850                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
16851                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
16852                            </tr>
16853                            <tr class="row">
16854                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
16855                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
16856                                  <p class="p"></p>
16857                                  <p class="p"></p>
16858                                  the matrix type is not supported.
16859                               </td>
16860                            </tr>
16861                         </tbody>
16862                      </table>
16863                   </div>
16864                </div>
16865             </div>
16866             <div class="topic concept nested1" id="cusparse-lt-t-gt-dense2hyb"><a name="cusparse-lt-t-gt-dense2hyb" shape="rect">
16867                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-dense2hyb" name="cusparse-lt-t-gt-dense2hyb" shape="rect">11.12.&nbsp;cusparse&lt;t&gt;dense2hyb</a></h3>
16868                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t
16869 cusparseSdense2hyb(cusparseHandle_t handle, int m, int n,
16870                    const cusparseMatDescr_t descrA, 
16871                    const float           *A,
16872                    int lda, const int *nnzPerRow, cusparseHybMat_t hybA,
16873                    int userEllWidth, 
16874                    cusparseHybPartition_t partitionType)
16875 cusparseStatus_t
16876 cusparseDdense2hyb(cusparseHandle_t handle, int m, int n,
16877                    const cusparseMatDescr_t descrA, 
16878                    const double          *A,
16879                    int lda, const int *nnzPerRow, cusparseHybMat_t hybA, 
16880                    int userEllWidth, 
16881                    cusparseHybPartition_t partitionType)
16882 cusparseStatus_t
16883 cusparseCdense2hyb(cusparseHandle_t handle, int m, int n,
16884                    const cusparseMatDescr_t descrA, 
16885                    const cuComplex       *A,
16886                    int lda, const int *nnzPerRow, cusparseHybMat_t hybA,
16887                    int userEllWidth, 
16888                    cusparseHybPartition_t partitionType)
16889 cusparseStatus_t
16890 cusparseZdense2hyb(cusparseHandle_t handle, int m, int n,
16891                    const cusparseMatDescr_t descrA, 
16892                    const cuDoubleComplex *A,
16893                    int lda, const int *nnzPerRow, cusparseHybMat_t hybA,
16894                    int userEllWidth, 
16895                    cusparseHybPartition_t partitionType)</pre><p class="p">This function converts the matrix <samp class="ph codeph">A</samp> in dense format into a sparse matrix in HYB format. It assumes that the routine <samp class="ph codeph">cusparseCreateHybMat</samp> was used to initialize the opaque structure <samp class="ph codeph">hybA</samp> and that the array <samp class="ph codeph">nnzPerRow</samp> was pre-computed with <samp class="ph codeph">cusparse&lt;t&gt;nnz()</samp>.
16896                   </p>
16897                   <p class="p">This function requires some amount of temporary storage and a significant amount of storage for the matrix in HYB format.
16898                      It is executed asynchronously with respect to the host and it may return control to the application on the host before the
16899                      result is ready.
16900                   </p>
16901                   <div class="tablenoborder">
16902                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
16903                            <tr class="row">
16904                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
16905                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
16906                            </tr>
16907                            <tr class="row">
16908                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
16909                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
16910                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16911                                     <mi>A</mi>
16912                                  </math>.
16913                               </td>
16914                            </tr>
16915                            <tr class="row">
16916                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
16917                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
16918                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16919                                     <mi>A</mi>
16920                                  </math>.
16921                               </td>
16922                            </tr>
16923                            <tr class="row">
16924                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
16925                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
16926                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
16927                                     <mi>A</mi>
16928                                  </math>. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>.
16929                               </td>
16930                            </tr>
16931                            <tr class="row">
16932                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">A</samp></td>
16933                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of dimensions <samp class="ph codeph">(lda, n)</samp>.
16934                               </td>
16935                            </tr>
16936                            <tr class="row">
16937                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">lda</samp></td>
16938                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of dense array<samp class="ph codeph">A</samp>.
16939                               </td>
16940                            </tr>
16941                            <tr class="row">
16942                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzPerRow</samp></td>
16943                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of size <samp class="ph codeph">m</samp> containing the number of non-zero elements per row.
16944                               </td>
16945                            </tr>
16946                            <tr class="row">
16947                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">userEllWidth</samp></td>
16948                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">width of the regular (ELL) part of the matrix in HYB format, which should be less than maximum number of non-zeros per row
16949                                  and is only required if <samp class="ph codeph">partitionType</samp> == <samp class="ph codeph">CUSPARSE_HYB_PARTITION_USER</samp>.
16950                               </td>
16951                            </tr>
16952                            <tr class="row">
16953                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">partitionType</samp></td>
16954                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">partitioning method to be used in the conversion (please refer to <samp class="ph codeph">cusparseHybPartition_t</samp> on page ?? for details).
16955                               </td>
16956                            </tr>
16957                         </tbody>
16958                      </table>
16959                   </div>
16960                   <div class="tablenoborder">
16961                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
16962                            <tr class="row">
16963                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">hybA</samp></td>
16964                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix <samp class="ph codeph">A</samp> in HYB storage format.
16965                               </td>
16966                            </tr>
16967                         </tbody>
16968                      </table>
16969                   </div>
16970                   <div class="tablenoborder">
16971                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
16972                            <tr class="row">
16973                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
16974                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
16975                            </tr>
16976                            <tr class="row">
16977                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
16978                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
16979                            </tr>
16980                            <tr class="row">
16981                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
16982                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
16983                            </tr>
16984                            <tr class="row">
16985                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
16986                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n&lt;0</samp>).
16987                               </td>
16988                            </tr>
16989                            <tr class="row">
16990                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
16991                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
16992                            </tr>
16993                            <tr class="row">
16994                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
16995                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
16996                            </tr>
16997                            <tr class="row">
16998                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
16999                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
17000                            </tr>
17001                            <tr class="row">
17002                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
17003                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
17004                                  <p class="p"></p>
17005                                  <p class="p"></p>
17006                                  the matrix type is not supported.
17007                               </td>
17008                            </tr>
17009                         </tbody>
17010                      </table>
17011                   </div>
17012                </div>
17013             </div>
17014             <div class="topic concept nested1" id="cusparse-lt-t-gt-hyb2csc"><a name="cusparse-lt-t-gt-hyb2csc" shape="rect">
17015                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-hyb2csc" name="cusparse-lt-t-gt-hyb2csc" shape="rect">11.13.&nbsp;cusparse&lt;t&gt;hyb2csc</a></h3>
17016                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
17017 cusparseShyb2csc(cusparseHandle_t handle, 
17018                  const cusparseMatDescr_t descrA, 
17019                  const cusparseHybMat_t hybA,
17020                  float       *cscValA, int *cscRowIndA, int *cscColPtrA)
17021 cusparseStatus_t 
17022 cusparseDhyb2csc(cusparseHandle_t handle,
17023                  const cusparseMatDescr_t descrA, 
17024                  const cusparseHybMat_t hybA,
17025                  double      *cscValA, int *cscRowIndA, int *cscColPtrA)              
17026 cusparseStatus_t 
17027 cusparseChyb2csc(cusparseHandle_t handle,
17028                  const cusparseMatDescr_t descrA, 
17029                  const cusparseHybMat_t hybA,
17030                  cuComplex   *cscValA, int *cscRowIndA, int *cscColPtrA)
17031 cusparseStatus_t 
17032 cusparseZhyb2csc(cusparseHandle_t handle,
17033                  const cusparseMatDescr_t descrA, 
17034                  const cusparseHybMat_t hybA,
17035                  cuDoubleComplex *cscValA, int *cscRowIndA, int *cscColPtrA)</pre><p class="p">This function converts a sparse matrix in HYB format into a sparse matrix in CSC format.</p>
17036                   <p class="p">This function requires some amount of temporary storage. It is executed asynchronously with respect to the host and it may
17037                      return control to the application on the host before the result is ready.
17038                   </p>
17039                   <div class="tablenoborder">
17040                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
17041                            <tr class="row">
17042                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
17043                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
17044                            </tr>
17045                            <tr class="row">
17046                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
17047                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
17048                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
17049                                     <mi>A</mi>
17050                                  </math> in Hyb format. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>.
17051                               </td>
17052                            </tr>
17053                            <tr class="row">
17054                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">hybA</samp></td>
17055                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix <samp class="ph codeph">A</samp> in HYB storage format.
17056                               </td>
17057                            </tr>
17058                         </tbody>
17059                      </table>
17060                   </div>
17061                   <div class="tablenoborder">
17062                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
17063                            <tr class="row">
17064                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscValA</samp></td>
17065                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of 
17066                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17067                                     <mo stretchy="false">(</mo>
17068                                     <mo>=</mo>
17069                                  </math><samp class="ph codeph">cscColPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17070                                     <mo>-</mo>
17071                                  </math><samp class="ph codeph">cscColPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17072                                     <mo stretchy="false">)</mo>
17073                                  </math> 
17074                                         non-zero elements of matrix 
17075                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
17076                                     <mi>A</mi>
17077                                  </math>.
17078                               </td>
17079                            </tr>
17080                            <tr class="row">
17081                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscRowIndA</samp></td>
17082                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17083                                     <mo stretchy="false">(</mo>
17084                                     <mo>=</mo>
17085                                  </math><samp class="ph codeph">cscColPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17086                                     <mo>-</mo>
17087                                  </math><samp class="ph codeph">cscColPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17088                                     <mo stretchy="false">)</mo>
17089                                  </math> column indices of the non-zero elements of matrix 
17090                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
17091                                     <mi>A</mi>
17092                                  </math>.
17093                               </td>
17094                            </tr>
17095                            <tr class="row">
17096                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">cscColPtrA</samp></td>
17097                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every column and the end of the last row plus one.
17098                               </td>
17099                            </tr>
17100                         </tbody>
17101                      </table>
17102                   </div>
17103                   <div class="tablenoborder">
17104                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
17105                            <tr class="row">
17106                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
17107                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
17108                            </tr>
17109                            <tr class="row">
17110                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
17111                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
17112                            </tr>
17113                            <tr class="row">
17114                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
17115                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
17116                            </tr>
17117                            <tr class="row">
17118                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
17119                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n&lt;0</samp>).
17120                               </td>
17121                            </tr>
17122                            <tr class="row">
17123                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
17124                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
17125                            </tr>
17126                            <tr class="row">
17127                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
17128                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
17129                            </tr>
17130                            <tr class="row">
17131                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
17132                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
17133                            </tr>
17134                            <tr class="row">
17135                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
17136                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
17137                                  <p class="p"></p>
17138                                  <p class="p"></p>
17139                                  the matrix type is not supported.
17140                               </td>
17141                            </tr>
17142                         </tbody>
17143                      </table>
17144                   </div>
17145                </div>
17146             </div>
17147             <div class="topic concept nested1" id="cusparse-lt-t-gt-hyb2csr"><a name="cusparse-lt-t-gt-hyb2csr" shape="rect">
17148                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-hyb2csr" name="cusparse-lt-t-gt-hyb2csr" shape="rect">11.14.&nbsp;cusparse&lt;t&gt;hyb2csr</a></h3>
17149                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
17150 cusparseShyb2csr(cusparseHandle_t handle, 
17151                  const cusparseMatDescr_t descrA, 
17152                  const cusparseHybMat_t hybA,
17153                  float       *csrValA, int *csrRowPtrA, int *csrColIndA)
17154 cusparseStatus_t 
17155 cusparseDhyb2csr(cusparseHandle_t handle,
17156                  const cusparseMatDescr_t descrA, 
17157                  const cusparseHybMat_t hybA,
17158                  double      *csrValA, int *csrRowPtrA, int *csrColIndA)              
17159 cusparseStatus_t 
17160 cusparseChyb2csr(cusparseHandle_t handle,
17161                  const cusparseMatDescr_t descrA, 
17162                  const cusparseHybMat_t hybA,
17163                  cuComplex   *csrValA, int *csrRowPtrA, int *csrColIndA)
17164 cusparseStatus_t 
17165 cusparseZhyb2csr(cusparseHandle_t handle,
17166                  const cusparseMatDescr_t descrA, 
17167                  const cusparseHybMat_t hybA,
17168                  cuDoubleComplex *csrValA, int *csrRowPtrA, int *csrColIndA)</pre><p class="p">This function converts a sparse matrix in HYB format into a sparse matrix in CSR format.</p>
17169                   <p class="p">This function requires some amount of temporary storage. It is executed asynchronously with respect to the host and it may
17170                      return control to the application on the host before the result is ready.
17171                   </p>
17172                   <div class="tablenoborder">
17173                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
17174                            <tr class="row">
17175                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
17176                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
17177                            </tr>
17178                            <tr class="row">
17179                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
17180                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
17181                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
17182                                     <mi>A</mi>
17183                                  </math> in Hyb format. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>.
17184                               </td>
17185                            </tr>
17186                            <tr class="row">
17187                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">hybA</samp></td>
17188                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix <samp class="ph codeph">A</samp> in HYB storage format.
17189                               </td>
17190                            </tr>
17191                         </tbody>
17192                      </table>
17193                   </div>
17194                   <div class="tablenoborder">
17195                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
17196                            <tr class="row">
17197                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrValA</samp></td>
17198                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">&lt;type&gt; array of 
17199                                                 <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17200                                     <mo stretchy="false">(</mo>
17201                                     <mo>=</mo>
17202                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17203                                     <mo>-</mo>
17204                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17205                                     <mo stretchy="false">)</mo>
17206                                  </math> 
17207                                         non-zero elements of matrix 
17208                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
17209                                     <mi>A</mi>
17210                                  </math>.
17211                               </td>
17212                            </tr>
17213                            <tr class="row">
17214                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrRowPtrA</samp></td>
17215                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">m+1</samp> elements that contains the start of every column and the end of the last row plus one.
17216                               </td>
17217                            </tr>
17218                            <tr class="row">
17219                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">csrColIndA</samp></td>
17220                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">integer array of <samp class="ph codeph">nnz</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17221                                     <mo stretchy="false">(</mo>
17222                                     <mo>=</mo>
17223                                  </math><samp class="ph codeph">csrRowPtrA(m)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17224                                     <mo>-</mo>
17225                                  </math><samp class="ph codeph">csrRowPtrA(0)</samp><math xmlns="http://www.w3.org/1998/Math/MathML">
17226                                     <mo stretchy="false">)</mo>
17227                                  </math> column indices of the non-zero elements of matrix 
17228                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
17229                                     <mi>A</mi>
17230                                  </math>.
17231                               </td>
17232                            </tr>
17233                         </tbody>
17234                      </table>
17235                   </div>
17236                   <div class="tablenoborder">
17237                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
17238                            <tr class="row">
17239                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
17240                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
17241                            </tr>
17242                            <tr class="row">
17243                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
17244                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
17245                            </tr>
17246                            <tr class="row">
17247                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
17248                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
17249                            </tr>
17250                            <tr class="row">
17251                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
17252                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n&lt;0</samp>).
17253                               </td>
17254                            </tr>
17255                            <tr class="row">
17256                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
17257                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
17258                            </tr>
17259                            <tr class="row">
17260                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
17261                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
17262                            </tr>
17263                            <tr class="row">
17264                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
17265                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
17266                            </tr>
17267                            <tr class="row">
17268                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
17269                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
17270                                  <p class="p"></p>
17271                                  <p class="p"></p>
17272                                  the matrix type is not supported.
17273                               </td>
17274                            </tr>
17275                         </tbody>
17276                      </table>
17277                   </div>
17278                </div>
17279             </div>
17280             <div class="topic concept nested1" id="cusparse-lt-t-gt-hyb2dense"><a name="cusparse-lt-t-gt-hyb2dense" shape="rect">
17281                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-hyb2dense" name="cusparse-lt-t-gt-hyb2dense" shape="rect">11.15.&nbsp;cusparse&lt;t&gt;hyb2dense</a></h3>
17282                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
17283 cusparseShyb2csr(cusparseHandle_t handle, 
17284                  const cusparseMatDescr_t descrA, 
17285                  const cusparseHybMat_t hybA,
17286                  float       *csrValA, int *csrRowPtrA, int *csrColIndA)
17287 cusparseStatus_t 
17288 cusparseDhyb2csr(cusparseHandle_t handle,
17289                  const cusparseMatDescr_t descrA, 
17290                  const cusparseHybMat_t hybA,
17291                  double      *csrValA, int *csrRowPtrA, int *csrColIndA)              
17292 cusparseStatus_t 
17293 cusparseChyb2csr(cusparseHandle_t handle,
17294                  const cusparseMatDescr_t descrA, 
17295                  const cusparseHybMat_t hybA,
17296                  cuComplex   *csrValA, int *csrRowPtrA, int *csrColIndA)
17297 cusparseStatus_t 
17298 cusparseZhyb2csr(cusparseHandle_t handle,
17299                  const cusparseMatDescr_t descrA, 
17300                  const cusparseHybMat_t hybA,
17301                  cuDoubleComplex *csrValA, int *csrRowPtrA, int *csrColIndA)</pre><p class="p">This function converts a sparse matrix in HYB format (contained in the opaque structure ) into a matrix <samp class="ph codeph">A</samp> in dense format. The dense matrix <samp class="ph codeph">A</samp> is filled in with the values of the sparse matrix and with zeros elsewhere.
17302                   </p>
17303                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
17304                      to the application on the host before the result is ready.
17305                   </p>
17306                   <div class="tablenoborder">
17307                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
17308                            <tr class="row">
17309                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
17310                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
17311                            </tr>
17312                            <tr class="row">
17313                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
17314                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
17315                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
17316                                     <mi>A</mi>
17317                                  </math> in Hyb format. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>.
17318                               </td>
17319                            </tr>
17320                            <tr class="row">
17321                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">hybA</samp></td>
17322                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the matrix <samp class="ph codeph">A</samp> in HYB storage format.
17323                               </td>
17324                            </tr>
17325                            <tr class="row">
17326                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">lda</samp></td>
17327                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of dense array <samp class="ph codeph">A</samp>.
17328                               </td>
17329                            </tr>
17330                         </tbody>
17331                      </table>
17332                   </div>
17333                   <div class="tablenoborder">
17334                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
17335                            <tr class="row">
17336                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">A</samp></td>
17337                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of dimensions <samp class="ph codeph">(lda, n)</samp> that is filled in with the values of the sparse matrix.
17338                               </td>
17339                            </tr>
17340                         </tbody>
17341                      </table>
17342                   </div>
17343                   <div class="tablenoborder">
17344                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
17345                            <tr class="row">
17346                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
17347                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
17348                            </tr>
17349                            <tr class="row">
17350                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
17351                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
17352                            </tr>
17353                            <tr class="row">
17354                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
17355                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the internally stored hyb format parameters are invalid.</td>
17356                            </tr>
17357                            <tr class="row">
17358                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
17359                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
17360                            </tr>
17361                            <tr class="row">
17362                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
17363                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
17364                            </tr>
17365                            <tr class="row">
17366                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
17367                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
17368                                  <p class="p"></p>
17369                                  <p class="p"></p>
17370                                  the matrix type is not supported.
17371                               </td>
17372                            </tr>
17373                         </tbody>
17374                      </table>
17375                   </div>
17376                </div>
17377             </div>
17378             <div class="topic concept nested1" id="cusparse-lt-t-gt-nnz"><a name="cusparse-lt-t-gt-nnz" shape="rect">
17379                   <!-- --></a><h3 class="title topictitle2"><a href="#cusparse-lt-t-gt-nnz" name="cusparse-lt-t-gt-nnz" shape="rect">11.16.&nbsp;cusparse&lt;t&gt;nnz</a></h3>
17380                <div class="body conbody"><pre xml:space="preserve">cusparseStatus_t 
17381 cusparseSnnz(cusparseHandle_t handle, cusparseDirection_t dirA, int m, 
17382              int n, const cusparseMatDescr_t descrA, 
17383              const float           *A, 
17384              int lda, int *nnzPerRowColumn, int *nnzTotalDevHostPtr)
17385 cusparseStatus_t 
17386 cusparseDnnz(cusparseHandle_t handle, cusparseDirection_t dirA, int m, 
17387              int n, const cusparseMatDescr_t descrA, 
17388              const double          *A, 
17389              int lda, int *nnzPerRowColumn, int *nnzTotalDevHostPtr)
17390 cusparseStatus_t 
17391 cusparseCnnz(cusparseHandle_t handle, cusparseDirection_t dirA, int m, 
17392              int n, const cusparseMatDescr_t descrA, 
17393              const cuComplex       *A, 
17394              int lda, int *nnzPerRowColumn, int *nnzTotalDevHostPtr)
17395 cusparseStatus_t 
17396 cusparseZnnz(cusparseHandle_t handle, cusparseDirection_t dirA, int m, 
17397              int n, const cusparseMatDescr_t descrA, 
17398              const cuDoubleComplex *A, 
17399              int lda, int *nnzPerRowColumn, int *nnzTotalDevHostPtr)</pre><p class="p">This function computes the number of non-zero elements per row or column and the total number of non-zero elements in a dense
17400                      matrix.
17401                   </p>
17402                   <p class="p">This function requires no extra storage. It is executed asynchronously with respect to the host and it may return control
17403                      to the application on the host before the result is ready.
17404                   </p>
17405                   <div class="tablenoborder">
17406                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Input</strong></span><tbody class="tbody">
17407                            <tr class="row">
17408                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">handle</samp></td>
17409                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">handle to the CUSPARSE library context.</td>
17410                            </tr>
17411                            <tr class="row">
17412                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">dirA</samp></td>
17413                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">direction that specifies whether to count non-zero elements by <samp class="ph codeph">CUSPARSE_DIRECTION_ROW</samp> or <samp class="ph codeph">CUSPARSE_DIRECTION_COLUMN</samp>.
17414                               </td>
17415                            </tr>
17416                            <tr class="row">
17417                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">m</samp></td>
17418                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of rows of matrix 
17419                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
17420                                     <mi>A</mi>
17421                                  </math>.
17422                               </td>
17423                            </tr>
17424                            <tr class="row">
17425                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">n</samp></td>
17426                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">number of columns of matrix 
17427                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
17428                                     <mi>A</mi>
17429                                  </math>.
17430                               </td>
17431                            </tr>
17432                            <tr class="row">
17433                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">descrA</samp></td>
17434                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the descriptor of matrix 
17435                                  <math xmlns="http://www.w3.org/1998/Math/MathML">
17436                                     <mi>A</mi>
17437                                  </math> in Hyb format. The supported matrix type is <samp class="ph codeph">CUSPARSE_MATRIX_TYPE_GENERAL</samp>. Also, the supported index bases are <samp class="ph codeph">CUSPARSE_INDEX_BASE_ZERO</samp> and <samp class="ph codeph">CUSPARSE_INDEX_BASE_ONE</samp>.
17438                               </td>
17439                            </tr>
17440                            <tr class="row">
17441                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">A</samp></td>
17442                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of dimensions <samp class="ph codeph">(lda, n)</samp>.
17443                               </td>
17444                            </tr>
17445                            <tr class="row">
17446                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">lda</samp></td>
17447                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">leading dimension of dense array <samp class="ph codeph">A</samp>.
17448                               </td>
17449                            </tr>
17450                         </tbody>
17451                      </table>
17452                   </div>
17453                   <div class="tablenoborder">
17454                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Output</strong></span><tbody class="tbody">
17455                            <tr class="row">
17456                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzPerRowColumn</samp></td>
17457                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">array of size <samp class="ph codeph">m</samp> or <samp class="ph codeph">n</samp> containing the number of non-zero elements per row or column, respectively.
17458                               </td>
17459                            </tr>
17460                            <tr class="row">
17461                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">nnzTotalDevHostPtr</samp></td>
17462                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">total number of non-zero elements in device or host memory.</td>
17463                            </tr>
17464                         </tbody>
17465                      </table>
17466                   </div>
17467                   <div class="tablenoborder">
17468                      <table cellpadding="4" cellspacing="0" summary="" class="table" width="100%" frame="border" border="1" rules="all"><span class="desc tabledesc"><strong class="ph b">Status Returned</strong></span><tbody class="tbody">
17469                            <tr class="row">
17470                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_SUCCESS</samp></td>
17471                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the operation completed successfully.</td>
17472                            </tr>
17473                            <tr class="row">
17474                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_NOT_INITIALIZED</samp></td>
17475                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the library was not initialized.</td>
17476                            </tr>
17477                            <tr class="row">
17478                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ALLOC_FAILED</samp></td>
17479                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the resources could not be allocated.</td>
17480                            </tr>
17481                            <tr class="row">
17482                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INVALID_VALUE</samp></td>
17483                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">invalid parameters were passed (<samp class="ph codeph">m,n&lt;0</samp>).
17484                               </td>
17485                            </tr>
17486                            <tr class="row">
17487                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_ARCH_MISMATCH</samp></td>
17488                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the device does not support double precision.</td>
17489                            </tr>
17490                            <tr class="row">
17491                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_EXECUTION_FAILED</samp></td>
17492                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">the function failed to launch on the GPU</td>
17493                            </tr>
17494                            <tr class="row">
17495                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_INTERNAL_ERROR</samp></td>
17496                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">an internal operation failed.</td>
17497                            </tr>
17498                            <tr class="row">
17499                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1"><samp class="ph codeph">CUSPARSE_STATUS_MATRIX_TYPE_NOT_SUPPORTED</samp></td>
17500                               <td class="entry" valign="top" width="50%" rowspan="1" colspan="1">
17501                                  <p class="p"></p>
17502                                  <p class="p"></p>
17503                                  the matrix type is not supported.
17504                               </td>
17505                            </tr>
17506                         </tbody>
17507                      </table>
17508                   </div>
17509                </div>
17510             </div>
17511          </div>
17512          <div class="topic concept nested0" id="appendix-b-cusparse-library-c---example"><a name="appendix-b-cusparse-library-c---example" shape="rect">
17513                <!-- --></a><h2 class="title topictitle1"><a href="#appendix-b-cusparse-library-c---example" name="appendix-b-cusparse-library-c---example" shape="rect">12.&nbsp;Appendix A: CUSPARSE Library C++ Example</a></h2>
17514             <div class="body conbody">
17515                <p class="p">For sample code reference please see the example code below. It shows an application written in C++ using the CUSPARSE library
17516                   API. The code performs the following actions:
17517                </p>
17518                <p class="p">1. Creates a sparse test matrix in COO format.</p>
17519                <p class="p">2. Creates a sparse and dense vector.</p>
17520                <p class="p">3. Allocates GPU memory and copies the matrix and vectors into it.</p>
17521                <p class="p">4. Initializes the CUSPARSE library.</p>
17522                <p class="p">5. Creates and sets up the matrix descriptor.</p>
17523                <p class="p">6. Converts the matrix from COO to CSR format.</p>
17524                <p class="p">7. Exercises Level 1 routines.</p>
17525                <p class="p">8. Exercises Level 2 routines.</p>
17526                <p class="p">9. Exercises Level 3 routines.</p>
17527                <p class="p">10. Destroys the matrix descriptor.</p>
17528                <p class="p">11. Releases resources allocated for the CUSPARSE library.</p><pre xml:space="preserve"><span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">//Example: Application using C++ and the CUSPARSE library </span>
17529 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">//-------------------------------------------------------</span>
17530 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-directive">#include &lt;stdio.h&gt;</span>
17531 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-directive">#include &lt;stdlib.h&gt;</span>
17532 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-directive">#include &lt;cuda_runtime.h&gt;</span>
17533 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-directive">#include "cusparse_v2.h"</span>
17534
17535 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-directive">#define CLEANUP(s)                                   \
17536 do {                                                 \
17537     printf ("%s\n", s);                              \
17538     if (yHostPtr)           free(yHostPtr);          \
17539     if (zHostPtr)           free(zHostPtr);          \
17540     if (xIndHostPtr)        free(xIndHostPtr);       \
17541     if (xValHostPtr)        free(xValHostPtr);       \
17542     if (cooRowIndexHostPtr) free(cooRowIndexHostPtr);\
17543     if (cooColIndexHostPtr) free(cooColIndexHostPtr);\
17544     if (cooValHostPtr)      free(cooValHostPtr);     \
17545     if (y)                  cudaFree(y);             \
17546     if (z)                  cudaFree(z);             \
17547     if (xInd)               cudaFree(xInd);          \
17548     if (xVal)               cudaFree(xVal);          \
17549     if (csrRowPtr)          cudaFree(csrRowPtr);     \
17550     if (cooRowIndex)        cudaFree(cooRowIndex);   \
17551     if (cooColIndex)        cudaFree(cooColIndex);   \
17552     if (cooVal)             cudaFree(cooVal);        \
17553     if (descr)              cusparseDestroyMatDescr(descr);\
17554     if (handle)             cusparseDestroy(handle); \
17555     cudaDeviceReset();          \
17556     fflush (stdout);                                 \
17557 } while (0)</span>
17558
17559 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> main(){     
17560     cudaError_t cudaStat1,cudaStat2,cudaStat3,cudaStat4,cudaStat5,cudaStat6;
17561     cusparseStatus_t status;
17562     cusparseHandle_t handle=0;
17563     cusparseMatDescr_t descr=0;
17564     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *    cooRowIndexHostPtr=0;
17565     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *    cooColIndexHostPtr=0;    
17566     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> * cooValHostPtr=0;
17567     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *    cooRowIndex=0;
17568     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *    cooColIndex=0;    
17569     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> * cooVal=0;
17570     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *    xIndHostPtr=0;
17571     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> * xValHostPtr=0;
17572     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> * yHostPtr=0;
17573     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *    xInd=0;
17574     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> * xVal=0;
17575     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> * y=0;  
17576     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *    csrRowPtr=0;
17577     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> * zHostPtr=0; 
17578     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> * z=0; 
17579     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span>      n, nnz, nnz_vector;
17580     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> dzero =0.0;
17581     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> dtwo  =2.0;
17582     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> dthree=3.0;
17583     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> dfive =5.0;
17584
17585     printf(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"testing example\n"</span>);
17586     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* create the following sparse test matrix in COO format */</span>
17587     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* |1.0     2.0 3.0|
17588        |    4.0        |
17589        |5.0     6.0 7.0|
17590        |    8.0     9.0| */</span>
17591     n=4; nnz=9; 
17592     cooRowIndexHostPtr = (<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *)   malloc(nnz*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(cooRowIndexHostPtr[0])); 
17593     cooColIndexHostPtr = (<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *)   malloc(nnz*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(cooColIndexHostPtr[0])); 
17594     cooValHostPtr      = (<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> *)malloc(nnz*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(cooValHostPtr[0])); 
17595     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> ((!cooRowIndexHostPtr) || (!cooColIndexHostPtr) || (!cooValHostPtr)){
17596         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Host malloc failed (matrix)"</span>);
17597         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1; 
17598     }
17599     cooRowIndexHostPtr[0]=0; cooColIndexHostPtr[0]=0; cooValHostPtr[0]=1.0;  
17600     cooRowIndexHostPtr[1]=0; cooColIndexHostPtr[1]=2; cooValHostPtr[1]=2.0;  
17601     cooRowIndexHostPtr[2]=0; cooColIndexHostPtr[2]=3; cooValHostPtr[2]=3.0;  
17602     cooRowIndexHostPtr[3]=1; cooColIndexHostPtr[3]=1; cooValHostPtr[3]=4.0;  
17603     cooRowIndexHostPtr[4]=2; cooColIndexHostPtr[4]=0; cooValHostPtr[4]=5.0;  
17604     cooRowIndexHostPtr[5]=2; cooColIndexHostPtr[5]=2; cooValHostPtr[5]=6.0;
17605     cooRowIndexHostPtr[6]=2; cooColIndexHostPtr[6]=3; cooValHostPtr[6]=7.0;  
17606     cooRowIndexHostPtr[7]=3; cooColIndexHostPtr[7]=1; cooValHostPtr[7]=8.0;  
17607     cooRowIndexHostPtr[8]=3; cooColIndexHostPtr[8]=3; cooValHostPtr[8]=9.0;  
17608     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/*
17609     //print the matrix
17610     printf("Input data:\n");
17611     for (int i=0; i&lt;nnz; i++){        
17612         printf("cooRowIndexHostPtr[%d]=%d  ",i,cooRowIndexHostPtr[i]);
17613         printf("cooColIndexHostPtr[%d]=%d  ",i,cooColIndexHostPtr[i]);
17614         printf("cooValHostPtr[%d]=%f     \n",i,cooValHostPtr[i]);
17615     }
17616     */</span>
17617
17618     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* create a sparse and dense vector */</span> 
17619     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* xVal= [100.0 200.0 400.0]   (sparse)
17620        xInd= [0     1     3    ]
17621        y   = [10.0 20.0 30.0 40.0 | 50.0 60.0 70.0 80.0] (dense) */</span>
17622     nnz_vector = 3;
17623     xIndHostPtr = (<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">int</span> *)   malloc(nnz_vector*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(xIndHostPtr[0])); 
17624     xValHostPtr = (<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> *)malloc(nnz_vector*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(xValHostPtr[0])); 
17625     yHostPtr    = (<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> *)malloc(2*n       *<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(yHostPtr[0]));
17626     zHostPtr    = (<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">double</span> *)malloc(2*(n+1)   *<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(zHostPtr[0]));
17627     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span>((!xIndHostPtr) || (!xValHostPtr) || (!yHostPtr) || (!zHostPtr)){
17628         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Host malloc failed (vectors)"</span>);
17629         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1; 
17630     }
17631     yHostPtr[0] = 10.0;  xIndHostPtr[0]=0; xValHostPtr[0]=100.0; 
17632     yHostPtr[1] = 20.0;  xIndHostPtr[1]=1; xValHostPtr[1]=200.0;  
17633     yHostPtr[2] = 30.0;
17634     yHostPtr[3] = 40.0;  xIndHostPtr[2]=3; xValHostPtr[2]=400.0;  
17635     yHostPtr[4] = 50.0;
17636     yHostPtr[5] = 60.0;
17637     yHostPtr[6] = 70.0;
17638     yHostPtr[7] = 80.0;
17639     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/*
17640     //print the vectors
17641     for (int j=0; j&lt;2; j++){
17642         for (int i=0; i&lt;n; i++){        
17643             printf("yHostPtr[%d,%d]=%f\n",i,j,yHostPtr[i+n*j]);
17644         }
17645     }
17646     for (int i=0; i&lt;nnz_vector; i++){        
17647         printf("xIndHostPtr[%d]=%d  ",i,xIndHostPtr[i]);
17648         printf("xValHostPtr[%d]=%f\n",i,xValHostPtr[i]);
17649     }
17650     */</span>
17651
17652     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* allocate GPU memory and copy the matrix and vectors into it */</span>
17653     cudaStat1 = cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;cooRowIndex,nnz*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(cooRowIndex[0])); 
17654     cudaStat2 = cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;cooColIndex,nnz*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(cooColIndex[0]));
17655     cudaStat3 = cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;cooVal,     nnz*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(cooVal[0])); 
17656     cudaStat4 = cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;y,          2*n*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(y[0]));   
17657     cudaStat5 = cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;xInd,nnz_vector*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(xInd[0])); 
17658     cudaStat6 = cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;xVal,nnz_vector*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(xVal[0])); 
17659     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> ((cudaStat1 != cudaSuccess) ||
17660         (cudaStat2 != cudaSuccess) ||
17661         (cudaStat3 != cudaSuccess) ||
17662         (cudaStat4 != cudaSuccess) ||
17663         (cudaStat5 != cudaSuccess) ||
17664         (cudaStat6 != cudaSuccess)) {
17665         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Device malloc failed"</span>);
17666         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1; 
17667     }    
17668     cudaStat1 = cudaMemcpy(cooRowIndex, cooRowIndexHostPtr, 
17669                            (size_t)(nnz*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(cooRowIndex[0])), 
17670                            cudaMemcpyHostToDevice);
17671     cudaStat2 = cudaMemcpy(cooColIndex, cooColIndexHostPtr, 
17672                            (size_t)(nnz*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(cooColIndex[0])), 
17673                            cudaMemcpyHostToDevice);
17674     cudaStat3 = cudaMemcpy(cooVal,      cooValHostPtr,      
17675                            (size_t)(nnz*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(cooVal[0])),      
17676                            cudaMemcpyHostToDevice);
17677     cudaStat4 = cudaMemcpy(y,           yHostPtr,           
17678                            (size_t)(2*n*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(y[0])),           
17679                            cudaMemcpyHostToDevice);
17680     cudaStat5 = cudaMemcpy(xInd,        xIndHostPtr,        
17681                            (size_t)(nnz_vector*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(xInd[0])), 
17682                            cudaMemcpyHostToDevice);
17683     cudaStat6 = cudaMemcpy(xVal,        xValHostPtr,        
17684                            (size_t)(nnz_vector*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(xVal[0])), 
17685                            cudaMemcpyHostToDevice);
17686     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> ((cudaStat1 != cudaSuccess) ||
17687         (cudaStat2 != cudaSuccess) ||
17688         (cudaStat3 != cudaSuccess) ||
17689         (cudaStat4 != cudaSuccess) ||
17690         (cudaStat5 != cudaSuccess) ||
17691         (cudaStat6 != cudaSuccess)) {
17692         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Memcpy from Host to Device failed"</span>);
17693         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17694     }
17695     
17696     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* initialize cusparse library */</span>
17697     status= cusparseCreate(&amp;handle);
17698     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status != CUSPARSE_STATUS_SUCCESS) {
17699         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"CUSPARSE Library initialization failed"</span>);
17700         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17701     }
17702
17703     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* create and setup matrix descriptor */</span> 
17704     status= cusparseCreateMatDescr(&amp;descr); 
17705     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status != CUSPARSE_STATUS_SUCCESS) {
17706         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Matrix descriptor initialization failed"</span>);
17707         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17708     }       
17709     cusparseSetMatType(descr,CUSPARSE_MATRIX_TYPE_GENERAL);
17710     cusparseSetMatIndexBase(descr,CUSPARSE_INDEX_BASE_ZERO);  
17711     
17712     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* exercise conversion routines (convert matrix from COO 2 CSR format) */</span>
17713     cudaStat1 = cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;csrRowPtr,(n+1)*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(csrRowPtr[0]));
17714     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (cudaStat1 != cudaSuccess) {
17715         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Device malloc failed (csrRowPtr)"</span>);
17716         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17717     }
17718     status= cusparseXcoo2csr(handle,cooRowIndex,nnz,n,
17719                              csrRowPtr,CUSPARSE_INDEX_BASE_ZERO); 
17720     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status != CUSPARSE_STATUS_SUCCESS) {
17721         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Conversion from COO to CSR format failed"</span>);
17722         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17723     }  
17724     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">//csrRowPtr = [0 3 4 7 9] </span>
17725
17726     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* exercise Level 1 routines (scatter vector elements) */</span>
17727     status= cusparseDsctr(handle, nnz_vector, xVal, xInd, 
17728                           &amp;y[n], CUSPARSE_INDEX_BASE_ZERO);
17729     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status != CUSPARSE_STATUS_SUCCESS) {
17730         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Scatter from sparse to dense vector failed"</span>);
17731         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17732     }  
17733     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">//y = [10 20 30 40 | 100 200 70 400]</span>
17734
17735     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* exercise Level 2 routines (csrmv) */</span>
17736     status= cusparseDcsrmv(handle,CUSPARSE_OPERATION_NON_TRANSPOSE, n, n, nnz,
17737                            &amp;dtwo, descr, cooVal, csrRowPtr, cooColIndex, 
17738                            &amp;y[0], &amp;dthree, &amp;y[n]);
17739     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status != CUSPARSE_STATUS_SUCCESS) {
17740         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Matrix-vector multiplication failed"</span>);
17741         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17742     }    
17743     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">//y = [10 20 30 40 | 680 760 1230 2240]</span>
17744     cudaMemcpy(yHostPtr, y, (size_t)(2*n*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(y[0])), cudaMemcpyDeviceToHost);
17745     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/*
17746     printf("Intermediate results:\n");
17747     for (int j=0; j&lt;2; j++){
17748         for (int i=0; i&lt;n; i++){        
17749             printf("yHostPtr[%d,%d]=%f\n",i,j,yHostPtr[i+n*j]);
17750         }
17751     }
17752     */</span>
17753
17754     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* exercise Level 3 routines (csrmm) */</span>
17755     cudaStat1 = cudaMalloc((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span>**)&amp;z, 2*(n+1)*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(z[0]));   
17756     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (cudaStat1 != cudaSuccess) {
17757         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Device malloc failed (z)"</span>);
17758         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17759     }
17760     cudaStat1 = cudaMemset((<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">void</span> *)z,0, 2*(n+1)*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(z[0]));    
17761     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (cudaStat1 != cudaSuccess) {
17762         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Memset on Device failed"</span>);
17763         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17764     }
17765     status= cusparseDcsrmm(handle, CUSPARSE_OPERATION_NON_TRANSPOSE, n, 2, n, 
17766                            nnz, &amp;dfive, descr, cooVal, csrRowPtr, cooColIndex, 
17767                            y, n, &amp;dzero, z, n+1);
17768     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status != CUSPARSE_STATUS_SUCCESS) {
17769         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Matrix-matrix multiplication failed"</span>);
17770         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17771     }  
17772
17773     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* print final results (z) */</span>
17774     cudaStat1 = cudaMemcpy(zHostPtr, z, 
17775                            (size_t)(2*(n+1)*<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">sizeof</span>(z[0])), 
17776                            cudaMemcpyDeviceToHost);
17777     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (cudaStat1 != cudaSuccess)  {
17778         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Memcpy from Device to Host failed"</span>);
17779         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17780     } 
17781     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">//z = [950 400 2550 2600 0 | 49300 15200 132300 131200 0]</span>
17782     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/*
17783     printf("Final results:\n");
17784     for (int j=0; j&lt;2; j++){
17785         for (int i=0; i&lt;n+1; i++){
17786             printf("z[%d,%d]=%f\n",i,j,zHostPtr[i+(n+1)*j]);
17787         }
17788     }
17789     */</span>
17790
17791     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* destroy matrix descriptor */</span> 
17792     status = cusparseDestroyMatDescr(descr); 
17793     descr = 0;
17794     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status != CUSPARSE_STATUS_SUCCESS) {
17795         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Matrix descriptor destruction failed"</span>);
17796         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17797     }    
17798
17799     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* destroy handle */</span>
17800     status = cusparseDestroy(handle);
17801     handle = 0;
17802     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status != CUSPARSE_STATUS_SUCCESS) {
17803         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"CUSPARSE Library release of resources failed"</span>);
17804         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17805     }   
17806
17807     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* check the results */</span>
17808     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-comment">/* Notice that CLEANUP() contains a call to cusparseDestroy(handle) */</span>
17809     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> ((zHostPtr[0] != 950.0)    || 
17810         (zHostPtr[1] != 400.0)    || 
17811         (zHostPtr[2] != 2550.0)   || 
17812         (zHostPtr[3] != 2600.0)   || 
17813         (zHostPtr[4] != 0.0)      || 
17814         (zHostPtr[5] != 49300.0)  || 
17815         (zHostPtr[6] != 15200.0)  || 
17816         (zHostPtr[7] != 132300.0) || 
17817         (zHostPtr[8] != 131200.0) || 
17818         (zHostPtr[9] != 0.0)      ||
17819         (yHostPtr[0] != 10.0)     || 
17820         (yHostPtr[1] != 20.0)     || 
17821         (yHostPtr[2] != 30.0)     || 
17822         (yHostPtr[3] != 40.0)     || 
17823         (yHostPtr[4] != 680.0)    || 
17824         (yHostPtr[5] != 760.0)    || 
17825         (yHostPtr[6] != 1230.0)   || 
17826         (yHostPtr[7] != 2240.0)){ 
17827         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"example test FAILED"</span>);
17828         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 1;
17829     }
17830     <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">else</span>{
17831         CLEANUP(<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"example test PASSED"</span>);
17832         <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">return</span> 0;
17833     }      
17834 }
17835 </pre></div>
17836          </div>
17837          <div class="topic concept nested0" id="appendix-c-cusparse-fortran-bindings"><a name="appendix-c-cusparse-fortran-bindings" shape="rect">
17838                <!-- --></a><h2 class="title topictitle1"><a href="#appendix-c-cusparse-fortran-bindings" name="appendix-c-cusparse-fortran-bindings" shape="rect">13.&nbsp;Appendix B: CUSPARSE Fortran Bindings</a></h2>
17839             <div class="body conbody">
17840                <p class="p">The CUSPARSE library is implemented using the C-based CUDA toolchain, and it thus provides a C-style API that makes interfacing
17841                   to applications written in C or C++ trivial. There are also many applications implemented in Fortran that would benefit from
17842                   using CUSPARSE, and therefore a CUSPARSE Fortran interface has been developed.
17843                </p>
17844                <p class="p">Unfortunately, Fortran-to-C calling conventions are not standardized and differ by platform and toolchain. In particular,
17845                   differences may exist in the following areas:
17846                </p>
17847                <p class="p">Symbol names (capitalization, name decoration)</p>
17848                <p class="p">Argument passing (by value or reference)</p>
17849                <p class="p">Passing of pointer arguments (size of the pointer)</p>
17850                <p class="p">To provide maximum flexibility in addressing those differences, the CUSPARSE Fortran interface is provided in the form of
17851                   wrapper functions, which are written in C and are located in the file <samp class="ph codeph">cusparse_fortran.c</samp>. This file also contains a few additional wrapper functions (for <samp class="ph codeph">cudaMalloc()</samp>, <samp class="ph codeph">cudaMemset</samp>, and so on) that can be used to allocate memory on the GPU.
17852                </p>
17853                <p class="p">The CUSPARSE Fortran wrapper code is provided as an example only and needs to be compiled into an application for it to call
17854                   the CUSPARSE API functions. Providing this source code allows users to make any changes necessary for a particular platform
17855                   and toolchain.
17856                </p>
17857                <p class="p">The CUSPARSE Fortran wrapper code has been used to demonstrate interoperability with the compilers g95 0.91 (on 32-bit and
17858                   64-bit Linux) and g95 0.92 (on 32-bit and 64-bit Mac OS X). In order to use other compilers, users have to make any changes
17859                   to the wrapper code that may be required.
17860                </p>
17861                <p class="p">The direct wrappers, intended for production code, substitute device pointers for vector and matrix arguments in all CUSPARSE
17862                   functions. To use these interfaces, existing applications need to be modified slightly to allocate and deallocate data structures
17863                   in GPU memory space (using <samp class="ph codeph">CUDA_MALLOC()</samp> and <samp class="ph codeph">CUDA_FREE()</samp>) and to copy data between GPU and CPU memory spaces (using the <samp class="ph codeph">CUDA_MEMCPY()</samp> routines). The sample wrappers provided in <samp class="ph codeph">cusparse_fortran.c</samp> map device pointers to the OS-dependent type <samp class="ph codeph">size_t</samp>, which is 32 bits wide on 32-bit platforms and 64 bits wide on a 64-bit platforms.
17864                </p>
17865                <p class="p">One approach to dealing with index arithmetic on device pointers in Fortran code is to use C-style macros and to use the C
17866                   preprocessor to expand them. On Linux and Mac OS X, preprocessing can be done by using the option <samp class="ph codeph">'-cpp'</samp> with g95 or gfortran. The function <samp class="ph codeph">GET_SHIFTED_ADDRESS()</samp>, provided with the CUSPARSE Fortran wrappers, can also be used, as shown in example B.
17867                </p>
17868                <p class="p">Example B shows the the C++ of example A implemented in Fortran 77 on the host. This example should be compiled with <samp class="ph codeph">ARCH_64</samp> defined as 1 on a 64-bit OS system and as undefined on a 32-bit OS system. For example, on g95 or gfortran, it can be done
17869                   directly on the command line using the option <samp class="ph codeph">-cpp -DARCH_64=1</samp>.
17870                </p>
17871             </div>
17872             <div class="topic concept nested1" id="example-b"><a name="example-b" shape="rect">
17873                   <!-- --></a><h3 class="title topictitle2"><a href="#example-b" name="example-b" shape="rect">13.1.&nbsp;Example B, Fortran Application</a></h3>
17874                <div class="body conbody"><pre xml:space="preserve">c     #define ARCH_64 0
17875 c     #define ARCH_64 1
17876
17877       program cusparse_fortran_example
17878       implicit none
17879       integer cuda_malloc
17880       external cuda_free
17881       integer cuda_memcpy_c2fort_int
17882       integer cuda_memcpy_c2fort_real
17883       integer cuda_memcpy_fort2c_int
17884       integer cuda_memcpy_fort2c_real
17885       integer cuda_memset
17886       integer cusparse_create 
17887       external cusparse_destroy
17888       integer cusparse_get_version 
17889       integer cusparse_create_mat_descr
17890       external cusparse_destroy_mat_descr
17891       integer cusparse_set_mat_type 
17892       integer cusparse_get_mat_type
17893       integer cusparse_get_mat_fill_mode
17894       integer cusparse_get_mat_diag_type
17895       integer cusparse_set_mat_index_base
17896       integer cusparse_get_mat_index_base
17897       integer cusparse_xcoo2csr
17898       integer cusparse_dsctr
17899       integer cusparse_dcsrmv
17900       integer cusparse_dcsrmm
17901       external get_shifted_address
17902 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-directive">#if ARCH_64      </span>
17903       integer*8 handle
17904       integer*8 descrA      
17905       integer*8 cooRowIndex
17906       integer*8 cooColIndex    
17907       integer*8 cooVal
17908       integer*8 xInd
17909       integer*8 xVal
17910       integer*8 y  
17911       integer*8 z 
17912       integer*8 csrRowPtr
17913       integer*8 ynp1  
17914 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-directive">#else</span>
17915       integer*4 handle
17916       integer*4 descrA
17917       integer*4 cooRowIndex
17918       integer*4 cooColIndex    
17919       integer*4 cooVal
17920       integer*4 xInd
17921       integer*4 xVal
17922       integer*4 y  
17923       integer*4 z 
17924       integer*4 csrRowPtr
17925       integer*4 ynp1  
17926 <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-directive">#endif      </span>
17927       integer status
17928       integer cudaStat1,cudaStat2,cudaStat3
17929       integer cudaStat4,cudaStat5,cudaStat6
17930       integer n, nnz, nnz_vector
17931       parameter (n=4, nnz=9, nnz_vector=3)
17932       integer cooRowIndexHostPtr(nnz)
17933       integer cooColIndexHostPtr(nnz)    
17934       real*8  cooValHostPtr(nnz)
17935       integer xIndHostPtr(nnz_vector)
17936       real*8  xValHostPtr(nnz_vector)
17937       real*8  yHostPtr(2*n)
17938       real*8  zHostPtr(2*(n+1)) 
17939       integer i, j
17940       integer version, mtype, fmode, dtype, ibase
17941       real*8  dzero,dtwo,dthree,dfive
17942       real*8  epsilon
17943
17944
17945       write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"testing fortran example"</span>
17946 c     predefined constants (need to be careful with them)
17947       dzero = 0.0
17948       dtwo  = 2.0
17949       dthree= 3.0
17950       dfive = 5.0
17951 c     create the following sparse test matrix in COO format 
17952 c     (notice one-based indexing)
17953 c     |1.0     2.0 3.0|
17954 c     |    4.0        |
17955 c     |5.0     6.0 7.0|
17956 c     |    8.0     9.0| 
17957       cooRowIndexHostPtr(1)=1 
17958       cooColIndexHostPtr(1)=1 
17959       cooValHostPtr(1)     =1.0  
17960       cooRowIndexHostPtr(2)=1 
17961       cooColIndexHostPtr(2)=3 
17962       cooValHostPtr(2)     =2.0  
17963       cooRowIndexHostPtr(3)=1 
17964       cooColIndexHostPtr(3)=4 
17965       cooValHostPtr(3)     =3.0  
17966       cooRowIndexHostPtr(4)=2 
17967       cooColIndexHostPtr(4)=2 
17968       cooValHostPtr(4)     =4.0  
17969       cooRowIndexHostPtr(5)=3 
17970       cooColIndexHostPtr(5)=1 
17971       cooValHostPtr(5)     =5.0  
17972       cooRowIndexHostPtr(6)=3 
17973       cooColIndexHostPtr(6)=3 
17974       cooValHostPtr(6)     =6.0
17975       cooRowIndexHostPtr(7)=3 
17976       cooColIndexHostPtr(7)=4 
17977       cooValHostPtr(7)     =7.0  
17978       cooRowIndexHostPtr(8)=4 
17979       cooColIndexHostPtr(8)=2 
17980       cooValHostPtr(8)     =8.0  
17981       cooRowIndexHostPtr(9)=4 
17982       cooColIndexHostPtr(9)=4 
17983       cooValHostPtr(9)     =9.0  
17984 c     print the matrix
17985       write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Input data:"</span>
17986       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">do</span> i=1,nnz        
17987          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cooRowIndexHostPtr["</span>,i,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"]="</span>,cooRowIndexHostPtr(i)
17988          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cooColIndexHostPtr["</span>,i,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"]="</span>,cooColIndexHostPtr(i)
17989          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cooValHostPtr["</span>,     i,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"]="</span>,cooValHostPtr(i)
17990       enddo
17991   
17992 c     create a sparse and dense vector  
17993 c     xVal= [100.0 200.0 400.0]   (sparse)
17994 c     xInd= [0     1     3    ]
17995 c     y   = [10.0 20.0 30.0 40.0 | 50.0 60.0 70.0 80.0] (dense) 
17996 c     (notice one-based indexing)
17997       yHostPtr(1) = 10.0  
17998       yHostPtr(2) = 20.0  
17999       yHostPtr(3) = 30.0
18000       yHostPtr(4) = 40.0  
18001       yHostPtr(5) = 50.0
18002       yHostPtr(6) = 60.0
18003       yHostPtr(7) = 70.0
18004       yHostPtr(8) = 80.0
18005       xIndHostPtr(1)=1 
18006       xValHostPtr(1)=100.0 
18007       xIndHostPtr(2)=2 
18008       xValHostPtr(2)=200.0
18009       xIndHostPtr(3)=4 
18010       xValHostPtr(3)=400.0    
18011 c     print the vectors
18012       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">do</span> j=1,2
18013          <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">do</span> i=1,n        
18014             write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"yHostPtr["</span>,i,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">","</span>,j,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"]="</span>,yHostPtr(i+n*(j-1))
18015          enddo
18016       enddo
18017       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">do</span> i=1,nnz_vector        
18018          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"xIndHostPtr["</span>,i,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"]="</span>,xIndHostPtr(i)
18019          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"xValHostPtr["</span>,i,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"]="</span>,xValHostPtr(i)
18020       enddo
18021
18022 c     allocate GPU memory and copy the matrix and vectors into it 
18023 c     cudaSuccess=0
18024 c     cudaMemcpyHostToDevice=1
18025       cudaStat1 = cuda_malloc(cooRowIndex,nnz*4) 
18026       cudaStat2 = cuda_malloc(cooColIndex,nnz*4)
18027       cudaStat3 = cuda_malloc(cooVal,     nnz*8) 
18028       cudaStat4 = cuda_malloc(y,          2*n*8)   
18029       cudaStat5 = cuda_malloc(xInd,nnz_vector*4) 
18030       cudaStat6 = cuda_malloc(xVal,nnz_vector*8) 
18031       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> ((cudaStat1 /= 0) .OR. 
18032      $    (cudaStat2 /= 0) .OR. 
18033      $    (cudaStat3 /= 0) .OR. 
18034      $    (cudaStat4 /= 0) .OR. 
18035      $    (cudaStat5 /= 0) .OR. 
18036      $    (cudaStat6 /= 0)) then 
18037          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Device malloc failed"</span>
18038          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat1="</span>,cudaStat1
18039          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat2="</span>,cudaStat2
18040          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat3="</span>,cudaStat3
18041          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat4="</span>,cudaStat4
18042          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat5="</span>,cudaStat5
18043          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat6="</span>,cudaStat6
18044          stop 
18045       endif    
18046       cudaStat1 = cuda_memcpy_fort2c_int(cooRowIndex,cooRowIndexHostPtr, 
18047      $                                   nnz*4,1)        
18048       cudaStat2 = cuda_memcpy_fort2c_int(cooColIndex,cooColIndexHostPtr, 
18049      $                                   nnz*4,1)       
18050       cudaStat3 = cuda_memcpy_fort2c_real(cooVal,    cooValHostPtr,      
18051      $                                    nnz*8,1)       
18052       cudaStat4 = cuda_memcpy_fort2c_real(y,      yHostPtr,           
18053      $                                    2*n*8,1)       
18054       cudaStat5 = cuda_memcpy_fort2c_int(xInd,       xIndHostPtr,        
18055      $                                   nnz_vector*4,1) 
18056       cudaStat6 = cuda_memcpy_fort2c_real(xVal,      xValHostPtr,        
18057      $                                    nnz_vector*8,1)
18058       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> ((cudaStat1 /= 0) .OR. 
18059      $    (cudaStat2 /= 0) .OR. 
18060      $    (cudaStat3 /= 0) .OR. 
18061      $    (cudaStat4 /= 0) .OR. 
18062      $    (cudaStat5 /= 0) .OR. 
18063      $    (cudaStat6 /= 0)) then 
18064          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Memcpy from Host to Device failed"</span>
18065          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat1="</span>,cudaStat1
18066          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat2="</span>,cudaStat2
18067          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat3="</span>,cudaStat3
18068          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat4="</span>,cudaStat4
18069          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat5="</span>,cudaStat5
18070          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"cudaStat6="</span>,cudaStat6
18071          call cuda_free(cooRowIndex)
18072          call cuda_free(cooColIndex)    
18073          call cuda_free(cooVal)
18074          call cuda_free(xInd)
18075          call cuda_free(xVal)
18076          call cuda_free(y)  
18077          stop
18078       endif
18079     
18080 c     initialize cusparse library
18081 c     CUSPARSE_STATUS_SUCCESS=0 
18082       status = cusparse_create(handle)
18083       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status /= 0) then 
18084          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"CUSPARSE Library initialization failed"</span>
18085          call cuda_free(cooRowIndex)
18086          call cuda_free(cooColIndex)    
18087          call cuda_free(cooVal)
18088          call cuda_free(xInd)
18089          call cuda_free(xVal)
18090          call cuda_free(y)  
18091          stop
18092       endif
18093 c     get version
18094 c     CUSPARSE_STATUS_SUCCESS=0
18095       status = cusparse_get_version(handle,version)
18096       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status /= 0) then 
18097          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"CUSPARSE Library initialization failed"</span>
18098          call cuda_free(cooRowIndex)
18099          call cuda_free(cooColIndex)    
18100          call cuda_free(cooVal)
18101          call cuda_free(xInd)
18102          call cuda_free(xVal)
18103          call cuda_free(y)   
18104          call cusparse_destroy(handle)
18105          stop
18106       endif
18107       write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"CUSPARSE Library version"</span>,version
18108
18109 c     create and setup the matrix descriptor
18110 c     CUSPARSE_STATUS_SUCCESS=0 
18111 c     CUSPARSE_MATRIX_TYPE_GENERAL=0
18112 c     CUSPARSE_INDEX_BASE_ONE=1  
18113       status= cusparse_create_mat_descr(descrA) 
18114       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status /= 0) then 
18115          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Creating matrix descriptor failed"</span>
18116          call cuda_free(cooRowIndex)
18117          call cuda_free(cooColIndex)    
18118          call cuda_free(cooVal)
18119          call cuda_free(xInd)
18120          call cuda_free(xVal)
18121          call cuda_free(y)  
18122          call cusparse_destroy(handle)
18123          stop
18124       endif  
18125       status = cusparse_set_mat_type(descrA,0)       
18126       status = cusparse_set_mat_index_base(descrA,1) 
18127 c     print the matrix descriptor
18128       mtype = cusparse_get_mat_type(descrA)
18129       fmode = cusparse_get_mat_fill_mode(descrA) 
18130       dtype = cusparse_get_mat_diag_type(descrA) 
18131       ibase = cusparse_get_mat_index_base(descrA) 
18132       write (*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"matrix descriptor:"</span>
18133       write (*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"t="</span>,mtype,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"m="</span>,fmode,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"d="</span>,dtype,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"b="</span>,ibase
18134
18135 c     exercise conversion routines (convert matrix from COO 2 CSR format) 
18136 c     cudaSuccess=0
18137 c     CUSPARSE_STATUS_SUCCESS=0 
18138 c     CUSPARSE_INDEX_BASE_ONE=1
18139       cudaStat1 = cuda_malloc(csrRowPtr,(n+1)*4)
18140       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (cudaStat1 /= 0) then  
18141          call cuda_free(cooRowIndex)
18142          call cuda_free(cooColIndex)    
18143          call cuda_free(cooVal)
18144          call cuda_free(xInd)
18145          call cuda_free(xVal)
18146          call cuda_free(y)  
18147          call cusparse_destroy_mat_descr(descrA)
18148          call cusparse_destroy(handle)
18149          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Device malloc failed (csrRowPtr)"</span>
18150          stop
18151       endif
18152       status= cusparse_xcoo2csr(handle,cooRowIndex,nnz,n,
18153      $                          csrRowPtr,1)         
18154       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status /= 0) then 
18155          call cuda_free(cooRowIndex)
18156          call cuda_free(cooColIndex)    
18157          call cuda_free(cooVal)
18158          call cuda_free(xInd)
18159          call cuda_free(xVal)
18160          call cuda_free(y)  
18161          call cuda_free(csrRowPtr)
18162          call cusparse_destroy_mat_descr(descrA)
18163          call cusparse_destroy(handle)
18164          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Conversion from COO to CSR format failed"</span>
18165          stop
18166       endif  
18167 c     csrRowPtr = [0 3 4 7 9] 
18168
18169 c     exercise Level 1 routines (scatter vector elements)
18170 c     CUSPARSE_STATUS_SUCCESS=0  
18171 c     CUSPARSE_INDEX_BASE_ONE=1
18172       call get_shifted_address(y,n*8,ynp1)
18173       status= cusparse_dsctr(handle, nnz_vector, xVal, xInd, 
18174      $                       ynp1, 1)
18175       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status /= 0) then 
18176          call cuda_free(cooRowIndex)
18177          call cuda_free(cooColIndex)    
18178          call cuda_free(cooVal)
18179          call cuda_free(xInd)
18180          call cuda_free(xVal)
18181          call cuda_free(y)  
18182          call cuda_free(csrRowPtr)
18183          call cusparse_destroy_mat_descr(descrA)
18184          call cusparse_destroy(handle)
18185          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Scatter from sparse to dense vector failed"</span>
18186          stop
18187       endif  
18188 c     y = [10 20 30 40 | 100 200 70 400]
18189
18190 c     exercise Level 2 routines (csrmv) 
18191 c     CUSPARSE_STATUS_SUCCESS=0
18192 c     CUSPARSE_OPERATION_NON_TRANSPOSE=0
18193       status= cusparse_dcsrmv(handle, 0, n, n, nnz, dtwo,
18194      $                       descrA, cooVal, csrRowPtr, cooColIndex, 
18195      $                       y, dthree, ynp1)        
18196       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status /= 0) then 
18197          call cuda_free(cooRowIndex)
18198          call cuda_free(cooColIndex)    
18199          call cuda_free(cooVal)
18200          call cuda_free(xInd)
18201          call cuda_free(xVal)
18202          call cuda_free(y)  
18203          call cuda_free(csrRowPtr)
18204          call cusparse_destroy_mat_descr(descrA)
18205          call cusparse_destroy(handle)
18206          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Matrix-vector multiplication failed"</span>
18207          stop
18208       endif    
18209     
18210 c     print intermediate results (y) 
18211 c     y = [10 20 30 40 | 680 760 1230 2240]
18212 c     cudaSuccess=0
18213 c     cudaMemcpyDeviceToHost=2
18214       cudaStat1 = cuda_memcpy_c2fort_real(yHostPtr, y, 2*n*8, 2) 
18215       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (cudaStat1 /= 0) then  
18216          call cuda_free(cooRowIndex)
18217          call cuda_free(cooColIndex)    
18218          call cuda_free(cooVal)
18219          call cuda_free(xInd)
18220          call cuda_free(xVal)
18221          call cuda_free(y)  
18222          call cuda_free(csrRowPtr)
18223          call cusparse_destroy_mat_descr(descrA)
18224          call cusparse_destroy(handle)
18225          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Memcpy from Device to Host failed"</span>
18226          stop
18227       endif
18228       write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Intermediate results:"</span>
18229       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">do</span> j=1,2
18230          <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">do</span> i=1,n        
18231              write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"yHostPtr["</span>,i,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">","</span>,j,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"]="</span>,yHostPtr(i+n*(j-1))
18232          enddo
18233       enddo 
18234
18235 c     exercise Level 3 routines (csrmm)
18236 c     cudaSuccess=0 
18237 c     CUSPARSE_STATUS_SUCCESS=0
18238 c     CUSPARSE_OPERATION_NON_TRANSPOSE=0
18239       cudaStat1 = cuda_malloc(z, 2*(n+1)*8)   
18240       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (cudaStat1 /= 0) then  
18241          call cuda_free(cooRowIndex)
18242          call cuda_free(cooColIndex)    
18243          call cuda_free(cooVal)
18244          call cuda_free(xInd)
18245          call cuda_free(xVal)
18246          call cuda_free(y)  
18247          call cuda_free(csrRowPtr)
18248          call cusparse_destroy_mat_descr(descrA)
18249          call cusparse_destroy(handle)
18250          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Device malloc failed (z)"</span>
18251          stop
18252       endif
18253       cudaStat1 = cuda_memset(z, 0, 2*(n+1)*8)    
18254       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (cudaStat1 /= 0) then  
18255          call cuda_free(cooRowIndex)
18256          call cuda_free(cooColIndex)    
18257          call cuda_free(cooVal)
18258          call cuda_free(xInd)
18259          call cuda_free(xVal)
18260          call cuda_free(y)  
18261          call cuda_free(z) 
18262          call cuda_free(csrRowPtr)
18263          call cusparse_destroy_mat_descr(descrA)
18264          call cusparse_destroy(handle)
18265          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Memset on Device failed"</span>
18266          stop
18267       endif
18268       status= cusparse_dcsrmm(handle, 0, n, 2, n, nnz, dfive, 
18269      $                        descrA, cooVal, csrRowPtr, cooColIndex, 
18270      $                        y, n, dzero, z, n+1) 
18271       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (status /= 0) then     
18272          call cuda_free(cooRowIndex)
18273          call cuda_free(cooColIndex)    
18274          call cuda_free(cooVal)
18275          call cuda_free(xInd)
18276          call cuda_free(xVal)
18277          call cuda_free(y)  
18278          call cuda_free(z) 
18279          call cuda_free(csrRowPtr)
18280          call cusparse_destroy_mat_descr(descrA)
18281          call cusparse_destroy(handle)
18282          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Matrix-matrix multiplication failed"</span>
18283          stop
18284       endif  
18285
18286 c     print final results (z) 
18287 c     cudaSuccess=0
18288 c     cudaMemcpyDeviceToHost=2
18289       cudaStat1 = cuda_memcpy_c2fort_real(zHostPtr, z, 2*(n+1)*8, 2) 
18290       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> (cudaStat1 /= 0) then 
18291          call cuda_free(cooRowIndex)
18292          call cuda_free(cooColIndex)    
18293          call cuda_free(cooVal)
18294          call cuda_free(xInd)
18295          call cuda_free(xVal)
18296          call cuda_free(y)  
18297          call cuda_free(z) 
18298          call cuda_free(csrRowPtr)
18299          call cusparse_destroy_mat_descr(descrA)
18300          call cusparse_destroy(handle)
18301          write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Memcpy from Device to Host failed"</span>
18302          stop
18303       endif 
18304 c     z = [950 400 2550 2600 0 | 49300 15200 132300 131200 0]
18305       write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"Final results:"</span>
18306       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">do</span> j=1,2
18307          <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">do</span> i=1,n+1
18308             write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"z["</span>,i,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">","</span>,j,<span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"]="</span>,zHostPtr(i+(n+1)*(j-1))
18309          enddo
18310       enddo
18311     
18312 c     check the results 
18313       epsilon = 0.00000000000001
18314       <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">if</span> ((DABS(zHostPtr(1) - 950.0)   .GT. epsilon)  .OR. 
18315      $    (DABS(zHostPtr(2) - 400.0)   .GT. epsilon)  .OR.  
18316      $    (DABS(zHostPtr(3) - 2550.0)  .GT. epsilon)  .OR.  
18317      $    (DABS(zHostPtr(4) - 2600.0)  .GT. epsilon)  .OR.  
18318      $    (DABS(zHostPtr(5) - 0.0)     .GT. epsilon)  .OR.  
18319      $    (DABS(zHostPtr(6) - 49300.0) .GT. epsilon)  .OR.  
18320      $    (DABS(zHostPtr(7) - 15200.0) .GT. epsilon)  .OR.  
18321      $    (DABS(zHostPtr(8) - 132300.0).GT. epsilon)  .OR.  
18322      $    (DABS(zHostPtr(9) - 131200.0).GT. epsilon)  .OR.  
18323      $    (DABS(zHostPtr(10) - 0.0)    .GT. epsilon)  .OR. 
18324      $    (DABS(yHostPtr(1) - 10.0)    .GT. epsilon)  .OR.  
18325      $    (DABS(yHostPtr(2) - 20.0)    .GT. epsilon)  .OR.  
18326      $    (DABS(yHostPtr(3) - 30.0)    .GT. epsilon)  .OR.  
18327      $    (DABS(yHostPtr(4) - 40.0)    .GT. epsilon)  .OR.  
18328      $    (DABS(yHostPtr(5) - 680.0)   .GT. epsilon)  .OR.  
18329      $    (DABS(yHostPtr(6) - 760.0)   .GT. epsilon)  .OR.  
18330      $    (DABS(yHostPtr(7) - 1230.0)  .GT. epsilon)  .OR.  
18331      $    (DABS(yHostPtr(8) - 2240.0)  .GT. epsilon)) then 
18332           write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"fortran example test FAILED"</span>
18333        <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-keyword">else</span>
18334           write(*,*) <span xmlns:xslthl="http://xslthl.sf.net" class="xslthl-string">"fortran example test PASSED"</span>
18335        endif   
18336        
18337 c      deallocate GPU memory and exit      
18338        call cuda_free(cooRowIndex)
18339        call cuda_free(cooColIndex)    
18340        call cuda_free(cooVal)
18341        call cuda_free(xInd)
18342        call cuda_free(xVal)
18343        call cuda_free(y)  
18344        call cuda_free(z) 
18345        call cuda_free(csrRowPtr)
18346        call cusparse_destroy_mat_descr(descrA)
18347        call cusparse_destroy(handle)
18348
18349        stop
18350        end
18351 </pre></div>
18352             </div>
18353          </div>
18354          <div class="topic concept nested0" id="appendix-acknowledgements"><a name="appendix-acknowledgements" shape="rect">
18355                <!-- --></a><h2 class="title topictitle1"><a href="#appendix-acknowledgements" name="appendix-acknowledgements" shape="rect">Appendix C: Acknowledgements</a></h2>
18356             <div class="body conbody">
18357                <p class="p">
18358                   NVIDIA would like to thank the following individuals and
18359                   institutions for their contributions:
18360                   
18361                </p>
18362                <ul class="ul">
18363                   <li class="li">
18364                      The cusparse&lt;t&gt;gtsv implementation is derived from a version developed by Li-Wen Chang from the University of Illinois.
18365                      
18366                   </li>
18367                </ul>
18368             </div>
18369          </div>
18370          <div class="topic concept nested0" id="bibliography"><a name="bibliography" shape="rect">
18371                <!-- --></a><h2 class="title topictitle1"><a href="#bibliography" name="bibliography" shape="rect">15.&nbsp;Bibliography</a></h2>
18372             <div class="body conbody">
18373                <p class="p">[1] N. Bell and M. Garland, <a class="xref" href="http://research.nvidia.com/content/implementing-sparse-matrix-vector-multiplication-throughput-oriented-processors" target="_blank" shape="rect">“Implementing Sparse Matrix-Vector Multiplication on Throughput-Oriented Processors”</a>, Supercomputing, 2009.
18374                </p>
18375                <p class="p">[2] R. Grimes, D. Kincaid, and D. Young, “ITPACK 2.0 User’s Guide”, Technical Report CNA-150, Center for Numerical Analysis,
18376                   University of Texas, 1979.
18377                </p>
18378                <p class="p">[3] M. Naumov, <a class="xref" href="http://developer.nvidia.com/content/accelerated-solution-sparse-linear-systems" target="_blank" shape="rect">“Incomplete-LU and Cholesky Preconditioned Iterative Methods Using CUSPARSE and CUBLAS”</a>, Technical Report and White Paper, 2011.
18379                </p>
18380             </div>
18381          </div>
18382          <div class="topic concept nested0" id="notices-header"><a name="notices-header" shape="rect">
18383                <!-- --></a><h2 class="title topictitle1"><a href="#notices-header" name="notices-header" shape="rect">Notices</a></h2>
18384             <div class="topic reference nested1" id="notice"><a name="notice" shape="rect">
18385                   <!-- --></a><h3 class="title topictitle2"><a href="#notice" name="notice" shape="rect"></a></h3>
18386                <div class="body refbody">
18387                   <div class="section">
18388                      <h3 class="title sectiontitle">Notice</h3>
18389                      <p class="p">ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND
18390                         SEPARATELY, "MATERIALS") ARE BEING PROVIDED "AS IS." NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE
18391                         WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS
18392                         FOR A PARTICULAR PURPOSE. 
18393                      </p>
18394                      <p class="p">Information furnished is believed to be accurate and reliable. However, NVIDIA Corporation assumes no responsibility for the
18395                         consequences of use of such information or for any infringement of patents or other rights of third parties that may result
18396                         from its use. No license is granted by implication of otherwise under any patent rights of NVIDIA Corporation. Specifications
18397                         mentioned in this publication are subject to change without notice. This publication supersedes and replaces all other information
18398                         previously supplied. NVIDIA Corporation products are not authorized as critical components in life support devices or systems
18399                         without express written approval of NVIDIA Corporation.
18400                      </p>
18401                   </div>
18402                </div>
18403             </div>
18404             <div class="topic reference nested1" id="trademarks"><a name="trademarks" shape="rect">
18405                   <!-- --></a><h3 class="title topictitle2"><a href="#trademarks" name="trademarks" shape="rect"></a></h3>
18406                <div class="body refbody">
18407                   <div class="section">
18408                      <h3 class="title sectiontitle">Trademarks</h3>
18409                      <p class="p">NVIDIA and the NVIDIA logo are trademarks or registered trademarks of NVIDIA Corporation
18410                         in the U.S. and other countries.  Other company and product names may be trademarks of
18411                         the respective companies with which they are associated.
18412                      </p>
18413                   </div>
18414                </div>
18415             </div>
18416             <div class="topic reference nested1" id="copyright-past-to-present"><a name="copyright-past-to-present" shape="rect">
18417                   <!-- --></a><h3 class="title topictitle2"><a href="#copyright-past-to-present" name="copyright-past-to-present" shape="rect"></a></h3>
18418                <div class="body refbody">
18419                   <div class="section">
18420                      <h3 class="title sectiontitle">Copyright</h3>
18421                      <p class="p">© <span class="ph">2007</span>-<span class="ph">2013</span> NVIDIA
18422                         Corporation. All rights reserved.
18423                      </p>
18424                   </div>
18425                </div>
18426             </div>
18427          </div>
18428          
18429          <hr id="contents-end"></hr>
18430          <div id="release-info">CUSPARSE
18431             (<a href="../../pdf/CUSPARSE_Library.pdf">PDF</a>)
18432             -
18433             CUDA Toolkit v5.5
18434             (<a href="https://developer.nvidia.com/cuda-toolkit-archive">older</a>)
18435             -
18436             Last updated 
18437             September 5, 2013
18438             -
18439             <a href="mailto:cudatools@nvidia.com?subject=CUDA Tools Documentation Feedback: cusparse">Send Feedback</a></div>
18440          
18441       </article>
18442       
18443       <header id="header"><span id="company">NVIDIA</span><span id="site-title">CUDA Toolkit Documentation</span><form id="search" method="get" action="search">
18444             <input type="text" name="search-text"></input><fieldset id="search-location">
18445                <legend>Search In:</legend>
18446                <label><input type="radio" name="search-type" value="site"></input>Entire Site</label>
18447                <label><input type="radio" name="search-type" value="document"></input>Just This Document</label></fieldset>
18448             <button type="reset">clear search</button>
18449             <button id="submit" type="submit">search</button></form>
18450       </header>
18451       <nav id="site-nav">
18452          <div class="category closed"><span class="twiddle">▷</span><a href="../index.html" title="The root of the site.">CUDA Toolkit</a></div>
18453          <ul class="closed">
18454             <li><a href="../cuda-toolkit-release-notes/index.html" title="The Release Notes for the CUDA Toolkit from v4.0 to today.">Release Notes</a></li>
18455             <li><a href="../eula/index.html" title="The End User License Agreements for the NVIDIA CUDA Toolkit, the NVIDIA CUDA Samples, the NVIDIA Display Driver, and NVIDIA NSight (Visual Studio Edition).">EULA</a></li>
18456             <li><a href="../cuda-getting-started-guide-for-linux/index.html" title="This guide discusses how to install and check for correct operation of the CUDA Development Tools on GNU/Linux systems.">Getting Started Linux</a></li>
18457             <li><a href="../cuda-getting-started-guide-for-mac-os-x/index.html" title="This guide discusses how to install and check for correct operation of the CUDA Development Tools on Mac OS X systems.">Getting Started Mac OS X</a></li>
18458             <li><a href="../cuda-getting-started-guide-for-microsoft-windows/index.html" title="This guide discusses how to install and check for correct operation of the CUDA Development Tools on Microsoft Windows systems.">Getting Started Windows</a></li>
18459             <li><a href="../cuda-c-programming-guide/index.html" title="This guide provides a detailed discussion of the CUDA programming model and programming interface. It then describes the hardware implementation, and provides guidance on how to achieve maximum performance. The Appendixes include a list of all CUDA-enabled devices, detailed description of all extensions to the C language, listings of supported mathematical functions, C++ features supported in host and device code, details on texture fetching, technical specifications of various devices, and concludes by introducing the low-level driver API.">Programming Guide</a></li>
18460             <li><a href="../cuda-c-best-practices-guide/index.html" title="This guide presents established parallelization and optimization techniques and explains coding metaphors and idioms that can greatly simplify programming for CUDA-capable GPU architectures. The intent is to provide guidelines for obtaining the best performance from NVIDIA GPUs using the CUDA Toolkit.">Best Practices Guide</a></li>
18461             <li><a href="../kepler-compatibility-guide/index.html" title="This application note is intended to help developers ensure that their NVIDIA CUDA applications will run effectively on GPUs based on the NVIDIA Kepler Architecture. This document provides guidance to ensure that your software applications are compatible with Kepler.">Kepler Compatibility Guide</a></li>
18462             <li><a href="../kepler-tuning-guide/index.html" title="Kepler is NVIDIA's next-generation architecture for CUDA compute applications. Applications that follow the best practices for the Fermi architecture should typically see speedups on the Kepler architecture without any code changes. This guide summarizes the ways that an application can be fine-tuned to gain additional speedups by leveraging Kepler architectural features.">Kepler Tuning Guide</a></li>
18463             <li><a href="../parallel-thread-execution/index.html" title="This guide provides detailed instructions on the use of PTX, a low-level parallel thread execution virtual machine and instruction set architecture (ISA). PTX exposes the GPU as a data-parallel computing device.">PTX ISA</a></li>
18464             <li><a href="../optimus-developer-guide/index.html" title="This document explains how CUDA APIs can be used to query for GPU capabilities in NVIDIA Optimus systems.">Developer Guide for Optimus</a></li>
18465             <li><a href="../video-decoder/index.html" title="This document provides the video decoder API specification and the format conversion and display using DirectX or OpenGL following decode.">Video Decoder</a></li>
18466             <li><a href="../video-encoder/index.html" title="This document provides the CUDA video encoder specifications, including the C-library API functions and encoder query parameters.">Video Encoder</a></li>
18467             <li><a href="../inline-ptx-assembly/index.html" title="This document shows how to inline PTX (parallel thread execution) assembly language statements into CUDA code. It describes available assembler statement parameters and constraints, and the document also provides a list of some pitfalls that you may encounter.">Inline PTX Assembly</a></li>
18468             <li><a href="../cuda-runtime-api/index.html" title="The CUDA runtime API.">CUDA Runtime API</a></li>
18469             <li><a href="../cuda-driver-api/index.html" title="The CUDA driver API.">CUDA Driver API</a></li>
18470             <li><a href="../cuda-math-api/index.html" title="The CUDA math API.">CUDA Math API</a></li>
18471             <li><a href="../cublas/index.html" title="The CUBLAS library is an implementation of BLAS (Basic Linear Algebra Subprograms) on top of the NVIDIA CUDA runtime. It allows the user to access the computational resources of NVIDIA Graphical Processing Unit (GPU), but does not auto-parallelize across multiple GPUs.">CUBLAS</a></li>
18472             <li><a href="../cufft/index.html" title="The CUFFT library user guide.">CUFFT</a></li>
18473             <li><a href="../curand/index.html" title="The CURAND library user guide.">CURAND</a></li>
18474             <li><a href="../cusparse/index.html" title="The CUSPARSE library user guide.">CUSPARSE</a></li>
18475             <li><a href="../npp/index.html" title="NVIDIA NPP is a library of functions for performing CUDA accelerated processing. The initial set of functionality in the library focuses on imaging and video processing and is widely applicable for developers in these areas. NPP will evolve over time to encompass more of the compute heavy tasks in a variety of problem domains. The NPP library is written to maximize flexibility, while maintaining high performance.">NPP</a></li>
18476             <li><a href="../thrust/index.html" title="The Thrust getting started guide.">Thrust</a></li>
18477             <li><a href="../cuda-samples/index.html" title="This document contains a complete listing of the code samples that are included with the NVIDIA CUDA Toolkit. It describes each code sample, lists the minimum GPU specification, and provides links to the source code and white papers if available.">CUDA Samples</a></li>
18478             <li><a href="../cuda-compiler-driver-nvcc/index.html" title="This document is a reference guide on the use of the CUDA compiler driver nvcc. Instead of being a specific CUDA compilation driver, nvcc mimics the behavior of the GNU compiler gcc, accepting a range of conventional compiler options, such as for defining macros and include/library paths, and for steering the compilation process.">NVCC</a></li>
18479             <li><a href="../cuda-gdb/index.html" title="The NVIDIA tool for debugging CUDA applications running on Linux and Mac, providing developers with a mechanism for debugging CUDA applications running on actual hardware. CUDA-GDB is an extension to the x86-64 port of GDB, the GNU Project debugger.">CUDA-GDB</a></li>
18480             <li><a href="../cuda-memcheck/index.html" title="CUDA-MEMCHECK is a suite of run time tools capable of precisely detecting out of bounds and misaligned memory access errors, checking device allocation leaks, reporting hardware errors and identifying shared memory data access hazards.">CUDA-MEMCHECK</a></li>
18481             <li><a href="../nsight-eclipse-edition-getting-started-guide/index.html" title="Nsight Eclipse Edition getting started guide">Nsight Eclipse Edition</a></li>
18482             <li><a href="../profiler-users-guide/index.html" title="This is the guide to the Profiler.">Profiler</a></li>
18483             <li><a href="../cuda-binary-utilities/index.html" title="The application notes for cuobjdump and nvdisasm.">CUDA Binary Utilities</a></li>
18484             <li><a href="../floating-point/index.html" title="A number of issues related to floating point accuracy and compliance are a frequent source of confusion on both CPUs and GPUs. The purpose of this white paper is to discuss the most common issues related to NVIDIA GPUs and to supplement the documentation in the CUDA C Programming Guide.">Floating Point and IEEE 754</a></li>
18485             <li><a href="../incomplete-lu-cholesky/index.html" title="In this white paper we show how to use the CUSPARSE and CUBLAS libraries to achieve a 2x speedup over CPU in the incomplete-LU and Cholesky preconditioned iterative methods. We focus on the Bi-Conjugate Gradient Stabilized and Conjugate Gradient iterative methods, that can be used to solve large sparse nonsymmetric and symmetric positive definite linear systems, respectively. Also, we comment on the parallel sparse triangular solve, which is an essential building block in these algorithms.">Incomplete-LU and Cholesky Preconditioned Iterative Methods</a></li>
18486             <li><a href="../libnvvm-api/index.html" title="The libNVVM API.">libNVVM API</a></li>
18487             <li><a href="../libdevice-users-guide/index.html" title="The libdevice library is an LLVM bitcode library that implements common functions for GPU kernels.">libdevice User's Guide</a></li>
18488             <li><a href="../nvvm-ir-spec/index.html" title="NVVM IR is a compiler IR (internal representation) based on the LLVM IR. The NVVM IR is designed to represent GPU compute kernels (for example, CUDA kernels). High-level language front-ends, like the CUDA C compiler front-end, can generate NVVM IR.">NVVM IR</a></li>
18489             <li><a href="../cupti/index.html" title="The CUPTI API.">CUPTI</a></li>
18490             <li><a href="../debugger-api/index.html" title="The CUDA debugger API.">Debugger API</a></li>
18491             <li><a href="../gpudirect-rdma/index.html" title="A tool for Kepler-class GPUs and CUDA 5.0 enabling a direct path for communication between the GPU and a peer device on the PCI Express bus when the devices share the same upstream root complex using standard features of PCI Express. This document introduces the technology and describes the steps necessary to enable a RDMA for GPUDirect connection to NVIDIA GPUs within the Linux device driver model.">RDMA for GPUDirect</a></li>
18492          </ul>
18493          <div class="category"><span class="twiddle">▼</span><a href="index.html" title="CUSPARSE">CUSPARSE</a></div>
18494          <ul>
18495             <li><a href="#introduction">1.&nbsp;Introduction</a><ul>
18496                   <li><a href="#naming-convention">1.1.&nbsp;Naming Conventions</a></li>
18497                   <li><a href="#asynchronous-execution">1.2.&nbsp;Asynchronous Execution</a></li>
18498                </ul>
18499             </li>
18500             <li><a href="#using-the-cusparse-api">2.&nbsp;Using the CUSPARSE API</a><ul>
18501                   <li><a href="#thread-safety">2.1.&nbsp;Thread Safety</a></li>
18502                   <li><a href="#scalar-parameters2">2.2.&nbsp;Scalar Parameters</a></li>
18503                   <li><a href="#parallelism-with-streams">2.3.&nbsp;Parallelism with Streams</a></li>
18504                </ul>
18505             </li>
18506             <li><a href="#cusparse-indexing-and-data-formats">3.&nbsp;CUSPARSE Indexing and Data Formats</a><ul>
18507                   <li><a href="#index-base-format">3.1.&nbsp;Index Base Format</a></li>
18508                   <li><a href="#vector-formats">3.2.&nbsp;Vector Formats</a><ul>
18509                         <li><a href="#dense-format">3.2.1.&nbsp;Dense Format</a></li>
18510                         <li><a href="#sparse-format">3.2.2.&nbsp;Sparse Format</a></li>
18511                      </ul>
18512                   </li>
18513                   <li><a href="#matrix-formats">3.3.&nbsp;Matrix Formats</a><ul>
18514                         <li><a href="#dense-format2">3.3.1.&nbsp;Dense Format</a></li>
18515                         <li><a href="#coordinate-format-coo">3.3.2.&nbsp;Coordinate Format (COO)</a></li>
18516                         <li><a href="#compressed-sparse-row-format-csr">3.3.3.&nbsp;Compressed Sparse Row Format (CSR)</a></li>
18517                         <li><a href="#compressed-sparse-column-format-csc">3.3.4.&nbsp;Compressed Sparse Column Format (CSC)</a></li>
18518                         <li><a href="#ellpack-itpack-format-ell">3.3.5.&nbsp;Ellpack-Itpack Format (ELL)</a></li>
18519                         <li><a href="#hybrid-format-hyb">3.3.6.&nbsp;Hybrid Format (HYB)</a></li>
18520                         <li><a href="#block-compressed-sparse-row-format-bsr">3.3.7.&nbsp;Block Compressed Sparse Row Format (BSR)</a></li>
18521                         <li><a href="#extended-bsr-format-bsrx">3.3.8.&nbsp;Extended BSR Format (BSRX)</a></li>
18522                      </ul>
18523                   </li>
18524                </ul>
18525             </li>
18526             <li><a href="#cusparse-types-reference">4.&nbsp;CUSPARSE Types Reference</a><ul>
18527                   <li><a href="#data-types">4.1.&nbsp;Data types</a></li>
18528                   <li><a href="#cusparseactiont">4.2.&nbsp;cusparseAction_t</a></li>
18529                   <li><a href="#cusparsedirectiont">4.3.&nbsp;cusparseDirection_t</a></li>
18530                   <li><a href="#cusparsehandlet">4.4.&nbsp;cusparseHandle_t</a></li>
18531                   <li><a href="#cusparsehybmatt">4.5.&nbsp;cusparseHybMat_t</a><ul>
18532                         <li><a href="#cusparsehybpartitiont">4.5.1.&nbsp;cusparseHybPartition_t</a></li>
18533                      </ul>
18534                   </li>
18535                   <li><a href="#cusparsematdescrt">4.6.&nbsp;cusparseMatDescr_t</a><ul>
18536                         <li><a href="#cusparsediagtypet">4.6.1.&nbsp;cusparseDiagType_t</a></li>
18537                         <li><a href="#cusparsefillmodet">4.6.2.&nbsp;cusparseFillMode_t</a></li>
18538                         <li><a href="#cusparseindexbaset">4.6.3.&nbsp;cusparseIndexBase_t</a></li>
18539                         <li><a href="#cusparsematrixtypet">4.6.4.&nbsp;cusparseMatrixType_t</a></li>
18540                      </ul>
18541                   </li>
18542                   <li><a href="#cusparseoperationt">4.7.&nbsp;cusparseOperation_t</a></li>
18543                   <li><a href="#cusparsepointermode_t">4.8.&nbsp;cusparsePointerMode_t</a></li>
18544                   <li><a href="#cusparsesolveanalysisinfot">4.9.&nbsp;cusparseSolveAnalysisInfo_t</a></li>
18545                   <li><a href="#cusparsestatust">4.10.&nbsp;cusparseStatus_t</a></li>
18546                </ul>
18547             </li>
18548             <li><a href="#cusparse-helper-function-reference">5.&nbsp;CUSPARSE Helper Function Reference</a><ul>
18549                   <li><a href="#cusparsecreate">5.1.&nbsp;cusparseCreate()</a></li>
18550                   <li><a href="#cusparsecreatehybmat">5.2.&nbsp;cusparseCreateHybMat()</a></li>
18551                   <li><a href="#cusparsecreatematdescr">5.3.&nbsp;cusparseCreateMatDescr()</a></li>
18552                   <li><a href="#cusparsecreatesolveanalysisinfo">5.4.&nbsp;cusparseCreateSolveAnalysisInfo()</a></li>
18553                   <li><a href="#cusparsedestroy">5.5.&nbsp;cusparseDestroy()</a></li>
18554                   <li><a href="#cusparsedestroyhybmat">5.6.&nbsp;cusparseDestroyHybMat()</a></li>
18555                   <li><a href="#cusparsedestroymatdescr">5.7.&nbsp;cusparseDestroyMatDescr()</a></li>
18556                   <li><a href="#cusparsedestroysolveanalysisinfo">5.8.&nbsp;cusparseDestroySolveAnalysisInfo()</a></li>
18557                   <li><a href="#cusparsegetlevelinfo">5.9.&nbsp;cusparseGetLevelInfo()</a></li>
18558                   <li><a href="#cusparsegetmatdiagtype">5.10.&nbsp;cusparseGetMatDiagType()</a></li>
18559                   <li><a href="#cusparsegetmatfillmode">5.11.&nbsp;cusparseGetMatFillMode()</a></li>
18560                   <li><a href="#cusparsegetmatindexbase">5.12.&nbsp;cusparseGetMatIndexBase()</a></li>
18561                   <li><a href="#cusparsegetmattype">5.13.&nbsp;cusparseGetMatType()</a></li>
18562                   <li><a href="#cusparsegetpointermode">5.14.&nbsp;cusparseGetPointerMode()</a></li>
18563                   <li><a href="#cusparsegetversion">5.15.&nbsp;cusparseGetVersion()</a></li>
18564                   <li><a href="#cusparsesetmatdiagtype">5.16.&nbsp;cusparseSetMatDiagType()</a></li>
18565                   <li><a href="#cusparsesetmatfillmode">5.17.&nbsp;cusparseSetMatFillMode()</a></li>
18566                   <li><a href="#cusparsesetmatindexbase">5.18.&nbsp;cusparseSetMatIndexBase()</a></li>
18567                   <li><a href="#cusparsesetmattype">5.19.&nbsp;cusparseSetMatType()</a></li>
18568                   <li><a href="#cusparsesetpointermode">5.20.&nbsp;cusparseSetPointerMode()</a></li>
18569                   <li><a href="#cusparsesetstream">5.21.&nbsp;cusparseSetStream()</a></li>
18570                </ul>
18571             </li>
18572             <li><a href="#cusparse-level-1-function-reference">6.&nbsp;CUSPARSE Level 1 Function Reference</a><ul>
18573                   <li><a href="#cusparse-lt-t-gt-axpyi">6.1.&nbsp;cusparse&lt;t&gt;axpyi</a></li>
18574                   <li><a href="#cusparse-lt-t-gt-doti">6.2.&nbsp;cusparse&lt;t&gt;doti</a></li>
18575                   <li><a href="#cusparse-lt-t-gt-dotci">6.3.&nbsp;cusparse&lt;t&gt;dotci</a></li>
18576                   <li><a href="#cusparse-lt-t-gt-gthr">6.4.&nbsp;cusparse&lt;t&gt;gthr</a></li>
18577                   <li><a href="#cusparse-lt-t-gt-gthrz">6.5.&nbsp;cusparse&lt;t&gt;gthrz</a></li>
18578                   <li><a href="#cusparse-lt-t-gt-roti">6.6.&nbsp;cusparse&lt;t&gt;roti</a></li>
18579                   <li><a href="#cusparse-lt-t-gt-sctr">6.7.&nbsp;cusparse&lt;t&gt;sctr</a></li>
18580                </ul>
18581             </li>
18582             <li><a href="#cusparse-level-2-function-reference">7.&nbsp;CUSPARSE Level 2 Function Reference</a><ul>
18583                   <li><a href="#cusparse-lt-t-gt-bsrmv">7.1.&nbsp;cusparse&lt;t&gt;bsrmv</a></li>
18584                   <li><a href="#cusparse-lt-t-gt-bsrxmv">7.2.&nbsp;cusparse&lt;t&gt;bsrxmv</a></li>
18585                   <li><a href="#cusparse-lt-t-gt-csrmv">7.3.&nbsp;cusparse&lt;t&gt;csrmv</a></li>
18586                   <li><a href="#cusparse-lt-t-gt-csrsvanalysis">7.4.&nbsp;cusparse&lt;t&gt;csrsv_analysis</a></li>
18587                   <li><a href="#cusparse-lt-t-gt-csrsvsolve">7.5.&nbsp;cusparse&lt;t&gt;csrsv_solve</a></li>
18588                   <li><a href="#cusparse-lt-t-gt-hybmv">7.6.&nbsp;cusparse&lt;t&gt;hybmv</a></li>
18589                   <li><a href="#cusparse-lt-t-gt-hybsvanalysis">7.7.&nbsp;cusparse&lt;t&gt;hybsv_analysis</a></li>
18590                   <li><a href="#cusparse-lt-t-gt-hybsvsolve">7.8.&nbsp;cusparse&lt;t&gt;hybsv_solve</a></li>
18591                </ul>
18592             </li>
18593             <li><a href="#cusparse-level-3-function-reference">8.&nbsp;CUSPARSE Level 3 Function Reference</a><ul>
18594                   <li><a href="#cusparse-lt-t-gt-csrmm">8.1.&nbsp;cusparse&lt;t&gt;csrmm</a></li>
18595                   <li><a href="#cusparse-lt-t-gt-csrmm2">8.2.&nbsp;cusparse&lt;t&gt;csrmm2</a></li>
18596                   <li><a href="#cusparse-lt-t-gt-csrsmanalysis">8.3.&nbsp;cusparse&lt;t&gt;csrsm_analysis</a></li>
18597                   <li><a href="#cusparse-lt-t-gt-csrsmsolve">8.4.&nbsp;cusparse&lt;t&gt;csrsm_solve</a></li>
18598                </ul>
18599             </li>
18600             <li><a href="#cusparse-extra-function-reference">9.&nbsp;CUSPARSE Extra Function Reference</a><ul>
18601                   <li><a href="#cusparse-lt-t-gt-csrgeam">9.1.&nbsp;cusparse&lt;t&gt;csrgeam</a></li>
18602                   <li><a href="#cusparse-lt-t-gt-csrgemm">9.2.&nbsp;cusparse&lt;t&gt;csrgemm</a></li>
18603                </ul>
18604             </li>
18605             <li><a href="#cusparse-preconditioners-reference">10.&nbsp;CUSPARSE Preconditioners Reference</a><ul>
18606                   <li><a href="#cusparse-lt-t-gt-csric0">10.1.&nbsp;cusparse&lt;t&gt;csric0</a></li>
18607                   <li><a href="#cusparse-lt-t-gt-csrilu0">10.2.&nbsp;cusparse&lt;t&gt;csrilu0</a></li>
18608                   <li><a href="#cusparse-lt-t-gt-gtsv">10.3.&nbsp;cusparse&lt;t&gt;gtsv</a></li>
18609                   <li><a href="#cusparse-lt-t-gt-gtsv_nopivot">10.4.&nbsp;cusparse&lt;t&gt;gtsv_nopivot</a></li>
18610                   <li><a href="#cusparse-lt-t-gt-gtsvstridedbatch">10.5.&nbsp;cusparse&lt;t&gt;gtsvStridedBatch</a></li>
18611                </ul>
18612             </li>
18613             <li><a href="#cusparse-format-conversion-reference">11.&nbsp;CUSPARSE Format Conversion Reference</a><ul>
18614                   <li><a href="#cusparse-lt-t-gt-bsr2csr">11.1.&nbsp;cusparse&lt;t&gt;bsr2csr</a></li>
18615                   <li><a href="#cusparse-lt-t-gt-coo2csr">11.2.&nbsp;cusparse&lt;t&gt;coo2csr</a></li>
18616                   <li><a href="#cusparse-lt-t-gt-csc2dense">11.3.&nbsp;cusparse&lt;t&gt;csc2dense</a></li>
18617                   <li><a href="#cusparse-lt-t-gt-csc2hyb">11.4.&nbsp;cusparse&lt;t&gt;csc2hyb</a></li>
18618                   <li><a href="#cusparse-lt-t-gt-csr2bsr">11.5.&nbsp;cusparse&lt;t&gt;csr2bsr</a></li>
18619                   <li><a href="#cusparse-lt-t-gt-csr2coo">11.6.&nbsp;cusparse&lt;t&gt;csr2coo</a></li>
18620                   <li><a href="#cusparse-lt-t-gt-csr2csc">11.7.&nbsp;cusparse&lt;t&gt;csr2csc</a></li>
18621                   <li><a href="#cusparse-lt-t-gt-csr2dense">11.8.&nbsp;cusparse&lt;t&gt;csr2dense</a></li>
18622                   <li><a href="#cusparse-lt-t-gt-csr2hyb">11.9.&nbsp;cusparse&lt;t&gt;csr2hyb</a></li>
18623                   <li><a href="#cusparse-lt-t-gt-dense2csc">11.10.&nbsp;cusparse&lt;t&gt;dense2csc</a></li>
18624                   <li><a href="#cusparse-lt-t-gt-dense2csr">11.11.&nbsp;cusparse&lt;t&gt;dense2csr</a></li>
18625                   <li><a href="#cusparse-lt-t-gt-dense2hyb">11.12.&nbsp;cusparse&lt;t&gt;dense2hyb</a></li>
18626                   <li><a href="#cusparse-lt-t-gt-hyb2csc">11.13.&nbsp;cusparse&lt;t&gt;hyb2csc</a></li>
18627                   <li><a href="#cusparse-lt-t-gt-hyb2csr">11.14.&nbsp;cusparse&lt;t&gt;hyb2csr</a></li>
18628                   <li><a href="#cusparse-lt-t-gt-hyb2dense">11.15.&nbsp;cusparse&lt;t&gt;hyb2dense</a></li>
18629                   <li><a href="#cusparse-lt-t-gt-nnz">11.16.&nbsp;cusparse&lt;t&gt;nnz</a></li>
18630                </ul>
18631             </li>
18632             <li><a href="#appendix-b-cusparse-library-c---example">12.&nbsp;Appendix A: CUSPARSE Library C++ Example</a></li>
18633             <li><a href="#appendix-c-cusparse-fortran-bindings">13.&nbsp;Appendix B: CUSPARSE Fortran Bindings</a><ul>
18634                   <li><a href="#example-b">13.1.&nbsp;Example B, Fortran Application</a></li>
18635                </ul>
18636             </li>
18637             <li><a href="#appendix-acknowledgements">14.&nbsp;Appendix C: Acknowledgements</a></li>
18638             <li><a href="#bibliography">15.&nbsp;Bibliography</a></li>
18639          </ul>
18640       </nav>
18641       <nav id="search-results">
18642          <h2>Search Results</h2>
18643          <ol></ol>
18644       </nav>
18645       <script language="JavaScript" type="text/javascript" charset="utf-8" src="../common/formatting/common.min.js"></script>
18646       <script language="JavaScript" type="text/javascript" charset="utf-8" src="../common/scripts/omniture/s_code_us_dev_aut1-nolinktrackin.js"></script>
18647       <script language="JavaScript" type="text/javascript" charset="utf-8" src="../common/scripts/omniture/omniture.js"></script>
18648       <noscript><a href="http://www.omniture.com" title="Web Analytics"><img src="http://omniture.nvidia.com/b/ss/nvidiacudadocs/1/H.17--NS/0" height="1" width="1" border="0" alt=""></img></a></noscript>
18649       <script language="JavaScript" type="text/javascript" charset="utf-8" src="../common/scripts/google-analytics/google-analytics-write.js"></script>
18650       <script language="JavaScript" type="text/javascript" charset="utf-8" src="../common/scripts/google-analytics/google-analytics-tracker.js"></script>
18651       </body>
18652 </html>