move resize of buffer to set_kernel_args