Filename Size Date modified Message
38 B
1.3 KB
493 B
596 B

Welcome to PyCULA, a python wrapper for CULAtools.

PyCULA was written by Garrett Wright and Dr. Louis Theran. It was funded by an NSF grant through Dr. Igor Rivin.

Using PyCULA is meant to be simple. For those familiar with using numpy this will be quite similar, and for those familiar with using CULA, well, this should be simpler!

Below is an example. You can enter this into the python interpreter once you have installed PyCULA and its dependencies.

Here is how it works:

# Import cula wrappers >>> from PyCULA.cula import *

# Import numpy >>> import numpy as np

# Make a numpy array >>> a = np.array([[1,2],[3,4]],np.float32)

# Initialize CULA on GPU card so it can do some work >>> culaInitialize()

# Perform a routine. You may either print the answers, or give them a variable name. In this case we will call answers b. # Python, numpy, and PyCULA takes care of all the background memory alloc/deallocation and variable types for us>> This is the automagic part.

>>> b = gpu_eigenvalues(a)
>>> b # Print the answer
array([-0.37228107+0.j, 5.37228155+0.j])

# Shutdown CULA on GPU card so it is ready for its next job >>> culaShutdown()

There is much more functionality then this, including the ability to use the device wrappers mixed with your own kernel code by utilizing pyCUDA! See the examples folder.