/usr/include/clSPARSE-1x.h is in libclsparse-dev 0.10.2.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | /* ************************************************************************
* Copyright 2015 Advanced Micro Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ************************************************************************ */
/*! \file
* \brief clSPARSE-1x.h defines public types specific to OpenCL 1.x API's.
* This file is kept as a strictly 'C' compatible interface.
*/
#pragma once
#ifndef _CL_SPARSE_1x_H_
#define _CL_SPARSE_1x_H_
#include "clSPARSE-xx.h"
/*! \brief Structure to encapsulate scalar data to clSPARSE API
*/
typedef struct clsparseScalar_
{
cl_mem value; /**< OpenCL 1.x memory handle */
/*! Given that cl_mem objects are opaque without pointer arithmetic, this offset is added to
* the cl_mem locations on device to define beginning of the data in the cl_mem buffers
*/
clsparseIdx_t off_value;
} clsparseScalar;
/*! \brief Structure to encapsulate dense vector data to clSPARSE API
*/
typedef struct cldenseVector_
{
clsparseIdx_t num_values; /*!< Length of dense vector */
cl_mem values; /*!< OpenCL 1.x memory handle */
/*! Given that cl_mem objects are opaque without pointer arithmetic, this offset is added to
* the cl_mem locations on device to define beginning of the data in the cl_mem buffers
*/
clsparseIdx_t off_values;
} cldenseVector;
/*! \brief Structure to encapsulate sparse matrix data encoded in CSR
* form to clSPARSE API
* \note The indices stored are 0-based
* \note It is the users responsibility to allocate/deallocate OpenCL buffers
*/
typedef struct clsparseCsrMatrix_
{
/** @name CSR matrix data */
/**@{*/
clsparseIdx_t num_rows; /*!< Number of rows this matrix has if viewed as dense */
clsparseIdx_t num_cols; /*!< Number of columns this matrix has if viewed as dense */
clsparseIdx_t num_nonzeros; /*!< Number of values in matrix that are non-zero */
/**@}*/
/** @name OpenCL state */
/**@{*/
cl_mem values; /*!< non-zero values in sparse matrix of size num_nonzeros */
cl_mem col_indices; /*!< column index for corresponding value of size num_nonzeros */
cl_mem row_pointer; /*!< Invariant: row_pointer[i+1]-row_pointer[i] = number of values in row i */
/**@}*/
/** @name Buffer offsets */
/**@{*/
/*! Given that cl_mem objects are opaque without pointer arithmetic, these offsets are added to
* the cl_mem locations on device to define beginning of the data in the cl_mem buffers
*/
clsparseIdx_t off_values;
clsparseIdx_t off_col_indices;
clsparseIdx_t off_row_pointer;
/**@}*/
/*! Pointer to a private structure that contains meta-information the library keeps on a
csr-encoded sparse matrix
*/
void* meta;
} clsparseCsrMatrix;
/*! \brief Structure to encapsulate sparse matrix data encoded in COO
* form to clSPARSE API
* \note The indices stored are 0-based
* \note It is the users responsibility to allocate/deallocate OpenCL buffers
*/
typedef struct clsparseCooMatrix_
{
/** @name COO matrix data */
/**@{*/
clsparseIdx_t num_rows; /*!< Number of rows this matrix has if viewed as dense */
clsparseIdx_t num_cols; /*!< Number of columns this matrix has if viewed as dense */
clsparseIdx_t num_nonzeros; /*!< Number of values in matrix that are non-zero */
/**@}*/
/** @name OpenCL state */
/**@{*/
cl_mem values; /*!< CSR non-zero values of size num_nonzeros */
cl_mem col_indices; /*!< column index for corresponding element; array size num_nonzeros */
cl_mem row_indices; /*!< row index for corresponding element; array size num_nonzeros */
/**@}*/
/** @name Buffer offsets */
/**@{*/
/*! Given that cl_mem objects are opaque without pointer arithmetic, these offsets are added to
* the cl_mem locations on device to define beginning of the data in the cl_mem buffers
*/
clsparseIdx_t off_values;
clsparseIdx_t off_col_indices;
clsparseIdx_t off_row_indices;
/**@}*/
} clsparseCooMatrix;
/*! \brief Structure to encapsulate dense matrix data to clSPARSE API
* \note It is the users responsibility to allocate/deallocate OpenCL buffers
*/
typedef struct cldenseMatrix_
{
/** @name Dense matrix data */
/**@{*/
clsparseIdx_t num_rows; /*!< Number of rows */
clsparseIdx_t num_cols; /*!< Number of columns */
clsparseIdx_t lead_dim; /*! Stride to the next row or column, in units of elements */
cldenseMajor major; /*! Memory layout for dense matrix */
/**@}*/
cl_mem values; /*!< Array of matrix values */
/*! Given that cl_mem objects are opaque without pointer arithmetic, these offsets are added to
* the cl_mem locations on device to define beginning of the data in the cl_mem buffers
*/
clsparseIdx_t off_values;
} cldenseMatrix;
#endif
|