Added num_thread and sh_mem_size parameters for template rendering