Loading...
Searching...
No Matches
backbone.h
Go to the documentation of this file.
1#ifndef _BBM_DRJIT_BACKBONE_H_
2#define _BBM_DRJIT_BACKBONE_H_
3
4#include <cstdint>
6
7#include "drjit/fwd.h"
8#include "drjit/jit.h"
9#include "drjit/math.h"
10#include "drjit/array.h"
11#include "drjit/packet.h"
12
13#include "backbone/vec.h"
14#include "backbone/color.h"
15#include "backbone/complex.h"
16#include "backbone/type_traits.h"
17#include "backbone/math.h"
18#include "backbone/horizontal.h"
19#include "backbone/control.h"
20#include "backbone/random.h"
21
22#ifdef DRJIT_AUTODIFF
23 #include "backbone/gradient.h"
24#endif /* DRJIT_AUTODIFF */
25
26#include "backbone/stringconvert.h"
27
28/************************************************************************/
29/*! \file backbone.h
30
31 \brief Define the available configurations of the DrJIT backbone
32
33*************************************************************************/
34
35namespace bbm {
36
37 /*** Implementation detail ***/
38 namespace detail {
39 template<typename VALUE, string_literal NAME, typename CONF>
40 struct rgbConfig
41 {
42 static constexpr string_literal name = NAME;
43 using Config = CONF;
44 using Value = VALUE;
45 using Spectrum = backbone::color<Value>;
46 static Spectrum wavelength(void) { return {0.645, 0.526, 0.444}; } // in micron
47 };
48 }
49
50 /**********************************************************************/
51 /*! @{ \name Config with non-packet/non-diff floating point RGB colors
52 **********************************************************************/
53 struct floatRGB : public detail::rgbConfig<DRJIT_FLOAT, "floatRGB", floatRGB> {};
54 struct doubleRGB : public detail::rgbConfig<DRJIT_DOUBLE, "doubleRGB", doubleRGB> {};
55 //! @}
56
57#ifdef DRJIT_AUTODIFF
58 /**********************************************************************/
59 /*! @{ \name Config with differentiable floating point RGB colors
60 **********************************************************************/
61 struct floatDiffRGB : public detail::rgbConfig<drjit::DiffArray<DRJIT_FLOAT>, "floatDiffArray", floatDiffRGB> {};
62 struct doubleDiffRGB : public detail::rgbConfig<drjit::DiffArray<DRJIT_DOUBLE>, "doubleDiffArray", doubleDiffRGB> {};
63 //! @}
64#endif /* DRJIT_AUTODIFF */
65
66} // end bbm namespace
67
68
69#ifdef DRJIT_BACKBONE_LLVM
70 /**********************************************************************/
71 /*! \brief Init the JIT if the DrJIT backbone is LLVM and AUTODIFF is enabled
72 ***********************************************************************/
73 struct DRJIT_LLVM_Backbone
74 {
75 DRJIT_LLVM_Backbone(void) { jit_init((uint32_t) JitBackend::LLVM ); }
76 };
77
78 static DRJIT_LLVM_Backbone _drjit_llvm_backbone;
79#endif /* DRJIT_BACKBONE_LLVM */
80
81
82#endif /* _BBM_DRJIT_BACKBONE_H_ */
drjit::Array< T, 3 > color
Definition: color.h:13
Definition: aggregatebsdf.h:29
Definition: backbone.h:54
Definition: backbone.h:53