Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the type of u to prevent illegal memory access #722

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions implicit/gpu/als.cu
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ least_squares_cg_kernel(int factors, size_t user_count, size_t item_count, T *X,

// Stride over users in the grid:
// https://devblogs.nvidia.com/parallelforall/cuda-pro-tip-write-flexible-kernels-grid-stride-loops/
for (int u = blockIdx.x; u < user_count; u += gridDim.x) {
for (size_t u = blockIdx.x; u < user_count; u += gridDim.x) {
T *x = &X[u * factors];

float x_value = convert<T, float>(x[threadIdx.x]);
Expand Down Expand Up @@ -102,7 +102,7 @@ least_squares_cg_kernel(int factors, size_t user_count, size_t item_count, T *X,
// complain and don't let it perpetuate
if (isnan(rsold)) {
if (threadIdx.x == 0) {
printf("Warning NaN Detected in row %i of %lu\n", u, user_count);
printf("Warning NaN Detected in row %zu of %lu\n", u, user_count);
}
x_value = 0;
}
Expand Down