How can I return a float in cuda kernel call?

Hi ,

I am trying to understand how can i return a float in cuda kernel call?

I used following kernel call but i am getting following error!

error: a “global” function must have a void return type

I will appreciate any help and suggestion.

Thanks

[codebox]global float initR( mystruct, float, float *);[/codebox]

Hi ,

I am trying to understand how can i return a float in cuda kernel call?

I used following kernel call but i am getting following error!

error: a “global” function must have a void return type

I will appreciate any help and suggestion.

Thanks

[codebox]global float initR( mystruct, float, float *);[/codebox]

Store it into a [font=“Courier New”]device[/font] variable and copy that to the host.

Keep in mind that this really makes sense only with a single block, otherwise you need to think about a suitable reduction of the results from multiple blocks, either using atomics or a separate kernel that again only executes a single block.

Store it into a [font=“Courier New”]device[/font] variable and copy that to the host.

Keep in mind that this really makes sense only with a single block, otherwise you need to think about a suitable reduction of the results from multiple blocks, either using atomics or a separate kernel that again only executes a single block.