Skip to content

Commit

Permalink
Fix __any warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Hernandez committed Jul 10, 2021
1 parent bd047a3 commit 7b9cf5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ project(sgm)
find_package( OpenCV REQUIRED )
find_package( CUDA REQUIRED )

SET(OpenCV_DIR /home/lichi/packages/opencv3/build/installation/OpenCV-3.4.12/share/OpenCV)
SET(OpenCV_INCLUDE_DIRS /home/lichi/packages/opencv3/build/installation/OpenCV-3.4.12/include)

message(STATUS "OpenCV_INCLUDE_DIRS = ${OpenCV_INCLUDE_DIRS}")
message(STATUS "OpenCV_DIR = ${OpenCV_DIR}")
message(STATUS "OpenCV_LIBS = ${OpenCV_LIBS}")
set(
CUDA_NVCC_FLAGS
${CUDA_NVCC_FLAGS};
Expand Down
13 changes: 6 additions & 7 deletions util.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ __inline__ __device__ int shfl_32(int scalarValue, const int lane) {
#if FERMI
return __emulated_shfl(scalarValue, (uint32_t)lane);
#else
//return __shfl(scalarValue, lane); deprecated
return __shfl_sync(0xffffffff,scalarValue, lane);
return __shfl_sync(0xffffffff, scalarValue, lane);
#endif
}

Expand All @@ -114,7 +113,7 @@ __inline__ __device__ int shfl_up_32(int scalarValue, const int n) {
lane -= n;
return shfl_32(scalarValue, lane);
#else
return __shfl_up_sync(0xffffffff,scalarValue, n);
return __shfl_up_sync(0xffffffff, scalarValue, n);
#endif
}

Expand All @@ -124,7 +123,7 @@ __inline__ __device__ int shfl_down_32(int scalarValue, const int n) {
lane += n;
return shfl_32(scalarValue, lane);
#else
return __shfl_down_sync(0xffffffff,scalarValue, n);
return __shfl_down_sync(0xffffffff, scalarValue, n);
#endif
}

Expand All @@ -134,7 +133,7 @@ __inline__ __device__ int shfl_xor_32(int scalarValue, const int n) {
lane = lane ^ n;
return shfl_32(scalarValue, lane);
#else
return __shfl_xor_sync(0xffffffff,scalarValue, n);
return __shfl_xor_sync(0xffffffff, scalarValue, n);
#endif
}

Expand Down Expand Up @@ -340,7 +339,7 @@ __inline__ __device__ bool blockAny(bool local_condition) {
const int lane = threadIdx.x % WARP_SIZE;
const int wid = threadIdx.x / WARP_SIZE;

local_condition = __any(local_condition); // Each warp performs __any
local_condition = __any_sync(0xffffffff, local_condition); // Each warp performs __any

if (lane==0) {
conditions[wid]=local_condition;
Expand All @@ -352,7 +351,7 @@ __inline__ __device__ bool blockAny(bool local_condition) {
local_condition = (threadIdx.x < blockDim.x / WARP_SIZE) ? conditions[lane] : false;

if (wid==0) {
local_condition = __any(local_condition); //Final __any within first warp
local_condition = __any_sync(0xffffffff, local_condition); //Final __any within first warp
}

return local_condition;
Expand Down

0 comments on commit 7b9cf5d

Please sign in to comment.