search for: buildcompilation

Displaying 8 results from an estimated 8 matches for "buildcompilation".

2020 Nov 17
2
JIT compiling CUDA source code
...xecute C++ code on the fly, using Orc JIT v2, via the LLJIT class. And we would like to extend it to allow the user to provide CUDA source code as well, for GPU programming. But I am having a hard time figuring out how to do it. To JIT compile C++ code, we do basically as follows: 1. call Driver::BuildCompilation(), which returns a clang Command to execute 2. create a CompilerInvocation using the arguments from the Command 3. create a CompilerInstance around the CompilerInvocation 4. use the CompilerInstance to execute an EmitLLVMOnlyAction 5. retrieve the resulting Module from the action and add it to the...
2020 Nov 19
1
JIT compiling CUDA source code
...ples/simpleDrvRuntime/simpleDrvRuntime.cpp Hope that helps. -V On Thu, Nov 19, 2020 at 12:11 PM Geoff Levner via llvm-dev < llvm-dev at lists.llvm.org> wrote: > I have made a bit of progress... When compiling CUDA source code in > memory, the Compilation instance returned by Driver::BuildCompilation() > contains two clang Commands: one for the host and one for the CUDA device. > I can execute both commands using EmitLLVMOnlyActions. I add the Module > from the host compilation to my JIT as usual, but... what to do with the > Module from the device compilation? If I just add it to t...
2020 Nov 19
0
JIT compiling CUDA source code
I have made a bit of progress... When compiling CUDA source code in memory, the Compilation instance returned by Driver::BuildCompilation() contains two clang Commands: one for the host and one for the CUDA device. I can execute both commands using EmitLLVMOnlyActions. I add the Module from the host compilation to my JIT as usual, but... what to do with the Module from the device compilation? If I just add it to the JIT, I get an err...
2016 Feb 01
1
Core dump Compiling with clang sample
...:driver::Action const*, clang::driver::ToolChain const*, char const*, bool, bool, char const*, clang::driver::InputInfo&) const + 1832 10 clang 0x00836174 clang::driver::Driver::BuildJobs(clang::driver::Compilation&) const + 356 11 clang 0x008373f0 clang::driver::Driver::BuildCompilation(llvm::ArrayRef<char const*>) + 3192 12 clang 0x0075a180 main + 3800 13 clang 0x00750160 _start + 92 Stack dump: 0. Program arguments: clang hello.c -o hello 1. Compilation construction 2. Building compilation jobs 3. Building compilation jobs Abor...
2010 Aug 18
1
[LLVMdev] clang: call extern function using JIT
...e need to extend the driver library to support this use model // (basically, exactly one input, and the operation mode is hard wired). llvm::SmallVector<const char *, 16> Args(argv, argv + argc); Args.push_back("-fsyntax-only"); llvm::OwningPtr<Compilation> C(TheDriver.BuildCompilation(Args.size(), Args.data())); if (!C) return 0; // FIXME: This is copied from ASTUnit.cpp; simplify and eliminate. // We expect to get back exactly one command job, if we didn't something // failed. Extract that job from th...
2010 Aug 18
0
[LLVMdev] clang: call extern function using JIT
I tried what you said, now I get: LLVM ERROR: Program used external function 'yipee' which could not be resolved! Stack dump: 0. Running pass 'X86 Machine Code Emitter' on function '@main' did not even get as far as a breakpoint. Óscar Fuentes wrote: > > gafferuk <gafferuk at gmail.com> writes: > >> Im confused. The function i wish to call is
2010 Aug 18
2
[LLVMdev] clang: call extern function using JIT
gafferuk <gafferuk at gmail.com> writes: > Im confused. The function i wish to call is a return type of int. > Im calling it with int dd = yipee(1); > > What's wrong? Declare the function: int yipee(int); int main() { int dd = yipee(1); return 0; } If that still crashes, put a breakpoint on `yipee' and see if the execution gets there, if the argument is
2013 Oct 03
0
[LLVMdev] libclang JIT frontend
...t this use model // (basically, exactly one input, and the operation mode is hard wired). // SmallVector<const char *, 16> Args(argv, argv + argc); SmallVector<const char *, 16> Args(2, argv); Args.push_back("-fsyntax-only"); OwningPtr<Compilation> C(TheDriver.BuildCompilation(Args)); if (!C) return 0; // FIXME: This is copied from ASTUnit.cpp; simplify and eliminate. // We expect to get back exactly one command job, if we didn't something // failed. Extract that job from the compilation. const driver::JobList &Jobs = C->getJobs(); if (Jobs.s...