()
| 154 | |
| 155 | |
| 156 | def test_dlpack_cuda_not_supported(): |
| 157 | cuda = pytest.importorskip("pyarrow.cuda", exc_type=ImportError) |
| 158 | |
| 159 | schema = pa.schema([pa.field('f0', pa.int16())]) |
| 160 | a0 = pa.array([1, 2, 3], type=pa.int16()) |
| 161 | batch = pa.record_batch([a0], schema=schema) |
| 162 | |
| 163 | cbuf = cuda.serialize_record_batch(batch, cuda.Context(0)) |
| 164 | cbatch = cuda.read_record_batch(cbuf, batch.schema) |
| 165 | carr = cbatch["f0"] |
| 166 | |
| 167 | # CudaBuffers not yet supported |
| 168 | with pytest.raises(NotImplementedError, match="DLPack support is implemented " |
| 169 | "only for buffers on CPU device."): |
| 170 | np.from_dlpack(carr) |
| 171 | |
| 172 | with pytest.raises(NotImplementedError, match="DLPack support is implemented " |
| 173 | "only for buffers on CPU device."): |
| 174 | carr.__dlpack_device__() |
nothing calls this directly
no test coverage detected