Skip to content

davidbrochart/uarray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

uarray

from uarray import *

x1 = uarray([0, 1, 2], 'cpu')
x2 = uarray([3, 4, 5], 'gpu')
out = uarray([0, 0, 0], 'cpu')

with context('gpu'):
    add(x1, x2, out)

print(f'out = {out.array}')
Switching context from cpu to gpu
Moving "x1" from cpu to gpu
Allocating memory for "out" on gpu
Adding arrays in gpu
Moving "out" from gpu to cpu
Switching context from gpu to cpu
out = [3, 5, 7]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages