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

Function get_random_data

example/example_utils.hpp:50–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49template<class T>
50inline auto get_random_data(size_t size, T min, T max)
51 -> typename std::enable_if<std::is_integral<T>::value, std::vector<T>>::type
52{
53 std::random_device rd;
54 std::default_random_engine gen(rd());
55 std::uniform_int_distribution<T> distribution(min, max);
56 std::vector<T> data(size);
57 std::generate(data.begin(), data.end(), [&]() { return distribution(gen); });
58 return data;
59}
60
61template<class T>
62inline void hip_read_device_memory(std::vector<T> &host_destination, T *device_source)

Callers

nothing calls this directly

Calls 1

generateFunction · 0.85

Tested by

no test coverage detected