()
| 356 | |
| 357 | |
| 358 | def test_dlpack_cuda_not_supported(): |
| 359 | cuda = pytest.importorskip("pyarrow.cuda", exc_type=ImportError) |
| 360 | |
| 361 | schema = pa.schema([pa.field('f0', pa.int16())]) |
| 362 | a0 = pa.array([1, 2, 3], type=pa.int16()) |
| 363 | batch = pa.record_batch([a0], schema=schema) |
| 364 | |
| 365 | cbuf = cuda.serialize_record_batch(batch, cuda.Context(0)) |
| 366 | cbatch = cuda.read_record_batch(cbuf, batch.schema) |
| 367 | carr = cbatch["f0"] |
| 368 | |
| 369 | # CudaBuffers not yet supported |
| 370 | with pytest.raises(NotImplementedError, match="DLPack support is implemented " |
| 371 | "only for buffers on CPU device."): |
| 372 | np.from_dlpack(carr) |
| 373 | |
| 374 | with pytest.raises(NotImplementedError, match="DLPack support is implemented " |
| 375 | "only for buffers on CPU device."): |
| 376 | carr.__dlpack_device__() |
| 377 | |
| 378 | |
| 379 | @requires_numpy_version("2.1.0") |
nothing calls this directly
no test coverage detected