I used code like
#define BLOCK_SIZE 32
to determine block size for kernel function.
Is there any way to detect reasonable block size for kernel function at the time when program runs?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When running the kernel, the intrinsic variable gridDim contains the block size. (It corresponds to special read-only registers in the hardware.)
It is 3D, so you have to write gridDim.x, grimDim.y, or grimDim.z.