MCPcopy Create free account
hub / github.com/AdaptiveCpp/AdaptiveCpp / all_bytes_equal

Function all_bytes_equal

include/hipSYCL/algorithms/algorithm.hpp:42–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41template<class T>
42bool all_bytes_equal(const T& val, unsigned char& byte_value) {
43 std::array<unsigned char, sizeof(T)> buff;
44 std::memcpy(buff.data(), &val, sizeof(T));
45
46 for(int i = 0; i < sizeof(T); ++i) {
47 if(buff[i] != buff[0])
48 return false;
49 }
50 byte_value = buff[0];
51 return true;
52}
53
54inline bool should_use_memcpy(const sycl::device& dev) {
55#ifdef __ACPP_STDPAR_ENABLE_AUTO_MULTIQUEUE__

Callers 1

fillFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected