MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / fillIntTest

Function fillIntTest

test/OpenCL/ParallelPrimitives/main.cpp:77–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77inline void fillIntTest()
78{
79 TEST_INIT;
80
81 b3FillCL* fillCL = new b3FillCL(g_context, g_device, g_queue);
82 int maxSize = 1024 * 256;
83 b3OpenCLArray<int> intBuffer(g_context, g_queue, maxSize);
84 intBuffer.resize(maxSize);
85
86#define NUM_TESTS 7
87
88 int dx = maxSize / NUM_TESTS;
89 for (int iter = 0; iter < NUM_TESTS; iter++)
90 {
91 int size = b3Min(11 + dx * iter, maxSize);
92
93 int value = 2;
94
95 int offset = 0;
96 fillCL->execute(intBuffer, value, size, offset);
97
98 b3AlignedObjectArray<int> hostBuf2;
99 hostBuf2.resize(size);
100 fillCL->executeHost(hostBuf2, value, size, offset);
101
102 b3AlignedObjectArray<int> hostBuf;
103 intBuffer.copyToHost(hostBuf);
104
105 for (int i = 0; i < size; i++)
106 {
107 TEST_ASSERT(hostBuf[i] == hostBuf2[i]);
108 TEST_ASSERT(hostBuf[i] == hostBuf2[i]);
109 }
110 }
111
112 delete fillCL;
113
114 TEST_REPORT("fillIntTest");
115}
116
117__inline void seedRandom(int seed)
118{

Callers 1

mainFunction · 0.85

Calls 4

copyToHostMethod · 0.80
resizeMethod · 0.45
executeMethod · 0.45
executeHostMethod · 0.45

Tested by

no test coverage detected