From c69fe857f79c79673a3dc0701c08971e6390f9ee Mon Sep 17 00:00:00 2001 From: Arnaud Bergeron Date: Wed, 28 Oct 2015 13:20:42 -0400 Subject: [PATCH] Update the COp section to reflect the current API. --- advanced.tex | 8 ++++---- cop.py | 2 +- doublecop.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/advanced.tex b/advanced.tex index d9bcdfa..ec7680c 100644 --- a/advanced.tex +++ b/advanced.tex @@ -302,15 +302,15 @@ \section{How to Make an Op (C)} \begin{frame}{Constructor Arguments} \begin{itemize} -\item Basically you just pass two arguments to the constructor of COp +\item Basically you just pass arguments to the constructor of COp \begin{itemize} \item Either by calling the constructor directly \code{COp.__init__(self, ...)} \item Or via the superclass \code{super(MyOp, self).__init__(...)} \end{itemize} -\item The two arguments are: +\item The arguments are: \begin{itemize} -\item the name of the C code file -\item the name of the function to call to make the computation +\item a list of file names with code sections (relative to the location of the op class) +\item the name of a function to call to make the computation (optional) \end{itemize} \end{itemize} \end{frame} diff --git a/cop.py b/cop.py index 81b65e1..40c8297 100644 --- a/cop.py +++ b/cop.py @@ -4,7 +4,7 @@ class MyOp(COp): __props__ = () def __init__(self, ...): - COp.__init__(self, c_file, func_name) + COp.__init__(self, c_files, func_name) # Other init code if needed def make_node(self, ...): diff --git a/doublecop.py b/doublecop.py index d62ca60..419ad0c 100644 --- a/doublecop.py +++ b/doublecop.py @@ -6,7 +6,7 @@ class DoubleCOp(COp): __props__ = () def __init__(self): - COp.__init__(self, "./doublecop.c", + COp.__init__(self, ["doublecop.c"], "APPLY_SPECIFIC(doublecop)") def make_node(self, x):