imate
C++/CUDA Reference
|
#include "./definitions.h"
Go to the source code of this file.
Typedefs | |
typedef int | LongIndexType |
typedef int | IndexType |
typedef int | FlagType |
typedef int LongIndexType |
Use LongIndexType
type for long indices where parallelization could be important. This could include, for instance, indices of long columns of matrices, but not short rows.
This type is intended to be set as long
. However, because the indices of scipy.sparse
matrices are stored as int
(and not long
) here, a fused type is used to accommodate both int
and long
.
The type of indices of sparse arrays can be cast, for instance by:
// In this file: ctypedef long IndexType // In linear_operator.pyx:LinearOperator:__cinit__() // Add .astype('uint64') to these variables: self.A_indices = A.indices.astype('uint64') self.B_indices = A.indices.astype('uint64') self.A_index_pointer = A.indptr.astype('uint64') self.B_index_pointer = B.indptr.astype('uint64')
In the above, uint64
is equivalent to long
. Note, this will copy the data, since scipy's sparse indices should be casted from uint32
.