Class CUDAScanCompaction

Class Documentation

class flamegpu::CUDAScanCompaction

Utility for managing storage of scan/compaction buffers shared between all functions of a particular stream

Public Types

enum Type

Different scan reasons have different buffers, as it’s possible an agent function uses all at once

Values:

enumerator MESSAGE_OUTPUT
enumerator AGENT_DEATH
enumerator AGENT_OUTPUT

Public Functions

inline CUDAScanCompaction()

Default constructor

CUDAScanCompaction(CUDAScanCompaction const&) = delete

Copy construction is disabled

void operator=(CUDAScanCompaction const&) = delete

Assignment is disabled

void purge()

Wipes out host mirrors of device memory Only really to be used after calls to cudaDeviceReset() CUDAScanCompaction methods

Note

Only currently used after some tests

void resize(const unsigned int &newCount, const Type &type, const unsigned int &streamId)

Resize the scan flag buffer for the specified stream and type for the provided number of items

Parameters
  • newCount – The number of scan flags that the resized buffer must be able to hold

  • type – The type of the scan flag buffer to be resized

  • streamId – The stream index of the scan flag buffer to be resized

void zero(const Type &type, const unsigned int &streamId)

Reset all scan flags in the buffer for the specified stream and type to zero

Parameters
  • type – The type of the scan flag buffer to be zerod

  • streamId – The stream index of the scan flag buffer to be zerod

const CUDAScanCompactionConfig &getConfig(const Type &type, const unsigned int &streamId)

Returns a const reference to the scan flag config structure for the specified stream and type

See

Config() for the non-const variant.

Parameters
  • type – The type of the scan flag buffer to return

  • streamId – The stream index of the scan flag buffer to return

CUDAScanCompactionConfig &Config(const Type &type, const unsigned int &streamId)

Returns a reference to the scan flag config structure for the specified stream and type

See

getConfig() for the const variant.

Parameters
  • type – The type of the scan flag buffer to return

  • streamId – The stream index of the scan flag buffer to return

Public Static Attributes

static const unsigned int MAX_TYPES = 3

Number of valid values in Type

static const unsigned int MAX_STREAMS = 128

As of Compute Capability 7.5; 128 is the max concurrent streams