annotate examples/myfunc.c @ 15078:fe4752f772e2

Generate ND indexing functions on demand in JIT. * src/jit-typeinfo.cc (jit_operation::~jit_operation, jit_operation::do_generate, jit_operation::generate, jit_operation::signature_cmp::operator()): New function. (jit_operation::overload): Call do_generate when lookup fails. (jit_index_operation, jit_paren_subsref, jit_paren_subsasgn): New class. (jit_typeinfo::jit_typeinfo): Update to use jit_paren_subsref and jit_paren_subsasgn. (jit_typeinfo::gen_subsref, jit_typeinfo::gen_subsasgn): Removed functions. * src/jit-typeinfo.h (jit_operation::~jit_operation, jit_operation::generate, jit_operation::do_generate): New declaration. (jit_operation::add_overload, jit_operation::overload, jit_operation::result, jit_operation::to_idx): Use signature_vec typedef. (jit_operation::singature_cmp): New class. (jit_index_operation, jit_paren_subsref, jit_paren_subsasgn): New class. (jit_typeinfo::get_scalar_ptr): Nwe function. (jit_typeinfo::gen_subsref, jit_typeinfo::gen_subsasgn): Removed declaration. * src/pt-jit.cc: New test.
author Max Brister <max@2bass.com>
date Wed, 01 Aug 2012 17:00:12 -0500
parents 6cb30a539481
children be41c30bcb44
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6580
d2bb3b8a8d20 [project @ 2007-04-25 22:19:03 by dbateman]
dbateman
parents:
diff changeset
1 #include "mex.h"
d2bb3b8a8d20 [project @ 2007-04-25 22:19:03 by dbateman]
dbateman
parents:
diff changeset
2
d2bb3b8a8d20 [project @ 2007-04-25 22:19:03 by dbateman]
dbateman
parents:
diff changeset
3 void
7081
503001863427 [project @ 2007-10-31 01:08:14 by jwe]
jwe
parents: 7019
diff changeset
4 mexFunction (int nlhs, mxArray *plhs[], int nrhs,
9932
6cb30a539481 untabify files in examples directory
John W. Eaton <jwe@octave.org>
parents: 9053
diff changeset
5 const mxArray *prhs[])
6580
d2bb3b8a8d20 [project @ 2007-04-25 22:19:03 by dbateman]
dbateman
parents:
diff changeset
6 {
d2bb3b8a8d20 [project @ 2007-04-25 22:19:03 by dbateman]
dbateman
parents:
diff changeset
7 const char *nm;
d2bb3b8a8d20 [project @ 2007-04-25 22:19:03 by dbateman]
dbateman
parents:
diff changeset
8 nm = mexFunctionName ();
6581
1a414f670635 [project @ 2007-04-25 22:34:52 by jwe]
jwe
parents: 6580
diff changeset
9 mexPrintf ("You called function: %s\n", nm);
6580
d2bb3b8a8d20 [project @ 2007-04-25 22:19:03 by dbateman]
dbateman
parents:
diff changeset
10 if (strcmp (nm, "myfunc") == 0)
6581
1a414f670635 [project @ 2007-04-25 22:34:52 by jwe]
jwe
parents: 6580
diff changeset
11 mexPrintf ("This is the principal function\n", nm);
6580
d2bb3b8a8d20 [project @ 2007-04-25 22:19:03 by dbateman]
dbateman
parents:
diff changeset
12 return;
d2bb3b8a8d20 [project @ 2007-04-25 22:19:03 by dbateman]
dbateman
parents:
diff changeset
13 }