def METHOD_NAME(self, env):
    if "+cuda" in self.spec:
        env.set("CUDA_HOME", self.spec["cuda"].prefix)
        env.set("CUDA_PATH", self.spec["cuda"].prefix)
        cuda_arch = self.spec.variants["cuda_arch"].value
        if cuda_arch:
            arch_sorted = list(sorted(cuda_arch, reverse=True))
            env.set("HYPRE_CUDA_SM", arch_sorted[0])
        # In CUDA builds hypre currently doesn't handle flags correctly
        env.append_flags("CXXFLAGS", "-O2" if "~debug" in self.spec else "-g")