Skip to content

Commit

Permalink
Fixes #366: Spruce up the FOR_THIS_SCOPE macros
Browse files Browse the repository at this point in the history
The `CUDA_DEVICE_OR_THIS_SCOPE()` and `CUDA_CONTEXT_FOR_THIS_SCOPE()` now take a device and a context, respectively; and the namer of the latter upon expansion has been corrected.
  • Loading branch information
eyalroz committed Jun 20, 2022
1 parent 17d944b commit 59408e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 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 @@ -195,8 +195,8 @@ class scoped_override_t;
* it as an opaque command, which does not explicitly expose the variable defined under
* the hood to effect this behavior.
*/
#define CUDA_CONTEXT_FOR_THIS_SCOPE(_cuda_context_ctor_argument) \
::cuda::context::current::scoped_override_t scoped_device_override( ::cuda::context_t(_cuda_context_ctor_argument) )
#define CUDA_CONTEXT_FOR_THIS_SCOPE(_cuda_context) \
::cuda::context::current::scoped_override_t scoped_context_override{ _cuda_context }


inline bool push_if_not_on_top(const context_t& context);
Expand Down
4 changes: 2 additions & 2 deletions src/cuda/api/current_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ inline void set_to_default() { return detail_::set(device::default_device_id); }
* it as an opaque command, which does not explicitly expose the variable defined under
* the hood to effect this behavior.
*/
#define CUDA_DEVICE_FOR_THIS_SCOPE(_cuda_device_ctor_argument) \
::cuda::device::current::scoped_override_t scoped_device_override( ::cuda::device_t(_cuda_device_ctor_argument) )
#define CUDA_DEVICE_FOR_THIS_SCOPE(_cuda_device) \
::cuda::device::current::scoped_override_t scoped_device_override{ _cuda_device }


} // namespace current
Expand Down

0 comments on commit 59408e1

Please sign in to comment.