Prepare for cuda impl.