13#ifndef PROTEUS_JIT_INTERFACE_HPP
14#define PROTEUS_JIT_INTERFACE_HPP
35template <
typename T>
__attribute__((noinline))
void jit_arg(T V)
noexcept;
36#if defined(__CUDACC__) || defined(__HIP__)
38__attribute__((noinline)) __device__
void jit_arg(T V)
noexcept;
43jit_array(T V, [[maybe_unused]]
size_t NumElts,
45 typename std::remove_pointer<T>::type
Velem = 0) noexcept;
46#if defined(__CUDACC__) || defined(__HIP__)
49jit_array(T V, [[maybe_unused]]
size_t NumElts,
51 typename std::remove_pointer<T>::type
Velem = 0) noexcept;
56std::enable_if_t<std::is_trivially_copyable_v<std::remove_pointer_t<T>>,
void>
57jit_object(T *V,
size_t Size =
sizeof(std::remove_pointer_t<T>))
noexcept;
59#if defined(__CUDACC__) || defined(__HIP__)
62 std::is_trivially_copyable_v<std::remove_pointer_t<T>>,
void>
63jit_object(T *V,
size_t Size =
sizeof(T))
noexcept;
68std::enable_if_t<!std::is_pointer_v<T> &&
69 std::is_trivially_copyable_v<std::remove_reference_t<T>>,
71jit_object(T &V,
size_t Size =
sizeof(std::remove_reference_t<T>))
noexcept;
73#if defined(__CUDACC__) || defined(__HIP__)
76 !std::is_pointer_v<T> &&
77 std::is_trivially_copyable_v<std::remove_reference_t<T>>,
79jit_object(T &V,
size_t Size =
sizeof(T))
noexcept;
83 if constexpr (std::is_same_v<T, bool>) {
85 }
else if constexpr (std::is_integral_v<T> &&
sizeof(T) ==
sizeof(int8_t)) {
87 }
else if constexpr (std::is_integral_v<T> &&
sizeof(T) ==
sizeof(int32_t)) {
89 }
else if constexpr (std::is_integral_v<T> &&
sizeof(T) ==
sizeof(int64_t)) {
91 }
else if constexpr (std::is_same_v<T, float>) {
93 }
else if constexpr (std::is_same_v<T, double>) {
95 }
else if constexpr (std::is_same_v<T, long double>) {
97 }
else if constexpr (std::is_pointer_v<T>) {
106 int Offset = -1) noexcept {
108 std::memcpy(&RC, &V,
sizeof(T));
116register_lambda(T &&t,
const char *Symbol =
"") noexcept {
117 assert(Symbol &&
"Expected non-null Symbol");
119 return std::forward<T>(t);
122#if defined(__CUDACC__) || defined(__HIP__)
125shared_array([[maybe_unused]]
size_t N,
126 [[maybe_unused]]
size_t ElemSize =
sizeof(T)) {
131inline void enable() {
136inline void disable() {
143#if PROTEUS_ENABLE_HIP || PROTEUS_ENABLE_CUDA
148inline void finalize() {
150#if PROTEUS_ENABLE_HIP || PROTEUS_ENABLE_CUDA
void __jit_init_device()
Definition CompilerInterfaceDevice.cpp:65
void __jit_enable_device()
Definition CompilerInterfaceDevice.cpp:72
void __jit_disable_device()
Definition CompilerInterfaceDevice.cpp:77
void __jit_finalize_device()
Definition CompilerInterfaceDevice.cpp:67
void __jit_init_host()
Definition CompilerInterfaceHost.cpp:41
void __jit_disable_host()
Definition CompilerInterfaceHost.cpp:50
void __jit_enable_host()
Definition CompilerInterfaceHost.cpp:45
void __jit_finalize_host()
Definition CompilerInterfaceHost.cpp:43
void __jit_init_host()
Definition CompilerInterfaceHost.cpp:41
void __jit_init_device()
Definition CompilerInterfaceDevice.cpp:65
void __jit_enable_device()
Definition CompilerInterfaceDevice.cpp:72
void __jit_disable_host()
Definition CompilerInterfaceHost.cpp:50
void __jit_enable_host()
Definition CompilerInterfaceHost.cpp:45
void __jit_disable_device()
Definition CompilerInterfaceDevice.cpp:77
void __jit_finalize_host()
Definition CompilerInterfaceHost.cpp:43
void __jit_push_variable(proteus::RuntimeConstant RC)
void __jit_register_lambda(const char *Symbol)
void __jit_finalize_device()
Definition CompilerInterfaceDevice.cpp:67
Definition CppJitModule.cpp:21
size_t std::remove_pointer< T >::type Velem
Definition JitInterface.hpp:45
static int Pos
Definition JitInterface.hpp:105
RuntimeConstantType
Definition CompilerInterfaceTypes.h:20
@ NONE
Definition CompilerInterfaceTypes.h:22
@ INT32
Definition CompilerInterfaceTypes.h:25
@ INT64
Definition CompilerInterfaceTypes.h:26
@ FLOAT
Definition CompilerInterfaceTypes.h:27
@ LONG_DOUBLE
Definition CompilerInterfaceTypes.h:29
@ INT8
Definition CompilerInterfaceTypes.h:24
@ BOOL
Definition CompilerInterfaceTypes.h:23
@ PTR
Definition CompilerInterfaceTypes.h:30
@ DOUBLE
Definition CompilerInterfaceTypes.h:28
size_t NumElts
Definition JitInterface.hpp:43
__attribute__((noinline)) void jit_arg(T V) noexcept
Definition CompilerInterfaceTypes.h:72