def METHOD_NAME(self, env):
    env.set("CUPY_NUM_BUILD_JOBS", make_jobs)
    if self.spec.satisfies("+cuda"):
        cuda_arch = self.spec.variants["cuda_arch"].value
        arch_str = ";".join("arch=compute_{0},code=sm_{0}".format(i) for i in cuda_arch)
        env.set("CUPY_NVCC_GENERATE_CODE", arch_str)
    elif self.spec.satisfies("+rocm"):
        spec = self.spec
        incs = {
            "roctracer-dev": ["include/roctracer"],
            "hiprand": ["include"],
            "rocrand": ["include"],
            "rocthrust": ["include"],
            "rocprim": ["include"],
            "hip": ["include", "include/hip"],
        }
        inc_dirs = []
        for pkg, ds in incs.items():
            for d in ds:
                p = os.path.join(spec[pkg].prefix, d)
                if os.path.exists(p):
                    inc_dirs.append(p)
        env.set("CUPY_INCLUDE_PATH", ":".join(inc_dirs))
        env.set("HIPCC", self.spec["hip"].hipcc)
        env.set("ROCM_HOME", self.spec["hipcub"].prefix)
        env.set("CUPY_INSTALL_USE_HIP", 1)