Could not deduce type of integer error
- Dominant language
- LLVM
- Stars
- 1.7k
- Forks
- 188
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 26
Description
Using the `kalman` library, with a somewhat minified version of https://github.com/mherb/kalman/blob/master/examples/Robot1/main.cpp:
```c
// this MUST be first, otherwise there might be problems on windows
// see: https://stackoverflow.com/questions/6563810/m-pi-works-with-math-h-but-not-with-cmath-in-visual-studio/6563891#6563891
#define _USE_MATH_DEFINES
#include
#define EIGEN_USE_BLAS
#include "SystemModel.hpp"
#include
#include
#include
#include
#include
extern double __enzyme_autodiff(void *, double);
using namespace KalmanExamples;
typedef float T;
// Some type shortcuts
typedef Robot1::State State;
typedef Robot1::Control Control;
typedef Robot1::SystemModel SystemModel;
double simulate(double input) {
State x;
x.setZero();
Control u;
SystemModel sys;
Kalman::ExtendedKalmanFilter ekf;
ekf.init(x);
double ekfy_sum = 0.0;
auto x_ekf = ekf.predict(sys, u);
return 0.0;
}
int main(int argc, char **argv) {
double df_dx1 = __enzyme_autodiff((void *)simulate, 1.0);
return 0;
}
```
The error is `could not deduce type of integer %5 = getelementptr inbounds %"class.Kalman::LinearizedSystemModel", ptr %0, i64 0, i32 1, i32 0, i32 0, i32 0, i32 0, i64 1, !dbg !20902 num:32 q:{[]:Pointer`.
Error dump: https://gist.github.com/gaurav-arya/3009232d6b24844ec49de4b8e4942081
Contributor guide
Assessment
This issue has not been assessed yet.