Skip to content
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

callback argument for the FFT class #51

Open
mugundhan1 opened this issue Oct 10, 2020 · 5 comments
Open

callback argument for the FFT class #51

mugundhan1 opened this issue Oct 10, 2020 · 5 comments

Comments

@mugundhan1
Copy link

Hi,

Is there an example for performing the callback using the FFT high-level interface ? Do I give pass the argument to the FFT high level callback as a part of the dict only ? If yes, what keyword does it look for there ?

Secondly, in a callback function, how to access a 2D array ?

Please guide !
sincerely,

Mugundhan

@geggo
Copy link
Owner

geggo commented Oct 10, 2020 via email

@mugundhan1
Copy link
Author

mugundhan1 commented Oct 12, 2020 via email

@mugundhan1
Copy link
Author

mugundhan1 commented Oct 12, 2020 via email

@geggo
Copy link
Owner

geggo commented Oct 12, 2020

Hi,

thanks for the report, porting to Python 3.x broke setting callbacks from the high-level interface. The high-level also does not support providing user data to the callbacks. I have to think how to implement this properly.

For the moment, you have to use the low-level interface for setting the callbacks, but you can mix it easily, e.g.

transform = FFT(context, queue, data)
transform.plan.set_callback('your_kernel_name', kernel_source, 'post', user_data)
transform.enqueue()

The enqueue() method of the transform returns a list of events for each internal kernel call. You can access the profiling information of each event, e.g., via evt.profile.start , provided that profiling has been enabled for the queue.

The callbacks are called once for each element of the transform data, for input (pre) and output (post). In this respect it es similar to an elementwise kernel, if this is what you mean.

There are some examples on how to use callbacks (with C) link

hope that helps
Gregor

@mugundhan1
Copy link
Author

mugundhan1 commented Oct 12, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants