Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def gemm(A, B, dD):
N = A.shape[0] # square matrices
'''
Note that all arrays are in Fortran order.
'''
# cuBLAS
blas = Blas()
start = timer()
blas.gemm('N', 'N', N, N, N, 1.0, A, B, 1.0, dD)
cuda_time = timer() - start
D = dD.copy_to_host()
print("CUBLAS took %f seconds" % cuda_time)
diff = np.abs(D - E)
print("Maximum error %f" % np.max(diff))
return D