Skip to content

Commit

Permalink
Correcting const in memcpy2D
Browse files Browse the repository at this point in the history
  • Loading branch information
llaniewski committed Dec 20, 2023
1 parent 3d8a6cc commit 6827cd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cross.cu
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

uint3 CpuBlock, CpuThread, CpuSize;

void memcpy2D(void * dst_, int dpitch, void * src_, int spitch, int width, int height) {
void memcpy2D(void * dst_, int dpitch, const void * src_, int spitch, int width, int height) {
char * dst = (char*) dst_, *src = (char*) src_;
for (int i=0; i<height; i++) {
memcpy(dst + i*dpitch, src + i*spitch, width);
Expand Down
2 changes: 1 addition & 1 deletion src/cross.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
CPUKernelRun(func, blocks, std::forward<P>(args)...);
}

void memcpy2D(void * dst_, int dpitch, void * src_, int spitch, int width, int height);
void memcpy2D(void * dst_, int dpitch, const void * src_, int spitch, int width, int height);

template <class T, class P> inline T data_cast(const P& x) {
static_assert(sizeof(T)==sizeof(P),"Wrong sizes in data_cast");
Expand Down

0 comments on commit 6827cd2

Please sign in to comment.