|
1 | 1 | ## CHANGE LOG |
2 | 2 |
|
3 | | - |
4 | | -###Hydra 2.5.0 |
| 3 | +### Hydra 3.0.0 |
| 4 | + |
| 5 | +It is the first release of the longly waited 3 series. Overall, this release is expected to be faster |
| 6 | +or at least to have similar performance to the previous releases. |
| 7 | +There are many bug fixes and other changes across. The most significant are summarized below: |
| 8 | + |
| 9 | +#### Function call interface |
| 10 | + |
| 11 | +This is probably the most impacting change in this release, making **Hydra3** series backward incompatible with the previous series. |
| 12 | + |
| 13 | +1. New interface for calling functors and lambdas. |
| 14 | + |
| 15 | + a) Extensive statically-bound named parameter idiom support. This new idiom for specification of function call interfaces makes the definition callable objects in **Hydra3** much more safe, straight forward, transparent and user friendly, without compromise performance. In many cases enhancing performance, indeed. From **Hydra3**, users will be able to define new types, with *ad hoc* names wrapping around primary types, using the macro ```declvar(NewVar, Type)```. |
| 16 | + These new types are searched in compile time to bind the function call, if the type |
| 17 | +is not found a compile error is emitted, avoiding the generation of invalid or error prone code. |
| 18 | +See how it works: |
| 19 | + |
| 20 | + ```cpp |
| 21 | + ... |
| 22 | + #include <hydra/functions/Gaussian.h> |
| 23 | + ... |
| 24 | + |
| 25 | + declvar(Angle, double) |
| 26 | + |
| 27 | + int main(int argv, char** argc) |
| 28 | + { |
| 29 | + ... |
| 30 | + |
| 31 | + auto gauss = hydra::Gaussian<Angle>(mean, signa); |
| 32 | + ... |
| 33 | + } |
| 34 | + ``` |
| 35 | + in the previous code snippet, wherever the object `gauss` is called, if the argument consists of one or tuples, which are the entry type of all multidimensional dataset classes in Hydra, the ``Angle``type identifier will be searched among the elements, if not found, code will not compile. If the argument is a non-tuple type, conversion will be tried. |
| 36 | + Multidimensional datasets can be defined using named parameters like in the snippet below: |
| 37 | + |
| 38 | + ```cpp |
| 39 | + |
| 40 | + ... |
| 41 | + #include <hydra/multivector.h> |
| 42 | + ... |
| 43 | + |
| 44 | + declvar(X, double) |
| 45 | + declvar(Y, double) |
| 46 | + declvar(Z, double) |
| 47 | + |
| 48 | + int main(int argv, char** argc) |
| 49 | + { |
| 50 | + //3D device buffer |
| 51 | + hydra::multivector< hydra::tuple<X,Y,Z>, hydra::device::sys_t> data(nentries); |
| 52 | + |
| 53 | + ... |
| 54 | + |
| 55 | + for(auto x: hydra::column<X>(data) |
| 56 | + { |
| 57 | + |
| 58 | + std::cout << x << std::endl; |
| 59 | + |
| 60 | + } |
| 61 | + } |
| 62 | + |
| 63 | + ``` |
| 64 | + |
| 65 | + b) Functors: as usual, it should derive from ``hydra::BaseFunctor``, defined in ``hydra/Function.h``, but now the must inform their argument type, signature and number of parameters (``hydra::Parameter``) at template instantiation time. It is also necessary to implement the ``ResultType Evaluate(ArgType...)`` method. Default constructors should be deleted, non-default and copy constructors, as well as assignments operators should be implemented as well. See how this works for ``hydra::Gaussian``: |
| 66 | + |
| 67 | + ```cpp |
| 68 | + |
| 69 | + //implementations omited, for complete details |
| 70 | + //see: hydra/functions/Gaussian.h |
| 71 | + |
| 72 | + template<typename ArgType, typename Signature=double(ArgType) > |
| 73 | + class Gaussian: public BaseFunctor<Gaussian<ArgType>, Signature, 2> |
| 74 | + { |
| 75 | + |
| 76 | + public: |
| 77 | + |
| 78 | + Gaussian()=delete; |
| 79 | + |
| 80 | + Gaussian(Parameter const& mean, Parameter const& sigma ); |
| 81 | + |
| 82 | + __hydra_host__ __hydra_device__ |
| 83 | + Gaussian(Gaussian<ArgType> const& other ); |
| 84 | + |
| 85 | + __hydra_host__ __hydra_device__ |
| 86 | + Gaussian<ArgType>& operator=(Gaussian<ArgType> const& other ); |
| 87 | + |
| 88 | + __hydra_host__ __hydra_device__ |
| 89 | + inline double Evaluate(ArgType x) const; |
| 90 | + |
| 91 | + }; |
| 92 | +
|
| 93 | + ``` |
| 94 | +
|
| 95 | + c) Lambdas: Support for lambdas is updated for the new interface. The new interface is implemented |
| 96 | + in ``hydra/Lambda.h`` |
| 97 | + |
| 98 | + ```cpp |
| 99 | + |
| 100 | + ... |
| 101 | + #include <hydra/multivector.h> |
| 102 | + #include <hydra/Lambda.h> |
| 103 | + ... |
| 104 | + |
| 105 | + declvar(X, double) |
| 106 | + declvar(Y, double) |
| 107 | + declvar(Z, double) |
| 108 | + |
| 109 | + int main(int argv, char** argc) |
| 110 | + { |
| 111 | + //3D device buffer |
| 112 | + hydra::multivector< hydra::tuple<X,Y,Z>, hydra::device::sys_t> data(nentries); |
| 113 | + |
| 114 | + //Lambda |
| 115 | + auto printer = hydra::wrap_lambda( []__hydra_dual__(X x, Y y){ |
| 116 | + |
| 117 | + print("x = %f y = %f", x(), y()); |
| 118 | + |
| 119 | + } ); |
| 120 | + |
| 121 | + for(auto entry: data) printer(entry); |
| 122 | + } |
| 123 | +
|
| 124 | + ``` |
| 125 | +
|
| 126 | +
|
| 127 | +### Hydra 2.5.0 |
5 | 128 |
|
6 | 129 | 1. **Eigen** is not being distributed with **Hydra** anymore. **Eigen** will remain an dependency for foreseeable future. |
7 | 130 | 2. New facility to update **Thrust** and **CUB**. New namespaces ```hydra::hydra_thrust``` and ```hydra::hydra_cub``` defined. |
|
11 | 134 | 6. Re-implementation of the impacted examples. |
12 | 135 | 7. Many bug fixes across the tree... |
13 | 136 |
|
14 | | -###Hydra 2.4.1 (probably incomplete) |
| 137 | +### Hydra 2.4.1 (probably incomplete) |
15 | 138 |
|
16 | 139 | 1. The main change is this release is the update of Thrust instance distributed with Hydra to the version 1.9.6, which enabled the support for CUDA 10.1 and hopefuly higher |
17 | 140 | 2. Range semantics implemented in Decays::Unweight methods |
|
0 commit comments