-
Notifications
You must be signed in to change notification settings - Fork 347
Update macro parameter names with parentheses #2913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Mike Essenmacher <[email protected]>
Signed-off-by: Mike Essenmacher <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grepping for #define *[\w_-]* *\(
I find more patterns
e.g.
#define OM_TYPE_METADATA_DEF(ENUM_NAME, ENUM_VAL, DTYPE_SIZE, DTYPE_NAME) \
ENUM_NAME = ENUM_VAL,
or
#define INVOKE_ACCEL_INIT_FUNCTION(name, kinds) \
if (!kinds.empty() && \
llvm::is_contained(kinds, accel::Accelerator::Kind::name)) \
create##name()->setName(#name);
#define compareFunctionBody(typeName, direction, load, dataPtr, idx1p, idx2p) \
{ \
uint64_t idx1 = *((uint64_t *)idx1p); \
uint64_t idx2 = *((uint64_t *)idx2p); \
typeName *data = (typeName *)dataPtr; \
load(typeName, v1, data[idx1]); \
load(typeName, v2, data[idx2]); \
return (direction(v1, v2) || (v1 == v2 && idx1 < idx2)) ? -1 : 1; \
}
and many more in that file
#define LOOP_1(INDEX, IV, UB) \
fprintf(fout, "["); \
for (int64_t IV = 0; IV < UB; ++IV) { \
if (IV) \
fprintf(fout, ", "); \
indexes[INDEX] = IV; \
int64_t elemOffset = computeElemOffset(tensor->_strides, indexes, rank); \
printElement(fout, dataPtr, elemOffset, dataType); \
} \
fprintf(fout, "]");
and many more in that file
#define THREAD_LOCAL_INIT(key, func) pthread_once(key, func)
#define MIN(x, y) ((x) > (y) ? y : x)
and many more in that file
#define CHECK_CALL(type, var, call, success, ...) \
type var = call; \
do { \
if (!(success)) { \
LOG_PRINTF(LOG_ERROR, __VA_ARGS__); \
return NULL; \
} \
} while (0)
and many more in that file
#define BIT_CAST(TO_TYPE, TO, FROM) \
TO_TYPE TO; \
static_assert(sizeof(TO) == sizeof(FROM), "only bit cast same sizes"); \
memcpy(&TO, &FROM, sizeof(FROM))
and more in that file
#define IGNORE_ARG(FLAG) \
if (arg.find(FLAG) == 0) { \
return false; \
}
plus more in that file
Signed-off-by: Mike Essenmacher <[email protected]>
Signed-off-by: Mike Essenmacher <[email protected]>
Signed-off-by: Mike Essenmacher <[email protected]>
@AlexandreEichenberger Thanks for the comment! I added more updates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for looking at all these other patterns
Jenkins Linux s390x Build #15411 [push] Update macro parameter n... started at 07:15 |
Jenkins Linux ppc64le Build #14436 [push] Update macro parameter n... started at 07:24 |
Jenkins Linux amd64 Build #15406 [push] Update macro parameter n... started at 06:15 |
Jenkins Linux amd64 Build #15406 [push] Update macro parameter n... passed after 1 hr 7 min |
Jenkins Linux s390x Build #15411 [push] Update macro parameter n... passed after 1 hr 31 min |
Jenkins Linux ppc64le Build #14436 [push] Update macro parameter n... passed after 2 hr 8 min |
Update code to add macro parameter names with parentheses to zDNNExtension and Stickify.