How to assign values to 'block_num' and 'block_size' when the application is running?

When we launch a kernel method like “kernel<<<block_num, block_size>>> …”, generally the values of ‘block_num’ and ‘block_size’ have been assigned in the compilation process. Is it possible to determine the values in the running process, like reading from a file or console inputs ?? Thanks in advance!

Yes, you can put any C++ expression there as long as it evaluates to numbers in the allowed range at runtime.
That includes variables that you have read from files or the console.

Why not just try it out?