fix wrong logic, avoid modifying arguments, do copy-on-write in enqueue_nd_range_kernel