Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLOAT codegen argument doesn't work as expected #114

Open
kirkrudolph opened this issue May 29, 2023 · 0 comments
Open

FLOAT codegen argument doesn't work as expected #114

kirkrudolph opened this issue May 29, 2023 · 0 comments

Comments

@kirkrudolph
Copy link

Issue

Using the following code in Python, I'm expecting the resulting generated code to use floats because of FLOAT='True'. Instead, it looks like the generated code is still using doubles.

prob.codegen('osqp_gen',parameters='vectors', FLOAT='True')

Outputs the following to the console along with the generated files.

-----------------------------------------------------------------
           OSQP v0.6.3  -  Operator Splitting QP Solver
              (c) Bartolomeo Stellato,  Goran Banjac
        University of Oxford  -  Stanford University 2021
-----------------------------------------------------------------
problem:  variables n = 172, constraints m = 304
          nnz(P) + nnz(A) = 1161
settings: linear system solver = qdldl,
          eps_abs = 1.0e-03, eps_rel = 1.0e-03,
          eps_prim_inf = 1.0e-04, eps_dual_inf = 1.0e-04,
          rho = 1.00e-01 (adaptive),
          sigma = 1.00e-06, alpha = 1.60, max_iter = 4000
          check_termination: on (interval 25),
          scaling: on, scaled_termination: off
          warm start: on, polish: off, time_limit: off

Getting workspace from OSQP object...                           [done]
Creating target directories...                                  [done]
Copying OSQP sources...                                         [done]
Generating customized code...                                   [done]
Compiling Python wrapper...                                     [done]
Copying code-generated Python solver to current directory...    [done]

In osqp_gen > include > osqp_configure.h I see:

/* DFLOAT */
/* #undef DFLOAT */

/* DLONG */
#define DLONG

In osqp_gen > include > qdldl_types.h I see:

// QDLDL integer and float types
typedef long long    QDLDL_int;   /* for indices */
typedef double  QDLDL_float; /* for numerical values  */
typedef unsigned char   QDLDL_bool;  /* for boolean values  */

Compiling

Running the CMakeLists.txt file, it also shows Floats are still disabled.

-- We are on a Generic system
-- Embedded is 1
-- Passing EMBEDDED flag to compiler
-- Disabling printing for embedded
-- Printing is OFF
-- Disabling profiling for embedded
-- Profiling is OFF
-- Floats are OFF
-- Disabling long integers (64bit) on 32bit machine
-- Long integers (64bit) are OFF
@imciner2 imciner2 transferred this issue from osqp/osqp Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant