can I make a host function by using kernel call?

Hi all,

I want to make a host function which may call one or several kernel functions?

Is it ok? If not, is there any alternative for me to do like that?

Is it forced that I need write all the code in device or in host?

To make it specific

can I do as follows:

host func_conv(float *a, float *b, float *c)




c = ifft(a.*b);


all the fft, I want to use the cufft call. Thanks.

Yes you can call multiple kernels from a host function.

It would look something like:

_host function()
kernel<<< a >>>
kernel<<< b >>>
kernel<<< a. *b, c >>>
copy( h, c ) // cuda c to host h

thanks a lot