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

Fix race condition in OpenCL kernel #3535

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/backend/opencl/kernel/flood_fill.cl
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,7 @@ int barrierOR(local int *predicates) {
barrier(CLK_LOCAL_MEM_FENCE);
}
int retVal = predicates[0];
#if AF_IS_PLATFORM_NVIDIA
// Without the extra barrier sync after reading the reduction result,
// the caller's loop is going into infinite loop occasionally which is
// in turn randoms hangs. This doesn't seem to be an issue on non-nvidia
// hardware. Hence, the check.
barrier(CLK_LOCAL_MEM_FENCE);
#endif
return retVal;
}

Expand Down
2 changes: 0 additions & 2 deletions src/backend/opencl/kernel/flood_fill.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ void floodFill(Param out, const Param image, const Param seedsx,
DefineKeyValue(LMEM_WIDTH, (THREADS_X + 2 * RADIUS)),
DefineKeyValue(LMEM_HEIGHT, (THREADS_Y + 2 * RADIUS)),
DefineKeyValue(GROUP_SIZE, (THREADS_Y * THREADS_X)),
DefineKeyValue(AF_IS_PLATFORM_NVIDIA, (int)(AFCL_PLATFORM_NVIDIA ==
getActivePlatformVendor())),
getTypeBuildDefinition<T>()};

auto floodStep =
Expand Down