GCC Code Coverage Report


Directory: ./
File: openvdb_ax/openvdb_ax/codegen/Functions.h
Date: 2022-07-25 17:40:05
Exec Total Coverage
Lines: 6 6 100.0%
Functions: 1 1 100.0%
Branches: 3 6 50.0%

Line Branch Exec Source
1 // Copyright Contributors to the OpenVDB Project
2 // SPDX-License-Identifier: MPL-2.0
3
4 /// @file codegen/Functions.h
5 ///
6 /// @authors Nick Avramoussis, Richard Jones, Francisco Gochez
7 ///
8 /// @brief Contains the function objects that define the functions used in
9 /// compute function generation, to be inserted into the FunctionRegistry.
10 /// These define general purpose functions such as math functions.
11 ///
12
13 #ifndef OPENVDB_AX_CODEGEN_GENERIC_FUNCTIONS_HAS_BEEN_INCLUDED
14 #define OPENVDB_AX_CODEGEN_GENERIC_FUNCTIONS_HAS_BEEN_INCLUDED
15
16 #include "FunctionRegistry.h"
17
18 #include "../compiler/CompilerOptions.h"
19
20 #include <openvdb/version.h>
21
22 namespace openvdb {
23 OPENVDB_USE_VERSION_NAMESPACE
24 namespace OPENVDB_VERSION_NAME {
25
26 namespace ax {
27 namespace codegen {
28
29 /// @brief Creates a registry with the default set of registered functions
30 /// including math functions, point functions and volume functions
31 /// @param op The current function options
32 ///
33 inline FunctionRegistry::UniquePtr createDefaultRegistry(const FunctionOptions* op = nullptr);
34
35 /// @brief Populates a function registry with all available "standard" AX
36 /// library function. This primarily consists of all mathematical ops
37 /// on AX containers (scalars, vectors, matrices) and other stl built-ins
38 /// @param reg The function registry to populate
39 /// @param options The current function options
40 ///
41 OPENVDB_AX_API void insertStandardFunctions(FunctionRegistry& reg, const FunctionOptions* options = nullptr);
42
43 /// @brief Populates a function registry with all available OpenVDB Point AX
44 /// library function
45 /// @param reg The function registry to populate
46 /// @param options The current function options
47 ///
48 OPENVDB_AX_API void insertVDBPointFunctions(FunctionRegistry& reg, const FunctionOptions* options = nullptr);
49
50 /// @brief Populates a function registry with all available OpenVDB Volume AX
51 /// library function
52 /// @param reg The function registry to populate
53 /// @param options The current function options
54 ///
55 OPENVDB_AX_API void insertVDBVolumeFunctions(FunctionRegistry& reg, const FunctionOptions* options = nullptr);
56
57
58 ///////////////////////////////////////////////////////////////////////////
59 ///////////////////////////////////////////////////////////////////////////
60
61
62 1486 inline FunctionRegistry::UniquePtr createDefaultRegistry(const FunctionOptions* op)
63 {
64 1486 FunctionRegistry::UniquePtr registry(new FunctionRegistry);
65
1/2
✓ Branch 1 taken 1486 times.
✗ Branch 2 not taken.
1486 insertStandardFunctions(*registry, op);
66
1/2
✓ Branch 1 taken 1486 times.
✗ Branch 2 not taken.
1486 insertVDBPointFunctions(*registry, op);
67
1/2
✓ Branch 1 taken 1486 times.
✗ Branch 2 not taken.
1486 insertVDBVolumeFunctions(*registry, op);
68 1486 return registry;
69 }
70
71 } // namespace codegen
72 } // namespace ax
73 } // namespace OPENVDB_VERSION_NAME
74 } // namespace openvdb
75
76 #endif // OPENVDB_AX_CODEGEN_GENERIC_FUNCTIONS_HAS_BEEN_INCLUDED
77
78