MCPcopy Create free account
hub / github.com/CRVI/OpenCLIPP / PrepareBuffer

Method PrepareBuffer

C++/programs/Statistics.cpp:46–64  ·  view source on GitHub ↗

Statistics

Source from the content-addressed store, hash-verified

44
45// Statistics
46void Statistics::PrepareBuffer(const ImageBase& Source)
47{
48 size_t NbGroups = (size_t) GetNbGroups(Source);
49
50 // We need space for 4 channels + another space for the number of pixels
51 size_t BufferSize = NbGroups * (4 + 1);
52
53 if (m_PartialResultBuffer != nullptr &&
54 m_PartialResultBuffer->Size() == BufferSize * sizeof(float) &&
55 m_PartialResult.size() == BufferSize)
56 {
57 return;
58 }
59
60 m_PartialResult.assign(BufferSize, 0);
61
62 m_PartialResultBuffer.reset();
63 m_PartialResultBuffer = make_shared<Buffer>(*m_CL, m_PartialResult.data(), BufferSize);
64}
65
66void Statistics::PrepareCoords(const ImageBase& Source)
67{

Callers

nothing calls this directly

Calls 1

GetNbGroupsFunction · 0.85

Tested by

no test coverage detected