Skip to content

Commit

Permalink
make STDEXEC_ATTRIBUTE robust against rogue #define-s of __host__ and…
Browse files Browse the repository at this point in the history
… __device__
  • Loading branch information
ericniebler committed Dec 4, 2023
1 parent 8ddb4ef commit 5b72950
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions include/stdexec/__detail/__config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,19 @@
#define STDEXEC_ATTR_WHICH_0(_ATTR) [[_ATTR]]

// custom handling for specific attribute types
#define STDEXEC_ATTR_WHICH_1(_ATTR) STDEXEC_CUDA(__host__)
#ifdef __CUDACC__
#define STDEXEC_ATTR_WHICH_1(_ATTR) __host__
#else
#define STDEXEC_ATTR_WHICH_1(_ATTR)
#endif
#define STDEXEC_ATTR_host STDEXEC_PROBE(~, 1)
#define STDEXEC_ATTR___host__ STDEXEC_PROBE(~, 1)

#define STDEXEC_ATTR_WHICH_2(_ATTR) STDEXEC_CUDA(__device__)
#ifdef __CUDACC__
#define STDEXEC_ATTR_WHICH_2(_ATTR) __device__
#else
#define STDEXEC_ATTR_WHICH_2(_ATTR)
#endif
#define STDEXEC_ATTR_device STDEXEC_PROBE(~, 2)
#define STDEXEC_ATTR___device__ STDEXEC_PROBE(~, 2)

Expand Down

0 comments on commit 5b72950

Please sign in to comment.