13#ifndef PROTEUS_JIT_INTERFACE_HPP
14#define PROTEUS_JIT_INTERFACE_HPP
36#if defined(__CUDACC__) || defined(__HIP__)
46#if defined(__CUDACC__) || defined(__HIP__)
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>
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>>,
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>) {
108 std::memcpy(&
RC, &
V,
sizeof(
T));
119 return std::forward<T>(
t);
122#if defined(__CUDACC__) || defined(__HIP__)
125template <
typename T,
size_t MAXN,
int UniqueID = 0>
130 return reinterpret_cast<T *
>(
shmem);
134inline void enable() {
139inline void disable() {
146#if PROTEUS_ENABLE_HIP || PROTEUS_ENABLE_CUDA
151inline void finalize() {
153#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 BuiltinsCUDA.cpp:4
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
T getRuntimeConstantValue(void *Arg)
Definition CompilerInterfaceRuntimeConstantInfo.h:114
size_t NumElts
Definition JitInterface.hpp:43
__attribute__((noinline)) void jit_arg(T V) noexcept
Definition CompilerInterfaceTypes.h:72