简体   繁体   中英

Can the arguments for CUDA kernel launch be dynamic?

i want to pass a random no. to the threads, like

main()
{
.
.
.

func<<<1,10>>(rand()%10);
.
.
.
}

is it possible to do that?

i am quite new to CUDA programming and I might have missed a crucial point here. Please help. Thanks in advance.

Yes, it's possible.

(Note: your kernel call syntax isn't quite right: func<<<1,10>> , but I assume that's a typing error)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM