Skip to content

Commit a98fb0c

Browse files
committed
Reorder declarations to minimise padding
1 parent 36f4238 commit a98fb0c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

external/Actor.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@
3636

3737
class Actor {
3838
private:
39-
sycl::float2 pos;
40-
sycl::float2 velocity;
41-
float desiredSpeed;
42-
int pathId;
43-
int destinationIndex;
44-
float mass;
45-
float radius;
46-
bool atDestination;
47-
std::array<int, 3> color;
48-
std::array<int, 2> bBox;
49-
uint seed;
50-
float force;
39+
std::array<int, 3> color; // 12 bytes
40+
sycl::float2 pos; // 8 bytes
41+
sycl::float2 velocity; // 8 bytes
42+
std::array<int, 2> bBox; // 8 bytes
43+
float desiredSpeed; // 4 bytes
44+
int pathId; // 4 bytes
45+
int destinationIndex; // 4 bytes
46+
float mass; // 4 bytes
47+
float radius; // 4 bytes
48+
uint seed; // 4 bytes
49+
float force; // 4 bytes
50+
bool atDestination; // 1 byte
5151

5252
public:
5353
Actor(sycl::float2 pPos, sycl::float2 pVelocity, float pdesiredSpeed, int pPathId,

external/Path.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const int PATHALLOCATIONSIZE = 10;
3737

3838
class Path {
3939
private:
40-
int id;
4140
std::array<std::array<sycl::float2, 2>, PATHALLOCATIONSIZE> checkpoints;
41+
int id;
4242
int pathSize;
4343

4444
public:

0 commit comments

Comments
 (0)