Skip to content

Commit

Permalink
Merge pull request inducer#7 from nouiz/const
Browse files Browse the repository at this point in the history
Add const parameter.
  • Loading branch information
abergeron committed Dec 14, 2013
2 parents 0c5f677 + 54a20e6 commit 178ac0e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/compyte/numpy_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 178ac0e

Please sign in to comment.