FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix barrierOR fn in confidence connected opencl kernel by 9prady9 · Pull Request #2969 · arrayfire/arrayfire · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cl  (1) .cpp  (2) .hpp  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 0 additions & 7 deletions src/api/c/confidence_connected.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,6 @@ af_err af_confidence_cc(af_array* out, const af_array in, const af_array seedx,
const af_array seedy, const unsigned radius,
const unsigned multiplier, const int iter,
const double segmented_value) {
#if defined(AF_OPENCL)
// FIXME OpenCL backend keeps running into indefinte loop for
// short bit size(16,8) types very often and occasionally
// with 32 bit types.
AF_ERROR("There is a known issue for OpenCL implementation",
AF_ERR_NOT_SUPPORTED);
#endif
try {
const ArrayInfo& inInfo = getInfo(in);
const ArrayInfo& seedxInfo = getInfo(seedx);
Expand Down
9 changes: 8 additions & 1 deletion src/backend/opencl/kernel/flood_fill.cl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ 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);
return predicates[0];
#endif
return retVal;
}

kernel void flood_step(global T *out, KParam oInfo, global const T *img,
Expand Down
2 changes: 2 additions & 0 deletions src/backend/opencl/kernel/flood_fill.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ 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 == getActivePlatform())),
};
options.emplace_back(getTypeBuildDefinition<T>());

Expand Down
3 changes: 0 additions & 3 deletions test/confidence_connected.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ void testData(CCCTestParams params) {
class ConfidenceConnectedDataTest
: public testing::TestWithParam<CCCTestParams> {};

#if !defined(AF_OPENCL)

TYPED_TEST(ConfidenceConnectedImageTest, DonutBackgroundExtraction) {
const unsigned seedx = 10;
const unsigned seedy = 10;
Expand Down Expand Up @@ -200,4 +198,3 @@ INSTANTIATE_TEST_CASE_P(
<< info.param.iterations << "_replace_" << info.param.replace;
return ss.str();
});
#endif

Back | FazBrowse Home | New Git URL