Skip to main content
`Ctrl`+`K`

# /build/rocrand-cWAlCE/rocrand-7.2.4/library/include/rocrand/rocrand_log_normal.h Source File

API library: /build/rocrand-cWAlCE/rocrand-7.2.4/library/include/rocrand/rocrand_log_normal.h Source File
rocrand_log_normal.h
1// Copyright (c) 2017-2025 Advanced Micro Devices, Inc. All rights reserved.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"), to deal
5// in the Software without restriction, including without limitation the rights
6// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7// copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software.
12//
13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19// THE SOFTWARE.
20
21#ifndef ROCRAND_LOG_NORMAL_H_
22#define ROCRAND_LOG_NORMAL_H_
23
28
29#include "rocrand/rocrand_lfsr113.h"
30#include "rocrand/rocrand_mrg31k3p.h"
31#include "rocrand/rocrand_mrg32k3a.h"
32#include "rocrand/rocrand_mtgp32.h"
33#include "rocrand/rocrand_philox4x32_10.h"
34#include "rocrand/rocrand_scrambled_sobol32.h"
35#include "rocrand/rocrand_scrambled_sobol64.h"
36#include "rocrand/rocrand_sobol32.h"
37#include "rocrand/rocrand_sobol64.h"
38#include "rocrand/rocrand_threefry2x32_20.h"
39#include "rocrand/rocrand_threefry2x64_20.h"
40#include "rocrand/rocrand_threefry4x32_20.h"
41#include "rocrand/rocrand_threefry4x64_20.h"
42#include "rocrand/rocrand_xorwow.h"
43
44#include "rocrand/rocrand_normal.h"
45
46#include <hip/hip_runtime.h>
47
48#include <math.h>
49
65#ifndef ROCRAND_DETAIL_BM_NOT_IN_STATE
66__forceinline__ __device__ __host__ float
67 rocrand_log_normal(rocrand_state_philox4x32_10* state, float mean, float stddev)
68{
69 typedef rocrand_device::detail::engine_boxmuller_helper<rocrand_state_philox4x32_10> bm_helper;
70
71 if(bm_helper::has_float(state))
72 {
73 return expf(mean + (stddev * bm_helper::get_float(state)));
74 }
75
76 auto state1 = rocrand(state);
77 auto state2 = rocrand(state);
78
79 float2 r = rocrand_device::detail::normal_distribution2(state1, state2);
80 bm_helper::save_float(state, r.y);
81 return expf(mean + (stddev * r.x));
82}
83#endif // ROCRAND_DETAIL_BM_NOT_IN_STATE
84
99__forceinline__ __device__ __host__
100float2 rocrand_log_normal2(rocrand_state_philox4x32_10* state, float mean, float stddev)
101{
102 auto state1 = rocrand(state);
103 auto state2 = rocrand(state);
104
105 float2 r = rocrand_device::detail::normal_distribution2(state1, state2);
106 return float2 {
107 expf(mean + (stddev * r.x)),
108 expf(mean + (stddev * r.y))
109 };
110}
111
126__forceinline__ __device__ __host__
127float4 rocrand_log_normal4(rocrand_state_philox4x32_10* state, float mean, float stddev)
128{
129 float4 r = rocrand_device::detail::normal_distribution4(rocrand4(state));
130 return float4 {
131 expf(mean + (stddev * r.x)),
132 expf(mean + (stddev * r.y)),
133 expf(mean + (stddev * r.z)),
134 expf(mean + (stddev * r.w))
135 };
136}
137
153#ifndef ROCRAND_DETAIL_BM_NOT_IN_STATE
154__forceinline__ __device__ __host__ double
155 rocrand_log_normal_double(rocrand_state_philox4x32_10* state, double mean, double stddev)
156{
157 typedef rocrand_device::detail::engine_boxmuller_helper<rocrand_state_philox4x32_10> bm_helper;
158
159 if(bm_helper::has_double(state))
160 {
161 return exp(mean + (stddev * bm_helper::get_double(state)));
162 }
163 double2 r = rocrand_device::detail::normal_distribution_double2(rocrand4(state));
164 bm_helper::save_double(state, r.y);
165 return exp(mean + r.x * stddev);
166}
167#endif // ROCRAND_DETAIL_BM_NOT_IN_STATE
168
183__forceinline__ __device__ __host__
184double2 rocrand_log_normal_double2(rocrand_state_philox4x32_10* state, double mean, double stddev)
185{
186 double2 r = rocrand_device::detail::normal_distribution_double2(rocrand4(state));
187 return double2 {
188 exp(mean + (stddev * r.x)),
189 exp(mean + (stddev * r.y))
190 };
191}
192
207__forceinline__ __device__ __host__
208double4 rocrand_log_normal_double4(rocrand_state_philox4x32_10* state, double mean, double stddev)
209{
210 double2 r1, r2;
211 r1 = rocrand_log_normal_double2(state, mean, stddev);
212 r2 = rocrand_log_normal_double2(state, mean, stddev);
213 return double4 {
214 r1.x, r1.y, r2.x, r2.y
215 };
216}
217
233#ifndef ROCRAND_DETAIL_BM_NOT_IN_STATE
234__forceinline__ __device__ __host__ float
235 rocrand_log_normal(rocrand_state_mrg31k3p* state, float mean, float stddev)
236{
237 typedef rocrand_device::detail::engine_boxmuller_helper<rocrand_state_mrg31k3p> bm_helper;
238
239 if(bm_helper::has_float(state))
240 {
241 return expf(mean + (stddev * bm_helper::get_float(state)));
242 }
243
244 auto state1 = state->next();
245 auto state2 = state->next();
246
247 float2 r
248 = rocrand_device::detail::mrg_normal_distribution2<rocrand_state_mrg31k3p>(state1, state2);
249 bm_helper::save_float(state, r.y);
250 return expf(mean + (stddev * r.x));
251}
252#endif // ROCRAND_DETAIL_BM_NOT_IN_STATE
253
268__forceinline__ __device__ __host__
269float2 rocrand_log_normal2(rocrand_state_mrg31k3p* state, float mean, float stddev)
270{
271 auto state1 = state->next();
272 auto state2 = state->next();
273
274 float2 r
275 = rocrand_device::detail::mrg_normal_distribution2<rocrand_state_mrg31k3p>(state1, state2);
276 return float2{expf(mean + (stddev * r.x)), expf(mean + (stddev * r.y))};
277}
278
294#ifndef ROCRAND_DETAIL_BM_NOT_IN_STATE
295__forceinline__ __device__ __host__ double
296 rocrand_log_normal_double(rocrand_state_mrg31k3p* state, double mean, double stddev)
297{
298 typedef rocrand_device::detail::engine_boxmuller_helper<rocrand_state_mrg31k3p> bm_helper;
299
300 if(bm_helper::has_double(state))
301 {
302 return exp(mean + (stddev * bm_helper::get_double(state)));
303 }
304
305 auto state1 = state->next();
306 auto state2 = state->next();
307
308 double2 r
309 = rocrand_device::detail::mrg_normal_distribution_double2<rocrand_state_mrg31k3p>(state1,
310 state2);
311 bm_helper::save_double(state, r.y);
312 return exp(mean + r.x * stddev);
313}
314#endif // ROCRAND_DETAIL_BM_NOT_IN_STATE
315
330__forceinline__ __device__ __host__
331double2 rocrand_log_normal_double2(rocrand_state_mrg31k3p* state, double mean, double stddev)
332{
333 auto state1 = state->next();
334 auto state2 = state->next();
335
336 double2 r
337 = rocrand_device::detail::mrg_normal_distribution_double2<rocrand_state_mrg31k3p>(state1,
338 state2);
339 return double2{exp(mean + (stddev * r.x)), exp(mean + (stddev * r.y))};
340}
341
357#ifndef ROCRAND_DETAIL_BM_NOT_IN_STATE
358__forceinline__ __device__ __host__ float
359 rocrand_log_normal(rocrand_state_mrg32k3a* state, float mean, float stddev)
360{
361 typedef rocrand_device::detail::engine_boxmuller_helper<rocrand_state_mrg32k3a> bm_helper;
362
363 if(bm_helper::has_float(state))
364 {
365 return expf(mean + (stddev * bm_helper::get_float(state)));
366 }
367
368 auto state1 = state->next();
369 auto state2 = state->next();
370
371 float2 r
372 = rocrand_device::detail::mrg_normal_distribution2<rocrand_state_mrg32k3a>(state1, state2);
373 bm_helper::save_float(state, r.y);
374 return expf(mean + (stddev * r.x));
375}
376#endif // ROCRAND_DETAIL_BM_NOT_IN_STATE
377
392__forceinline__ __device__ __host__
393float2 rocrand_log_normal2(rocrand_state_mrg32k3a* state, float mean, float stddev)
394{
395 auto state1 = state->next();
396 auto state2 = state->next();
397
398 float2 r
399 = rocrand_device::detail::mrg_normal_distribution2<rocrand_state_mrg32k3a>(state1, state2);
400 return float2 {
401 expf(mean + (stddev * r.x)),
402 expf(mean + (stddev * r.y))
403 };
404}
405
421#ifndef ROCRAND_DETAIL_BM_NOT_IN_STATE
422__forceinline__ __device__ __host__ double
423 rocrand_log_normal_double(rocrand_state_mrg32k3a* state, double mean, double stddev)
424{
425 typedef rocrand_device::detail::engine_boxmuller_helper<rocrand_state_mrg32k3a> bm_helper;
426
427 if(bm_helper::has_double(state))
428 {
429 return exp(mean + (stddev * bm_helper::get_double(state)));
430 }
431
432 auto state1 = state->next();
433 auto state2 = state->next();
434
435 double2 r
436 = rocrand_device::detail::mrg_normal_distribution_double2<rocrand_state_mrg32k3a>(state1,
437 state2);
438 bm_helper::save_double(state, r.y);
439 return exp(mean + r.x * stddev);
440}
441#endif // ROCRAND_DETAIL_BM_NOT_IN_STATE
442
457__forceinline__ __device__ __host__
458double2 rocrand_log_normal_double2(rocrand_state_mrg32k3a* state, double mean, double stddev)
459{
460 auto state1 = state->next();
461 auto state2 = state->next();
462
463 double2 r
464 = rocrand_device::detail::mrg_normal_distribution_double2<rocrand_state_mrg32k3a>(state1,
465 state2);
466 return double2 {
467 exp(mean + (stddev * r.x)),
468 exp(mean + (stddev * r.y))
469 };
470}
471
487#ifndef ROCRAND_DETAIL_BM_NOT_IN_STATE
488__forceinline__ __device__ __host__ float
489 rocrand_log_normal(rocrand_state_xorwow* state, float mean, float stddev)
490{
491 typedef rocrand_device::detail::engine_boxmuller_helper<rocrand_state_xorwow> bm_helper;
492
493 if(bm_helper::has_float(state))
494 {
495 return expf(mean + (stddev * bm_helper::get_float(state)));
496 }
497
498 auto state1 = rocrand(state);
499 auto state2 = rocrand(state);
500
501 float2 r = rocrand_device::detail::normal_distribution2(state1, state2);
502 bm_helper::save_float(state, r.y);
503 return expf(mean + (stddev * r.x));
504}
505#endif // ROCRAND_DETAIL_BM_NOT_IN_STATE
506
521__forceinline__ __device__ __host__
522float2 rocrand_log_normal2(rocrand_state_xorwow* state, float mean, float stddev)
523{
524 auto state1 = rocrand(state);
525 auto state2 = rocrand(state);
526
527 float2 r = rocrand_device::detail::normal_distribution2(state1, state2);
528 return float2 {
529 expf(mean + (stddev * r.x)),
530 expf(mean + (stddev * r.y))
531 };
532}
533
549#ifndef ROCRAND_DETAIL_BM_NOT_IN_STATE
550__forceinline__ __device__ __host__ double
551 rocrand_log_normal_double(rocrand_state_xorwow* state, double mean, double stddev)
552{
553 typedef rocrand_device::detail::engine_boxmuller_helper<rocrand_state_xorwow> bm_helper;
554
555 if(bm_helper::has_double(state))
556 {
557 return exp(mean + (stddev * bm_helper::get_double(state)));
558 }
559
560 auto state1 = rocrand(state);
561 auto state2 = rocrand(state);
562 auto state3 = rocrand(state);
563 auto state4 = rocrand(state);
564
565 double2 r = rocrand_device::detail::normal_distribution_double2(
566 uint4 { state1, state2, state3, state4 }
567 );
568 bm_helper::save_double(state, r.y);
569 return exp(mean + (stddev * r.x));
570}
571#endif // ROCRAND_DETAIL_BM_NOT_IN_STATE
572
587__forceinline__ __device__ __host__
588double2 rocrand_log_normal_double2(rocrand_state_xorwow* state, double mean, double stddev)
589{
590 auto state1 = rocrand(state);
591 auto state2 = rocrand(state);
592 auto state3 = rocrand(state);
593 auto state4 = rocrand(state);
594
595 double2 r = rocrand_device::detail::normal_distribution_double2(
596 uint4 { state1, state2, state3, state4 }
597 );
598 return double2 {
599 exp(mean + (stddev * r.x)),
600 exp(mean + (stddev * r.y))
601 };
602}
603
616__forceinline__ __device__
617 float rocrand_log_normal(rocrand_state_mtgp32* state, float mean, float stddev)
618{
619 float r = rocrand_device::detail::normal_distribution(rocrand(state));
620 return expf(mean + (stddev * r));
621}
622
637__forceinline__ __device__
638float2 rocrand_log_normal2(rocrand_state_mtgp32* state, float mean, float stddev)
639{
640 auto state1 = rocrand(state);
641 auto state2 = rocrand(state);
642
643 float2 r = rocrand_device::detail::normal_distribution2(state1, state2);
644 return float2{expf(mean + (stddev * r.x)), expf(mean + (stddev * r.y))};
645}
646
659__forceinline__ __device__
660 double rocrand_log_normal_double(rocrand_state_mtgp32* state, double mean, double stddev)
661{
662 double r = rocrand_device::detail::normal_distribution_double(rocrand(state));
663 return exp(mean + (stddev * r));
664}
665
680__forceinline__ __device__
681double2 rocrand_log_normal_double2(rocrand_state_mtgp32* state, double mean, double stddev)
682{
683 auto state1 = rocrand(state);
684 auto state2 = rocrand(state);
685 auto state3 = rocrand(state);
686 auto state4 = rocrand(state);
687
688 double2 r = rocrand_device::detail::normal_distribution_double2(
689 uint4{state1, state2, state3, state4});
690 return double2{exp(mean + (stddev * r.x)), exp(mean + (stddev * r.y))};
691}
692
705__forceinline__ __device__ __host__
706 float rocrand_log_normal(rocrand_state_sobol32* state, float mean, float stddev)
707{
708 float r = rocrand_device::detail::normal_distribution(rocrand(state));
709 return expf(mean + (stddev * r));
710}
711
724__forceinline__ __device__ __host__
725 double rocrand_log_normal_double(rocrand_state_sobol32* state, double mean, double stddev)
726{
727 double r = rocrand_device::detail::normal_distribution_double(rocrand(state));
728 return exp(mean + (stddev * r));
729}
730
743__forceinline__ __device__ __host__
744 float rocrand_log_normal(rocrand_state_scrambled_sobol32* state, float mean, float stddev)
745{
746 float r = rocrand_device::detail::normal_distribution(rocrand(state));
747 return expf(mean + (stddev * r));
748}
749
762__forceinline__ __device__ __host__
763 double rocrand_log_normal_double(rocrand_state_scrambled_sobol32* state, double mean, double stddev)
764{
765 double r = rocrand_device::detail::normal_distribution_double(rocrand(state));
766 return exp(mean + (stddev * r));
767}
768
781__forceinline__ __device__ __host__
782 float rocrand_log_normal(rocrand_state_sobol64* state, float mean, float stddev)
783{
784 float r = rocrand_device::detail::normal_distribution(rocrand(state));
785 return expf(mean + (stddev * r));
786}
787
800__forceinline__ __device__ __host__
801 double rocrand_log_normal_double(rocrand_state_sobol64* state, double mean, double stddev)
802{
803 double r = rocrand_device::detail::normal_distribution_double(rocrand(state));
804 return exp(mean + (stddev * r));
805}
806
819__forceinline__ __device__ __host__
820 float rocrand_log_normal(rocrand_state_scrambled_sobol64* state, float mean, float stddev)
821{
822 float r = rocrand_device::detail::normal_distribution(rocrand(state));
823 return expf(mean + (stddev * r));
824}
825
838__forceinline__ __device__ __host__
839 double rocrand_log_normal_double(rocrand_state_scrambled_sobol64* state, double mean, double stddev)
840{
841 double r = rocrand_device::detail::normal_distribution_double(rocrand(state));
842 return exp(mean + (stddev * r));
843}
844
857__forceinline__ __device__ __host__
858 float rocrand_log_normal(rocrand_state_lfsr113* state, float mean, float stddev)
859{
860 float r = rocrand_device::detail::normal_distribution(rocrand(state));
861 return expf(mean + (stddev * r));
862}
863
878__forceinline__ __device__ __host__
879float2 rocrand_log_normal2(rocrand_state_lfsr113* state, float mean, float stddev)
880{
881 auto state1 = rocrand(state);
882 auto state2 = rocrand(state);
883
884 float2 r = rocrand_device::detail::normal_distribution2(state1, state2);
885 return float2{expf(mean + (stddev * r.x)), expf(mean + (stddev * r.y))};
886}
887
900__forceinline__ __device__ __host__
901 double rocrand_log_normal_double(rocrand_state_lfsr113* state, double mean, double stddev)
902{
903 double r = rocrand_device::detail::normal_distribution_double(rocrand(state));
904 return exp(mean + (stddev * r));
905}
906
921__forceinline__ __device__ __host__
922double2 rocrand_log_normal_double2(rocrand_state_lfsr113* state, double mean, double stddev)
923{
924 auto state1 = rocrand(state);
925 auto state2 = rocrand(state);
926 auto state3 = rocrand(state);
927 auto state4 = rocrand(state);
928
929 double2 r = rocrand_device::detail::normal_distribution_double2(
930 uint4{state1, state2, state3, state4});
931 return double2{exp(mean + (stddev * r.x)), exp(mean + (stddev * r.y))};
932}
933
946__forceinline__ __device__ __host__
947 float rocrand_log_normal(rocrand_state_threefry2x32_20* state, double mean, double stddev)
948{
949 float r = rocrand_device::detail::normal_distribution(rocrand(state));
950 return expf(mean + (stddev * r));
951}
952
967__forceinline__ __device__ __host__
968float2 rocrand_log_normal2(rocrand_state_threefry2x32_20* state, float mean, float stddev)
969{
970 float2 r = rocrand_device::detail::normal_distribution2(rocrand2(state));
971 return float2{expf(mean + (stddev * r.x)), expf(mean + (stddev * r.y))};
972}
973
986__forceinline__ __device__ __host__
987 double rocrand_log_normal_double(rocrand_state_threefry2x32_20* state, double mean, double stddev)
988{
989 double r = rocrand_device::detail::normal_distribution_double(rocrand(state));
990 return exp(mean + (stddev * r));
991}
992
1007__forceinline__ __device__ __host__
1008double2 rocrand_log_normal_double2(rocrand_state_threefry2x32_20* state, double mean, double stddev)
1009{
1010 auto state1 = rocrand(state);
1011 auto state2 = rocrand(state);
1012 auto state3 = rocrand(state);
1013 auto state4 = rocrand(state);
1014
1015 double2 r = rocrand_device::detail::normal_distribution_double2(
1016 uint4{state1, state2, state3, state4});
1017 return double2{exp(mean + (stddev * r.x)), exp(mean + (stddev * r.y))};
1018}
1019
1032__forceinline__ __device__ __host__
1033 float rocrand_log_normal(rocrand_state_threefry2x64_20* state, double mean, double stddev)
1034{
1035 float r = rocrand_device::detail::normal_distribution(rocrand(state));
1036 return expf(mean + (stddev * r));
1037}
1038
1053__forceinline__ __device__ __host__
1054float2 rocrand_log_normal2(rocrand_state_threefry2x64_20* state, float mean, float stddev)
1055{
1056 auto state1 = rocrand(state);
1057 auto state2 = rocrand(state);
1058
1059 float2 r = rocrand_device::detail::normal_distribution2(state1, state2);
1060 return float2{expf(mean + (stddev * r.x)), expf(mean + (stddev * r.y))};
1061}
1062
1075__forceinline__ __device__ __host__
1076 double rocrand_log_normal_double(rocrand_state_threefry2x64_20* state, double mean, double stddev)
1077{
1078 double r = rocrand_device::detail::normal_distribution_double(rocrand(state));
1079 return exp(mean + (stddev * r));
1080}
1081
1096__forceinline__ __device__ __host__
1097double2 rocrand_log_normal_double2(rocrand_state_threefry2x64_20* state, double mean, double stddev)
1098{
1099 double2 r = rocrand_device::detail::normal_distribution_double2(rocrand2(state));
1100 return double2{exp(mean + (stddev * r.x)), exp(mean + (stddev * r.y))};
1101}
1102
1115__forceinline__ __device__ __host__
1116 float rocrand_log_normal(rocrand_state_threefry4x32_20* state, double mean, double stddev)
1117{
1118 float r = rocrand_device::detail::normal_distribution(rocrand(state));
1119 return expf(mean + (stddev * r));
1120}
1121
1136__forceinline__ __device__ __host__
1137float2 rocrand_log_normal2(rocrand_state_threefry4x32_20* state, float mean, float stddev)
1138{
1139 auto state1 = rocrand(state);
1140 auto state2 = rocrand(state);
1141
1142 float2 r = rocrand_device::detail::normal_distribution2(state1, state2);
1143 return float2{expf(mean + (stddev * r.x)), expf(mean + (stddev * r.y))};
1144}
1145
1158__forceinline__ __device__ __host__
1159 double rocrand_log_normal_double(rocrand_state_threefry4x32_20* state, double mean, double stddev)
1160{
1161 double r = rocrand_device::detail::normal_distribution_double(rocrand(state));
1162 return exp(mean + (stddev * r));
1163}
1164
1179__forceinline__ __device__ __host__
1180double2 rocrand_log_normal_double2(rocrand_state_threefry4x32_20* state, double mean, double stddev)
1181{
1182 double2 r = rocrand_device::detail::normal_distribution_double2(rocrand4(state));
1183 return double2{exp(mean + (stddev * r.x)), exp(mean + (stddev * r.y))};
1184}
1185
1198__forceinline__ __device__ __host__
1199 float rocrand_log_normal(rocrand_state_threefry4x64_20* state, double mean, double stddev)
1200{
1201 float r = rocrand_device::detail::normal_distribution(rocrand(state));
1202 return expf(mean + (stddev * r));
1203}
1204
1219__forceinline__ __device__ __host__
1220float2 rocrand_log_normal2(rocrand_state_threefry4x64_20* state, float mean, float stddev)
1221{
1222 auto state1 = rocrand(state);
1223 auto state2 = rocrand(state);
1224
1225 float2 r = rocrand_device::detail::normal_distribution2(state1, state2);
1226 return float2{expf(mean + (stddev * r.x)), expf(mean + (stddev * r.y))};
1227}
1228
1241__forceinline__ __device__ __host__
1242 double rocrand_log_normal_double(rocrand_state_threefry4x64_20* state, double mean, double stddev)
1243{
1244 double r = rocrand_device::detail::normal_distribution_double(rocrand(state));
1245 return exp(mean + (stddev * r));
1246}
1247
1262__forceinline__ __device__ __host__
1263double2 rocrand_log_normal_double2(rocrand_state_threefry4x64_20* state, double mean, double stddev)
1264{
1265 auto state1 = rocrand(state);
1266 auto state2 = rocrand(state);
1267
1268 double2 r = rocrand_device::detail::normal_distribution_double2(ulonglong2{state1, state2});
1269 return double2{exp(mean + (stddev * r.x)), exp(mean + (stddev * r.y))};
1270}
1271 // end of group rocranddevice
1273
1274#endif // ROCRAND_LOG_NORMAL_H_
rocrand_log_normal_double
__forceinline__ __device__ __host__ double rocrand_log_normal_double(rocrand_state_philox4x32_10 *state, double mean, double stddev)
Returns a log-normally distributed double values.
Definition rocrand_log_normal.h:155
rocrand4
__forceinline__ __device__ __host__ uint4 rocrand4(rocrand_state_philox4x32_10 *state)
Returns four uniformly distributed random unsigned int values from [0; 2^32 - 1] range.
Definition rocrand_philox4x32_10.h:377
rocrand_log_normal4
__forceinline__ __device__ __host__ float4 rocrand_log_normal4(rocrand_state_philox4x32_10 *state, float mean, float stddev)
Returns four log-normally distributed float values.
Definition rocrand_log_normal.h:127
rocrand_log_normal
__forceinline__ __device__ __host__ float rocrand_log_normal(rocrand_state_philox4x32_10 *state, float mean, float stddev)
Returns a log-normally distributed float value.
Definition rocrand_log_normal.h:67
rocrand_log_normal2
__forceinline__ __device__ __host__ float2 rocrand_log_normal2(rocrand_state_philox4x32_10 *state, float mean, float stddev)
Returns two log-normally distributed float values.
Definition rocrand_log_normal.h:100
rocrand_log_normal_double4
__forceinline__ __device__ __host__ double4 rocrand_log_normal_double4(rocrand_state_philox4x32_10 *state, double mean, double stddev)
Returns four log-normally distributed double values.
Definition rocrand_log_normal.h:208
rocrand_log_normal_double2
__forceinline__ __device__ __host__ double2 rocrand_log_normal_double2(rocrand_state_philox4x32_10 *state, double mean, double stddev)
Returns two log-normally distributed double values.
Definition rocrand_log_normal.h:184
rocrand
__forceinline__ __device__ __host__ unsigned int rocrand(rocrand_state_lfsr113 *state)
Returns uniformly distributed random unsigned int value from [0; 2^32 - 1] range.
Definition rocrand_lfsr113.h:277