Skip to content

Commit

Permalink
Commiting changes previously only made to the generated code (fix) - …
Browse files Browse the repository at this point in the history
…improved const correctness for lbRegion
  • Loading branch information
kubagalecki committed Oct 20, 2023
1 parent 4768726 commit ef50874
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Region.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ class lbRegion {
if (ret.nx <= 0 || ret.ny <= 0 || ret.nz <= 0) { ret.nx = ret.ny = ret.nz = 0; };
return ret;
};
inline int offset(int x,int y) {
int offset(int x,int y) const {
return (x-dx) + (y-dy) * nx;
};
inline void print() {
printf("Region: %dx%dx%d + %d,%d,%d\n", nx,ny,nz,dx,dy,dz);
};
CudaHostFunction CudaDeviceFunction inline int offset(int x,int y,int z) {
CudaHostFunction CudaDeviceFunction int offset(int x,int y,int z) const {
return (x-dx) + (y-dy) * nx + (z-dz) * nx * ny;
};
CudaHostFunction CudaDeviceFunction inline size_t offsetL(int x,int y,int z) {
CudaHostFunction CudaDeviceFunction size_t offsetL(int x,int y,int z) const {
return (x-dx) + (y-dy) * nx + (z-dz) * nx * ny;
};

Expand Down

0 comments on commit ef50874

Please sign in to comment.