Skip to content

Commit

Permalink
Merge pull request #525 from kkraus14/thrust_patch
Browse files Browse the repository at this point in the history
[REVIEW] Patch Thrust to workaround CUDA_CUB_RET_IF_FAIL macro clearing CUDA errors
  • Loading branch information
raydouglass authored Aug 27, 2020
2 parents 2f83a03 + dc46492 commit 7f5ff19
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
- PR #511 Specify `--basetemp` for `py.test` run
- PR #509 Fix missing : before __LINE__ in throw string of RMM_CUDA_TRY
- PR #510 Fix segfault in pool_memory_resource when a CUDA stream is destroyed
- PR #525 Patch Thrust to workaround `CUDA_CUB_RET_IF_FAIL` macro clearing CUDA errors


# RMM 0.14.0 (03 Jun 2020)
Expand Down
1 change: 1 addition & 0 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/thrust/thrust.git
GIT_TAG 1.9.10
GIT_SHALLOW true
PATCH_COMMAND COMMAND patch -p1 < "${CMAKE_CURRENT_SOURCE_DIR}/thrust-ret-if-fail.patch"
)

FetchContent_GetProperties(thrust)
Expand Down
16 changes: 16 additions & 0 deletions thirdparty/thrust-ret-if-fail.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/thrust/system/cuda/detail/core/util.h b/thrust/system/cuda/detail/core/util.h
index a2c87772..ea4ed640 100644
--- a/thrust/system/cuda/detail/core/util.h
+++ b/thrust/system/cuda/detail/core/util.h
@@ -652,7 +652,10 @@ namespace core {
}

#define CUDA_CUB_RET_IF_FAIL(e) \
- if (cub::Debug((e), __FILE__, __LINE__)) return e;
+ { \
+ auto const error = (e); \
+ if (cub::Debug(error, __FILE__, __LINE__)) return error; \
+ }

// uninitialized
// -------

0 comments on commit 7f5ff19

Please sign in to comment.