test opencl fill function
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)))
Please register or sign in to comment