Skip to content
  • Nguyen, Thien Minh's avatar
    A minimal fix to make qpu_lambda type casting more robust · fb6c8fb8
    Nguyen, Thien Minh authored
    
    
    Since we ultimately need to use the template parameter pack to cast the raw function pointer from JIT, we need to regularize the QJIT kernel rewritten from the lambda body.
    
    The strategy here is to convert by-value type of simple types (int, double) to reference types so that type-forwarding in JIT with Args&& will work consistently.
    
    Tested by: unit test cases: both by-value argument passing (vqe ansatz) and capture by reference (lambda captures other lambda, etc.)
    
    Signed-off-by: default avatarThien Nguyen <nguyentm@ornl.gov>
    fb6c8fb8