-
I have a kernel where I tune a bunch of parameters, but need to insert some static values as well (think problem size etc.) as preprocessor definitions. I thought I'd be able to use the Currently I'm using single-value tunable parameters as a workaround, but it clutters the tuning output a bit. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
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 |
Beta Was this translation helpful? Give feedback.
-
Thanks for the tip, that should solve my issue! |
Beta Was this translation helpful? Give feedback.
-
Great! This should be documented better since currently its a bit hidden away in the API documentation between all the other keyword argument descriptions. |
Beta Was this translation helpful? Give feedback.
-
At least the API documentation is visible again! haha |
Beta Was this translation helpful? Give feedback.
You should be able to use:
If I remember correctly, this should also work:
In which case, you can generate the dict automatically: