Allow setup code in `%gpu_timeit`
Open
cat:enhancement
prio:high
- Dominant language
- Python
- Stars
- 12.3k
- Forks
- 1.1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 45
Description
> It seems that `args.code` is still active but ignored. Maybe add an error for that? (Mainly, because `%timeit` supports that as setup code I think).
>
> EDIT: For clarity, I mean:
>
> ```
> %%gpu_timeit -n100 a = cp.ones(100)
> a.sum()
> ```
>
> the `a = cp.ones(100)` is just ignored, but if it was used would be an error (and if it was called, should be setup code).
>
> If it is trivial to do as setup code, that would be even cooler of course.
_Originally posted by @seberg in https://github.com/cupy/cupy/pull/9561#discussion_r2661677837_
Contributor guide
Assessment
This issue has not been assessed yet.