Skip to content
Snippets Groups Projects

WIP: Index vectorization

Closed Slattery, Stuart requested to merge (removed):index_opt into master
Files
2
+ 5
20
@@ -648,10 +648,7 @@ class AoSoA<MemberDataTypes<Types...>,Properties...>
struct_member_reference_type<M> >::type
access( const int struct_index, const int array_index ) const
{
return
reinterpret_cast<struct_member_array_type<M> >(
static_cast<struct_member_pointer_type<M> >(_data[struct_index]) + struct_index * stride(M)
)[array_index];
return accessStructMember<M>( struct_index, array_index );
}
// Rank 1
@@ -662,10 +659,7 @@ class AoSoA<MemberDataTypes<Types...>,Properties...>
access( const int struct_index, const int array_index,
const int d0 ) const
{
return
reinterpret_cast<struct_member_array_type<M> >(
static_cast<struct_member_pointer_type<M> >(_data[struct_index]) + struct_index * stride(M)
)[array_index][d0];
return accessStructMember<M>( struct_index, array_index, d0 );
}
// Rank 2
@@ -677,10 +671,7 @@ class AoSoA<MemberDataTypes<Types...>,Properties...>
const int d0,
const int d1 ) const
{
return
reinterpret_cast<struct_member_array_type<M> >(
static_cast<struct_member_pointer_type<M> >(_data[struct_index]) + struct_index * stride(M)
)[array_index][d0][d1];
return accessStructMember<M>( struct_index, array_index, d0, d1 );
}
// Rank 3
@@ -693,10 +684,7 @@ class AoSoA<MemberDataTypes<Types...>,Properties...>
const int d1,
const int d2 ) const
{
return
reinterpret_cast<struct_member_array_type<M> >(
static_cast<struct_member_pointer_type<M> >(_data[struct_index]) + struct_index * stride(M)
)[array_index][d0][d1][d2];
return accessStructMember<M>( struct_index, array_index, d0, d1, d2 );
}
// Rank 4
@@ -710,10 +698,7 @@ class AoSoA<MemberDataTypes<Types...>,Properties...>
const int d2,
const int d3 ) const
{
return
reinterpret_cast<struct_member_array_type<M> >(
static_cast<struct_member_pointer_type<M> >(_data[struct_index]) + struct_index * stride(M)
)[array_index][d0][d1][d2][d3];
return accessStructMember<M>( struct_index, array_index, d0, d1, d2, d3 );
}
// -------------------------------
Loading