Skip to content
Snippets Groups Projects

test opencl fill function

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Hao Gao
    Edited
    opencl_fill.py 331 B
    import numpy as np
    import pyopencl as cl
    import pyopencl.array
    import time
    N = 10000
    dtype = np.float64
    
    ctx = cl.create_some_context()
    queue = cl.CommandQueue(ctx)
    array = cl.array.empty(queue, N, dtype=dtype)
    
    start_time = time.time()
    array.fill(0)
    array.finish()
    print("elapsed time: {0}".format(str(time.time() - start_time)))
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment