You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am trying to run the wiki example and while i can do basic jit operations ( even basic custom matrix code for the sake of it)
I am having an issue when passing the type. I am using the wiki example :
#include <iostream>
struct F {
int i;
double d;
};
template <typename T, int S>
struct G {
T arr[S];
};
template <typename T>
[[clang::jit]] void run() {
std::cout << "I was compiled at runtime, sizeof(T) = " << sizeof(T) << "\n";
}
int main(int argc, char *argv[]) {
std::string t(argv[1]);
run<t>();
}
When i run i get the following error :
./jit-t "double"
Declaration may not be in a Comdat!
void (i8*)* @__clang_call_terminate
in function __clang_call_terminate
LLVM ERROR: Broken function found, compilation aborted!
I have tried to pass the type in another custom examples and I hit the same error every time ?
Am I missing something?
Also, i saw in the issues that there is a new [[clang::for_dynamic_instantiation]] API in 9.0-ni branch. Any pointer to updated documentation can be helpful.
The text was updated successfully, but these errors were encountered:
the issue seems strange , the following code works :
#include <iostream>
using namespace std;
struct F {
int i;
double d;
};
template <typename T, int S>
struct G {
T arr[S];
};
template <typename T>
[[clang::jit]] void run() {
std::cout << "I was compiled at runtime, sizeof(T) = " << sizeof(T) << "\n";
}
int main(int argc, char *argv[]) {
run<"double">();
}
if I use the very basic example and add a single line : creating a string in main , even without using the string for anything the jit process fail
#include <iostream>
#include <cstdlib>
template <int x>
[[clang::jit]] void run() {
int z = 0;
for (int i = 0 ; i < x ; i++){
z = x + 5 * x;
}
std::cout << "I was compiled at runtime, x = " << x << " z = " << z << "\n";
}
int main(int argc, char *argv[]) {
int a = std::atoi(argv[1]);
std::string t("double");
run<a>();
}
Same error .. looks like allocating a string is what trigger the issue ..
./jit 1
Declaration may not be in a Comdat!
void (i8*)* @__clang_call_terminate
in function __clang_call_terminate
LLVM ERROR: Broken function found, compilation aborted!
Hi,
I am trying to run the wiki example and while i can do basic jit operations ( even basic custom matrix code for the sake of it)
I am having an issue when passing the type. I am using the wiki example :
When i run i get the following error :
I have tried to pass the type in another custom examples and I hit the same error every time ?
Am I missing something?
Also, i saw in the issues that there is a new
[[clang::for_dynamic_instantiation]]
API in 9.0-ni branch. Any pointer to updated documentation can be helpful.The text was updated successfully, but these errors were encountered: