work around nvcc bug by only defining has_result when it's needed