Skip to content

Commit

Permalink
Merge pull request #27 from markkimsal/fixes/implicit-func-warning
Browse files Browse the repository at this point in the history
fix: quiet compilation warning about implicit functions
  • Loading branch information
henrique-borba authored Jul 25, 2023
2 parents f90cb2b + c50c0f0 commit 2dd212e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ndarray.c
Original file line number Diff line number Diff line change
Expand Up @@ -963,13 +963,15 @@ NDArray_Broadcast(NDArray *a, NDArray *b) {
rtn_p = rtn_p + (sizeof(float) * NDArray_SHAPE(src)[0]);
}
}
#ifdef HAVE_CUBLAS
if (NDArray_DEVICE(dst) == NDARRAY_DEVICE_GPU) {
for (i = 0; i < NDArray_SHAPE(dst)[NDArray_NDIM(dst) - 2]; i++) {
NDArray_VMEMCPY_D2D(NDArray_DATA(src), rtn_p,
sizeof(float) * NDArray_SHAPE(dst)[NDArray_NDIM(dst) - 1]);
rtn_p = rtn_p + (sizeof(float) * NDArray_SHAPE(src)[0]);
}
}
#endif
}
}
int j;
Expand All @@ -982,6 +984,7 @@ NDArray_Broadcast(NDArray *a, NDArray *b) {
}
}
}
#ifdef HAVE_CUBLAS
if (NDArray_DEVICE(dst) == NDARRAY_DEVICE_GPU) {
for (i = 0; i < NDArray_SHAPE(dst)[NDArray_NDIM(dst) - 2]; i++) {
for (j = 0; j < NDArray_SHAPE(dst)[NDArray_NDIM(dst) - 1]; j++) {
Expand All @@ -990,8 +993,8 @@ NDArray_Broadcast(NDArray *a, NDArray *b) {
NDArray_VMEMCPY_D2D(tmp_p, rtn_p, sizeof(float));
}
}
NDArray_Print(rtn,0);
}
#endif
}
if (NDArray_SHAPE(src)[NDArray_NDIM(dst) - 1] == NDArray_SHAPE(dst)[NDArray_NDIM(dst) - 2]) {
if (NDArray_DEVICE(dst) == NDARRAY_DEVICE_CPU) {
Expand All @@ -1001,6 +1004,7 @@ NDArray_Broadcast(NDArray *a, NDArray *b) {
rtn_p = rtn_p + (sizeof(float) * NDArray_SHAPE(src)[NDArray_NDIM(dst) - 1]);
}
}
#ifdef HAVE_CUBLAS
if (NDArray_DEVICE(dst) == NDARRAY_DEVICE_GPU) {
for (i = 0; i < NDArray_SHAPE(dst)[NDArray_NDIM(dst) - 2]; i++) {
NDArray_VMEMCPY_D2D(NDArray_DATA(src), rtn_p,
Expand All @@ -1009,6 +1013,7 @@ NDArray_Broadcast(NDArray *a, NDArray *b) {
(i * NDArray_STRIDES(rtn)[NDArray_NDIM(rtn) - 2] / NDArray_ELSIZE(rtn)) + j);
}
}
#endif
}
}
return rtn;
Expand Down

0 comments on commit 2dd212e

Please sign in to comment.