GPU1 python gpu programming example code import numpy as npfrom timeit import default_timer as timerfrom numba import vectorize # This should be a substantially high value. On my test machine, this took# 33 seconds to run via the CPU and just over 3 seconds on the GPU.NUM_ELEMENTS = 100000000 # This is the CPU version.def vector_add_cpu(a, b): c = np.zeros(NUM_ELEMENTS, dtype=np.float32) for i in range(NUM_ELEMENTS): c[i] = a[i] + b[i].. 2019. 3. 18. 이전 1 다음