Skip to content

Commit 7e5c2c0

Browse files
author
Clara
committed
Added support for data ro and prolong/restrict/inject
1 parent 855bebf commit 7e5c2c0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pyop2/gpu/cuda.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,14 @@ def data(self):
156156
v.restoreCUDAHandle(self.device_handle)
157157
return v.array
158158

159+
## TODO: fail when trying to acess elems from data_ro
160+
@collective
161+
@property
162+
def data_ro(self):
163+
with self.vec_ro as v:
164+
v.restoreCUDAHandle(self.device_handle)
165+
return v.array
166+
159167

160168
class Global(petsc_Global):
161169

@@ -618,6 +626,9 @@ def insn_needs_atomic(insn):
618626
elif program.name in ["wrap_zero", "wrap_expression_kernel",
619627
"wrap_expression", "wrap_pyop2_kernel_uniform_extrusion",
620628
"wrap_form_cell_integral_otherwise",
629+
"wrap_loopy_kernel_prolong",
630+
"wrap_loopy_kernel_restrict",
631+
"wrap_loopy_kernel_inject"
621632
]:
622633
from pyop2.gpu.snpt import snpt_transform
623634
kernel, args_to_make_global = snpt_transform(kernel,

0 commit comments

Comments
 (0)