Thanks Carlo,
For the sake of others who struggle with the same problem, I settled on declaring variables and const int values and used the following:
const int parm1 = args(0).int_value();
const int parm2 = args(1).int_value();
Matrix tmp1 (parm1, parm2);
set_global_value ("P1", tmp1);
set_global_value ("P2", tmp2);
This solved the problem of extracting the scalar integer values, but is actually a very poor implementation for my purposes. The Matrix constructor creates arrays of doubles and for my purposes I could get by with single precision floats or even integers. In addition to using several times as much memory as needed, using double precision values is much slower on CUDA than single precision. However, implementation of single precision floating point operations is far from complete in Octave. It is something I'm considering trying to add to enhance the capability with CUDA.
As a first step I tried to reserve the necessary memory manually using OCTAVE_LOCAL_BUFFER, but it did not work as I expected. I've trying to locate some examples of how to use it to reserve space for an array of single precision or integer variables.
- Mike