1 # simple module to show the plotting of random data
2
3 import pycuda.autoinit
4 import pycuda.curandom as curandom
5
6 size = 1000
7 a = curandom.rand((size,)).get()
8
9 from matplotlib.pylab import *
10 subplot(211)
11 plot(a)
12 grid(True)
13 ylabel('plot - gpu')
14
15 subplot(212)
16 hist(a, 100)
17 grid(True)
18 ylabel('histogram - gpu')
19
20 #and save it
21 savefig('plot-random-data')
22
