Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

src/p/y/PyOP2-HEAD/pyop2/opencl.py   PyOP2(Download)
import plan
import petsc_base
from utils import verify_reshape, uniquify, maybe_setflags
 
 
    def data(self, value):
        base._trace.evaluate(set(), set([self]))
        self._data = verify_reshape(value, self.dtype, self.dim)
        if self.state is not DeviceDataMixin.DEVICE_UNALLOCATED:
            self.state = DeviceDataMixin.HOST

src/p/y/PyOP2-HEAD/pyop2/cuda.py   PyOP2(Download)
import plan
import numpy as np
from utils import verify_reshape
import jinja2
import pycuda.driver as driver
    def data(self, value):
        base._trace.evaluate(set(), set([self]))
        self._data = verify_reshape(value, self.dtype, self.dim)
        if self.state is not DeviceDataMixin.DEVICE_UNALLOCATED:
            self.state = DeviceDataMixin.HOST