Python: added some new examples

This commit is contained in:
Philippe Tillet
2015-08-12 00:48:16 -07:00
parent ff4cf94df7
commit cd51f75eb5
3 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import isaac as sc
N = 7
platforms = sc.driver.get_platforms()
devices = [d for platform in platforms for d in platform.get_devices()]
device = devices[0]
print 'Using', device.name, 'on', device.platform.name
context = sc.driver.context(device)
x = sc.empty(N, sc.float32, context)
y = sc.empty(N, sc.float32, context)
z, events = sc.driver.enqueue(x + y)
z.context.synchronize()
print z