29template <
typename AFloat>
32template<
typename AFloat>
35 if (!fgRandomGen) fgRandomGen =
new TRandom3();
36 fgRandomGen->SetSeed(seed);
38template<
typename AFloat>
41 if (!fgRandomGen) fgRandomGen =
new TRandom3(0);
45template<
typename AFloat>
49 size_t n = (A.GetNDim() == 2 && A.GetLayout() == Tensor_t::MemoryLayout::ColumnMajor) ?
50 A.GetShape()[1] : A.GetFirstStride();
61 A.GetDeviceBuffer().CopyFrom(
xhost);
65template<
typename AFloat>
70 (A.GetNDim() == 2 && A.GetLayout() == Tensor_t::MemoryLayout::ColumnMajor) ?
71 A.GetShape()[1] : A.GetFirstStride();
82 A.GetDeviceBuffer().CopyFrom(
xhost);
91template<
typename AFloat>
96 size_t n = A.GetShape()[0];
97 size_t m = A.GetShape()[1];
99 if (A.GetShape().size() > 2) {
101 for (
size_t j = 2;
j < A.GetShape().
size(); ++
j) {
102 m *= A.GetShape()[
j];
103 n *= A.GetShape()[
j];
110 size_t nsize = A.GetSize();
112 for (
size_t i = 0; i <
nsize; i++) {
119 A.GetDeviceBuffer().CopyFrom(
xhost);
127template<
typename AFloat>
130 size_t n = A.GetShape()[0];
131 size_t m = A.GetShape()[1];
133 if (A.GetShape().size() > 2) {
135 for (
size_t j = 2;
j < A.GetShape().
size(); ++
j) {
136 m *= A.GetShape()[
j];
137 n *= A.GetShape()[
j];
144 size_t nsize = A.GetSize();
146 for (
size_t i = 0; i <
nsize; i++) {
149 A.GetDeviceBuffer().CopyFrom(
xhost);
154template<
typename AFloat>
158 m = A.GetFirstSize();
159 n = A.GetFirstStride();
163 for (
size_t i = 0; i <
m; i++) {
164 for (
size_t j = 0;
j <
n ;
j++) {
172 A.GetDeviceBuffer() =
mB.GetDeviceBuffer();
176template<
typename AFloat>
180 cudaMemset(A.GetDataPointer(), 0,
sizeof(AFloat) * A.GetSize());
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Random number generator class based on M.
This is the base class for the ROOT Random number generators.
create variable transformations