Esempio n. 1
0
 def __init__(self, func, sig, identity=None, targetoptions={}):
     assert not targetoptions
     self.py_func = func
     self.identity = self.parse_identity(identity)
     self.signature = sig
     self.inputsig, self.outputsig = parse_signature(self.signature)
     assert len(self.outputsig) == 1, "only support 1 output"
     self.kernelmap = {}  # { arg_dtype: (return_dtype), cudakernel }
Esempio n. 2
0
 def __init__(self, func, sig, identity=None, targetoptions={}):
     assert not targetoptions
     self.py_func = func
     self.identity = self.parse_identity(identity)
     self.signature = sig
     self.inputsig, self.outputsig = parse_signature(self.signature)
     assert len(self.outputsig) == 1, "only support 1 output"
     # { arg_dtype: (return_dtype), cudakernel }
     self.kernelmap = OrderedDict()
Esempio n. 3
0
    def __init__(self, func, sig, identity=None, targetoptions={}):
        # Allow nopython flag to be set.
        if not targetoptions.pop('nopython', True):
            raise TypeError("nopython flag must be True")
        # Are there any more target options?
        if targetoptions:
            opts = ', '.join([repr(k) for k in targetoptions.keys()])
            fmt = "The following target options are not supported: {0}"
            raise TypeError(fmt.format(opts))

        self.py_func = func
        self.identity = parse_identity(identity)
        self.signature = sig
        self.inputsig, self.outputsig = parse_signature(self.signature)
        assert len(self.outputsig) == 1, "only support 1 output"
        # { arg_dtype: (return_dtype), cudakernel }
        self.kernelmap = OrderedDict()
Esempio n. 4
0
    def __init__(self, func, sig, identity=None, targetoptions={}):
        # Allow nopython flag to be set.
        if not targetoptions.pop('nopython', True):
            raise TypeError("nopython flag must be True")
        # Are there any more target options?
        if targetoptions:
            opts = ', '.join([repr(k) for k in targetoptions.keys()])
            fmt = "The following target options are not supported: {0}"
            raise TypeError(fmt.format(opts))

        self.py_func = func
        self.identity = self.parse_identity(identity)
        self.signature = sig
        self.inputsig, self.outputsig = parse_signature(self.signature)
        assert len(self.outputsig) == 1, "only support 1 output"
        # { arg_dtype: (return_dtype), cudakernel }
        self.kernelmap = OrderedDict()
Esempio n. 5
0
 def from_signature(cls, signature):
     return cls(*parse_signature(signature))
Esempio n. 6
0
 def from_signature(cls, signature):
     return cls(*parse_signature(signature))