From 54a20e6e9fb96a033a8c1a84f5bde377483de467 Mon Sep 17 00:00:00 2001 From: Frederic Date: Fri, 13 Dec 2013 22:56:44 -0500 Subject: [PATCH] Add const parameter. --- src/compyte/numpy_compat.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/compyte/numpy_compat.h b/src/compyte/numpy_compat.h index 167a347..8dcb33e 100644 --- a/src/compyte/numpy_compat.h +++ b/src/compyte/numpy_compat.h @@ -7,24 +7,24 @@ #ifndef COMPYTE_BUFFER_CUDA_H #define COMPYTE_BUFFER_CUDA_H -int PyGpuArray_NDIM(PyGpuArrayObject *arr) { +int PyGpuArray_NDIM(const PyGpuArrayObject *arr) { return arr->ga.nd; } -size_t *PyGpuArray_DIMS(PyGpuArrayObject *arr) { +const size_t *PyGpuArray_DIMS(const PyGpuArrayObject *arr) { return arr->ga.dimensions; } -ssize_t *PyGpuArray_STRIDES(PyGpuArrayObject* arr) { +const ssize_t *PyGpuArray_STRIDES(const PyGpuArrayObject* arr) { return arr->ga.strides; } -size_t PyGpuArray_DIM(PyGpuArrayObject* arr, int n) { +size_t PyGpuArray_DIM(const PyGpuArrayObject* arr, int n) { return arr->ga.dimensions[n]; } -ssize_t PyGpuArray_STRIDE(PyGpuArrayObject* arr, int n) { +ssize_t PyGpuArray_STRIDE(const PyGpuArrayObject* arr, int n) { return arr->ga.strides[n]; } //int PyGpuArray_ITEMSIZE(PyGpuArrayObject* arr) -size_t PyGpuArray_SIZE(PyGpuArrayObject* arr) { +size_t PyGpuArray_SIZE(const PyGpuArrayObject* arr) { size_t size = 1; for(int i=0; i< arr->ga.nd; i++) { size *= arr->ga.dimensions[i];