NebulaStream  0.6.213
NebulaStream is a data and application management framework for the internet of things
jitify.hpp File Reference

The Jitify library header. More...

#include <algorithm>
#include <cctype>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <sstream>
#include <stdexcept>
#include <stdint.h>
#include <string>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <mutex>
#include <cuda.h>
#include <cuda_runtime_api.h>
#include <nvrtc.h>
#include <cxxabi.h>
Include dependency graph for jitify.hpp:

Classes

struct  jitify::reflection::NonType< T, VALUE_ >
 
struct  jitify::reflection::Instance< T >
 
struct  jitify::reflection::Type< T >
 
struct  jitify::ProgramConfig
 
class  jitify::JitCache_impl
 
class  jitify::Program_impl
 
class  jitify::Kernel_impl
 
class  jitify::KernelInstantiation_impl
 
class  jitify::KernelLauncher_impl
 
class  jitify::KernelLauncher
 
class  jitify::KernelInstantiation
 
class  jitify::Kernel
 
class  jitify::Program
 
class  jitify::JitCache
 
struct  jitify::ExecutionPolicy
 
class  jitify::Capture
 
class  jitify::Lambda< Func >
 
class  jitify::experimental::Program
 
class  jitify::experimental::Kernel
 
class  jitify::experimental::KernelInstantiation
 
class  jitify::experimental::KernelLauncher
 

Namespaces

 jitify
 
 jitify::reflection
 
 jitify::experimental
 
 jitify::experimental::serialization
 
 jitify::experimental::serialization::detail
 

Macros

#define JITIFY_THREAD_SAFE   1
 
#define JITIFY_PRINT_LOG   1
 
#define JITIFY_CAPTURE(...)   jitify::Capture(jitify::detail::split_string(#__VA_ARGS__, -1, ","), __VA_ARGS__)
 
#define JITIFY_MAKE_LAMBDA(capture, x, ...)
 
#define JITIFY_ARGS(...)   __VA_ARGS__
 
#define JITIFY_LAMBDA_(x, ...)   JITIFY_MAKE_LAMBDA(JITIFY_CAPTURE(x), JITIFY_ARGS(x), __VA_ARGS__)
 
#define JITIFY_STRIP_PARENS(X)   X
 
#define JITIFY_PASS_PARAMETERS(X)   JITIFY_STRIP_PARENS(JITIFY_ARGS X)
 
#define JITIFY_LAMBDA(capture, ...)   JITIFY_LAMBDA_(JITIFY_ARGS(JITIFY_PASS_PARAMETERS(capture)), JITIFY_ARGS(__VA_ARGS__))
 

Typedefs

typedef std::istream *(* jitify::file_callback_type) (std::string filename, std::iostream &tmp_stream)
 

Enumerations

enum  jitify::Location { jitify::HOST , jitify::DEVICE }
 

Functions

template<typename T >
std::string jitify::reflection::reflect (T const &value)
 
template<typename T >
Instance< T const > jitify::reflection::instance_of (T const &value)
 
template<typename T >
std::string jitify::reflection::reflect ()
 
template<typename T , T N>
std::string jitify::reflection::reflect ()
 
template<typename T >
std::string jitify::reflection::reflect (jitify::reflection::Type< T >)
 
std::ostream & jitify::operator<< (std::ostream &stream, dim3 d)
 
template<typename T >
Lambda< T > jitify::make_Lambda (Capture const &capture, std::string func, T lambda)
 
template<typename IndexType , class Func >
CUresult jitify::parallel_for (ExecutionPolicy policy, IndexType begin, IndexType end, Lambda< Func > const &lambda)
 
void jitify::experimental::serialization::detail::serialize (std::ostream &stream, size_t u)
 
bool jitify::experimental::serialization::detail::deserialize (std::istream &stream, size_t *size)
 
void jitify::experimental::serialization::detail::serialize (std::ostream &stream, std::string const &s)
 
bool jitify::experimental::serialization::detail::deserialize (std::istream &stream, std::string *s)
 
void jitify::experimental::serialization::detail::serialize (std::ostream &stream, std::vector< std::string > const &v)
 
bool jitify::experimental::serialization::detail::deserialize (std::istream &stream, std::vector< std::string > *v)
 
void jitify::experimental::serialization::detail::serialize (std::ostream &stream, std::map< std::string, std::string > const &m)
 
bool jitify::experimental::serialization::detail::deserialize (std::istream &stream, std::map< std::string, std::string > *m)
 
template<typename T , typename... Rest>
void jitify::experimental::serialization::detail::serialize (std::ostream &stream, T const &value, Rest... rest)
 
template<typename T , typename... Rest>
bool jitify::experimental::serialization::detail::deserialize (std::istream &stream, T *value, Rest... rest)
 
void jitify::experimental::serialization::detail::serialize_magic_number (std::ostream &stream)
 
bool jitify::experimental::serialization::detail::deserialize_magic_number (std::istream &stream)
 
template<typename... Values>
std::string jitify::experimental::serialization::serialize (Values const &... values)
 
template<typename... Values>
bool jitify::experimental::serialization::deserialize (std::string const &serialized, Values *... values)
 

Detailed Description

The Jitify library header.

Macro Definition Documentation

◆ JITIFY_ARGS

#define JITIFY_ARGS (   ...)    __VA_ARGS__

◆ JITIFY_CAPTURE

#define JITIFY_CAPTURE (   ...)    jitify::Capture(jitify::detail::split_string(#__VA_ARGS__, -1, ","), __VA_ARGS__)

◆ JITIFY_LAMBDA

#define JITIFY_LAMBDA (   capture,
  ... 
)    JITIFY_LAMBDA_(JITIFY_ARGS(JITIFY_PASS_PARAMETERS(capture)), JITIFY_ARGS(__VA_ARGS__))

Creates a Lambda object with captured variables and a function definition.

Parameters
captureA bracket-enclosed list of variables to capture.
...The function definition.
float* capture_me;
int capture_me_too;
auto my_lambda = JITIFY_LAMBDA( (capture_me, capture_me_too),
capture_me[i] = i*capture_me_too );

◆ JITIFY_LAMBDA_

#define JITIFY_LAMBDA_ (   x,
  ... 
)    JITIFY_MAKE_LAMBDA(JITIFY_CAPTURE(x), JITIFY_ARGS(x), __VA_ARGS__)

◆ JITIFY_MAKE_LAMBDA

#define JITIFY_MAKE_LAMBDA (   capture,
  x,
  ... 
)
Value:
jitify::make_Lambda(capture, std::string(#__VA_ARGS__), [x](int i) { \
__VA_ARGS__; \
})

◆ JITIFY_PASS_PARAMETERS

#define JITIFY_PASS_PARAMETERS (   X)    JITIFY_STRIP_PARENS(JITIFY_ARGS X)

◆ JITIFY_PRINT_LOG

#define JITIFY_PRINT_LOG   1

◆ JITIFY_STRIP_PARENS

#define JITIFY_STRIP_PARENS (   X)    X

◆ JITIFY_THREAD_SAFE

#define JITIFY_THREAD_SAFE   1

Jitify - A C++ library that simplifies the use of NVRTC Use class jitify::JitCache to manage and launch JIT-compiled CUDA kernels.

Use namespace jitify::reflection to reflect types and values into code-strings.

Use JITIFY_INCLUDE_EMBEDDED_FILE() to declare files that have been embedded into the executable using the GCC linker.

Use jitify::parallel_for and JITIFY_LAMBDA() to generate and launch simple kernels.