def test_num_8():
    content = ak.layout.NumpyArray(np.array([0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.1]))
    offsets = ak.layout.Index64(np.array([0, 3, 3, 5, 6, 10, 10]))
    listoffsetarray = ak.layout.ListOffsetArray64(offsets, content)
    regulararray = ak.layout.RegularArray(listoffsetarray, 2)
    starts = ak.layout.Index64(np.array([0, 1]))
    stops = ak.layout.Index64(np.array([2, 3]))
    listarray = ak.layout.ListArray64(starts, stops, regulararray)
    cuda_listoffsetarray = ak.to_kernels(listoffsetarray, 'cuda')
    assert (ak.num(cuda_listoffsetarray, 0) == ak.num(ak.Array(listoffsetarray), 0))
    assert (ak.num(cuda_listoffsetarray, 1).tolist() == ak.num(ak.Array(listoffsetarray), 1).tolist())
    cuda_regulararray = ak.to_kernels(regulararray, 'cuda')
    assert (ak.num(cuda_regulararray, 0) == ak.num(ak.Array(regulararray), 0))
    assert (ak.num(cuda_regulararray, 1).tolist() == ak.num(ak.Array(regulararray), 1).tolist())
    cuda_listarray = ak.to_kernels(listarray, 'cuda')
    assert (ak.num(cuda_listarray, 0) == ak.num(ak.Array(listarray), 0))
    assert (ak.num(cuda_listarray, 1).tolist() == ak.num(ak.Array(listarray), 1).tolist())
    content1 = ak.layout.NumpyArray(np.array([1, 2, 3, 4, 5]))
    content2 = ak.layout.NumpyArray(np.array([1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9]))
    offsets = ak.layout.Index32(np.array([0, 3, 3, 5, 6, 9]))
    recordarray = ak.Array(ak.layout.RecordArray([content1, listoffsetarray, content2, content1], keys=['one', 'two', '2', 'wonky']))
    cuda_recordarray = ak.to_kernels(recordarray, 'cuda')
    assert (ak.num(cuda_recordarray, 0).tolist() == ak.num(recordarray, 0).tolist())
    content0 = ak.Array([[1.1, 2.2, 3.3], [], [4.4, 5.5]]).layout
    content = ak.Array(['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']).layout
    tags = ak.layout.Index8(np.array([1, 1, 0, 0, 1, 0, 1, 1], dtype=np.int8))
    index = ak.layout.Index32(np.array([0, 1, 0, 1, 2, 2, 4, 3], dtype=np.int32))
    unionarray = ak.Array(ak.layout.UnionArray8_32(tags, index, [content0, content1]))
    cuda_unionarray = ak.to_kernels(unionarray, 'cuda')
    assert (ak.num(cuda_unionarray, 0) == ak.num(unionarray, 0))
def test_num_8():
    content = ak.layout.NumpyArray(np.array([0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9, 10.1]))
    offsets = ak.layout.Index64(np.array([0, 3, 3, 5, 6, 10, 10]))
    listoffsetarray = ak.layout.ListOffsetArray64(offsets, content)
    regulararray = ak.layout.RegularArray(listoffsetarray, 2)
    starts = ak.layout.Index64(np.array([0, 1]))
    stops = ak.layout.Index64(np.array([2, 3]))
    listarray = ak.layout.ListArray64(starts, stops, regulararray)
    cuda_listoffsetarray = ak.to_kernels(listoffsetarray, 'cuda')
    assert (ak.num(cuda_listoffsetarray, 0) == ak.num(ak.Array(listoffsetarray), 0))
    assert (ak.num(cuda_listoffsetarray, 1).tolist() == ak.num(ak.Array(listoffsetarray), 1).tolist())
    cuda_regulararray = ak.to_kernels(regulararray, 'cuda')
    assert (ak.num(cuda_regulararray, 0) == ak.num(ak.Array(regulararray), 0))
    assert (ak.num(cuda_regulararray, 1).tolist() == ak.num(ak.Array(regulararray), 1).tolist())
    cuda_listarray = ak.to_kernels(listarray, 'cuda')
    assert (ak.num(cuda_listarray, 0) == ak.num(ak.Array(listarray), 0))
    assert (ak.num(cuda_listarray, 1).tolist() == ak.num(ak.Array(listarray), 1).tolist())
    content1 = ak.layout.NumpyArray(np.array([1, 2, 3, 4, 5]))
    content2 = ak.layout.NumpyArray(np.array([1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9]))
    offsets = ak.layout.Index32(np.array([0, 3, 3, 5, 6, 9]))
    recordarray = ak.Array(ak.layout.RecordArray([content1, listoffsetarray, content2, content1], keys=['one', 'two', '2', 'wonky']))
    cuda_recordarray = ak.to_kernels(recordarray, 'cuda')
    assert (ak.num(cuda_recordarray, 0).tolist() == ak.num(recordarray, 0).tolist())
    content0 = ak.Array([[1.1, 2.2, 3.3], [], [4.4, 5.5]]).layout
    content = ak.Array(['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']).layout
    tags = ak.layout.Index8(np.array([1, 1, 0, 0, 1, 0, 1, 1], dtype=np.int8))
    index = ak.layout.Index32(np.array([0, 1, 0, 1, 2, 2, 4, 3], dtype=np.int32))
    unionarray = ak.Array(ak.layout.UnionArray8_32(tags, index, [content0, content1]))
    cuda_unionarray = ak.to_kernels(unionarray, 'cuda')
    assert (ak.num(cuda_unionarray, 0) == ak.num(unionarray, 0))