def use_gpu()

in dynalab_cli/test.py [0:0]


    def use_gpu(self, config) -> bool:
        task = config["task"]
        # TODO: should this be stored in the DB ? And exposed in the /tasks API ?
        should_use_gpu = "flores" in task
        gpu_available = sys.platform == "linux"

        if should_use_gpu and not gpu_available:
            logger.warning(
                f"Task {task} should run on GPU, but this is not supported"
                f" on platform '{sys.platform}'. Will runs the tests on CPU."
            )
            return False
        if should_use_gpu:
            logger.info(f"Will run tests on GPU for task {task}")
        return should_use_gpu