Example #1
0
            method(a)
        if argumentCount == 2:
            method(a,2)

    #stop timer
    end.record()
    end.synchronize()
        
    #calculate used time
    secs = start.time_till(end)

    return secs

#iterate over all methods and time the execution time with different array sizes
print "compile kernels"
kernel._compile_kernels(kernel)

#generate our output table, one for gpu, one for cpu
tblCPU = Table()
tblGPU = Table()
tblSPD = Table()

#contains all the method names
methods = ["size"]

for name in dir(cuma):
    if (name.startswith("__") and name.endswith("__")) == False:
        method = getattr(cuma, name)

        if type(method) == types.FunctionType:
            methods.append(name)
Example #2
0
 def compile_kernels(cls):
     # useful for benchmarking
     kernel._compile_kernels(cls)