(self, *args, **kwargs)
| 24 | super().__init__(*args, **kwargs) |
| 25 | |
| 26 | def createTests(self, *args, **kwargs): |
| 27 | super().createTests(*args, **kwargs) |
| 28 | |
| 29 | # Asume CUDA backend in this case |
| 30 | device = os.getenv("DEVICE", None) |
| 31 | if device is not None: |
| 32 | device = getattr(mx, device) |
| 33 | else: |
| 34 | device = mx.default_device() |
| 35 | |
| 36 | if not (device == mx.gpu and not mx.metal.is_available()): |
| 37 | return |
| 38 | |
| 39 | from cuda_skip import cuda_skip |
| 40 | |
| 41 | filtered_suite = unittest.TestSuite() |
| 42 | |
| 43 | def filter_and_add(t): |
| 44 | if isinstance(t, unittest.TestSuite): |
| 45 | for sub_t in t: |
| 46 | filter_and_add(sub_t) |
| 47 | else: |
| 48 | t_id = ".".join(t.id().split(".")[-2:]) |
| 49 | if t_id in cuda_skip: |
| 50 | print(f"Skipping {t_id}") |
| 51 | else: |
| 52 | filtered_suite.addTest(t) |
| 53 | |
| 54 | filter_and_add(self.test) |
| 55 | self.test = filtered_suite |
| 56 | |
| 57 | def runTests(self): |
| 58 | super().runTests() |
nothing calls this directly
no test coverage detected