Skip to content

Adding defines as _additional_ preprocessor definitions #235

Answered by stijnh
loostrum asked this question in Q&A
Discussion options

You must be logged in to vote

You should be able to use:

defines = dict(
block_size_x=lambda p: p["block_size_x"],
use_smem=lambda p: p["use_smem"],
...
)

If I remember correctly, this should also work:

defines = dict(
block_size_x="block_size_x",
use_smem="use_smem",
...
)

In which case, you can generate the dict automatically:

defines = {key: key for key in tune_params}
defines["another_variable"] = 1
defines["more_variables"] = 2

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by isazi
Comment options

loostrum
Dec 7, 2023
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #234 on December 08, 2023 09:05.