Skip to content

Instantly share code, notes, and snippets.

View magnumripper's full-sized avatar
💭
Trying to catch up

magnum magnumripper

💭
Trying to catch up
View GitHub Profile
@magnumripper
magnumripper / RandomNotes.md
Last active December 7, 2021 16:15
#pragma inside a macro

You can't use #pragma within a macro. But in C99, and therefore OpenCL, you can use the _Pragma() directive:

# if foo
#define PRAGMA_UNROLL "_Pragma(unroll 8)"
#elif bar
#define PRAGMA_UNROLL "_Pragma(unroll 16)"
#endif

#define macro foobar(...) \
(...) \