()
| 2254 | |
| 2255 | |
| 2256 | def test_gpu2cpu_old_exec_error(): |
| 2257 | bs = 8 |
| 2258 | |
| 2259 | @pipeline_def( |
| 2260 | batch_size=bs, |
| 2261 | num_threads=4, |
| 2262 | device_id=0, |
| 2263 | exec_async=False, |
| 2264 | exec_pipelined=False, |
| 2265 | exec_dynamic=False, |
| 2266 | ) |
| 2267 | def pdef(to_cpu): |
| 2268 | gpu = fn.external_source("input", device="gpu") |
| 2269 | return to_cpu(gpu) |
| 2270 | |
| 2271 | with assert_raises(RuntimeError, glob="doesn't support transition from GPU to CPU"): |
| 2272 | _ = pdef(lambda gpu: gpu.cpu()) # this will raise an error at construction time |
| 2273 | |
| 2274 | pipe = pdef(lambda gpu: gpu._to_backend("cpu")) # this will not raise errors until build-time |
| 2275 | |
| 2276 | with assert_raises( |
| 2277 | RuntimeError, glob="GPU->CPU transitions are not allowed in legacy execution model" |
| 2278 | ): |
| 2279 | pipe.build() |
| 2280 | |
| 2281 | |
| 2282 | def test_gpu2cpu_conditionals(): |
nothing calls this directly
no test coverage detected