Skip to content

Commit

Permalink
Fixes #542: Now using ::cuda:: or sub-namespaces as appropriate in …
Browse files Browse the repository at this point in the history
…macros

Fix mostly due to Aryan Chudasama <[email protected]>
  • Loading branch information
eyalroz committed Oct 3, 2023
1 parent f8473cb commit f334f6d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/cuda/api/current_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class scoped_override_t {
* prefer @ref SET_CUDA_CONTEXT_FOR_THIS_SCOPE instead.
*/
#define CAW_SET_SCOPE_CONTEXT(context_handle_expr_) \
const cuda::context::current::detail_::scoped_override_t caw_context_for_this_scope_(context_handle_expr_)
const ::cuda::context::current::detail_::scoped_override_t caw_context_for_this_scope_(context_handle_expr_)
///@endcond

/**
Expand Down Expand Up @@ -236,7 +236,7 @@ class scoped_ensurer_t {
* the hood to effect this behavior.
*/
#define CUDA_CONTEXT_FOR_THIS_SCOPE(_cuda_context) \
::cuda::context::current::scoped_override_t set_context_for_this_scope{ _cuda_context }
::cuda::context::current::scoped_override_t set_context_for_this_scope{ _cuda_context }

inline void synchronize()
{
Expand Down
2 changes: 1 addition & 1 deletion src/cuda/api/current_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ inline void set_to_default() { return detail_::set(device::default_device_id); }
* the hood to effect this behavior.
*/
#define CUDA_DEVICE_FOR_THIS_SCOPE(_cuda_device) \
::cuda::device::current::scoped_override_t scoped_device_override{ _cuda_device }
::cuda::device::current::scoped_override_t scoped_device_override{ _cuda_device }


} // namespace current
Expand Down
6 changes: 3 additions & 3 deletions src/cuda/api/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ class runtime_error : public ::std::runtime_error {

#define throw_if_error_lazy(status__, ... ) \
do { \
const status_t tie_status__ = static_cast<status_t>(status__); \
if (is_failure(tie_status__)) { \
throw runtime_error(tie_status__, (__VA_ARGS__)); \
const ::cuda::status_t tie_status__ = static_cast<::cuda::status_t>(status__); \
if (::cuda::is_failure(tie_status__)) { \
throw ::cuda::runtime_error(tie_status__, (__VA_ARGS__)); \
} \
} while(false)

Expand Down
6 changes: 3 additions & 3 deletions src/cuda/rtc/error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ inline void throw_if_error(rtc::status_t<Kind> status) noexcept(false)

#define throw_if_rtc_error_lazy(Kind, status__, ... ) \
do { \
rtc::status_t<Kind> tie_status__ = static_cast<rtc::status_t<Kind>>(status__); \
if (is_failure<Kind>(tie_status__)) { \
throw rtc::runtime_error<Kind>(tie_status__, (__VA_ARGS__)); \
::cuda::rtc::status_t<Kind> tie_status__ = static_cast<::cuda::rtc::status_t<Kind>>(status__); \
if (::cuda::is_failure<Kind>(tie_status__)) { \
throw ::cuda::rtc::runtime_error<Kind>(tie_status__, (__VA_ARGS__)); \
} \
} while(false)

Expand Down

0 comments on commit f334f6d

Please sign in to comment.