7#ifndef PXR_EXEC_VDF_VECTOR_IMPL_DISPATCH_H
8#define PXR_EXEC_VDF_VECTOR_IMPL_DISPATCH_H
17PXR_NAMESPACE_OPEN_SCOPE
23template <
typename T >
24class Vdf_VectorImplDispatch {
26 using Memcopyable = std::is_trivially_copyable<T>;
29 static void Copy(T *dest,
const T *source,
size_t size) {
30 _Copy(dest, source, size, Memcopyable());
34 static void Copy(T *dest,
const T *source,
const VdfMask::Bits &bits) {
36 View platforms = bits.GetPlatformsView();
37 for (View::const_iterator it=platforms.begin(), e=platforms.end();
40 const size_t index = *it;
41 Copy(dest + index, source + index, it.GetPlatformSize());
50 U *dest,
const U *source,
size_t size,
const std::false_type &) {
51 std::copy(source, source + size, dest);
57 U *dest,
const U *source,
size_t size,
const std::true_type &) {
58 memcpy(dest, source,
sizeof(T) * size);
62PXR_NAMESPACE_CLOSE_SCOPE
Fast, compressed bit array which is capable of performing logical operations without first decompress...
View< Mode::Platforms > PlatformsView
Returns an iteratable view for the bits that steps over all platforms.