[Python] Does pyopencl transfer arrays to host memory implicitly?

Discussão em 'Python' iniciado por Stack, Abril 9, 2025.

  1. Stack

    Stack Membro Participativo

    I have AMD GPU. I'm using pyopencl. I have a context and a queue. Then I created an array:

    import pyopencl
    import pyopencl.array
    ctx = pyopencl.create_some_context(interactive=False)
    queue = pyopencl.CommandQueue(ctx)
    array = pyopencl.array.empty(queue, [10], dtype=float)
    print(array)


    The print statement is showing some contents. Has pyopencl transferred data from GPU memory to print those values? If not, where do they come from?

    Continue reading...

Compartilhe esta Página