Research Article
Inastemp: A Novel Intrinsics-as-Template Library for Portable SIMD-Vectorization
Code 12
Inastemp advanced condition manager.
| (1) // Considering InaVecBestType can contain 4 doubles | | (2) InaVecBestType<double> a_value = ; | | (3) InaVecBestType<double> another_value = ; | | (4) | | (5) // Example with multiple conditions | | (6) a_value = InaVecBestType<double>::If(a_value 10. < another_value) | | (7) .Then(another_value) | | (8) .ElseIf(a_value < 10.).Then(a_value10) | | (9) .ElseIf(a_value == 0).Then([&]() | | (10) return another_value.sqrt(); | | (11) ) | | (12) .Else([&]() | | (13) InaVecBestType<double> velse = ; | | (14) return velse 100 + 40; | | (15) ); |
|