def __init__(self, cl_code, **kwargs): is_kernel_func, return_type, function_name, parameter_list, body = split_cl_function( cl_code) super().__init__(return_type, function_name, parameter_list, body, dependencies=kwargs.get('dependencies', None), is_kernel_func=is_kernel_func)
def from_string(cls, cl_function, dependencies=()): """Parse the given CL function into a SimpleCLFunction object. Args: cl_function (str): the function we wish to turn into an object dependencies (list or tuple of CLLibrary): The list of CL libraries this function depends on Returns: SimpleCLFunction: the CL data type for this parameter declaration """ is_kernel_func, return_type, function_name, parameter_list, body = split_cl_function( cl_function) return SimpleCLFunction(return_type, function_name, parameter_list, body, dependencies=dependencies, is_kernel_func=is_kernel_func)