|
Graph Framework
|
Class for JIT compile of the GPU kernels. More...
#include <jit.hpp>
Public Member Functions | |
| context (const size_t index) | |
| Construct a jit context object. | |
| void | add_kernel (const std::string name, graph::input_nodes< T, SAFE_MATH > inputs, graph::output_nodes< T, SAFE_MATH > outputs, graph::map_nodes< T, SAFE_MATH > setters, graph::shared_random_state< T, SAFE_MATH > state, const size_t size) |
| Add a kernel. | |
| void | add_max_reduction (const size_t size) |
| Add max reduction kernel. | |
| void | print_source () |
| Print the kernel source. | |
| void | save_source () |
| Save the kernel source code. | |
| void | compile (const bool add_reduction=false) |
| Compile the kernel. | |
| std::function< void(void)> | create_kernel_call (const std::string kernel_name, graph::input_nodes< T, SAFE_MATH > inputs, graph::output_nodes< T, SAFE_MATH > outputs, graph::shared_random_state< T, SAFE_MATH > state, const size_t num_rays) |
| Create a kernel calling function. | |
| std::function< T(void)> | create_max_call (graph::shared_leaf< T, SAFE_MATH > &argument, std::function< void(void)> run) |
| Create a max compute kernel calling function. | |
| void | print (const size_t index, const graph::output_nodes< T, SAFE_MATH > &nodes) |
| Print output. | |
| T | check_value (const size_t index, const graph::shared_leaf< T, SAFE_MATH > &node) |
| Check the value. | |
| void | wait () |
| Wait for kernel to finish. | |
| void | copy_to_device (graph::shared_leaf< T, SAFE_MATH > &node, T *source) |
| Copy contexts of buffer to device. | |
| void | copy_to_host (graph::shared_leaf< T, SAFE_MATH > &node, T *destination) |
| Copy contexts of buffer to host. | |
| T * | get_buffer (graph::shared_leaf< T, SAFE_MATH > &node) |
| Get buffer from the gpu_context. | |
Static Public Member Functions | |
| static size_t | max_concurrency () |
| Get the maximum number of concurrent instances. | |
Static Public Attributes | |
| static constexpr size_t | random_state_size = gpu_context_type::random_state_size |
| Size of random state needed. | |
Class for JIT compile of the GPU kernels.
| T | Base type of the calculation. |
| SAFE_MATH | Use Safe Math operations. |
|
inline |
Construct a jit context object.
| [in] | index | Concurrent index. Not used. |
|
inline |
Add a kernel.
Build the source code for a kernel graph.
| [in] | name | Name to call the kernel. |
| [in] | inputs | Input variables of the kernel. |
| [in] | outputs | Output nodes of the graph to compute. |
| [in] | setters | Map outputs back to input values. |
| [in] | state | Random state node. |
| [in] | size | Size of the kernel. |
|
inline |
Add max reduction kernel.
| [in] | size | Size of the input buffer. |
|
inline |
Check the value.
| [in] | index | Ray index to check value for. |
| [in] | node | Node to check the value for. |
|
inline |
Compile the kernel.
| [in] | add_reduction | Optional argument to generate the reduction kernel. |
|
inline |
Copy contexts of buffer to device.
| [in] | node | Not to copy buffer to. |
| [in] | source | Host side buffer to copy from. |
|
inline |
Copy contexts of buffer to host.
| [in] | node | Node to copy buffer from. |
| [in,out] | destination | Host side buffer to copy to. |
|
inline |
Create a kernel calling function.
| [in] | kernel_name | Name of the kernel for later reference. |
| [in] | inputs | Input nodes of the kernel. |
| [in] | outputs | Output nodes of the kernel. |
| [in] | state | Random states. |
| [in] | num_rays | Number of rays to trace. |
|
inline |
Create a max compute kernel calling function.
| [in] | argument | Node to reduce. |
| [in] | run | Function to run before reduction. |
|
inline |
Get buffer from the gpu_context.
| [in] | node | Node to get the gpu buffer for. |
|
inlinestatic |
Get the maximum number of concurrent instances.
|
inline |
Print output.
| [in] | index | Particle index to print. |
| [in] | nodes | Nodes to output. |