MCPcopy Create free account
hub / github.com/ROCm/rocPRIM / get_random_samples

Function get_random_samples

test/rocprim/test_device_histogram.cpp:83–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81// (correctly handling test cases like uchar [0, 256), ushort [0, 65536))
82template<class T, class U>
83inline auto get_random_samples(size_t size, U min, U max, int seed_value) ->
84 typename std::enable_if<rocprim::is_integral<T>::value, std::vector<T>>::type
85{
86 const long long min1 = static_cast<long long>(min);
87 const long long max1 = static_cast<long long>(max);
88 const long long d = max1 - min1;
89 return test_utils::get_random_data_wrapped<T>(
90 size,
91 static_cast<T>(
92 std::max(min1 - d / 10, static_cast<long long>(rocprim::numeric_limits<T>::lowest()))),
93 static_cast<T>(
94 std::min(max1 + d / 10, static_cast<long long>(rocprim::numeric_limits<T>::max()))),
95 seed_value);
96}
97
98template<class T, class U>
99inline auto get_random_samples(size_t size, U min, U max, int seed_value) ->

Callers

nothing calls this directly

Calls 2

maxFunction · 0.50
minFunction · 0.50

Tested by

no test coverage detected