pslang/libs/jit/source/jit.cpp

40 lines
984 B
C++

#include <pslang/jit/jit.hpp>
#include <pslang/jit/arch/macos_aarch64/compiler.hpp>
#include <pslang/jit/arch/linux_x86_64/compiler.hpp>
#include <stdexcept>
namespace pslang::jit
{
void compile(program_context & pcontext, ir::compiled_module const & module_in)
{
switch (pcontext.abi.platform)
{
case platform::linux:
switch (pcontext.abi.isa)
{
case isa::x86_64:
linux_x86_64::compile(pcontext, module_in);
break;
case isa::aarch64:
throw std::runtime_error("Linux aarch64 JIT compilation not supported");
}
break;
throw std::runtime_error("Linux JIT compilation not supported");
case platform::windows:
throw std::runtime_error("Windows JIT compilation not supported");
case platform::macos:
switch (pcontext.abi.isa)
{
case isa::x86_64:
throw std::runtime_error("macOS x86_64 JIT compilation not supported");
case isa::aarch64:
macos_aarch64::compile(pcontext, module_in);
break;
}
break;
}
}
}