thrust icon indicating copy to clipboard operation
thrust copied to clipboard

Add a `THRUST_HOST_DEVICE` macro

Open miscco opened this issue 3 years ago • 1 comments

clang-format is generally confused by our __host__ and __device__ macros, severely messing up formatting.

We can replace that by a single macro and tell clang-format to not mess with its formatting.

While we are at it add some other common macros to the list of StatementMacros

miscco avatar Sep 19 '22 12:09 miscco

Interesting -- this has been an annoyance for so long!

I'm curious why we'd need the macro. If __host__ and __device__ are both marked as statement macros, __host__ __device__ should work too, right?

(Edit: I see now that the StatementMacros are each on a newline, which is indeed annoying. Maybe AttributeMacros will behave more intuitively here?)

alliepiper avatar Sep 19 '22 14:09 alliepiper

I am closing this for now. It would make more sense to find a common style for all three repositories

miscco avatar Feb 21 '23 13:02 miscco