From 4d255dd06db8fc4ea346df327af9643d0c55c60a Mon Sep 17 00:00:00 2001
From: Mondus
Date: Tue, 25 Oct 2022 17:16:24 +0100
Subject: [PATCH 01/13] all int, unsigned int and bool
---
.../exception/FLAMEGPUDeviceException.cuh | 4 +-
.../flamegpu/exception/FLAMEGPUException.h | 2 +-
include/flamegpu/gpu/CUDAAgent.h | 28 ++++-----
include/flamegpu/gpu/CUDAAgentStateList.h | 14 ++---
include/flamegpu/gpu/CUDAFatAgent.h | 16 ++---
include/flamegpu/gpu/CUDAFatAgentStateList.h | 24 ++++----
include/flamegpu/gpu/CUDAMessage.h | 6 +-
include/flamegpu/gpu/CUDAScanCompaction.h | 8 +--
include/flamegpu/gpu/CUDAScatter.cuh | 58 +++++++++----------
include/flamegpu/gpu/CUDASimulation.h | 2 +-
include/flamegpu/io/JSONLogger.h | 2 +-
include/flamegpu/io/JSONStateWriter.h | 2 +-
include/flamegpu/io/StateWriter.h | 2 +-
include/flamegpu/io/StateWriterFactory.h | 2 +-
include/flamegpu/io/XMLLogger.h | 2 +-
include/flamegpu/io/XMLStateWriter.h | 2 +-
.../flamegpu/model/AgentFunctionDescription.h | 12 ++--
.../flamegpu/model/EnvironmentDescription.h | 2 +-
include/flamegpu/model/SubModelDescription.h | 2 +-
include/flamegpu/model/Variable.h | 2 +-
include/flamegpu/pop/AgentInstance.h | 8 +--
include/flamegpu/pop/AgentVector_Agent.h | 8 +--
include/flamegpu/pop/DeviceAgentVector_impl.h | 6 +-
include/flamegpu/runtime/DeviceAPI.cuh | 16 ++---
include/flamegpu/runtime/HostAPI.h | 6 +-
include/flamegpu/runtime/HostNewAgentAPI.h | 8 +--
.../MessageArray/MessageArrayDevice.cuh | 24 ++++----
.../MessageArray2D/MessageArray2DDevice.cuh | 40 ++++++-------
.../MessageArray3D/MessageArray3DDevice.cuh | 40 ++++++-------
.../MessageBruteForceDevice.cuh | 8 +--
.../MessageBucket/MessageBucketDevice.cuh | 4 +-
.../MessageBucket/MessageBucketHost.h | 2 +-
.../MessageSpatial2D/MessageSpatial2DHost.h | 2 +-
.../MessageSpatial3D/MessageSpatial3DHost.h | 2 +-
.../runtime/utility/DeviceEnvironment.cuh | 4 +-
.../runtime/utility/EnvironmentManager.cuh | 4 +-
.../runtime/utility/HostEnvironment.cuh | 2 +-
include/flamegpu/sim/LogFrame.h | 10 ++--
include/flamegpu/sim/LoggingConfig.h | 2 +-
include/flamegpu/sim/RunPlan.h | 6 +-
include/flamegpu/sim/RunPlanVector.h | 10 ++--
include/flamegpu/util/Any.h | 2 +-
.../exception/FLAMEGPUDeviceException.cu | 4 +-
src/flamegpu/exception/FLAMEGPUException.cpp | 2 +-
src/flamegpu/gpu/CUDAAgent.cu | 20 +++----
src/flamegpu/gpu/CUDAAgentStateList.cu | 10 ++--
src/flamegpu/gpu/CUDAEnsemble.cu | 2 +-
src/flamegpu/gpu/CUDAFatAgent.cu | 12 ++--
src/flamegpu/gpu/CUDAFatAgentStateList.cu | 18 +++---
src/flamegpu/gpu/CUDAMessage.cu | 6 +-
src/flamegpu/gpu/CUDAScanCompaction.cu | 8 +--
src/flamegpu/gpu/CUDAScatter.cu | 56 +++++++++---------
src/flamegpu/gpu/CUDASimulation.cu | 2 +-
src/flamegpu/io/JSONLogger.cu | 2 +-
src/flamegpu/io/JSONStateWriter.cpp | 2 +-
src/flamegpu/io/XMLLogger.cu | 2 +-
src/flamegpu/io/XMLStateWriter.cpp | 2 +-
.../model/AgentFunctionDescription.cpp | 4 +-
src/flamegpu/model/SubModelDescription.cpp | 2 +-
src/flamegpu/pop/DeviceAgentVector_impl.cu | 4 +-
src/flamegpu/runtime/HostAPI.cu | 2 +-
.../runtime/detail/curve/curve_rtc.cpp | 2 +-
.../runtime/messaging/MessageBucket.cu | 2 +-
.../runtime/messaging/MessageSpatial2D.cu | 2 +-
.../runtime/messaging/MessageSpatial3D.cu | 2 +-
.../runtime/utility/HostEnvironment.cu | 2 +-
src/flamegpu/sim/LogFrame.cu | 8 +--
src/flamegpu/sim/LoggingConfig.cu | 2 +-
src/flamegpu/sim/RunPlan.cpp | 6 +-
src/flamegpu/sim/RunPlanVector.cpp | 10 ++--
.../util/detail/compute_capability.cu | 2 +-
swig/python/flamegpu.i | 8 +--
tests/test_cases/pop/test_agent_instance.cu | 4 +-
tests/test_cases/pop/test_agent_vector.cu | 4 +-
.../host_reduction/test_histogram_even.cu | 2 +-
tests/test_cases/sim/test_RunPlanVector.cu | 6 +-
76 files changed, 314 insertions(+), 314 deletions(-)
diff --git a/include/flamegpu/exception/FLAMEGPUDeviceException.cuh b/include/flamegpu/exception/FLAMEGPUDeviceException.cuh
index 133d33236..c7000756c 100644
--- a/include/flamegpu/exception/FLAMEGPUDeviceException.cuh
+++ b/include/flamegpu/exception/FLAMEGPUDeviceException.cuh
@@ -23,8 +23,8 @@ class DeviceExceptionManager {
* Free all device memory
*/
~DeviceExceptionManager();
- DeviceExceptionBuffer *getDevicePtr(const unsigned int &streamId, const cudaStream_t &stream);
- void checkError(const std::string &function, const unsigned int &streamId, const cudaStream_t &stream);
+ DeviceExceptionBuffer *getDevicePtr(unsigned int streamId, const cudaStream_t &stream);
+ void checkError(const std::string &function, unsigned int streamId, const cudaStream_t &stream);
private:
/**
diff --git a/include/flamegpu/exception/FLAMEGPUException.h b/include/flamegpu/exception/FLAMEGPUException.h
index e31396278..9c24e641f 100644
--- a/include/flamegpu/exception/FLAMEGPUException.h
+++ b/include/flamegpu/exception/FLAMEGPUException.h
@@ -38,7 +38,7 @@ class FLAMEGPUException : public std::exception {
/**
* Sets internal members file and line, which are used by constructor
*/
- static void setLocation(const char *_file, const unsigned int &_line);
+ static void setLocation(const char *_file, unsigned int _line);
protected:
/**
diff --git a/include/flamegpu/gpu/CUDAAgent.h b/include/flamegpu/gpu/CUDAAgent.h
index f41995460..393a9e1c6 100644
--- a/include/flamegpu/gpu/CUDAAgent.h
+++ b/include/flamegpu/gpu/CUDAAgent.h
@@ -69,7 +69,7 @@ class CUDAAgent : public AgentInterface {
* @note TODO: This could be improved by iterating the variable list within the state_list, rather than individually looking up vars (the two lists should have all the same vars)
* @note This should probably be addressed when curve is updated to not use individual memcpys
*/
- void mapRuntimeVariables(const AgentFunctionData& func, const unsigned int &instance_id) const;
+ void mapRuntimeVariables(const AgentFunctionData& func, unsigned int instance_id) const;
/**
* Copies population data from the provided host object
* To the device buffers held by this object (overwriting any existing agent data)
@@ -81,7 +81,7 @@ class CUDAAgent : public AgentInterface {
* @param stream CUDA stream to be used for async CUDA operations
* @note Scatter is required for initialising submodel vars
*/
- void setPopulationData(const AgentVector& population, const std::string &state_name, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t& stream);
+ void setPopulationData(const AgentVector& population, const std::string &state_name, CUDAScatter &scatter, unsigned int streamId, const cudaStream_t& stream);
/**
* Copies population data the device buffers held by this object
* To the hosts object (overwriting any existing agent data)
@@ -116,9 +116,9 @@ class CUDAAgent : public AgentInterface {
* @param scatter Scatter instance and scan arrays to be used (CUDASimulation::singletons->scatter)
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
- * @see CUDAFatAgent::processDeath(const unsigned int &, const std::string &, const unsigned int &)
+ * @see CUDAFatAgent::processDeath(unsigned int, const std::string &, unsigned int)
*/
- void processDeath(const AgentFunctionData& func, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ void processDeath(const AgentFunctionData& func, CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Transitions all active agents from the source state to the destination state
* @param _src The source state
@@ -126,9 +126,9 @@ class CUDAAgent : public AgentInterface {
* @param scatter Scatter instance and scan arrays to be used (CUDASimulation::singletons->scatter)
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
- * @see CUDAFatAgent::transitionState(const unsigned int &, const std::string &, const std::string &, const unsigned int &)
+ * @see CUDAFatAgent::transitionState(unsigned int, const std::string &, const std::string &, unsigned int)
*/
- void transitionState(const std::string &_src, const std::string &_dest, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ void transitionState(const std::string &_src, const std::string &_dest, CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Scatters agents based on their output of the agent function condition
* Agents which failed the condition are scattered to the front and marked as disabled
@@ -137,11 +137,11 @@ class CUDAAgent : public AgentInterface {
* @param scatter Scatter instance and scan arrays to be used (CUDASimulation::singletons->scatter)
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
- * @see CUDAFatAgent::processFunctionCondition(const unsigned int &, const unsigned int &)
+ * @see CUDAFatAgent::processFunctionCondition(unsigned int, unsigned int)
* @note Named state must not already contain disabled agents
* @note The disabled agents are re-enabled using clearFunctionCondition(const std::string &)
*/
- void processFunctionCondition(const AgentFunctionData& func, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ void processFunctionCondition(const AgentFunctionData& func, CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Scatters agents from the provided device buffer, this is used for host agent creation
* The device buffer must be packed according to the param offsets
@@ -153,7 +153,7 @@ class CUDAAgent : public AgentInterface {
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
*/
- void scatterHostCreation(const std::string &state_name, const unsigned int &newSize, char *const d_inBuff, const VarOffsetStruct &offsets, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ void scatterHostCreation(const std::string &state_name, unsigned int newSize, char *const d_inBuff, const VarOffsetStruct &offsets, CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Sorts all agent variables according to the positions stored inside Message Output scan buffer
* @param state_name The state agents are scattered into
@@ -183,14 +183,14 @@ class CUDAAgent : public AgentInterface {
void releaseNewBuffer(const AgentFunctionData& func);
/**
* Scatters agents from the currently assigned device agent birth buffer (see member variable newBuffs)
- * The device buffer must be packed in the same format as mapNewRuntimeVariables(const AgentFunctionData&, const unsigned int &, const unsigned int &)
+ * The device buffer must be packed in the same format as mapNewRuntimeVariables(const AgentFunctionData&, unsigned int, unsigned int)
* @param func The agent function being processed
* @param newSize The maximum number of new agents (this will be the size of the agent state executing func)
* @param scatter Scatter instance and scan arrays to be used (CUDASimulation::singletons->scatter)
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
*/
- void scatterNew(const AgentFunctionData& func, const unsigned int &newSize, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ void scatterNew(const AgentFunctionData& func, unsigned int newSize, CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Reenables all disabled agents within the named state
* @param state The named state to enable all agents within
@@ -240,7 +240,7 @@ class CUDAAgent : public AgentInterface {
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
*/
- void initUnmappedVars(CUDAScatter& scatter, const unsigned int& streamId, const cudaStream_t& stream);
+ void initUnmappedVars(CUDAScatter& scatter, unsigned int streamId, const cudaStream_t& stream);
/**
* Initialises any agent variables within the CUDAFatAgentStateList of state which are not present in the agent-state's CUDAAgentStateList
* @param state Affected state
@@ -250,7 +250,7 @@ class CUDAAgent : public AgentInterface {
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
*/
- void initExcludedVars(const std::string& state, const unsigned int& count, const unsigned int& offset, CUDAScatter& scatter, const unsigned int& streamId, const cudaStream_t& stream);
+ void initExcludedVars(const std::string& state, unsigned int count, unsigned int offset, CUDAScatter& scatter, unsigned int streamId, const cudaStream_t& stream);
/**
* Resets the number of agents in every statelist to 0
*/
@@ -275,7 +275,7 @@ class CUDAAgent : public AgentInterface {
* @param newSize Number of active agents
* @throw exception::InvalidMemoryCapacity If the new number of disabled + active agents would exceed currently allocated buffer capacity
*/
- void setStateAgentCount(const std::string& state, const unsigned int &newSize);
+ void setStateAgentCount(const std::string& state, unsigned int newSize);
/**
* Returns a list of variable buffers attached to bound agents, not available in this agent
* @param state The state affected state
diff --git a/include/flamegpu/gpu/CUDAAgentStateList.h b/include/flamegpu/gpu/CUDAAgentStateList.h
index 1443eaafd..2bc1c1d9a 100644
--- a/include/flamegpu/gpu/CUDAAgentStateList.h
+++ b/include/flamegpu/gpu/CUDAAgentStateList.h
@@ -31,7 +31,7 @@ class CUDAAgentStateList {
CUDAAgentStateList(
const std::shared_ptr &fat_list,
CUDAAgent& cuda_agent,
- const unsigned int &_fat_index,
+ unsigned int _fat_index,
const AgentData& description,
bool _isSubStateList = false);
/**
@@ -46,7 +46,7 @@ class CUDAAgentStateList {
CUDAAgentStateList(
const std::shared_ptr &fat_list,
CUDAAgent& cuda_agent,
- const unsigned int &_fat_index,
+ unsigned int _fat_index,
const AgentData& description,
bool _isSubStateList,
const SubAgentData::Mapping &mapping);
@@ -56,7 +56,7 @@ class CUDAAgentStateList {
* @param minimumSize The minimum number of agents that must be representable
* @param retainData If true existing buffer data is retained
* @param stream The stream used to perform memcpys if data is retained
- * @see CUDAFatAgentStateList::resize(const unsigned int &, const bool &)
+ * @see CUDAFatAgentStateList::resize(unsigned int, bool)
*/
void resize(unsigned int minimumSize, bool retainData, cudaStream_t stream);
/**
@@ -105,7 +105,7 @@ class CUDAAgentStateList {
void scatterSort_async(CUDAScatter &scatter, unsigned int streamId, cudaStream_t stream);
/**
* Scatters agents from the currently assigned device agent birth buffer (see member variable newBuffs)
- * The device buffer must be packed in the same format as CUDAAgent::mapNewRuntimeVariables(const AgentFunctionData&, const unsigned int &, const unsigned int &)
+ * The device buffer must be packed in the same format as CUDAAgent::mapNewRuntimeVariables(const AgentFunctionData&, unsigned int, unsigned int)
* @param d_newBuff The buffer holding the new agent data
* @param newSize The maximum number of new agents (this will be the size of the agent state executing func)
* @param scatter Scatter instance and scan arrays to be used
@@ -124,7 +124,7 @@ class CUDAAgentStateList {
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
*/
- void initUnmappedVars(CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ void initUnmappedVars(CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Initialises any agent variables within the CUDAFatAgentStateList which are not present in this CUDAAgentStateList
* @param count Number of variables to init
@@ -133,7 +133,7 @@ class CUDAAgentStateList {
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
*/
- void initExcludedVars(const unsigned int& count, const unsigned int& offset, CUDAScatter& scatter, const unsigned int& streamId, const cudaStream_t& stream);
+ void initExcludedVars(unsigned int count, unsigned int offset, CUDAScatter& scatter, unsigned int streamId, const cudaStream_t& stream);
/**
* Returns the statelist to an empty state
* This resets the size to 0.
@@ -144,7 +144,7 @@ class CUDAAgentStateList {
* @param newSize Number of active agents
* @throw exception::InvalidMemoryCapacity If the new number of disabled + active agents would exceed currently allocated buffer capacity
*/
- void setAgentCount(const unsigned int& newSize);
+ void setAgentCount(unsigned int newSize);
/**
* Returns a list of variable buffers attached to bound agents, not available in this agent
* @note This access is only intended for DeviceAgentVector's correctly handling of subagents
diff --git a/include/flamegpu/gpu/CUDAFatAgent.h b/include/flamegpu/gpu/CUDAFatAgent.h
index 17634a6fc..3fba381bf 100644
--- a/include/flamegpu/gpu/CUDAFatAgent.h
+++ b/include/flamegpu/gpu/CUDAFatAgent.h
@@ -33,7 +33,7 @@ class CUDAFatAgent {
/**
* Index assigned to the agent when it is added to the CUDAFatAgent
* @note An index is used as two mapped agents from different models may share the same name
- * @see CUDAFatAgent::addSubAgent(const AgentData &, const unsigned int &, const std::shared_ptr &)
+ * @see CUDAFatAgent::addSubAgent(const AgentData &, unsigned int, const std::shared_ptr &)
*/
const unsigned int agent;
/**
@@ -78,14 +78,14 @@ class CUDAFatAgent {
*/
void addSubAgent(
const AgentData &description,
- const unsigned int &master_fat_index,
+ unsigned int master_fat_index,
const std::shared_ptr &mapping);
/**
* This function builds and returns the state_map required by the named CUDAAgent
* @param fat_index The index of the CUDAAgent within this CUDAFatAgent
* @return a statemap suitable for the named agent
*/
- std::unordered_map> getStateMap(const unsigned int &fat_index);
+ std::unordered_map> getStateMap(unsigned int fat_index);
/**
* Scatters all active agents within the named state to remove agents with death flag set
* This updates the alive agent count
@@ -95,7 +95,7 @@ class CUDAFatAgent {
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
*/
- void processDeath(const unsigned int &agent_fat_id, const std::string &state_name, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ void processDeath(unsigned int agent_fat_id, const std::string &state_name, CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Transitions all active agents from the source state to the destination state
* @param agent_fat_id The index of the CUDAAgent within this CUDAFatAgent
@@ -115,14 +115,14 @@ class CUDAFatAgent {
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
*/
- void processFunctionCondition(const unsigned int &agent_fat_id, const std::string &state_name, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ void processFunctionCondition(unsigned int agent_fat_id, const std::string &state_name, CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Marks the specified number of agents within the specified statelist as disabled
* @param agent_fat_id The index of the CUDAAgent within this CUDAFatAgent
* @param state_name The name of the state attached to the named fat agent index
* @param numberOfDisabled The number of agents to be marked as disabled
*/
- void setConditionState(const unsigned int &agent_fat_id, const std::string &state_name, const unsigned int numberOfDisabled);
+ void setConditionState(unsigned int agent_fat_id, const std::string &state_name, unsigned int numberOfDisabled);
/**
* Returns a device pointer of atleast type_size x new_agents bytes available
* @param total_agent_size Total number of bytes required to fit all variables in the agent
@@ -131,10 +131,10 @@ class CUDAFatAgent {
* @note It is assumed that when splitting the buffer into variables, each variable's sub-buffer will be 64 bit aligned
* @note New buffers are shared between all states and mapped/unmapped agents
*/
- void *allocNewBuffer(const size_t &total_agent_size, const unsigned int &new_agents, const size_t &varCount);
+ void *allocNewBuffer(const size_t &total_agent_size, unsigned int new_agents, const size_t &varCount);
/**
* Marks the named buffer as free
- * @param buff The buffer to free, this must be a pointer returned by allocNewBuffer(const size_t &, const unsigned int &, const size_t &)
+ * @param buff The buffer to free, this must be a pointer returned by allocNewBuffer(const size_t &, unsigned int, const size_t &)
*/
void freeNewBuffer(void *buff);
/**
diff --git a/include/flamegpu/gpu/CUDAFatAgentStateList.h b/include/flamegpu/gpu/CUDAFatAgentStateList.h
index 0931e1aed..717650425 100644
--- a/include/flamegpu/gpu/CUDAFatAgentStateList.h
+++ b/include/flamegpu/gpu/CUDAFatAgentStateList.h
@@ -160,15 +160,15 @@ class CUDAFatAgentStateList {
*/
void addSubAgentVariables(
const AgentData &description,
- const unsigned int &master_fat_index,
- const unsigned int &sub_fat_index,
+ unsigned int master_fat_index,
+ unsigned int sub_fat_index,
const std::shared_ptr &mapping);
/**
* Returns the VariableBuffer for the corresponding agent variable
* @param fat_index Fat index of the corresponding agent
* @param name Name of the variable within the corresponding agent
*/
- std::shared_ptr getVariableBuffer(const unsigned int &fat_index, const std::string &name);
+ std::shared_ptr getVariableBuffer(unsigned int fat_index, const std::string &name);
/**
* Resize all variable buffers
* @param minSize The minimum number of agents that must be representable
@@ -193,7 +193,7 @@ class CUDAFatAgentStateList {
* @param newCount New number of alive (and active agents)
* @param resetDisabled If true, the disableAgents count will be set to 0, else it will be added to newCount for the internal true alive count
*/
- void setAgentCount(const unsigned int &newCount, const bool &resetDisabled = false);
+ void setAgentCount(unsigned int newCount, bool resetDisabled = false);
/**
* Scatters all living agents (including disabled, according to the provided stream's death flag)
* @param scatter Scatter instance and scan arrays to be used (CUDASimulation::singletons->scatter)
@@ -201,7 +201,7 @@ class CUDAFatAgentStateList {
* @param stream CUDA stream to be used for async CUDA operations
* @return The number of agents that are still alive (this includes temporarily disabled agents due to agent function condition)
*/
- unsigned int scatterDeath(CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ unsigned int scatterDeath(CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Scatters all living agents which failed the agent function condition into the swap buffer (there should be no disabled at this time)
* This does not swap buffers or update disabledAgent)
@@ -209,9 +209,9 @@ class CUDAFatAgentStateList {
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
* @return The number of agents that were scattered (the number of agents which failed the condition)
- * @see scatterAgentFunctionConditionTrue(const unsigned int &, const unsigned int &)
+ * @see scatterAgentFunctionConditionTrue(unsigned int, unsigned int)
*/
- unsigned int scatterAgentFunctionConditionFalse(CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ unsigned int scatterAgentFunctionConditionFalse(CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Scatters all living agents which passed the agent function condition into the swap buffer (there should be no disabled at this time)
* Also swaps the buffers and sets the number of disabled agents
@@ -220,10 +220,10 @@ class CUDAFatAgentStateList {
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
* @return The number of agents that were scattered (the number of agents which passed the condition)
- * @see scatterAgentFunctionConditionFalse(const unsigned int &)
- * @see setConditionState(const unsigned int &)
+ * @see scatterAgentFunctionConditionFalse(unsigned int)
+ * @see setConditionState(unsigned int)
*/
- unsigned int scatterAgentFunctionConditionTrue(const unsigned int &conditionFailCount, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ unsigned int scatterAgentFunctionConditionTrue(unsigned int conditionFailCount, CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Sorts all agent variables according to the positions stored inside Message Output scan buffer
* @param scatter Scatter instance and scan arrays to be used (CUDASimulation::singletons->scatter)
@@ -236,7 +236,7 @@ class CUDAFatAgentStateList {
* Updates member var disabledAgents and data_condition for every item inside variables_unique
* @param numberOfDisabled The new number of disabled agents (this can increase of decrease)
*/
- void setDisabledAgents(const unsigned int &numberOfDisabled);
+ void setDisabledAgents(unsigned int numberOfDisabled);
/**
* Resets the value of all variables not present in exclusionSet to their defaults
*
@@ -248,7 +248,7 @@ class CUDAFatAgentStateList {
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
*/
- void initVariables(std::set> &exclusionSet, const unsigned int initCount, const unsigned initOffset, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ void initVariables(std::set> &exclusionSet, const unsigned int initCount, const unsigned initOffset, CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
/**
* Returns the collection of unique variable buffers held by this CUDAFatAgentStateList
*/
diff --git a/include/flamegpu/gpu/CUDAMessage.h b/include/flamegpu/gpu/CUDAMessage.h
index 69d5ae326..dae5ebb67 100644
--- a/include/flamegpu/gpu/CUDAMessage.h
+++ b/include/flamegpu/gpu/CUDAMessage.h
@@ -58,7 +58,7 @@ class CUDAMessage {
* @note This should be used cautiously
* @note Required by array message types
*/
- void setMessageCount(const unsigned int &_message_count);
+ void setMessageCount(unsigned int _message_count);
/**
* Initialise the CUDAMessagelist
* This allocates and initialises any CUDA data structures for reading the messagelist, and sets them asthough the messagelist were empty.
@@ -92,7 +92,7 @@ class CUDAMessage {
* @param stream The CUDAStream to use for CUDA operations
* @note swap() or scatter() should be called after the agent function has written messages
*/
- void mapWriteRuntimeVariables(const AgentFunctionData& func, const CUDAAgent& cuda_agent, const unsigned int &writeLen, cudaStream_t stream) const;
+ void mapWriteRuntimeVariables(const AgentFunctionData& func, const CUDAAgent& cuda_agent, unsigned int writeLen, cudaStream_t stream) const;
void *getReadPtr(const std::string &var_name);
const CUDAMessageMap &getReadList() { return message_list->getReadList(); }
const CUDAMessageMap &getWriteList() { return message_list->getWriteList(); }
@@ -122,7 +122,7 @@ class CUDAMessage {
* @param streamId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
* @param stream CUDA stream to be used for async CUDA operations
*/
- void buildIndex(CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream);
+ void buildIndex(CUDAScatter &scatter, unsigned int streamId, const cudaStream_t &stream);
const void *getMetaDataDevicePtr() const;
protected:
diff --git a/include/flamegpu/gpu/CUDAScanCompaction.h b/include/flamegpu/gpu/CUDAScanCompaction.h
index 46e55f0a8..4b0c58d10 100644
--- a/include/flamegpu/gpu/CUDAScanCompaction.h
+++ b/include/flamegpu/gpu/CUDAScanCompaction.h
@@ -56,7 +56,7 @@ struct CUDAScanCompactionConfig {
* Resize the two scan buffers inside d_ptrs
* @param count The number of items required to fit in the resized buffers
*/
- void resize_scan_flag(const unsigned int& count);
+ void resize_scan_flag(unsigned int count);
/**
* Reset all data inside the two scan buffers to 0
* @param stream The CUDA stream used to execute the memset
@@ -104,7 +104,7 @@ class CUDAScanCompaction {
* @param type The type of the scan flag buffer to be resized
* @param streamId The stream index of the scan flag buffer to be resized
*/
- void resize(const unsigned int& newCount, const Type& type, const unsigned int& streamId);
+ void resize(unsigned int newCount, const Type& type, unsigned int streamId);
/**
* Reset all scan flags in the buffer for the specified stream and type to zero
* @param type The type of the scan flag buffer to be zerod
@@ -119,14 +119,14 @@ class CUDAScanCompaction {
* @param streamId The stream index of the scan flag buffer to return
* @see Config() for the non-const variant.
*/
- const CUDAScanCompactionConfig &getConfig(const Type& type, const unsigned int& streamId);
+ const CUDAScanCompactionConfig &getConfig(const Type& type, unsigned int streamId);
/**
* Returns a reference to the scan flag config structure for the specified stream and type
* @param type The type of the scan flag buffer to return
* @param streamId The stream index of the scan flag buffer to return
* @see getConfig() for the const variant.
*/
- CUDAScanCompactionConfig &Config(const Type& type, const unsigned int& streamId);
+ CUDAScanCompactionConfig &Config(const Type& type, unsigned int streamId);
private:
/**
diff --git a/include/flamegpu/gpu/CUDAScatter.cuh b/include/flamegpu/gpu/CUDAScatter.cuh
index f04068ab0..e88b332ac 100644
--- a/include/flamegpu/gpu/CUDAScatter.cuh
+++ b/include/flamegpu/gpu/CUDAScatter.cuh
@@ -41,7 +41,7 @@ class CUDAScatter {
__device__ InversionIterator operator++ (int a) { p += a; return *this; }
__device__ InversionIterator operator++ () { p++; return *this; }
__device__ unsigned int operator *() { return invert(*p); }
- __device__ InversionIterator operator+(const int &b) const { return InversionIterator(p + b); }
+ __device__ InversionIterator operator+(const int b) const { return InversionIterator(p + b); }
__device__ unsigned int operator[](int b) const { return invert(p[b]); }
private:
__device__ unsigned int invert(unsigned int c) const { return c == 0 ? 1 : 0; }
@@ -71,7 +71,7 @@ class CUDAScatter {
unsigned int data_len;
StreamData();
~StreamData();
- void resize(const unsigned int &newLen);
+ void resize(unsigned int newLen);
};
std::array streamResources;
std::array cubTemps;
@@ -98,16 +98,16 @@ class CUDAScatter {
* @note This is deprecated, unclear if still used
*/
unsigned int scatter(
- const unsigned int &streamResourceId,
+ unsigned int streamResourceId,
const cudaStream_t &stream,
const Type &messageOrAgent,
const VariableMap &vars,
const std::map &in,
const std::map &out,
- const unsigned int &itemCount,
- const unsigned int &out_index_offset = 0,
- const bool &invert_scan_flag = false,
- const unsigned int &scatter_all_count = 0);
+ unsigned int itemCount,
+ unsigned int out_index_offset = 0,
+ const bool invert_scan_flag = false,
+ unsigned int scatter_all_count = 0);
/**
* Scatters agents from SoA to SoA according to d_position flag
* Used for device agent creation and agent death
@@ -123,14 +123,14 @@ class CUDAScatter {
* @param scatter_all_count The number of agents at the start of in to be copied, ones after this use scanflag
*/
unsigned int scatter(
- const unsigned int &streamResourceId,
+ unsigned int streamResourceId,
const cudaStream_t &stream,
const Type &messageOrAgent,
const std::vector &scatterData,
- const unsigned int &itemCount,
- const unsigned int &out_index_offset = 0,
- const bool &invert_scan_flag = false,
- const unsigned int &scatter_all_count = 0);
+ unsigned int itemCount,
+ unsigned int out_index_offset = 0,
+ const bool invert_scan_flag = false,
+ unsigned int scatter_all_count = 0);
/**
* Scatters agents from SoA to SoA according to d_position flag as input_source, all variables are scattered
* Used for Host function sort agent
@@ -163,11 +163,11 @@ class CUDAScatter {
* @param scatter_all_count The number offset into the array where the scan began
*/
unsigned int scatterCount(
- const unsigned int &streamResourceId,
+ unsigned int streamResourceId,
const cudaStream_t &stream,
const Type &messageOrAgent,
- const unsigned int &itemCount,
- const unsigned int &scatter_all_count = 0);
+ unsigned int itemCount,
+ unsigned int scatter_all_count = 0);
/**
* Scatters a contigous block from SoA to SoA
* CUDAScanCompaction::scan_flag/position are not used
@@ -179,11 +179,11 @@ class CUDAScatter {
* @note If calling scatter() with itemCount == scatter_all_count works the same
*/
unsigned int scatterAll(
- const unsigned int &streamResourceId,
+ unsigned int streamResourceId,
const cudaStream_t &stream,
const std::vector &scatterData,
- const unsigned int &itemCount,
- const unsigned int &out_index_offset = 0);
+ unsigned int itemCount,
+ unsigned int out_index_offset = 0);
/**
* Convenience wrapper to scatterAll()
* @param streamResourceId The stream index to use for accessing stream specific resources such as scan compaction arrays and buffers
@@ -195,13 +195,13 @@ class CUDAScatter {
* @param out_index_offset The offset to be applied to the output index (e.g. if out already contains data)
*/
unsigned int scatterAll(
- const unsigned int &streamResourceId,
+ unsigned int streamResourceId,
const cudaStream_t &stream,
const VariableMap &vars,
const std::map &in,
const std::map &out,
- const unsigned int &itemCount,
- const unsigned int &out_index_offset);
+ unsigned int itemCount,
+ unsigned int out_index_offset);
/**
* Used for reordering messages from SoA to SoA
* Position information is taken using PBM data, rather than d_position
@@ -217,12 +217,12 @@ class CUDAScatter {
* @param d_pbm This is the PBM, it identifies at which index a bin's storage begins
*/
void pbm_reorder(
- const unsigned int &streamResourceId,
+ unsigned int streamResourceId,
const cudaStream_t &stream,
const VariableMap &vars,
const std::map &in,
const std::map &out,
- const unsigned int &itemCount,
+ unsigned int itemCount,
const unsigned int *d_bin_index,
const unsigned int *d_bin_sub_index,
const unsigned int *d_pbm);
@@ -237,12 +237,12 @@ class CUDAScatter {
* @param out_index_offset The offset to be applied to the ouput index (e.g. if out already contains data)
*/
void scatterNewAgents(
- const unsigned int &streamResourceId,
+ unsigned int streamResourceId,
const cudaStream_t &stream,
const std::vector &scatterData,
const size_t &totalAgentSize,
- const unsigned int &inCount,
- const unsigned int &out_index_offset);
+ unsigned int inCount,
+ unsigned int out_index_offset);
/**
* Broadcasts a single value for each variable to a contiguous block in SoA
* Used prior to device agent creation
@@ -291,13 +291,13 @@ class CUDAScatter {
* @param d_write_flag Device pointer to array for tracking how many messages output to each bin, caller responsibiltiy to ensure it is array_length or longer
*/
void arrayMessageReorder(
- const unsigned int &streamResourceId,
+ unsigned int streamResourceId,
const cudaStream_t &stream,
const VariableMap &vars,
const std::map &in,
const std::map &out,
- const unsigned int &itemCount,
- const unsigned int &array_length,
+ unsigned int itemCount,
+ unsigned int array_length,
unsigned int *d_write_flag = nullptr);
private:
diff --git a/include/flamegpu/gpu/CUDASimulation.h b/include/flamegpu/gpu/CUDASimulation.h
index 02cfb77b6..c83fd1b08 100644
--- a/include/flamegpu/gpu/CUDASimulation.h
+++ b/include/flamegpu/gpu/CUDASimulation.h
@@ -571,7 +571,7 @@ class CUDASimulation : public Simulation {
* @param streamId Stream index to perform scatter on
* @note called at the end of step() and after all init/hostLayer functions and exit conditions have finished
*/
- void processHostAgentCreation(const unsigned int &streamId);
+ void processHostAgentCreation(unsigned int streamId);
public:
typedef std::vector AgentDataBuffer;
diff --git a/include/flamegpu/io/JSONLogger.h b/include/flamegpu/io/JSONLogger.h
index 39ae8c56b..54b277587 100644
--- a/include/flamegpu/io/JSONLogger.h
+++ b/include/flamegpu/io/JSONLogger.h
@@ -129,7 +129,7 @@ class JSONLogger : public Logger{
* @note Templated as can't forward declare rapidjson::Writer
*/
template
- void writeAny(T &writer, const util::Any &value, const unsigned int &elements = 1) const;
+ void writeAny(T &writer, const util::Any &value, unsigned int elements = 1) const;
std::string out_path;
bool prettyPrint;
diff --git a/include/flamegpu/io/JSONStateWriter.h b/include/flamegpu/io/JSONStateWriter.h
index 30423e944..ce7aa28d3 100644
--- a/include/flamegpu/io/JSONStateWriter.h
+++ b/include/flamegpu/io/JSONStateWriter.h
@@ -30,7 +30,7 @@ class JSONStateWriter : public StateWriter {
const std::string &model_name,
const std::shared_ptr& env_manager,
const util::StringPairUnorderedMap> &model_state,
- const unsigned int &iterations,
+ unsigned int iterations,
const std::string &output_file,
const Simulation *sim_instance);
/**
diff --git a/include/flamegpu/io/StateWriter.h b/include/flamegpu/io/StateWriter.h
index acacbc169..457aa6baa 100644
--- a/include/flamegpu/io/StateWriter.h
+++ b/include/flamegpu/io/StateWriter.h
@@ -35,7 +35,7 @@ class StateWriter {
StateWriter(const std::string &_model_name,
const std::shared_ptr& _env_manager,
const util::StringPairUnorderedMap> &_model_state,
- const unsigned int &_iterations,
+ const unsigned int _iterations,
const std::string &output_file,
const Simulation *_sim_instance)
: model_state(_model_state)
diff --git a/include/flamegpu/io/StateWriterFactory.h b/include/flamegpu/io/StateWriterFactory.h
index ecc1acf42..222626961 100644
--- a/include/flamegpu/io/StateWriterFactory.h
+++ b/include/flamegpu/io/StateWriterFactory.h
@@ -41,7 +41,7 @@ class StateWriterFactory {
const std::string& model_name,
const std::shared_ptr& env_manager,
const util::StringPairUnorderedMap>& model_state,
- const unsigned int& iterations,
+ const unsigned int iterations,
const std::string& output_file,
const Simulation* sim_instance) {
const std::string extension = std::filesystem::path(output_file).extension().string();
diff --git a/include/flamegpu/io/XMLLogger.h b/include/flamegpu/io/XMLLogger.h
index b6a35955d..583bcc4a8 100644
--- a/include/flamegpu/io/XMLLogger.h
+++ b/include/flamegpu/io/XMLLogger.h
@@ -113,7 +113,7 @@ class XMLLogger : public Logger{
* @tparam T Instance of rapidjson::Writer or subclass (e.g. rapidjson::PrettyWriter)
* @note Templated as can't forward declare rapidjson::Writer
*/
- void writeAny(tinyxml2::XMLElement *element, const util::Any &value, const unsigned int &elements = 1) const;
+ void writeAny(tinyxml2::XMLElement *element, const util::Any &value, unsigned int elements = 1) const;
std::string out_path;
bool prettyPrint;
diff --git a/include/flamegpu/io/XMLStateWriter.h b/include/flamegpu/io/XMLStateWriter.h
index 139d54431..6c549cb2d 100644
--- a/include/flamegpu/io/XMLStateWriter.h
+++ b/include/flamegpu/io/XMLStateWriter.h
@@ -30,7 +30,7 @@ class XMLStateWriter : public StateWriter {
const std::string &model_name,
const std::shared_ptr& env_manager,
const util::StringPairUnorderedMap> &model_state,
- const unsigned int &iterations,
+ unsigned int iterations,
const std::string &output_file,
const Simulation *sim_instance);
/**
diff --git a/include/flamegpu/model/AgentFunctionDescription.h b/include/flamegpu/model/AgentFunctionDescription.h
index 20f7976ca..aa72f636b 100644
--- a/include/flamegpu/model/AgentFunctionDescription.h
+++ b/include/flamegpu/model/AgentFunctionDescription.h
@@ -122,7 +122,7 @@ class AgentFunctionDescription : public DependencyNode {
* @throws exception::InvalidMessageName If a message with the same name is not found within the model's hierarchy
* @throws exception::InvalidMessageName If the same message is already bound to the message input of this agent function
* @see AgentFunctionDescription::setMessageOutput(MessageDescription &)
- * @see AgentFunctionDescription::setMessageOutputOptional(const bool &) To configure whether all agents must output messages
+ * @see AgentFunctionDescription::setMessageOutputOptional(bool) To configure whether all agents must output messages
*/
void setMessageOutput(const std::string &message_name);
/**
@@ -133,7 +133,7 @@ class AgentFunctionDescription : public DependencyNode {
* @throws exception::InvalidMessageName If a message with the same name is not found within the model's hierarchy
* @throws exception::InvalidMessageName If the same message is already bound to the message input of this agent function
* @see AgentFunctionDescription::setMessageInput(const std::string &)
- * @see AgentFunctionDescription::setMessageOutputOptional(const bool &) To configure whether all agents must output messages
+ * @see AgentFunctionDescription::setMessageOutputOptional(bool) To configure whether all agents must output messages
*/
void setMessageOutput(MessageBruteForce::Description &message);
/**
@@ -143,7 +143,7 @@ class AgentFunctionDescription : public DependencyNode {
* @param output_is_optional True if not all agents executing this function will output messages
* @note Defaults to false
*/
- void setMessageOutputOptional(const bool &output_is_optional);
+ void setMessageOutputOptional(bool output_is_optional);
/**
* Sets the agent type that can be output during this agent function
* This is optional, and only one type of agent can be output per agent function
@@ -173,7 +173,7 @@ class AgentFunctionDescription : public DependencyNode {
* @see AgentFunctionDescription::getAllowAgentDeath()
* @note Defaults to false
*/
- void setAllowAgentDeath(const bool &has_death);
+ void setAllowAgentDeath(bool has_death);
/**
* Sets the function condition for the agent function
* This is an FLAMEGPU_AGENT_FUNCTION_CONDITION which returns a boolean value (true or false)
@@ -219,13 +219,13 @@ class AgentFunctionDescription : public DependencyNode {
/**
* @return A mutable reference to the message output optional configuration flag
* @see AgentFunctionDescription::getAgentOutputOptional()
- * @see AgentFunctionDescription::setAgentOutputOptional(const bool &)
+ * @see AgentFunctionDescription::setAgentOutputOptional(bool)
*/
bool &MessageOutputOptional();
/**
* @return A mutable reference to the allow agent death configuration flag
* @see AgentFunctionDescription::getAllowAgentDeath()
- * @see AgentFunctionDescription::setAllowAgentDeath(const bool &)
+ * @see AgentFunctionDescription::setAllowAgentDeath(bool)
*/
bool &AllowAgentDeath();
diff --git a/include/flamegpu/model/EnvironmentDescription.h b/include/flamegpu/model/EnvironmentDescription.h
index 6dff66b87..46d40fa27 100644
--- a/include/flamegpu/model/EnvironmentDescription.h
+++ b/include/flamegpu/model/EnvironmentDescription.h
@@ -53,7 +53,7 @@ class EnvironmentDescription {
* @param _is_const Is the property constant
* @param _data The data to initially fill the property with
*/
- PropData(const bool &_is_const, const util::Any &_data)
+ PropData(bool _is_const, const util::Any &_data)
: isConst(_is_const)
, data(_data) { }
bool isConst;
diff --git a/include/flamegpu/model/SubModelDescription.h b/include/flamegpu/model/SubModelDescription.h
index a1fa58f88..e545a2a99 100644
--- a/include/flamegpu/model/SubModelDescription.h
+++ b/include/flamegpu/model/SubModelDescription.h
@@ -96,7 +96,7 @@ class SubModelDescription : public DependencyNode {
* Set the maximum number of steps per execution of the submodel
* If 0 (default), unlimited however an exit condition is required
*/
- void setMaxSteps(const unsigned int &max_steps);
+ void setMaxSteps(unsigned int max_steps);
/**
* Return the current value of max steps, defaults to 0
* This is the maximum number of steps per call of the submodel
diff --git a/include/flamegpu/model/Variable.h b/include/flamegpu/model/Variable.h
index 381a26e58..fa79a093d 100644
--- a/include/flamegpu/model/Variable.h
+++ b/include/flamegpu/model/Variable.h
@@ -66,7 +66,7 @@ struct Variable {
* @tparam T The type of the variable, it's size and std::type_index are derived from this
*/
template
- explicit Variable(const unsigned int &N, const std::vector &_default_value)
+ explicit Variable(const unsigned int N, const std::vector &_default_value)
: type(typeid(T))
, type_size(sizeof(T))
, elements(N)
diff --git a/include/flamegpu/pop/AgentInstance.h b/include/flamegpu/pop/AgentInstance.h
index ca618c6ef..735286a29 100644
--- a/include/flamegpu/pop/AgentInstance.h
+++ b/include/flamegpu/pop/AgentInstance.h
@@ -55,7 +55,7 @@ class AgentInstance {
template
std::array getVariable(const std::string& variable_name) const;
template
- T getVariable(const std::string& variable_name, const unsigned int& index) const;
+ T getVariable(const std::string& variable_name, unsigned int index) const;
#ifdef SWIG
template
std::vector getVariableArray(const std::string& variable_name) const;
@@ -69,7 +69,7 @@ class AgentInstance {
template
void setVariable(const std::string& variable_name, const std::array& value);
template
- void setVariable(const std::string& variable_name, const unsigned int& index, const T& value);
+ void setVariable(const std::string& variable_name, unsigned int index, const T& value);
#ifdef SWIG
template
void setVariableArray(const std::string& variable_name, const std::vector& value);
@@ -128,7 +128,7 @@ std::array AgentInstance::getVariable(const std::string& variable_name) co
return rtn;
}
template
-T AgentInstance::getVariable(const std::string& variable_name, const unsigned int& index) const {
+T AgentInstance::getVariable(const std::string& variable_name, const unsigned int index) const {
const auto v_it = _data.find(variable_name);
if (v_it == _data.end()) {
THROW exception::InvalidAgentVar("Variable with name '%s' was not found in agent, "
@@ -232,7 +232,7 @@ void AgentInstance::setVariable(const std::string& variable_name, const std::arr
memcpy(static_cast(v_buff.ptr), value.data(), sizeof(T) * N);
}
template
-void AgentInstance::setVariable(const std::string& variable_name, const unsigned int& index, const T& value) {
+void AgentInstance::setVariable(const std::string& variable_name, const unsigned int index, const T& value) {
const auto v_it = _data.find(variable_name);
if (v_it == _data.end()) {
THROW exception::InvalidAgentVar("Variable with name '%s' was not found in agent, "
diff --git a/include/flamegpu/pop/AgentVector_Agent.h b/include/flamegpu/pop/AgentVector_Agent.h
index 40c507d61..6e64aed8e 100644
--- a/include/flamegpu/pop/AgentVector_Agent.h
+++ b/include/flamegpu/pop/AgentVector_Agent.h
@@ -38,7 +38,7 @@ class AgentVector_CAgent {
template
std::array getVariable(const std::string& variable_name) const;
template
- T getVariable(const std::string& variable_name, const unsigned int& index) const;
+ T getVariable(const std::string& variable_name, unsigned int index) const;
#ifdef SWIG
template
std::vector getVariableArray(const std::string& variable_name) const;
@@ -85,7 +85,7 @@ class AgentVector_Agent : public AgentVector_CAgent {
template
void setVariable(const std::string &variable_name, const std::array &value);
template
- void setVariable(const std::string &variable_name, const unsigned int &index, const T &value);
+ void setVariable(const std::string &variable_name, unsigned int index, const T &value);
#ifdef SWIG
template
void setVariableArray(const std::string &variable_name, const std::vector &value);
@@ -206,7 +206,7 @@ void AgentVector_Agent::setVariable(const std::string &variable_name, const std:
_parent->_changed(variable_name, index);
}
template
-void AgentVector_Agent::setVariable(const std::string &variable_name, const unsigned int &array_index, const T &value) {
+void AgentVector_Agent::setVariable(const std::string &variable_name, const unsigned int array_index, const T &value) {
if (!variable_name.empty() && variable_name[0] == '_') {
THROW exception::ReservedName("Agent variable names that begin with '_' are reserved for internal usage and cannot be changed directly, "
"in AgentVector::Agent::setVariable().");
@@ -349,7 +349,7 @@ std::array AgentVector_CAgent::getVariable(const std::string &variable_nam
return rtn;
}
template
-T AgentVector_CAgent::getVariable(const std::string &variable_name, const unsigned int &array_index) const {
+T AgentVector_CAgent::getVariable(const std::string &variable_name, const unsigned int array_index) const {
const auto data = _data.lock();
if (!data) {
THROW exception::ExpiredWeakPtr("The AgentVector which owns this AgentVector::Agent has been deallocated, "
diff --git a/include/flamegpu/pop/DeviceAgentVector_impl.h b/include/flamegpu/pop/DeviceAgentVector_impl.h
index c38698ded..29e80fcd0 100644
--- a/include/flamegpu/pop/DeviceAgentVector_impl.h
+++ b/include/flamegpu/pop/DeviceAgentVector_impl.h
@@ -45,7 +45,7 @@ class DeviceAgentVector_impl : protected AgentVector {
*/
DeviceAgentVector_impl(CUDAAgent& _cuda_agent, const std::string& cuda_agent_state,
const VarOffsetStruct& _agentOffsets, std::vector& _newAgentData,
- CUDAScatter& scatter, const unsigned int& streamId, const cudaStream_t& stream);
+ CUDAScatter& scatter, unsigned int streamId, const cudaStream_t& stream);
/**
* Copy operations are disabled
*/
@@ -351,7 +351,7 @@ class DeviceAgentVector_impl : protected AgentVector {
* @param new_capacity New buffer capacity
* @param init If true, new memory is init
*/
- void resizeUnboundBuffers(const unsigned int& new_capacity, bool init);
+ void resizeUnboundBuffers(unsigned int new_capacity, bool init);
CUDAAgent& cuda_agent;
std::string cuda_agent_state;
@@ -360,7 +360,7 @@ class DeviceAgentVector_impl : protected AgentVector {
std::vector& newAgentData;
CUDAScatter& scatter;
- const unsigned int& streamId;
+ const unsigned int streamId;
const cudaStream_t& stream;
};
diff --git a/include/flamegpu/runtime/DeviceAPI.cuh b/include/flamegpu/runtime/DeviceAPI.cuh
index 2a35ce1e4..4e3164054 100644
--- a/include/flamegpu/runtime/DeviceAPI.cuh
+++ b/include/flamegpu/runtime/DeviceAPI.cuh
@@ -79,7 +79,7 @@ class ReadOnlyDeviceAPI {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template __device__
- T getVariable(const char(&variable_name)[M], const unsigned int &index) const;
+ T getVariable(const char(&variable_name)[M], unsigned int index) const;
/**
* Returns the agent's unique identifier
*/
@@ -201,7 +201,7 @@ class DeviceAPI {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ void setVariable(const char(&variable_name)[M], const unsigned int &index, T value) const;
+ __device__ void setVariable(const char(&variable_name)[M], unsigned int index, T value) const;
/**
* Return the ID of the agent to be created
* @note Calling AgentOut::setVariable() or AgentOut::getID() will trigger agent output
@@ -270,7 +270,7 @@ class DeviceAPI {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template __device__
- T getVariable(const char(&variable_name)[M], const unsigned int &index) const;
+ T getVariable(const char(&variable_name)[M], unsigned int index) const;
/**
* Sets a variable within the currently executing agent
* @param variable_name The name of the variable
@@ -295,7 +295,7 @@ class DeviceAPI {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ void setVariable(const char(&variable_name)[M], const unsigned int &index, const T &value);
+ __device__ void setVariable(const char(&variable_name)[M], unsigned int index, const T &value);
/**
* Returns the agent's unique identifier
*/
@@ -373,7 +373,7 @@ __device__ T ReadOnlyDeviceAPI::getVariable(const char(&variable_name)[N]) const
return value;
}
template
-__device__ T ReadOnlyDeviceAPI::getVariable(const char(&variable_name)[M], const unsigned int &array_index) const {
+__device__ T ReadOnlyDeviceAPI::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
// simple indexing assumes index is the thread number (this may change later)
const unsigned int index = (blockDim.x * blockIdx.x) + threadIdx.x;
@@ -400,7 +400,7 @@ __device__ T DeviceAPI::getVariable(const char(&variable_
template
template
-__device__ T DeviceAPI::getVariable(const char(&variable_name)[M], const unsigned int &array_index) const {
+__device__ T DeviceAPI::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
// simple indexing assumes index is the thread number (this may change later)
const unsigned int index = (blockDim.x * blockIdx.x) + threadIdx.x;
@@ -427,7 +427,7 @@ __device__ void DeviceAPI::setVariable(const char(&variab
}
template
template
-__device__ void DeviceAPI::setVariable(const char(&variable_name)[M], const unsigned int &array_index, const T &value) {
+__device__ void DeviceAPI::setVariable(const char(&variable_name)[M], const unsigned int array_index, const T &value) {
if (variable_name[0] == '_') {
#if !defined(SEATBELTS) || SEATBELTS
DTHROW("Variable names starting with '_' are reserved for internal use, with '%s', in DeviceAPI::setVariable().\n", variable_name);
@@ -467,7 +467,7 @@ __device__ void DeviceAPI::AgentOut::setVariable(const ch
}
template
template
-__device__ void DeviceAPI::AgentOut::setVariable(const char(&variable_name)[M], const unsigned int &array_index, T value) const {
+__device__ void DeviceAPI::AgentOut::setVariable(const char(&variable_name)[M], const unsigned int array_index, T value) const {
if (nextID) {
if (variable_name[0] == '_') {
#if !defined(SEATBELTS) || SEATBELTS
diff --git a/include/flamegpu/runtime/HostAPI.h b/include/flamegpu/runtime/HostAPI.h
index 5fefcd298..9ecf8d9c7 100644
--- a/include/flamegpu/runtime/HostAPI.h
+++ b/include/flamegpu/runtime/HostAPI.h
@@ -55,7 +55,7 @@ class HostAPI {
AgentDataMap &agentData,
const std::shared_ptr &env,
CUDAMacroEnvironment ¯o_env,
- const unsigned int &streamId,
+ unsigned int streamId,
cudaStream_t stream);
/**
* Frees held device memory
@@ -82,7 +82,7 @@ class HostAPI {
private:
template
- void resizeOutputSpace(const unsigned int &items = 1);
+ void resizeOutputSpace(unsigned int items = 1);
CUDASimulation &agentModel;
void *d_output_space;
size_t d_output_space_size;
@@ -112,7 +112,7 @@ class HostAPI {
};
template
-void HostAPI::resizeOutputSpace(const unsigned int &items) {
+void HostAPI::resizeOutputSpace(const unsigned int items) {
if (sizeof(T) * items > d_output_space_size) {
if (d_output_space_size) {
gpuErrchk(cudaFree(d_output_space));
diff --git a/include/flamegpu/runtime/HostNewAgentAPI.h b/include/flamegpu/runtime/HostNewAgentAPI.h
index 10de18b1b..827f6da9a 100644
--- a/include/flamegpu/runtime/HostNewAgentAPI.h
+++ b/include/flamegpu/runtime/HostNewAgentAPI.h
@@ -153,7 +153,7 @@ struct NewAgentStorage {
memcpy(data + var->second.offset, &val, var->second.len);
}
template
- void setVariable(const std::string &var_name, const unsigned int &index, const T &val) {
+ void setVariable(const std::string &var_name, const unsigned int index, const T &val) {
const auto &var = offsets.vars.find(var_name);
if (var == offsets.vars.end()) {
THROW exception::InvalidAgentVar("Variable '%s' not found, "
@@ -256,7 +256,7 @@ struct NewAgentStorage {
return *reinterpret_cast(data + var->second.offset);
}
template
- T getVariable(const std::string &var_name, const unsigned int &index) {
+ T getVariable(const std::string &var_name, const unsigned int index) {
const auto &var = offsets.vars.find(var_name);
if (var == offsets.vars.end()) {
THROW exception::InvalidAgentVar("Variable '%s' not found, "
@@ -388,7 +388,7 @@ class HostNewAgentAPI {
s->setVariable(var_name, val);
}
template
- void setVariable(const std::string &var_name, const unsigned int &index, const T &val) {
+ void setVariable(const std::string &var_name, const unsigned int index, const T &val) {
if (!var_name.empty() && var_name[0] == '_') {
THROW exception::ReservedName("Agent variable names cannot begin with '_', this is reserved for internal usage, "
"in HostNewAgentAPI::setVariable().");
@@ -422,7 +422,7 @@ class HostNewAgentAPI {
return s->getVariable(var_name);
}
template
- T getVariable(const std::string &var_name, const unsigned int &index) {
+ T getVariable(const std::string &var_name, const unsigned int index) {
return s->getVariable(var_name, index);
}
#ifndef SWIG
diff --git a/include/flamegpu/runtime/messaging/MessageArray/MessageArrayDevice.cuh b/include/flamegpu/runtime/messaging/MessageArray/MessageArrayDevice.cuh
index 37dacabf7..e6c104f77 100644
--- a/include/flamegpu/runtime/messaging/MessageArray/MessageArrayDevice.cuh
+++ b/include/flamegpu/runtime/messaging/MessageArray/MessageArrayDevice.cuh
@@ -83,7 +83,7 @@ class MessageArray::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int& index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* This class is created when a search origin is provided to MessageArray::In::operator()(size_type, size_type, size_type = 1)
@@ -124,7 +124,7 @@ class MessageArray::In {
* Constructs a message and directly initialises all of it's member variables
* @note See member variable documentation for their purposes
*/
- __device__ Message(const WrapFilter&parent, const int &relative_x)
+ __device__ Message(const WrapFilter&parent, const int relative_x)
: _parent(parent) {
relative_cell = relative_x;
}
@@ -182,7 +182,7 @@ class MessageArray::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template __device__
- T getVariable(const char(&variable_name)[M], const unsigned int &index) const;
+ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* Stock iterator for iterating MessageSpatial3D::In::WrapFilter::Message objects
@@ -199,7 +199,7 @@ class MessageArray::In {
* This iterator is constructed by MessageArray::In::WrapFilter::begin()(size_type, size_type)
* @see MessageArray::In::wrap(size_type, size_type)
*/
- __device__ iterator(const WrapFilter&parent, const int &relative_x)
+ __device__ iterator(const WrapFilter&parent, const int relative_x)
: _message(parent, relative_x) {
// Increment to find first message
++_message;
@@ -324,7 +324,7 @@ class MessageArray::In {
* Constructs a message and directly initialises all of it's member variables
* @note See member variable documentation for their purposes
*/
- __device__ Message(const Filter& parent, const int& relative_x)
+ __device__ Message(const Filter& parent, const int relative_x)
: _parent(parent) {
relative_cell = relative_x;
}
@@ -381,7 +381,7 @@ class MessageArray::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int& index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* Stock iterator for iterating MessageSpatial3D::In::Filter::Message objects
@@ -398,7 +398,7 @@ class MessageArray::In {
* This iterator is constructed by MessageArray::In::Filter::begin()(size_type, size_type)
* @see MessageArray::In::Operator()(size_type, size_type)
*/
- __device__ iterator(const Filter& parent, const int& relative_x)
+ __device__ iterator(const Filter& parent, const int relative_x)
: _message(parent, relative_x) {
// Increment to find first message
++_message;
@@ -621,7 +621,7 @@ class MessageArray::Out {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ void setVariable(const char(&variable_name)[M], const unsigned int& index, T value) const;
+ __device__ void setVariable(const char(&variable_name)[M], unsigned int index, T value) const;
protected:
/**
@@ -647,7 +647,7 @@ __device__ T MessageArray::In::Message::getVariable(const char(&variable_name)[N
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index);
}
template __device__
-T MessageArray::In::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray::In::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
// simple indexing assumes index is the thread number (this may change later)
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
@@ -673,7 +673,7 @@ __device__ T MessageArray::In::WrapFilter::Message::getVariable(const char(&vari
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index_1d);
}
template __device__
-T MessageArray::In::WrapFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray::In::WrapFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
// simple indexing assumes index is the thread number (this may change later)
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
@@ -699,7 +699,7 @@ __device__ T MessageArray::In::Filter::Message::getVariable(const char(&variable
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index_1d);
}
template __device__
-T MessageArray::In::Filter::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray::In::Filter::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
// simple indexing assumes index is the thread number (this may change later)
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
@@ -729,7 +729,7 @@ __device__ void MessageArray::Out::setVariable(const char(&variable_name)[N], T
// setIndex() sets the optional message scan flag
}
template
-__device__ void MessageArray::Out::setVariable(const char(&variable_name)[M], const unsigned int& array_index, T value) const {
+__device__ void MessageArray::Out::setVariable(const char(&variable_name)[M], const unsigned int array_index, T value) const {
if (variable_name[0] == '_') {
#if !defined(SEATBELTS) || SEATBELTS
DTHROW("Variable names starting with '_' are reserved for internal use, with '%s', in MessageArray::Out::setVariable().\n", variable_name);
diff --git a/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DDevice.cuh b/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DDevice.cuh
index a4c090524..2e6d43e25 100644
--- a/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DDevice.cuh
+++ b/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DDevice.cuh
@@ -79,7 +79,7 @@ class MessageArray2D::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int& index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
@@ -122,7 +122,7 @@ class MessageArray2D::In {
* Constructs a message and directly initialises all of it's member variables
* @note See member variable documentation for their purposes
*/
- __device__ Message(const WrapFilter&parent, const int &relative_x, const int &relative_y)
+ __device__ Message(const WrapFilter&parent, const int relative_x, const int relative_y)
: _parent(parent) {
relative_cell[0] = relative_x;
relative_cell[1] = relative_y;
@@ -196,7 +196,7 @@ class MessageArray2D::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int& index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* Stock iterator for iterating MessageSpatial3D::In::WrapFilter::Message objects
@@ -213,7 +213,7 @@ class MessageArray2D::In {
* This iterator is constructed by MessageArray2D::In::WrapFilter::begin()(size_type, size_type, size_type)
* @see MessageArray2D::In::wrap(size_type, size_type, size_type)
*/
- __device__ iterator(const WrapFilter&parent, const int &relative_x, const int &relative_y)
+ __device__ iterator(const WrapFilter&parent, const int relative_x, const int relative_y)
: _message(parent, relative_x, relative_y) {
// Increment to find first message
++_message;
@@ -339,7 +339,7 @@ class MessageArray2D::In {
* Constructs a message and directly initialises all of it's member variables
* @note See member variable documentation for their purposes
*/
- __device__ Message(const Filter &parent, const int &relative_x, const int &relative_y)
+ __device__ Message(const Filter &parent, const int relative_x, const int relative_y)
: _parent(parent) {
relative_cell[0] = relative_x;
relative_cell[1] = relative_y;
@@ -411,7 +411,7 @@ class MessageArray2D::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int& index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* Stock iterator for iterating MessageSpatial3D::In::Filter::Message objects
@@ -428,7 +428,7 @@ class MessageArray2D::In {
* This iterator is constructed by MessageArray2D::In::Filter::begin()(size_type, size_type, size_type)
* @see MessageArray2D::In::Operator()(size_type, size_type, size_type)
*/
- __device__ iterator(const Filter &parent, const int &relative_x, const int &relative_y)
+ __device__ iterator(const Filter &parent, const int relative_x, const int relative_y)
: _message(parent, relative_x, relative_y) {
// Increment to find first message
++_message;
@@ -555,7 +555,7 @@ class MessageArray2D::In {
* Constructs a message and directly initialises all of it's member variables
* @note See member variable documentation for their purposes
*/
- __device__ Message(const VonNeumannWrapFilter&parent, const int &relative_x, const int &relative_y)
+ __device__ Message(const VonNeumannWrapFilter&parent, const int relative_x, const int relative_y)
: _parent(parent) {
relative_cell[0] = relative_x;
relative_cell[1] = relative_y;
@@ -629,7 +629,7 @@ class MessageArray2D::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int& index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* Stock iterator for iterating MessageSpatial3D::In::WrapFilter::Message objects
@@ -646,7 +646,7 @@ class MessageArray2D::In {
* This iterator is constructed by MessageArray2D::In::WrapFilter::begin()(size_type, size_type, size_type)
* @see MessageArray2D::In::wrap(size_type, size_type, size_type)
*/
- __device__ iterator(const VonNeumannWrapFilter&parent, const int &relative_x, const int &relative_y)
+ __device__ iterator(const VonNeumannWrapFilter&parent, const int relative_x, const int relative_y)
: _message(parent, relative_x, relative_y) {
// Increment to find first message
++_message;
@@ -772,7 +772,7 @@ class MessageArray2D::In {
* Constructs a message and directly initialises all of it's member variables
* @note See member variable documentation for their purposes
*/
- __device__ Message(const VonNeumannFilter &parent, const int &relative_x, const int &relative_y)
+ __device__ Message(const VonNeumannFilter &parent, const int relative_x, const int relative_y)
: _parent(parent) {
relative_cell[0] = relative_x;
relative_cell[1] = relative_y;
@@ -844,7 +844,7 @@ class MessageArray2D::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int& index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* Stock iterator for iterating MessageSpatial3D::In::Filter::Message objects
@@ -861,7 +861,7 @@ class MessageArray2D::In {
* This iterator is constructed by MessageArray2D::In::Filter::begin()(size_type, size_type, size_type)
* @see MessageArray2D::In::Operator()(size_type, size_type, size_type)
*/
- __device__ iterator(const VonNeumannFilter&parent, const int &relative_x, const int &relative_y)
+ __device__ iterator(const VonNeumannFilter&parent, const int relative_x, const int relative_y)
: _message(parent, relative_x, relative_y) {
// Increment to find first message
++_message;
@@ -1169,7 +1169,7 @@ class MessageArray2D::Out {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ void setVariable(const char(&variable_name)[M], const unsigned int& index, T value) const;
+ __device__ void setVariable(const char(&variable_name)[M], unsigned int index, T value) const;
protected:
/**
@@ -1197,7 +1197,7 @@ __device__ T MessageArray2D::In::Message::getVariable(const char(&variable_name)
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index);
}
template __device__
-T MessageArray2D::In::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray2D::In::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
if (index >= this->_parent.metadata->length) {
@@ -1222,7 +1222,7 @@ __device__ T MessageArray2D::In::WrapFilter::Message::getVariable(const char(&va
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index_1d);
}
template __device__
-T MessageArray2D::In::WrapFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray2D::In::WrapFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
if (index_1d >= this->_parent.metadata->length) {
@@ -1247,7 +1247,7 @@ __device__ T MessageArray2D::In::Filter::Message::getVariable(const char(&variab
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index_1d);
}
template __device__
-T MessageArray2D::In::Filter::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray2D::In::Filter::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
if (index_1d >= this->_parent.metadata->length) {
@@ -1272,7 +1272,7 @@ __device__ T MessageArray2D::In::VonNeumannWrapFilter::Message::getVariable(cons
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index_1d);
}
template __device__
-T MessageArray2D::In::VonNeumannWrapFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray2D::In::VonNeumannWrapFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
if (index_1d >= this->_parent.metadata->length) {
@@ -1297,7 +1297,7 @@ __device__ T MessageArray2D::In::VonNeumannFilter::Message::getVariable(const ch
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index_1d);
}
template __device__
-T MessageArray2D::In::VonNeumannFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray2D::In::VonNeumannFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
if (index_1d >= this->_parent.metadata->length) {
@@ -1326,7 +1326,7 @@ __device__ void MessageArray2D::Out::setVariable(const char(&variable_name)[N],
// setIndex() sets the optional message scan flag
}
template
-__device__ void MessageArray2D::Out::setVariable(const char(&variable_name)[M], const unsigned int& array_index, T value) const {
+__device__ void MessageArray2D::Out::setVariable(const char(&variable_name)[M], const unsigned int array_index, T value) const {
if (variable_name[0] == '_') {
#if !defined(SEATBELTS) || SEATBELTS
DTHROW("Variable names starting with '_' are reserved for internal use, with '%s', in MessageArray2D::Out::setVariable().\n", variable_name);
diff --git a/include/flamegpu/runtime/messaging/MessageArray3D/MessageArray3DDevice.cuh b/include/flamegpu/runtime/messaging/MessageArray3D/MessageArray3DDevice.cuh
index 283ff1222..ce9499f8d 100644
--- a/include/flamegpu/runtime/messaging/MessageArray3D/MessageArray3DDevice.cuh
+++ b/include/flamegpu/runtime/messaging/MessageArray3D/MessageArray3DDevice.cuh
@@ -85,7 +85,7 @@ class MessageArray3D::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int &index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* This class is created when a search origin is provided to MessageArray2D::wrap()(size_type, size_type, size_type = 1)
@@ -127,7 +127,7 @@ class MessageArray3D::In {
* Constructs a message and directly initialises all of it's member variables
* @note See member variable documentation for their purposes
*/
- __device__ Message(const WrapFilter&parent, const int &relative_x, const int &relative_y, const int &relative_z)
+ __device__ Message(const WrapFilter&parent, const int relative_x, const int relative_y, const int relative_z)
: _parent(parent) {
relative_cell[0] = relative_x;
relative_cell[1] = relative_y;
@@ -217,7 +217,7 @@ class MessageArray3D::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int& index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* Stock iterator for iterating MessageSpatial3D::In::WrapFilter::Message objects
@@ -234,7 +234,7 @@ class MessageArray3D::In {
* This iterator is constructed by MessageArray3D::In::WrapFilter::begin()(size_type, size_type, size_type, size_type)
* @see MessageArray3D::In::wrap(size_type, size_type, size_type, size_type)
*/
- __device__ iterator(const WrapFilter&parent, const int &relative_x, const int &relative_y, const int &relative_z)
+ __device__ iterator(const WrapFilter&parent, const int relative_x, const int relative_y, const int relative_z)
: _message(parent, relative_x, relative_y, relative_z) {
// Increment to find first message
++_message;
@@ -360,7 +360,7 @@ class MessageArray3D::In {
* Constructs a message and directly initialises all of it's member variables
* @note See member variable documentation for their purposes
*/
- __device__ Message(const Filter& parent, const int& relative_x, const int& relative_y, const int& relative_z)
+ __device__ Message(const Filter& parent, const int relative_x, const int relative_y, const int relative_z)
: _parent(parent) {
relative_cell[0] = relative_x;
relative_cell[1] = relative_y;
@@ -447,7 +447,7 @@ class MessageArray3D::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int& index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* Stock iterator for iterating MessageSpatial3D::In::Filter::Message objects
@@ -464,7 +464,7 @@ class MessageArray3D::In {
* This iterator is constructed by MessageArray3D::In::Filter::begin()(size_type, size_type, size_type, size_type)
* @see MessageArray3D::In::Operator()(size_type, size_type, size_type, size_type)
*/
- __device__ iterator(const Filter& parent, const int& relative_x, const int& relative_y, const int& relative_z)
+ __device__ iterator(const Filter& parent, const int relative_x, const int relative_y, const int relative_z)
: _message(parent, relative_x, relative_y, relative_z) {
// Increment to find first message
++_message;
@@ -591,7 +591,7 @@ class MessageArray3D::In {
* Constructs a message and directly initialises all of it's member variables
* @note See member variable documentation for their purposes
*/
- __device__ Message(const VonNeumannWrapFilter&parent, const int &relative_x, const int &relative_y, const int &relative_z)
+ __device__ Message(const VonNeumannWrapFilter&parent, const int relative_x, const int relative_y, const int relative_z)
: _parent(parent) {
relative_cell[0] = relative_x;
relative_cell[1] = relative_y;
@@ -681,7 +681,7 @@ class MessageArray3D::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int& index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* Stock iterator for iterating MessageSpatial3D::In::WrapFilter::Message objects
@@ -698,7 +698,7 @@ class MessageArray3D::In {
* This iterator is constructed by MessageArray3D::In::WrapFilter::begin()(size_type, size_type, size_type, size_type)
* @see MessageArray3D::In::wrap(size_type, size_type, size_type, size_type)
*/
- __device__ iterator(const VonNeumannWrapFilter&parent, const int &relative_x, const int &relative_y, const int &relative_z)
+ __device__ iterator(const VonNeumannWrapFilter&parent, const int relative_x, const int relative_y, const int relative_z)
: _message(parent, relative_x, relative_y, relative_z) {
// Increment to find first message
++_message;
@@ -824,7 +824,7 @@ class MessageArray3D::In {
* Constructs a message and directly initialises all of it's member variables
* @note See member variable documentation for their purposes
*/
- __device__ Message(const VonNeumannFilter& parent, const int& relative_x, const int& relative_y, const int& relative_z)
+ __device__ Message(const VonNeumannFilter& parent, const int relative_x, const int relative_y, const int relative_z)
: _parent(parent) {
relative_cell[0] = relative_x;
relative_cell[1] = relative_y;
@@ -911,7 +911,7 @@ class MessageArray3D::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ T getVariable(const char(&variable_name)[M], const unsigned int& index) const;
+ __device__ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* Stock iterator for iterating MessageSpatial3D::In::Filter::Message objects
@@ -928,7 +928,7 @@ class MessageArray3D::In {
* This iterator is constructed by MessageArray3D::In::Filter::begin()(size_type, size_type, size_type, size_type)
* @see MessageArray3D::In::Operator()(size_type, size_type, size_type, size_type)
*/
- __device__ iterator(const VonNeumannFilter& parent, const int& relative_x, const int& relative_y, const int& relative_z)
+ __device__ iterator(const VonNeumannFilter& parent, const int relative_x, const int relative_y, const int relative_z)
: _message(parent, relative_x, relative_y, relative_z) {
// Increment to find first message
++_message;
@@ -1260,7 +1260,7 @@ class MessageArray3D::Out {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ void setVariable(const char(&variable_name)[M], const unsigned int& index, T value) const;
+ __device__ void setVariable(const char(&variable_name)[M], unsigned int index, T value) const;
protected:
/**
@@ -1286,7 +1286,7 @@ __device__ T MessageArray3D::In::Message::getVariable(const char(&variable_name)
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index);
}
template __device__
-T MessageArray3D::In::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray3D::In::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
// simple indexing assumes index is the thread number (this may change later)
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
@@ -1312,7 +1312,7 @@ __device__ T MessageArray3D::In::WrapFilter::Message::getVariable(const char(&va
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index_1d);
}
template __device__
-T MessageArray3D::In::WrapFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray3D::In::WrapFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
// simple indexing assumes index is the thread number (this may change later)
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
@@ -1338,7 +1338,7 @@ __device__ T MessageArray3D::In::Filter::Message::getVariable(const char(&variab
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index_1d);
}
template __device__
-T MessageArray3D::In::Filter::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray3D::In::Filter::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
// simple indexing assumes index is the thread number (this may change later)
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
@@ -1364,7 +1364,7 @@ __device__ T MessageArray3D::In::VonNeumannWrapFilter::Message::getVariable(cons
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index_1d);
}
template __device__
-T MessageArray3D::In::VonNeumannWrapFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray3D::In::VonNeumannWrapFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
// simple indexing assumes index is the thread number (this may change later)
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
@@ -1390,7 +1390,7 @@ __device__ T MessageArray3D::In::VonNeumannFilter::Message::getVariable(const ch
return detail::curve::DeviceCurve::getMessageVariable(variable_name, index_1d);
}
template __device__
-T MessageArray3D::In::VonNeumannFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageArray3D::In::VonNeumannFilter::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
// simple indexing assumes index is the thread number (this may change later)
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
@@ -1420,7 +1420,7 @@ __device__ void MessageArray3D::Out::setVariable(const char(&variable_name)[N],
// setIndex() sets the optional message scan flag
}
template
-__device__ void MessageArray3D::Out::setVariable(const char(&variable_name)[M], const unsigned int& array_index, T value) const {
+__device__ void MessageArray3D::Out::setVariable(const char(&variable_name)[M], const unsigned int array_index, T value) const {
if (variable_name[0] == '_') {
#if !defined(SEATBELTS) || SEATBELTS
DTHROW("Variable names starting with '_' are reserved for internal use, with '%s', in MessageArray3D::Out::setVariable().\n", variable_name);
diff --git a/include/flamegpu/runtime/messaging/MessageBruteForce/MessageBruteForceDevice.cuh b/include/flamegpu/runtime/messaging/MessageBruteForce/MessageBruteForceDevice.cuh
index ad69e382e..538c3b825 100644
--- a/include/flamegpu/runtime/messaging/MessageBruteForce/MessageBruteForceDevice.cuh
+++ b/include/flamegpu/runtime/messaging/MessageBruteForce/MessageBruteForceDevice.cuh
@@ -125,7 +125,7 @@ class MessageBruteForce::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template __device__
- T getVariable(const char(&variable_name)[M], const unsigned int &index) const;
+ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
@@ -210,7 +210,7 @@ class MessageBruteForce::Out {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ void setVariable(const char(&variable_name)[M], const unsigned int& index, T value) const;
+ __device__ void setVariable(const char(&variable_name)[M], unsigned int index, T value) const;
protected:
/**
@@ -237,7 +237,7 @@ __device__ T MessageBruteForce::In::Message::getVariable(const char(&variable_na
return value;
}
template __device__
-T MessageBruteForce::In::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageBruteForce::In::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
// simple indexing assumes index is the thread number (this may change later)
const unsigned int index = (blockDim.x * blockIdx.x) + threadIdx.x;
#if !defined(SEATBELTS) || SEATBELTS
@@ -275,7 +275,7 @@ __device__ void MessageBruteForce::Out::setVariable(const char(&variable_name)[N
this->scan_flag[index] = 1;
}
template
-__device__ void MessageBruteForce::Out::setVariable(const char(&variable_name)[M], const unsigned int& array_index, T value) const {
+__device__ void MessageBruteForce::Out::setVariable(const char(&variable_name)[M], const unsigned int array_index, T value) const {
if (variable_name[0] == '_') {
#if !defined(SEATBELTS) || SEATBELTS
DTHROW("Variable names starting with '_' are reserved for internal use, with '%s', in MessageBruteForce::Out::setVariable().\n", variable_name);
diff --git a/include/flamegpu/runtime/messaging/MessageBucket/MessageBucketDevice.cuh b/include/flamegpu/runtime/messaging/MessageBucket/MessageBucketDevice.cuh
index 30ac3195f..210867dc2 100644
--- a/include/flamegpu/runtime/messaging/MessageBucket/MessageBucketDevice.cuh
+++ b/include/flamegpu/runtime/messaging/MessageBucket/MessageBucketDevice.cuh
@@ -89,7 +89,7 @@ class MessageBucket::In {
* @throws exception::DeviceError If index is out of bounds for the variable array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template __device__
- T getVariable(const char(&variable_name)[M], const unsigned int &index) const;
+ T getVariable(const char(&variable_name)[M], unsigned int index) const;
};
/**
* Stock iterator for iterating MessageBucket::In::Filter::Message objects
@@ -330,7 +330,7 @@ __device__ T MessageBucket::In::Filter::Message::getVariable(const char(&variabl
return value;
}
template __device__
-T MessageBucket::In::Filter::Message::getVariable(const char(&variable_name)[M], const unsigned int& array_index) const {
+T MessageBucket::In::Filter::Message::getVariable(const char(&variable_name)[M], const unsigned int array_index) const {
#if !defined(SEATBELTS) || SEATBELTS
// Ensure that the message is within bounds.
if (cell_index >= _parent.bucket_end) {
diff --git a/include/flamegpu/runtime/messaging/MessageBucket/MessageBucketHost.h b/include/flamegpu/runtime/messaging/MessageBucket/MessageBucketHost.h
index 4d005546e..e3fc8b18d 100644
--- a/include/flamegpu/runtime/messaging/MessageBucket/MessageBucketHost.h
+++ b/include/flamegpu/runtime/messaging/MessageBucket/MessageBucketHost.h
@@ -72,7 +72,7 @@ class MessageBucket::CUDAModelHandler : public MessageSpecialisationHandler {
* @param newSize The new number of agents to represent
* @note This only scales upwards, it will never reduce the size
*/
- void resizeKeysVals(const unsigned int &newSize);
+ void resizeKeysVals(unsigned int newSize);
/**
* upperBound-lowerBound
*/
diff --git a/include/flamegpu/runtime/messaging/MessageSpatial2D/MessageSpatial2DHost.h b/include/flamegpu/runtime/messaging/MessageSpatial2D/MessageSpatial2DHost.h
index e91828a1a..775531513 100644
--- a/include/flamegpu/runtime/messaging/MessageSpatial2D/MessageSpatial2DHost.h
+++ b/include/flamegpu/runtime/messaging/MessageSpatial2D/MessageSpatial2DHost.h
@@ -73,7 +73,7 @@ class MessageSpatial2D::CUDAModelHandler : public MessageSpecialisationHandler {
* @param newSize The new number of agents to represent
* @note This only scales upwards, it will never reduce the size
*/
- void resizeKeysVals(const unsigned int &newSize);
+ void resizeKeysVals(unsigned int newSize);
/**
* Number of bins, arrays are +1 this length
*/
diff --git a/include/flamegpu/runtime/messaging/MessageSpatial3D/MessageSpatial3DHost.h b/include/flamegpu/runtime/messaging/MessageSpatial3D/MessageSpatial3DHost.h
index 96fb1cab2..e7ce56bf8 100644
--- a/include/flamegpu/runtime/messaging/MessageSpatial3D/MessageSpatial3DHost.h
+++ b/include/flamegpu/runtime/messaging/MessageSpatial3D/MessageSpatial3DHost.h
@@ -74,7 +74,7 @@ class MessageSpatial3D::CUDAModelHandler : public MessageSpecialisationHandler {
* @param newSize The new number of agents to represent
* @note This only scales upwards, it will never reduce the size
*/
- void resizeKeysVals(const unsigned int &newSize);
+ void resizeKeysVals(unsigned int newSize);
/**
* Number of bins, arrays are +1 this length
*/
diff --git a/include/flamegpu/runtime/utility/DeviceEnvironment.cuh b/include/flamegpu/runtime/utility/DeviceEnvironment.cuh
index e8669f4b4..af4b43b70 100644
--- a/include/flamegpu/runtime/utility/DeviceEnvironment.cuh
+++ b/include/flamegpu/runtime/utility/DeviceEnvironment.cuh
@@ -48,7 +48,7 @@ class ReadOnlyDeviceEnvironment {
* @throws exception::DeviceError If N does not match the length of the environment property array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
*/
template
- __device__ __forceinline__ T getProperty(const char(&name)[M], const unsigned int&index) const;
+ __device__ __forceinline__ T getProperty(const char(&name)[M], unsigned int index) const;
/**
* Returns a read-only accessor to the named macro property
* @param name name used for accessing the property, this value should be a string literal e.g. "foobar"
@@ -92,7 +92,7 @@ __device__ __forceinline__ T ReadOnlyDeviceEnvironment::getProperty(const char(&
return detail::curve::DeviceCurve::getEnvironmentProperty(name);
}
template
-__device__ __forceinline__ T ReadOnlyDeviceEnvironment::getProperty(const char(&name)[M], const unsigned int &index) const {
+__device__ __forceinline__ T ReadOnlyDeviceEnvironment::getProperty(const char(&name)[M], const unsigned int index) const {
return detail::curve::DeviceCurve::getEnvironmentArrayProperty(name, index);
}
diff --git a/include/flamegpu/runtime/utility/EnvironmentManager.cuh b/include/flamegpu/runtime/utility/EnvironmentManager.cuh
index 3e68d87e1..858091923 100644
--- a/include/flamegpu/runtime/utility/EnvironmentManager.cuh
+++ b/include/flamegpu/runtime/utility/EnvironmentManager.cuh
@@ -56,7 +56,7 @@ class EnvironmentManager : public std::enable_shared_from_this &env, CUDAMacroEnvironment &_macro_env);
+ explicit HostEnvironment(unsigned int instance_id, const std::shared_ptr &env, CUDAMacroEnvironment &_macro_env);
/**
* Provides access to EnvironmentManager singleton
*/
diff --git a/include/flamegpu/sim/LogFrame.h b/include/flamegpu/sim/LogFrame.h
index f89e1dba6..0893638aa 100644
--- a/include/flamegpu/sim/LogFrame.h
+++ b/include/flamegpu/sim/LogFrame.h
@@ -34,7 +34,7 @@ struct LogFrame {
*/
LogFrame(const std::map &_environment,
const std::map, unsigned int>> &_agents,
- const unsigned int &_step_count);
+ unsigned int _step_count);
/**
* Returns the step count of the log
* 0 is the state prior to the first step
@@ -92,7 +92,7 @@ struct StepLogFrame : public LogFrame {
*/
StepLogFrame(const std::map&& _environment,
const std::map, unsigned int>>&& _agents,
- const unsigned int& _step_count);
+ unsigned int _step_count);
/**
* Return the execution time of the associated step, in seconds
@@ -123,7 +123,7 @@ struct ExitLogFrame : public LogFrame {
*/
ExitLogFrame(const std::map&& _environment,
const std::map, unsigned int>>&& _agents,
- const unsigned int& _step_count);
+ unsigned int _step_count);
/**
* Return the runtime compilation time, in seconds
@@ -267,7 +267,7 @@ struct AgentLogFrame {
* @param data Map of reduction data
* @param count Population size (alive agents)
*/
- explicit AgentLogFrame(const std::map &data, const unsigned int &count);
+ explicit AgentLogFrame(const std::map &data, unsigned int count);
/**
* Return the number of alive agents in the population
* @return The population size
@@ -335,7 +335,7 @@ struct AgentLogFrame {
/**
* Population size of the related agent state
*/
- const unsigned int &count;
+ const unsigned int count;
};
template
diff --git a/include/flamegpu/sim/LoggingConfig.h b/include/flamegpu/sim/LoggingConfig.h
index c19f652b8..6f31d60d8 100644
--- a/include/flamegpu/sim/LoggingConfig.h
+++ b/include/flamegpu/sim/LoggingConfig.h
@@ -181,7 +181,7 @@ class StepLoggingConfig : public LoggingConfig {
* How many steps between each log collection, defaults to 1, so a log is collected every step
* A value of 0 disables step log collection
*/
- void setFrequency(const unsigned int &steps);
+ void setFrequency(unsigned int steps);
private:
/**
diff --git a/include/flamegpu/sim/RunPlan.h b/include/flamegpu/sim/RunPlan.h
index 657642d1f..9e5c21343 100644
--- a/include/flamegpu/sim/RunPlan.h
+++ b/include/flamegpu/sim/RunPlan.h
@@ -53,7 +53,7 @@ class RunPlan {
* A steps value of 0 requires the ModelDescription to have atleast 1 exit condition
* @param steps The number of steps to execute, 0 is unlimited but requires an exit condition
*/
- void setSteps(const unsigned int &steps);
+ void setSteps(unsigned int steps);
/**
* Set the sub directory within the output directory for outputs of this run
* If left empty, output will not goto subdirectories
@@ -173,10 +173,10 @@ class RunPlan {
*/
RunPlanVector operator+(const RunPlan& rhs) const;
RunPlanVector operator+(const RunPlanVector& rhs) const;
- RunPlanVector operator*(const unsigned int& rhs) const;
+ RunPlanVector operator*(unsigned int rhs) const;
private:
- explicit RunPlan(const std::shared_ptr> &environment, const bool &allow_0);
+ explicit RunPlan(const std::shared_ptr> &environment, bool allow_0);
uint64_t random_seed;
unsigned int steps;
std::string output_subdirectory;
diff --git a/include/flamegpu/sim/RunPlanVector.h b/include/flamegpu/sim/RunPlanVector.h
index c2bd2400a..00e2e337a 100644
--- a/include/flamegpu/sim/RunPlanVector.h
+++ b/include/flamegpu/sim/RunPlanVector.h
@@ -39,13 +39,13 @@ class RunPlanVector : private std::vector {
* @param step The value added to the previous seed to calculate the next seed
* @note A step of 0, will give the exact same seed to all RunPlans
*/
- void setRandomSimulationSeed(const uint64_t &initial_seed, const unsigned int &step = 0);
+ void setRandomSimulationSeed(const uint64_t &initial_seed, unsigned int step = 0);
/**
* Set the steps of each RunPlan currently within this vector
* @param steps The number of steps to be executed
* @note If 0 is provided, the model must have an exit condition
*/
- void setSteps(const unsigned int &steps);
+ void setSteps(unsigned int steps);
/**
* Set the the sub directory within the output directory for outputs of runplans in this vector
* @param subdir The name of the subdirectory
@@ -287,11 +287,11 @@ class RunPlanVector : private std::vector {
RunPlanVector operator+(const RunPlanVector& rhs) const;
RunPlanVector& operator+=(const RunPlan& rhs);
RunPlanVector& operator+=(const RunPlanVector& rhs);
- RunPlanVector& operator*=(const unsigned int& rhs);
- RunPlanVector operator*(const unsigned int& rhs) const;
+ RunPlanVector& operator*=(unsigned int rhs);
+ RunPlanVector operator*(unsigned int rhs) const;
private:
- RunPlanVector(const std::shared_ptr> &environment, const bool &allow_0_steps);
+ RunPlanVector(const std::shared_ptr> &environment, bool allow_0_steps);
/**
* Seed used for the current `rand` instance, which is only valid for elements generated since the last call to setRandomPropertySeed
*/
diff --git a/include/flamegpu/util/Any.h b/include/flamegpu/util/Any.h
index bdc491801..d0ddd3e61 100644
--- a/include/flamegpu/util/Any.h
+++ b/include/flamegpu/util/Any.h
@@ -16,7 +16,7 @@ struct Any {
* @param _elements How many elements does the property have (1 if it's not an array)
* @note Copies the data
*/
- Any(const void *_ptr, const size_t &_length, const std::type_index &_type, const unsigned int &_elements)
+ Any(const void *_ptr, const size_t &_length, const std::type_index &_type, const unsigned int _elements)
: ptr(malloc(_length))
, length(_length)
, type(_type)
diff --git a/src/flamegpu/exception/FLAMEGPUDeviceException.cu b/src/flamegpu/exception/FLAMEGPUDeviceException.cu
index 3da41fe4e..38d517a90 100644
--- a/src/flamegpu/exception/FLAMEGPUDeviceException.cu
+++ b/src/flamegpu/exception/FLAMEGPUDeviceException.cu
@@ -17,7 +17,7 @@ DeviceExceptionManager::~DeviceExceptionManager() {
gpuErrchk(cudaFree(i));
}
}
-DeviceExceptionBuffer *DeviceExceptionManager::getDevicePtr(const unsigned int &streamId, const cudaStream_t &stream) {
+DeviceExceptionBuffer *DeviceExceptionManager::getDevicePtr(const unsigned int streamId, const cudaStream_t &stream) {
if (streamId >= CUDAScanCompaction::MAX_STREAMS) {
THROW exception::OutOfBoundsException("Stream id %u is out of bounds, %u >= %u, "
"in FLAMEGPUDeviceException::getDevicePtr()\n", streamId, streamId, CUDAScanCompaction::MAX_STREAMS);
@@ -34,7 +34,7 @@ DeviceExceptionBuffer *DeviceExceptionManager::getDevicePtr(const unsigned int &
memset(&hd_buffer[streamId], 0, sizeof(DeviceExceptionBuffer));
return d_buffer[streamId];
}
-void DeviceExceptionManager::checkError(const std::string &function, const unsigned int &streamId, const cudaStream_t &stream) {
+void DeviceExceptionManager::checkError(const std::string &function, const unsigned int streamId, const cudaStream_t &stream) {
if (streamId >= CUDAScanCompaction::MAX_STREAMS) {
THROW exception::OutOfBoundsException("Stream id %u is out of bounds, %u >= %u, "
"in FLAMEGPUDeviceException::checkError()\n", streamId, streamId, CUDAScanCompaction::MAX_STREAMS);
diff --git a/src/flamegpu/exception/FLAMEGPUException.cpp b/src/flamegpu/exception/FLAMEGPUException.cpp
index 72ce615e1..3117f17b5 100644
--- a/src/flamegpu/exception/FLAMEGPUException.cpp
+++ b/src/flamegpu/exception/FLAMEGPUException.cpp
@@ -25,7 +25,7 @@ const char * FLAMEGPUException::what() const noexcept {
return err_message.c_str();
}
-void FLAMEGPUException::setLocation(const char *_file, const unsigned int &_line) {
+void FLAMEGPUException::setLocation(const char *_file, const unsigned int _line) {
file = _file;
line = _line;
}
diff --git a/src/flamegpu/gpu/CUDAAgent.cu b/src/flamegpu/gpu/CUDAAgent.cu
index e0b55ac57..9a3b933f4 100644
--- a/src/flamegpu/gpu/CUDAAgent.cu
+++ b/src/flamegpu/gpu/CUDAAgent.cu
@@ -75,7 +75,7 @@ CUDAAgent::CUDAAgent(
}
}
-void CUDAAgent::mapRuntimeVariables(const AgentFunctionData& func, const unsigned int &instance_id) const {
+void CUDAAgent::mapRuntimeVariables(const AgentFunctionData& func, const unsigned int instance_id) const {
// check the cuda agent state map to find the correct state list for functions starting state
auto sm = state_map.find(func.initial_state);
@@ -113,7 +113,7 @@ void CUDAAgent::mapRuntimeVariables(const AgentFunctionData& func, const unsigne
}
}
-void CUDAAgent::setPopulationData(const AgentVector& population, const std::string& state_name, CUDAScatter& scatter, const unsigned int& streamId, const cudaStream_t& stream) {
+void CUDAAgent::setPopulationData(const AgentVector& population, const std::string& state_name, CUDAScatter& scatter, const unsigned int streamId, const cudaStream_t& stream) {
// Validate agent state
auto our_state = state_map.find(state_name);
if (our_state == state_map.end()) {
@@ -263,7 +263,7 @@ void CUDAAgent::resizeState(const std::string& state, const unsigned int minimum
sm->second->resize(minimumSize, retainData, stream);
}
-void CUDAAgent::setStateAgentCount(const std::string& state, const unsigned int& newSize) {
+void CUDAAgent::setStateAgentCount(const std::string& state, const unsigned int newSize) {
// check the cuda agent state map to find the correct state list
const auto& sm = state_map.find(state);
@@ -288,25 +288,25 @@ void *CUDAAgent::getStateVariablePtr(const std::string &state_name, const std::s
}
return sm->second->getVariablePointer(variable_name);
}
-void CUDAAgent::processDeath(const AgentFunctionData& func, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+void CUDAAgent::processDeath(const AgentFunctionData& func, CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
// Optionally process agent death
if (func.has_agent_death) {
// Agent death operates on all mapped vars, so handled by fat agent
fat_agent->processDeath(fat_index, func.initial_state, scatter, streamId, stream);
}
}
-void CUDAAgent::transitionState(const std::string &_src, const std::string &_dest, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+void CUDAAgent::transitionState(const std::string &_src, const std::string &_dest, CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
// All mapped vars need to transition too, so handled by fat agent
fat_agent->transitionState(fat_index, _src, _dest, scatter, streamId, stream);
}
-void CUDAAgent::processFunctionCondition(const AgentFunctionData& func, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+void CUDAAgent::processFunctionCondition(const AgentFunctionData& func, CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
// Optionally process function condition
if ((func.condition) || (!func.rtc_func_condition_name.empty())) {
// Agent function condition operates on all mapped vars, so handled by fat agent
fat_agent->processFunctionCondition(fat_index, func.initial_state, scatter, streamId, stream);
}
}
-void CUDAAgent::scatterHostCreation(const std::string &state_name, const unsigned int &newSize, char *const d_inBuff, const VarOffsetStruct &offsets, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+void CUDAAgent::scatterHostCreation(const std::string &state_name, const unsigned int newSize, char *const d_inBuff, const VarOffsetStruct &offsets, CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
auto sm = state_map.find(state_name);
if (sm == state_map.end()) {
THROW exception::InvalidCudaAgentState("Error: Agent ('%s') state ('%s') was not found "
@@ -407,7 +407,7 @@ void CUDAAgent::releaseNewBuffer(const AgentFunctionData& func) {
}
}
-void CUDAAgent::scatterNew(const AgentFunctionData& func, const unsigned int &newSize, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+void CUDAAgent::scatterNew(const AgentFunctionData& func, const unsigned int newSize, CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
// Confirm agent output is set
if (auto oa = func.agent_output.lock()) {
auto sm = state_map.find(func.agent_output_state);
@@ -630,12 +630,12 @@ const CUDAAgent::CUDARTCFuncMap& CUDAAgent::getRTCFunctions() const {
return rtc_func_map;
}
-void CUDAAgent::initUnmappedVars(CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+void CUDAAgent::initUnmappedVars(CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
for (auto &s : state_map) {
s.second->initUnmappedVars(scatter, streamId, stream);
}
}
-void CUDAAgent::initExcludedVars(const std::string &state, const unsigned int&count, const unsigned int&offset, CUDAScatter& scatter, const unsigned int& streamId, const cudaStream_t& stream) {
+void CUDAAgent::initExcludedVars(const std::string &state, const unsigned int count, const unsigned int offset, CUDAScatter& scatter, const unsigned int streamId, const cudaStream_t& stream) {
// check the cuda agent state map to find the correct state list
const auto& sm = state_map.find(state);
diff --git a/src/flamegpu/gpu/CUDAAgentStateList.cu b/src/flamegpu/gpu/CUDAAgentStateList.cu
index 1731a8b5b..5b7d37fbd 100644
--- a/src/flamegpu/gpu/CUDAAgentStateList.cu
+++ b/src/flamegpu/gpu/CUDAAgentStateList.cu
@@ -25,7 +25,7 @@ namespace flamegpu {
CUDAAgentStateList::CUDAAgentStateList(
const std::shared_ptr &fat_list,
CUDAAgent& cuda_agent,
- const unsigned int &_fat_index,
+ const unsigned int _fat_index,
const AgentData& description,
bool _isSubStateList)
: fat_index(_fat_index)
@@ -40,7 +40,7 @@ CUDAAgentStateList::CUDAAgentStateList(
CUDAAgentStateList::CUDAAgentStateList(
const std::shared_ptr &fat_list,
CUDAAgent& cuda_agent,
- const unsigned int &_fat_index,
+ const unsigned int _fat_index,
const AgentData& description,
bool _isSubStateList,
const SubAgentData::Mapping &varMap)
@@ -235,7 +235,7 @@ unsigned int CUDAAgentStateList::scatterNew(void * d_newBuff, const unsigned int
bool CUDAAgentStateList::getIsSubStatelist() {
return isSubStateList;
}
-void CUDAAgentStateList::initUnmappedVars(CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+void CUDAAgentStateList::initUnmappedVars(CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
assert(parent_list->getSizeWithDisabled() == parent_list->getSize());
if (parent_list->getSize()) {
assert(isSubStateList);
@@ -245,7 +245,7 @@ void CUDAAgentStateList::initUnmappedVars(CUDAScatter &scatter, const unsigned i
}
}
}
-void CUDAAgentStateList::initExcludedVars(const unsigned int& count, const unsigned int& offset, CUDAScatter& scatter, const unsigned int& streamId, const cudaStream_t& stream) {
+void CUDAAgentStateList::initExcludedVars(const unsigned int count, const unsigned int offset, CUDAScatter& scatter, const unsigned int streamId, const cudaStream_t& stream) {
std::set> exclusionSet;
for (auto& a : variables)
exclusionSet.insert(a.second);
@@ -254,7 +254,7 @@ void CUDAAgentStateList::initExcludedVars(const unsigned int& count, const unsig
void CUDAAgentStateList::clear() {
parent_list->setAgentCount(0, true);
}
-void CUDAAgentStateList::setAgentCount(const unsigned int& newSize) {
+void CUDAAgentStateList::setAgentCount(const unsigned int newSize) {
parent_list->setAgentCount(newSize, false);
}
std::list> CUDAAgentStateList::getUnboundVariableBuffers() {
diff --git a/src/flamegpu/gpu/CUDAEnsemble.cu b/src/flamegpu/gpu/CUDAEnsemble.cu
index 7a647ae20..3187418b7 100644
--- a/src/flamegpu/gpu/CUDAEnsemble.cu
+++ b/src/flamegpu/gpu/CUDAEnsemble.cu
@@ -79,7 +79,7 @@ unsigned int CUDAEnsemble::simulate(const RunPlanVector &plans) {
if (device_count == 0) {
THROW exception::InvalidCUDAdevice("Error no CUDA devices found!, in CUDAEnsemble::simulate()");
}
- for (const int &id : config.devices) {
+ for (const int id : config.devices) {
if (id >= device_count) {
THROW exception::InvalidCUDAdevice("Requested CUDA device %d is not valid, only %d CUDA devices available!, in CUDAEnsemble::simulate()", id, device_count);
}
diff --git a/src/flamegpu/gpu/CUDAFatAgent.cu b/src/flamegpu/gpu/CUDAFatAgent.cu
index 3c0d1a330..c524257b0 100644
--- a/src/flamegpu/gpu/CUDAFatAgent.cu
+++ b/src/flamegpu/gpu/CUDAFatAgent.cu
@@ -39,7 +39,7 @@ CUDAFatAgent::~CUDAFatAgent() {
}
d_newLists.clear();
}
-std::unordered_map> CUDAFatAgent::getStateMap(const unsigned int &fat_index) {
+std::unordered_map> CUDAFatAgent::getStateMap(const unsigned int fat_index) {
std::unordered_map> rtn;
// For each state
for (const auto &s : states) {
@@ -53,7 +53,7 @@ std::unordered_map> CUDAFatA
}
void CUDAFatAgent::addSubAgent(
const AgentData &description,
- const unsigned int &master_fat_index,
+ const unsigned int master_fat_index,
const std::shared_ptr &mapping) {
assert(states.size());
assert(states_unique.size());
@@ -87,7 +87,7 @@ void CUDAFatAgent::addSubAgent(
mappedAgentCount++;
}
-void CUDAFatAgent::processDeath(const unsigned int &agent_fat_id, const std::string &state_name, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+void CUDAFatAgent::processDeath(const unsigned int agent_fat_id, const std::string &state_name, CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
auto sm = states.find({agent_fat_id, state_name});
if (sm == states.end()) {
THROW exception::InvalidCudaAgentState("Error: Agent ('%s') state ('%s') was not found "
@@ -168,7 +168,7 @@ void CUDAFatAgent::transitionState(unsigned int agent_fat_id, const std::string
}
}
-void CUDAFatAgent::processFunctionCondition(const unsigned int &agent_fat_id, const std::string &state_name, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+void CUDAFatAgent::processFunctionCondition(const unsigned int agent_fat_id, const std::string &state_name, CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
auto sm = states.find({agent_fat_id, state_name});
if (sm == states.end()) {
THROW exception::InvalidCudaAgentState("Error: Agent ('%s') state ('%s') was not found "
@@ -220,7 +220,7 @@ void CUDAFatAgent::processFunctionCondition(const unsigned int &agent_fat_id, co
}
}
-void CUDAFatAgent::setConditionState(const unsigned int &agent_fat_id, const std::string &state_name, const unsigned int numberOfDisabled) {
+void CUDAFatAgent::setConditionState(const unsigned int agent_fat_id, const std::string &state_name, const unsigned int numberOfDisabled) {
// check the cuda agent state map to find the correct state list for functions starting state
auto sm = states.find({agent_fat_id, state_name});
if (sm == states.end()) {
@@ -231,7 +231,7 @@ void CUDAFatAgent::setConditionState(const unsigned int &agent_fat_id, const std
sm->second->setDisabledAgents(numberOfDisabled);
}
-void *CUDAFatAgent::allocNewBuffer(const size_t &total_agent_size, const unsigned int &new_agents, const size_t &varCount) {
+void *CUDAFatAgent::allocNewBuffer(const size_t &total_agent_size, const unsigned int new_agents, const size_t &varCount) {
std::lock_guard guard(d_newLists_mutex);
// It is assumed that the buffer will be split into sub-buffers, each 64bit aligned
// So for total number of variables-1, add 64 bits incase required for alignment.
diff --git a/src/flamegpu/gpu/CUDAFatAgentStateList.cu b/src/flamegpu/gpu/CUDAFatAgentStateList.cu
index 44da8fb01..df89872ee 100644
--- a/src/flamegpu/gpu/CUDAFatAgentStateList.cu
+++ b/src/flamegpu/gpu/CUDAFatAgentStateList.cu
@@ -44,8 +44,8 @@ CUDAFatAgentStateList::~CUDAFatAgentStateList() {
}
void CUDAFatAgentStateList::addSubAgentVariables(
const AgentData &description,
- const unsigned int &master_fat_index,
- const unsigned int &sub_fat_index,
+ const unsigned int master_fat_index,
+ const unsigned int sub_fat_index,
const std::shared_ptr &mapping) {
for (const auto &v : description.variables) {
const auto &mapped = mapping->variables.find(v.first);
@@ -62,7 +62,7 @@ void CUDAFatAgentStateList::addSubAgentVariables(
}
}
}
-std::shared_ptr CUDAFatAgentStateList::getVariableBuffer(const unsigned int &fat_index, const std::string &name) {
+std::shared_ptr CUDAFatAgentStateList::getVariableBuffer(const unsigned int fat_index, const std::string &name) {
const AgentVariable variable = {fat_index, name};
return variables.at(variable);
}
@@ -132,7 +132,7 @@ unsigned int CUDAFatAgentStateList::getSizeWithDisabled() const {
unsigned int CUDAFatAgentStateList::getAllocatedSize() const {
return bufferLen;
}
-void CUDAFatAgentStateList::setAgentCount(const unsigned int &newCount, const bool &resetDisabled) {
+void CUDAFatAgentStateList::setAgentCount(const unsigned int newCount, const bool resetDisabled) {
if ((resetDisabled && newCount > bufferLen) || (!resetDisabled && (newCount + disabledAgents> bufferLen))) {
THROW exception::InvalidMemoryCapacity("Agent count will exceed allocated buffer size, "
"in CUDAFatAgentStateList::setAgentCount()\n");
@@ -142,7 +142,7 @@ void CUDAFatAgentStateList::setAgentCount(const unsigned int &newCount, const bo
}
aliveAgents = disabledAgents + newCount;
}
-unsigned int CUDAFatAgentStateList::scatterDeath(CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+unsigned int CUDAFatAgentStateList::scatterDeath(CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
// Build scatter data
std::vector sd;
for (const auto &v : variables_unique) {
@@ -166,7 +166,7 @@ unsigned int CUDAFatAgentStateList::scatterDeath(CUDAScatter &scatter, const uns
return living_agents;
}
-unsigned int CUDAFatAgentStateList::scatterAgentFunctionConditionFalse(CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+unsigned int CUDAFatAgentStateList::scatterAgentFunctionConditionFalse(CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
// This makes no sense if we have disabled agents (it's supposed to reorder to create disabled agents)
assert(disabledAgents == 0);
// Build scatter data
@@ -183,7 +183,7 @@ unsigned int CUDAFatAgentStateList::scatterAgentFunctionConditionFalse(CUDAScatt
aliveAgents, 0, false, disabledAgents);
return scattered_agents;
}
-unsigned int CUDAFatAgentStateList::scatterAgentFunctionConditionTrue(const unsigned int &conditionFailCount, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+unsigned int CUDAFatAgentStateList::scatterAgentFunctionConditionTrue(const unsigned int conditionFailCount, CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
// This makes no sense if we have disabled agents (it's suppose to reorder to create disabled agents)
assert(disabledAgents == 0);
// Build scatter data
@@ -206,7 +206,7 @@ unsigned int CUDAFatAgentStateList::scatterAgentFunctionConditionTrue(const unsi
disabledAgents = conditionFailCount;
return scattered_agents;
}
-void CUDAFatAgentStateList::setDisabledAgents(const unsigned int &numberOfDisabled) {
+void CUDAFatAgentStateList::setDisabledAgents(const unsigned int numberOfDisabled) {
assert(numberOfDisabled <= aliveAgents);
disabledAgents = numberOfDisabled;
// update data_condition for each unique variable
@@ -231,7 +231,7 @@ void CUDAFatAgentStateList::scatterSort_async(CUDAScatter &scatter, unsigned int
}
scatter.scatterPosition_async(streamId, stream, CUDAScatter::Type::MESSAGE_OUTPUT, sd, aliveAgents);
}
-void CUDAFatAgentStateList::initVariables(std::set> &exclusionSet, const unsigned int initCount, const unsigned initOffset, CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+void CUDAFatAgentStateList::initVariables(std::set> &exclusionSet, const unsigned int initCount, const unsigned initOffset, CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
if (initCount && exclusionSet.size()) {
assert(initCount + initOffset <= bufferLen);
std::list> initVars;
diff --git a/src/flamegpu/gpu/CUDAMessage.cu b/src/flamegpu/gpu/CUDAMessage.cu
index 17b1e4b76..c8677e240 100644
--- a/src/flamegpu/gpu/CUDAMessage.cu
+++ b/src/flamegpu/gpu/CUDAMessage.cu
@@ -69,7 +69,7 @@ unsigned int CUDAMessage::getMaximumListSize() const {
unsigned int CUDAMessage::getMessageCount() const {
return message_count;
}
-void CUDAMessage::setMessageCount(const unsigned int &_message_count) {
+void CUDAMessage::setMessageCount(const unsigned int _message_count) {
if (_message_count > max_list_size) {
THROW exception::OutOfBoundsException("message count exceeds allocated message list size (%u > %u) in CUDAMessage::setMessageCount().", _message_count, max_list_size);
}
@@ -121,7 +121,7 @@ void *CUDAMessage::getReadPtr(const std::string &var_name) {
}
return message_list->getReadMessageListVariablePointer(var_name);
}
-void CUDAMessage::mapWriteRuntimeVariables(const AgentFunctionData& func, const CUDAAgent& cuda_agent, const unsigned int &writeLen, cudaStream_t stream) const {
+void CUDAMessage::mapWriteRuntimeVariables(const AgentFunctionData& func, const CUDAAgent& cuda_agent, const unsigned int writeLen, cudaStream_t stream) const {
// check that the message list has been allocated
if (!message_list) {
THROW exception::InvalidMessageData("Error: Initial message list for message '%s' has not been allocated, "
@@ -196,7 +196,7 @@ void CUDAMessage::swap() {
message_list->swap();
}
-void CUDAMessage::buildIndex(CUDAScatter &scatter, const unsigned int &streamId, const cudaStream_t &stream) {
+void CUDAMessage::buildIndex(CUDAScatter &scatter, const unsigned int streamId, const cudaStream_t &stream) {
// Build the index if required.
if (pbm_construction_required) {
specialisation_handler->buildIndex(scatter, streamId, stream);
diff --git a/src/flamegpu/gpu/CUDAScanCompaction.cu b/src/flamegpu/gpu/CUDAScanCompaction.cu
index e230acc5b..834e82ff4 100644
--- a/src/flamegpu/gpu/CUDAScanCompaction.cu
+++ b/src/flamegpu/gpu/CUDAScanCompaction.cu
@@ -9,7 +9,7 @@ namespace flamegpu {
/**
* CUDAScanCompaction methods
*/
-void CUDAScanCompaction::resize(const unsigned int& newCount, const Type& type, const unsigned int& streamId) {
+void CUDAScanCompaction::resize(const unsigned int newCount, const Type& type, const unsigned int streamId) {
assert(streamId < MAX_STREAMS);
assert(type < MAX_TYPES);
configs[type][streamId].resize_scan_flag(newCount);
@@ -21,10 +21,10 @@ void CUDAScanCompaction::zero_async(const Type& type, cudaStream_t stream, unsig
configs[type][streamId].zero_scan_flag_async(stream);
}
-const CUDAScanCompactionConfig &CUDAScanCompaction::getConfig(const Type& type, const unsigned int& streamId) {
+const CUDAScanCompactionConfig &CUDAScanCompaction::getConfig(const Type& type, const unsigned int streamId) {
return configs[type][streamId];
}
-CUDAScanCompactionConfig &CUDAScanCompaction::Config(const Type& type, const unsigned int& streamId) {
+CUDAScanCompactionConfig &CUDAScanCompaction::Config(const Type& type, const unsigned int streamId) {
return configs[type][streamId];
}
/**
@@ -53,7 +53,7 @@ void CUDAScanCompactionConfig::zero_scan_flag_async(cudaStream_t stream) {
}
}
-void CUDAScanCompactionConfig::resize_scan_flag(const unsigned int& count) {
+void CUDAScanCompactionConfig::resize_scan_flag(const unsigned int count) {
if (count + 1 > scan_flag_len) {
free_scan_flag();
gpuErrchk(cudaMalloc(&d_ptrs.scan_flag, (count + 1) * sizeof(unsigned int))); // +1 so we can get the total from the scan
diff --git a/src/flamegpu/gpu/CUDAScatter.cu b/src/flamegpu/gpu/CUDAScatter.cu
index ed996b312..46e01f17f 100644
--- a/src/flamegpu/gpu/CUDAScatter.cu
+++ b/src/flamegpu/gpu/CUDAScatter.cu
@@ -36,7 +36,7 @@ CUDAScatter::StreamData::~StreamData() {
d_data = nullptr;
data_len = 0;
}
-void CUDAScatter::StreamData::resize(const unsigned int &newLen) {
+void CUDAScatter::StreamData::resize(const unsigned int newLen) {
if (newLen > data_len) {
if (d_data) {
gpuErrchk(cudaFree(d_data));
@@ -99,16 +99,16 @@ __global__ void scatter_all_generic(
}
unsigned int CUDAScatter::scatter(
- const unsigned int &streamResourceId,
+ const unsigned int streamResourceId,
const cudaStream_t &stream,
const Type &messageOrAgent,
const VariableMap &vars,
const std::map &in,
const std::map &out,
- const unsigned int &itemCount,
- const unsigned int &out_index_offset,
- const bool &invert_scan_flag,
- const unsigned int &scatter_all_count) {
+ const unsigned int itemCount,
+ const unsigned int out_index_offset,
+ const bool invert_scan_flag,
+ const unsigned int scatter_all_count) {
std::vector scatterData;
for (const auto &v : vars) {
char *in_p = reinterpret_cast(in.at(v.first));
@@ -118,14 +118,14 @@ unsigned int CUDAScatter::scatter(
return scatter(streamResourceId, stream, messageOrAgent, scatterData, itemCount, out_index_offset, invert_scan_flag, scatter_all_count);
}
unsigned int CUDAScatter::scatter(
- const unsigned int &streamResourceId,
+ const unsigned int streamResourceId,
const cudaStream_t &stream,
const Type &messageOrAgent,
const std::vector &sd,
- const unsigned int &itemCount,
- const unsigned int &out_index_offset,
- const bool &invert_scan_flag,
- const unsigned int &scatter_all_count) {
+ const unsigned int itemCount,
+ const unsigned int out_index_offset,
+ const bool invert_scan_flag,
+ const unsigned int scatter_all_count) {
int blockSize = 0; // The launch configurator returned block size
int minGridSize = 0; // The minimum grid size needed to achieve the // maximum occupancy for a full device // launch
int gridSize = 0; // The actual grid size needed, based on input size
@@ -192,22 +192,22 @@ void CUDAScatter::scatterPosition_async(
gpuErrchkLaunch();
}
unsigned int CUDAScatter::scatterCount(
- const unsigned int &streamResourceId,
+ const unsigned int streamResourceId,
const cudaStream_t &stream,
const Type &messageOrAgent,
- const unsigned int &itemCount,
- const unsigned int &scatter_all_count) {
+ const unsigned int itemCount,
+ const unsigned int scatter_all_count) {
unsigned int rtn = 0;
gpuErrchk(cudaMemcpy(&rtn, scan.Config(messageOrAgent, streamResourceId).d_ptrs.position + itemCount - scatter_all_count, sizeof(unsigned int), cudaMemcpyDeviceToHost));
return rtn;
}
unsigned int CUDAScatter::scatterAll(
- const unsigned int &streamResourceId,
+ const unsigned int streamResourceId,
const cudaStream_t &stream,
const std::vector &sd,
- const unsigned int &itemCount,
- const unsigned int &out_index_offset) {
+ const unsigned int itemCount,
+ const unsigned int out_index_offset) {
if (!itemCount)
return itemCount; // No work to do
int blockSize = 0; // The launch configurator returned block size
@@ -231,13 +231,13 @@ unsigned int CUDAScatter::scatterAll(
return itemCount;
}
unsigned int CUDAScatter::scatterAll(
- const unsigned int &streamResourceId,
+ const unsigned int streamResourceId,
const cudaStream_t &stream,
const VariableMap &vars,
const std::map &in,
const std::map &out,
- const unsigned int &itemCount,
- const unsigned int &out_index_offset) {
+ const unsigned int itemCount,
+ const unsigned int out_index_offset) {
std::vector scatterData;
for (const auto &v : vars) {
char *in_p = reinterpret_cast(in.at(v.first));
@@ -268,12 +268,12 @@ __global__ void pbm_reorder_generic(
}
void CUDAScatter::pbm_reorder(
- const unsigned int &streamResourceId,
+ const unsigned int streamResourceId,
const cudaStream_t &stream,
const VariableMap &vars,
const std::map &in,
const std::map &out,
- const unsigned int &itemCount,
+ const unsigned int itemCount,
const unsigned int *d_bin_index,
const unsigned int *d_bin_sub_index,
const unsigned int *d_pbm) {
@@ -340,12 +340,12 @@ __global__ void scatter_new_agents(
memcpy(out_ptr, in_ptr, scatter_data[var_out].typeLen);
}
void CUDAScatter::scatterNewAgents(
- const unsigned int &streamResourceId,
+ const unsigned int streamResourceId,
const cudaStream_t &stream,
const std::vector &sd,
const size_t &totalAgentSize,
- const unsigned int &inCount,
- const unsigned int &outIndexOffset) {
+ const unsigned int inCount,
+ const unsigned int outIndexOffset) {
// 1 thread per agent variable
const unsigned int threadCount = static_cast(sd.size()) * inCount;
int blockSize = 0; // The launch configurator returned block size
@@ -539,13 +539,13 @@ __global__ void reorder_array_messages(
}
}
void CUDAScatter::arrayMessageReorder(
- const unsigned int &streamResourceId,
+ const unsigned int streamResourceId,
const cudaStream_t &stream,
const VariableMap &vars,
const std::map &in,
const std::map &out,
- const unsigned int &itemCount,
- const unsigned int &array_length,
+ const unsigned int itemCount,
+ const unsigned int array_length,
unsigned int *d_write_flag) {
// If itemCount is 0, then there is no work to be done.
if (itemCount == 0) {
diff --git a/src/flamegpu/gpu/CUDASimulation.cu b/src/flamegpu/gpu/CUDASimulation.cu
index e687c7232..f70976b93 100644
--- a/src/flamegpu/gpu/CUDASimulation.cu
+++ b/src/flamegpu/gpu/CUDASimulation.cu
@@ -1655,7 +1655,7 @@ void CUDASimulation::initOffsetsAndMap() {
}
}
-void CUDASimulation::processHostAgentCreation(const unsigned int &streamId) {
+void CUDASimulation::processHostAgentCreation(const unsigned int streamId) {
size_t t_bufflen = 0;
char *t_buff = nullptr;
char *dt_buff = nullptr;
diff --git a/src/flamegpu/io/JSONLogger.cu b/src/flamegpu/io/JSONLogger.cu
index 97cfcd47c..178e35d5a 100644
--- a/src/flamegpu/io/JSONLogger.cu
+++ b/src/flamegpu/io/JSONLogger.cu
@@ -26,7 +26,7 @@ void JSONLogger::log(const RunLog &log, bool logConfig, bool logSteps, bool logE
}
template
-void JSONLogger::writeAny(T &writer, const util::Any &value, const unsigned int &elements) const {
+void JSONLogger::writeAny(T &writer, const util::Any &value, const unsigned int elements) const {
// Output value
if (elements > 1) {
writer.StartArray();
diff --git a/src/flamegpu/io/JSONStateWriter.cpp b/src/flamegpu/io/JSONStateWriter.cpp
index c56e5a264..c3437e697 100644
--- a/src/flamegpu/io/JSONStateWriter.cpp
+++ b/src/flamegpu/io/JSONStateWriter.cpp
@@ -20,7 +20,7 @@ JSONStateWriter::JSONStateWriter(
const std::string &model_name,
const std::shared_ptr &env_manager,
const util::StringPairUnorderedMap>&model,
- const unsigned int &iterations,
+ const unsigned int iterations,
const std::string &output_file,
const Simulation *_sim_instance)
: StateWriter(model_name, env_manager, model, iterations, output_file, _sim_instance) {}
diff --git a/src/flamegpu/io/XMLLogger.cu b/src/flamegpu/io/XMLLogger.cu
index 9bc5f46f1..992b5585b 100644
--- a/src/flamegpu/io/XMLLogger.cu
+++ b/src/flamegpu/io/XMLLogger.cu
@@ -282,7 +282,7 @@ void XMLLogger::writeCommonLogFrame(tinyxml2::XMLDocument &doc, tinyxml2::XMLEle
}
}
-void XMLLogger::writeAny(tinyxml2::XMLElement *pElement, const util::Any &value, const unsigned int &elements) const {
+void XMLLogger::writeAny(tinyxml2::XMLElement *pElement, const util::Any &value, const unsigned int elements) const {
std::stringstream ss;
// Loop through elements, to construct csv string
for (unsigned int el = 0; el < elements; ++el) {
diff --git a/src/flamegpu/io/XMLStateWriter.cpp b/src/flamegpu/io/XMLStateWriter.cpp
index b38300108..324e4e24b 100644
--- a/src/flamegpu/io/XMLStateWriter.cpp
+++ b/src/flamegpu/io/XMLStateWriter.cpp
@@ -65,7 +65,7 @@ XMLStateWriter::XMLStateWriter(
const std::string &model_name,
const std::shared_ptr& env_manager,
const util::StringPairUnorderedMap> &model,
- const unsigned int &iterations,
+ const unsigned int iterations,
const std::string &output_file,
const Simulation *_sim_instance)
: StateWriter(model_name, env_manager, model, iterations, output_file, _sim_instance) {}
diff --git a/src/flamegpu/model/AgentFunctionDescription.cpp b/src/flamegpu/model/AgentFunctionDescription.cpp
index ab282e0aa..56c471a50 100644
--- a/src/flamegpu/model/AgentFunctionDescription.cpp
+++ b/src/flamegpu/model/AgentFunctionDescription.cpp
@@ -286,7 +286,7 @@ void AgentFunctionDescription::setMessageOutput(MessageBruteForce::Description &
mdl->name.c_str(), message.getName().c_str());
}
}
-void AgentFunctionDescription::setMessageOutputOptional(const bool &output_is_optional) {
+void AgentFunctionDescription::setMessageOutputOptional(const bool output_is_optional) {
if (output_is_optional != this->function->message_output_optional) {
this->function->message_output_optional = output_is_optional;
if (auto b = this->function->message_output.lock()) {
@@ -362,7 +362,7 @@ void AgentFunctionDescription::setAgentOutput(AgentDescription &agent, const std
mdl->name.c_str(), agent.getName().c_str());
}
}
-void AgentFunctionDescription::setAllowAgentDeath(const bool &has_death) {
+void AgentFunctionDescription::setAllowAgentDeath(const bool has_death) {
function->has_agent_death = has_death;
}
diff --git a/src/flamegpu/model/SubModelDescription.cpp b/src/flamegpu/model/SubModelDescription.cpp
index 442ad459c..6688a858d 100644
--- a/src/flamegpu/model/SubModelDescription.cpp
+++ b/src/flamegpu/model/SubModelDescription.cpp
@@ -127,7 +127,7 @@ const SubEnvironmentDescription &SubModelDescription::getSubEnvironment(bool aut
return *data->subenvironment->description;
}
-void SubModelDescription::setMaxSteps(const unsigned int &max_steps) {
+void SubModelDescription::setMaxSteps(const unsigned int max_steps) {
data->max_steps = max_steps;
}
unsigned int SubModelDescription::getMaxSteps() const {
diff --git a/src/flamegpu/pop/DeviceAgentVector_impl.cu b/src/flamegpu/pop/DeviceAgentVector_impl.cu
index 146b4b0ce..68f59d071 100644
--- a/src/flamegpu/pop/DeviceAgentVector_impl.cu
+++ b/src/flamegpu/pop/DeviceAgentVector_impl.cu
@@ -5,7 +5,7 @@ namespace flamegpu {
DeviceAgentVector_impl::DeviceAgentVector_impl(CUDAAgent& _cuda_agent, const std::string &_cuda_agent_state,
const VarOffsetStruct& _agentOffsets, std::vector& _newAgentData,
- CUDAScatter& _scatter, const unsigned int& _streamId, const cudaStream_t& _stream)
+ CUDAScatter& _scatter, const unsigned int _streamId, const cudaStream_t& _stream)
: AgentVector(_cuda_agent.getAgentDescription(), 0)
, unbound_buffers_has_changed(false)
, known_device_buffer_size(_cuda_agent.getStateSize(_cuda_agent_state))
@@ -142,7 +142,7 @@ void DeviceAgentVector_impl::reinitUnboundBuffers() {
unbound_buffers_has_changed = true; // Probably not required, but if they are being init, high chance they're going to be changed
unbound_host_buffer_invalid = false;
}
-void DeviceAgentVector_impl::resizeUnboundBuffers(const unsigned int& new_capacity, bool init) {
+void DeviceAgentVector_impl::resizeUnboundBuffers(const unsigned int new_capacity, bool init) {
// Resize to match agent_count
for (auto& buff : unbound_buffers) {
if (!buff.host) {
diff --git a/src/flamegpu/runtime/HostAPI.cu b/src/flamegpu/runtime/HostAPI.cu
index 53bdc09b3..b7629a02d 100644
--- a/src/flamegpu/runtime/HostAPI.cu
+++ b/src/flamegpu/runtime/HostAPI.cu
@@ -14,7 +14,7 @@ HostAPI::HostAPI(CUDASimulation &_agentModel,
AgentDataMap &_agentData,
const std::shared_ptr& env,
CUDAMacroEnvironment ¯o_env,
- const unsigned int& _streamId,
+ const unsigned int _streamId,
cudaStream_t _stream)
: random(rng)
, environment(_agentModel.getInstanceID(), env, macro_env)
diff --git a/src/flamegpu/runtime/detail/curve/curve_rtc.cpp b/src/flamegpu/runtime/detail/curve/curve_rtc.cpp
index 5f9b9d207..f176616b7 100644
--- a/src/flamegpu/runtime/detail/curve/curve_rtc.cpp
+++ b/src/flamegpu/runtime/detail/curve/curve_rtc.cpp
@@ -185,7 +185,7 @@ __device__ __forceinline__ T ReadOnlyDeviceEnvironment::getProperty(const char(&
}
template
-__device__ __forceinline__ T ReadOnlyDeviceEnvironment::getProperty(const char(&name)[M], const unsigned int &index) const {
+__device__ __forceinline__ T ReadOnlyDeviceEnvironment::getProperty(const char(&name)[M], const unsigned int index) const {
$DYNAMIC_ENV_GETARRAYVARIABLE_IMPL
}
diff --git a/src/flamegpu/runtime/messaging/MessageBucket.cu b/src/flamegpu/runtime/messaging/MessageBucket.cu
index 4cb978f38..801159df8 100644
--- a/src/flamegpu/runtime/messaging/MessageBucket.cu
+++ b/src/flamegpu/runtime/messaging/MessageBucket.cu
@@ -128,7 +128,7 @@ void MessageBucket::CUDAModelHandler::resizeCubTemp() {
}
}
-void MessageBucket::CUDAModelHandler::resizeKeysVals(const unsigned int &newSize) {
+void MessageBucket::CUDAModelHandler::resizeKeysVals(const unsigned int newSize) {
size_t bytesCheck = newSize * sizeof(unsigned int);
if (bytesCheck > d_keys_vals_storage_bytes) {
if (d_keys) {
diff --git a/src/flamegpu/runtime/messaging/MessageSpatial2D.cu b/src/flamegpu/runtime/messaging/MessageSpatial2D.cu
index 1b8826ca9..d8224bc5c 100644
--- a/src/flamegpu/runtime/messaging/MessageSpatial2D.cu
+++ b/src/flamegpu/runtime/messaging/MessageSpatial2D.cu
@@ -138,7 +138,7 @@ void MessageSpatial2D::CUDAModelHandler::resizeCubTemp(cudaStream_t stream) {
}
}
-void MessageSpatial2D::CUDAModelHandler::resizeKeysVals(const unsigned int &newSize) {
+void MessageSpatial2D::CUDAModelHandler::resizeKeysVals(const unsigned int newSize) {
size_t bytesCheck = newSize * sizeof(unsigned int);
if (bytesCheck > d_keys_vals_storage_bytes) {
if (d_keys) {
diff --git a/src/flamegpu/runtime/messaging/MessageSpatial3D.cu b/src/flamegpu/runtime/messaging/MessageSpatial3D.cu
index bf12e8285..b73403939 100644
--- a/src/flamegpu/runtime/messaging/MessageSpatial3D.cu
+++ b/src/flamegpu/runtime/messaging/MessageSpatial3D.cu
@@ -137,7 +137,7 @@ void MessageSpatial3D::CUDAModelHandler::resizeCubTemp(cudaStream_t stream) {
}
}
-void MessageSpatial3D::CUDAModelHandler::resizeKeysVals(const unsigned int &newSize) {
+void MessageSpatial3D::CUDAModelHandler::resizeKeysVals(const unsigned int newSize) {
size_t bytesCheck = newSize * sizeof(unsigned int);
if (bytesCheck > d_keys_vals_storage_bytes) {
if (d_keys) {
diff --git a/src/flamegpu/runtime/utility/HostEnvironment.cu b/src/flamegpu/runtime/utility/HostEnvironment.cu
index c8f45b0b3..f69d3d902 100644
--- a/src/flamegpu/runtime/utility/HostEnvironment.cu
+++ b/src/flamegpu/runtime/utility/HostEnvironment.cu
@@ -2,7 +2,7 @@
namespace flamegpu {
-HostEnvironment::HostEnvironment(const unsigned int &_instance_id, const std::shared_ptr &env, CUDAMacroEnvironment& _macro_env)
+HostEnvironment::HostEnvironment(const unsigned int _instance_id, const std::shared_ptr &env, CUDAMacroEnvironment& _macro_env)
: env_mgr(env)
, macro_env(_macro_env)
, instance_id(_instance_id) { }
diff --git a/src/flamegpu/sim/LogFrame.cu b/src/flamegpu/sim/LogFrame.cu
index 5bfc81f85..94bdef33c 100644
--- a/src/flamegpu/sim/LogFrame.cu
+++ b/src/flamegpu/sim/LogFrame.cu
@@ -8,7 +8,7 @@ LogFrame::LogFrame()
LogFrame::LogFrame(const std::map &_environment,
const std::map, unsigned int>> &_agents,
-const unsigned int &_step_count)
+const unsigned int _step_count)
: environment(_environment)
, agents(_agents)
, step_count(_step_count) { }
@@ -29,7 +29,7 @@ AgentLogFrame LogFrame::getAgent(const std::string &agent_name, const std::strin
return AgentLogFrame(it->second.first, it->second.second);
}
-AgentLogFrame::AgentLogFrame(const std::map &_data, const unsigned int &_count)
+AgentLogFrame::AgentLogFrame(const std::map &_data, const unsigned int _count)
: data(_data)
, count(_count) { }
@@ -66,7 +66,7 @@ StepLogFrame::StepLogFrame()
StepLogFrame::StepLogFrame(const std::map&& _environment,
const std::map, unsigned int>>&& _agents,
- const unsigned int& _step_count)
+ const unsigned int _step_count)
: LogFrame(_environment, _agents, _step_count)
, step_time(0.0) { }
@@ -80,7 +80,7 @@ ExitLogFrame::ExitLogFrame()
ExitLogFrame::ExitLogFrame(const std::map&& _environment,
const std::map, unsigned int>>&& _agents,
- const unsigned int& _step_count)
+ const unsigned int _step_count)
: LogFrame(_environment, _agents, _step_count)
, rtc_time(0.0)
, init_time(0.0)
diff --git a/src/flamegpu/sim/LoggingConfig.cu b/src/flamegpu/sim/LoggingConfig.cu
index 86a1551a9..61c36fa0c 100644
--- a/src/flamegpu/sim/LoggingConfig.cu
+++ b/src/flamegpu/sim/LoggingConfig.cu
@@ -68,7 +68,7 @@ StepLoggingConfig::StepLoggingConfig(const StepLoggingConfig &other)
StepLoggingConfig::StepLoggingConfig(const LoggingConfig &other)
: LoggingConfig(other)
, frequency(1) { }
-void StepLoggingConfig::setFrequency(const unsigned int &steps) {
+void StepLoggingConfig::setFrequency(const unsigned int steps) {
frequency = steps;
}
diff --git a/src/flamegpu/sim/RunPlan.cpp b/src/flamegpu/sim/RunPlan.cpp
index bb85ee021..49154957a 100644
--- a/src/flamegpu/sim/RunPlan.cpp
+++ b/src/flamegpu/sim/RunPlan.cpp
@@ -8,7 +8,7 @@ namespace flamegpu {
RunPlan::RunPlan(const ModelDescription &model)
: RunPlan(std::make_shared const>(model.model->environment->getPropertiesMap()),
model.model->exitConditions.size() + model.model->exitConditionCallbacks.size() > 0) { }
-RunPlan::RunPlan(const std::shared_ptr> &environment, const bool &allow_0)
+RunPlan::RunPlan(const std::shared_ptr> &environment, const bool allow_0)
: random_seed(0)
, steps(1)
, environment(environment)
@@ -28,7 +28,7 @@ RunPlan& RunPlan::operator=(const RunPlan& other) {
void RunPlan::setRandomSimulationSeed(const uint64_t &_random_seed) {
random_seed = _random_seed;
}
-void RunPlan::setSteps(const unsigned int &_steps) {
+void RunPlan::setSteps(const unsigned int _steps) {
if (_steps == 0 && !allow_0_steps) {
throw exception::OutOfBoundsException("Model description requires atleast 1 exit condition to have unlimited steps, "
"in RunPlan::setSteps()");
@@ -73,7 +73,7 @@ RunPlanVector RunPlan::operator+(const RunPlanVector& rhs) const {
rtn+=*this;
return rtn;
}
-RunPlanVector RunPlan::operator*(const unsigned int& rhs) const {
+RunPlanVector RunPlan::operator*(const unsigned int rhs) const {
// Operation
RunPlanVector rtn(this->environment, this->allow_0_steps);
for (unsigned int i = 0; i < rhs; ++i) {
diff --git a/src/flamegpu/sim/RunPlanVector.cpp b/src/flamegpu/sim/RunPlanVector.cpp
index f5a1e7034..f13e78aca 100644
--- a/src/flamegpu/sim/RunPlanVector.cpp
+++ b/src/flamegpu/sim/RunPlanVector.cpp
@@ -12,20 +12,20 @@ RunPlanVector::RunPlanVector(const ModelDescription &model, unsigned int initial
this->resize(initial_length, RunPlan(environment, allow_0_steps));
}
-RunPlanVector::RunPlanVector(const std::shared_ptr> &_environment, const bool &_allow_0_steps)
+RunPlanVector::RunPlanVector(const std::shared_ptr> &_environment, const bool _allow_0_steps)
: std::vector()
, randomPropertySeed(std::random_device()())
, rand(randomPropertySeed)
, environment(_environment)
, allow_0_steps(_allow_0_steps) { }
-void RunPlanVector::setRandomSimulationSeed(const uint64_t &initial_seed, const unsigned int &step) {
+void RunPlanVector::setRandomSimulationSeed(const uint64_t &initial_seed, const unsigned int step) {
uint64_t current_seed = initial_seed;
for (auto &i : *this) {
i.setRandomSimulationSeed(current_seed);
current_seed += step;
}
}
-void RunPlanVector::setSteps(const unsigned int &steps) {
+void RunPlanVector::setSteps(const unsigned int steps) {
if (steps == 0 && !allow_0_steps) {
throw exception::OutOfBoundsException("Model description requires atleast 1 exit condition to have unlimited steps, "
"in RunPlanVector::setSteps()");
@@ -104,7 +104,7 @@ RunPlanVector& RunPlanVector::operator+=(const RunPlanVector& rhs) {
}
return *this;
}
-RunPlanVector& RunPlanVector::operator*=(const unsigned int& rhs) {
+RunPlanVector& RunPlanVector::operator*=(const unsigned int rhs) {
RunPlanVector copy(*this);
this->clear();
this->reserve(copy.size() * rhs);
@@ -116,7 +116,7 @@ RunPlanVector& RunPlanVector::operator*=(const unsigned int& rhs) {
}
return *this;
}
-RunPlanVector RunPlanVector::operator*(const unsigned int& rhs) const {
+RunPlanVector RunPlanVector::operator*(const unsigned int rhs) const {
RunPlanVector rtn(this->environment, this->allow_0_steps);
rtn.reserve(size() * rhs);
for (unsigned int i = 0; i < rhs; ++i) {
diff --git a/src/flamegpu/util/detail/compute_capability.cu b/src/flamegpu/util/detail/compute_capability.cu
index 4d4fd6fff..c363f3bd7 100644
--- a/src/flamegpu/util/detail/compute_capability.cu
+++ b/src/flamegpu/util/detail/compute_capability.cu
@@ -90,7 +90,7 @@ std::vector compute_capability::getNVRTCSupportedComputeCapabilties() {
int compute_capability::selectAppropraiteComputeCapability(const int target, const std::vector& architectures) {
int maxArch = 0;
- for (const int &arch : architectures) {
+ for (const int arch : architectures) {
if (arch <= target && arch > maxArch) {
maxArch = arch;
// The vector is in ascending order, so we can potentially early exit
diff --git a/swig/python/flamegpu.i b/swig/python/flamegpu.i
index df81d3357..a3824f1ee 100644
--- a/swig/python/flamegpu.i
+++ b/swig/python/flamegpu.i
@@ -614,7 +614,7 @@ class ModelVis;
def __len__(self):
return self.size()
}
- flamegpu::AgentVector::Agent flamegpu::AgentVector::__getitem__(const int &index) {
+ flamegpu::AgentVector::Agent flamegpu::AgentVector::__getitem__(const int index) {
if (index >= 0)
return $self->operator[](index);
return $self->operator[]($self->size() + index);
@@ -649,7 +649,7 @@ class ModelVis;
else: # "insert" is used as if the vector is a native C++ container
return self.insert(self, i, x)
}
- flamegpu::RunPlan &flamegpu::RunPlanVector::__getitem__(const int &index) {
+ flamegpu::RunPlan &flamegpu::RunPlanVector::__getitem__(const int index) {
if (index >= 0)
return $self->operator[](index);
return $self->operator[]($self->size() + index);
@@ -667,7 +667,7 @@ class ModelVis;
def __len__(self):
return self.size()
}
- flamegpu::DeviceAgentVector_impl::Agent flamegpu::DeviceAgentVector_impl::__getitem__(const int &index) {
+ flamegpu::DeviceAgentVector_impl::Agent flamegpu::DeviceAgentVector_impl::__getitem__(const int index) {
if (index >= 0)
return $self->operator[](index);
return $self->operator[]($self->size() + index);
@@ -992,7 +992,7 @@ TEMPLATE_VARIABLE_INSTANTIATE_FLOATS(logNormal, flamegpu::HostRandom::logNormal)
def __len__(self):
return self.size()
}
- flamegpu::visualiser::Color flamegpu::visualiser::Palette::__getitem__(const int &index) {
+ flamegpu::visualiser::Color flamegpu::visualiser::Palette::__getitem__(const int index) {
if (index >= 0)
return $self->operator[](index);
return $self->operator[]($self->size() + index);
diff --git a/tests/test_cases/pop/test_agent_instance.cu b/tests/test_cases/pop/test_agent_instance.cu
index 03af122b8..e3ab1ba0e 100644
--- a/tests/test_cases/pop/test_agent_instance.cu
+++ b/tests/test_cases/pop/test_agent_instance.cu
@@ -243,7 +243,7 @@ TEST(AgentInstanceTest, getsetVariable) {
// Wrong type
EXPECT_THROW((ai.setVariable)("int3", float3_ref), exception::InvalidVarType);
}
- { // setVariable(const std::string &variable_name, const unsigned int &array_index, const T &value)
+ { // setVariable(const std::string &variable_name, unsigned int array_index, const T &value)
// Bad name
EXPECT_THROW(ai.setVariable("wrong", 0, 1), exception::InvalidAgentVar);
// Index out of bounds
@@ -275,7 +275,7 @@ TEST(AgentInstanceTest, getsetVariable) {
// Wrong type
EXPECT_THROW((ai.getVariable)("int3"), exception::InvalidVarType);
}
- { // getVariable(const std::string &variable_name, const unsigned int &array_index) const
+ { // getVariable(const std::string &variable_name, unsigned int array_index) const
// Bad name
EXPECT_THROW(ai.getVariable("wrong", 0), exception::InvalidAgentVar);
// Index out of bounds
diff --git a/tests/test_cases/pop/test_agent_vector.cu b/tests/test_cases/pop/test_agent_vector.cu
index e3c63b5cf..2c63711e2 100644
--- a/tests/test_cases/pop/test_agent_vector.cu
+++ b/tests/test_cases/pop/test_agent_vector.cu
@@ -1448,7 +1448,7 @@ TEST(AgentVectorTest, AgentVector_Agent) {
// Wrong type
EXPECT_THROW((ai.setVariable)("int3", float3_ref), exception::InvalidVarType);
}
- { // setVariable(const std::string &variable_name, const unsigned int &array_index, const T &value)
+ { // setVariable(const std::string &variable_name, unsigned int array_index, const T &value)
// Bad name
EXPECT_THROW(ai.setVariable("wrong", 0, 1), exception::InvalidAgentVar);
// Index out of bounds
@@ -1480,7 +1480,7 @@ TEST(AgentVectorTest, AgentVector_Agent) {
// Wrong type
EXPECT_THROW((ai.getVariable)("int3"), exception::InvalidVarType);
}
- { // getVariable(const std::string &variable_name, const unsigned int &array_index)
+ { // getVariable(const std::string &variable_name, unsigned int array_index)
// Bad name
EXPECT_THROW(ai.getVariable("wrong", 0), exception::InvalidAgentVar);
// Index out of bounds
diff --git a/tests/test_cases/runtime/host_reduction/test_histogram_even.cu b/tests/test_cases/runtime/host_reduction/test_histogram_even.cu
index 64a482f71..bc3b3a8f1 100644
--- a/tests/test_cases/runtime/host_reduction/test_histogram_even.cu
+++ b/tests/test_cases/runtime/host_reduction/test_histogram_even.cu
@@ -39,7 +39,7 @@ FLAMEGPU_STEP_FUNCTION(step_histogramEvenuint64_t) {
* Doesn't work great with odd boundaries and ranges near integer limits
*/
template
-std::vector histogramEven(const std::array &variables, const unsigned int &histogramBins, const InT &lowerBound, const InT &upperBound) {
+std::vector histogramEven(const std::array &variables, const unsigned int histogramBins, const InT &lowerBound, const InT &upperBound) {
assert(upperBound > lowerBound);
std::vector rtn(histogramBins);
for (auto &i : rtn)
diff --git a/tests/test_cases/sim/test_RunPlanVector.cu b/tests/test_cases/sim/test_RunPlanVector.cu
index 184725edc..1566a43c9 100644
--- a/tests/test_cases/sim/test_RunPlanVector.cu
+++ b/tests/test_cases/sim/test_RunPlanVector.cu
@@ -625,7 +625,7 @@ TEST(TestRunPlanVector, operatorAddition) {
EXPECT_THROW((planVector += otherPlanVector), flamegpu::exception::InvalidArgument);
EXPECT_THROW((otherPlanVector += planVector), flamegpu::exception::InvalidArgument);
}
-// RunPlanVector operator*(const unsigned int& rhs) const;
+// RunPlanVector operator*(unsigned int rhs) const;
TEST(TestRunPlanVector, operatorMultiplication) {
// Define the simple model to use
flamegpu::ModelDescription model("test");
@@ -635,14 +635,14 @@ TEST(TestRunPlanVector, operatorMultiplication) {
EXPECT_EQ(plans.size(), totalPlans);
// Multiply the plan vector by a fixed size
- // RunPlanVector operator*(const unsigned int& rhs) const;
+ // RunPlanVector operator*(unsigned int rhs) const;
const uint32_t mult = 2u;
flamegpu::RunPlanVector morePlans = plans * mult;
const uint32_t expectedSize = mult * totalPlans;
EXPECT_EQ(morePlans.size(), expectedSize);
// multiply a plan in-place
- // RunPlanVector& operator*=(const unsigned int& rhs);
+ // RunPlanVector& operator*=(unsigned int rhs);
plans *= mult;
EXPECT_EQ(plans.size(), expectedSize);
}
From 4ca4d174cb186df307afc848ebbc4bfa8ad6ac0b Mon Sep 17 00:00:00 2001
From: Mondus
Date: Tue, 25 Oct 2022 17:49:10 +0100
Subject: [PATCH 02/13] char, unsigend char and size_type
---
.../MessageArray/MessageArrayDevice.cuh | 20 ++++++------
.../messaging/MessageArray/MessageArrayHost.h | 2 +-
.../MessageArray2D/MessageArray2DDevice.cuh | 32 +++++++++----------
.../MessageArray2D/MessageArray2DHost.h | 2 +-
.../MessageArray3D/MessageArray3DDevice.cuh | 32 +++++++++----------
.../MessageArray3D/MessageArray3DHost.h | 2 +-
.../MessageBruteForce/MessageBruteForceHost.h | 4 +--
.../runtime/utility/EnvironmentManager.cuh | 4 +--
.../flamegpu/runtime/utility/HostRandom.cuh | 4 +--
.../runtime/utility/RandomManager.cuh | 2 +-
include/flamegpu/sim/RunPlanVector.h | 8 ++---
.../runtime/messaging/MessageArray.cu | 2 +-
.../runtime/messaging/MessageArray2D.cu | 2 +-
.../runtime/messaging/MessageArray3D.cu | 2 +-
src/flamegpu/runtime/utility/RandomManager.cu | 2 +-
swig/python/flamegpu.i | 2 +-
.../model/test_environment_description.cu | 6 ++--
17 files changed, 64 insertions(+), 64 deletions(-)
diff --git a/include/flamegpu/runtime/messaging/MessageArray/MessageArrayDevice.cuh b/include/flamegpu/runtime/messaging/MessageArray/MessageArrayDevice.cuh
index e6c104f77..e9ca6c22c 100644
--- a/include/flamegpu/runtime/messaging/MessageArray/MessageArrayDevice.cuh
+++ b/include/flamegpu/runtime/messaging/MessageArray/MessageArrayDevice.cuh
@@ -39,7 +39,7 @@ class MessageArray::In {
* index is always init to 0
* @note See member variable documentation for their purposes
*/
- __device__ Message(const MessageArray::In &parent, const size_type &_index) : _parent(parent), index(_index) {}
+ __device__ Message(const MessageArray::In &parent, const size_type _index) : _parent(parent), index(_index) {}
#if !defined(SEATBELTS) || SEATBELTS
/**
* A null message which always returns the message at index 0
@@ -243,7 +243,7 @@ class MessageArray::In {
* @param x Search origin x coord
* @param _radius Search radius
*/
- inline __device__ WrapFilter(const size_type &_length, const size_type &x, const size_type &_radius);
+ inline __device__ WrapFilter(const size_type _length, const size_type x, const size_type _radius);
#if !defined(SEATBELTS) || SEATBELTS
/**
* A null filter which always returns 0 messages
@@ -443,7 +443,7 @@ class MessageArray::In {
* @param _radius Search radius
*/
- inline __device__ Filter(const size_type& _length, const size_type& x, const size_type& _radius);
+ inline __device__ Filter(size_type _length, size_type x, size_type _radius);
#if !defined(SEATBELTS) || SEATBELTS
/**
* A null filter which always returns 0 messages
@@ -506,7 +506,7 @@ class MessageArray::In {
* @note radius of 0 is unsupported
* @note The location x must be within the bounds of the message list
*/
- inline __device__ WrapFilter wrap(const size_type &x, const size_type &radius = 1) const {
+ inline __device__ WrapFilter wrap(const size_type x, const size_type radius = 1) const {
#if !defined(SEATBELTS) || SEATBELTS
if (radius == 0) {
DTHROW("Invalid radius %u for accessing array messagelist of length %u\n", radius, length);
@@ -539,7 +539,7 @@ class MessageArray::In {
* @note radius of 0 is unsupported
* @note The location x must be within the bounds of the message list
*/
- inline __device__ Filter operator() (const size_type &x, const size_type &radius = 1) const {
+ inline __device__ Filter operator() (const size_type x, const size_type radius = 1) const {
#if !defined(SEATBELTS) || SEATBELTS
if (radius == 0) {
DTHROW("Invalid radius %u for accessing array messagelist of length %u\n", radius, length);
@@ -558,7 +558,7 @@ class MessageArray::In {
__device__ size_type size(void) const {
return length;
}
- __device__ Message at(const size_type &index) const {
+ __device__ Message at(const size_type index) const {
#if !defined(SEATBELTS) || SEATBELTS
if (index >= length) {
DTHROW("Index is out of bounds for Array messagelist (%u >= %u).\n", index, length);
@@ -597,7 +597,7 @@ class MessageArray::Out {
/**
* Sets the array index to store the message in
*/
- __device__ inline void setIndex(const size_type &id) const;
+ __device__ inline void setIndex(const size_type id) const;
/**
* Sets the specified variable for this agents message
* @param variable_name Name of the variable
@@ -747,7 +747,7 @@ __device__ void MessageArray::Out::setVariable(const char(&variable_name)[M], co
/**
* Sets the array index to store the message in
*/
-__device__ void MessageArray::Out::setIndex(const size_type &id) const {
+__device__ void MessageArray::Out::setIndex(const size_type id) const {
unsigned int index = (blockDim.x * blockIdx.x) + threadIdx.x;
#if !defined(SEATBELTS) || SEATBELTS
@@ -762,7 +762,7 @@ __device__ void MessageArray::Out::setIndex(const size_type &id) const {
// Set scan flag incase the message is optional
this->scan_flag[index] = 1;
}
-__device__ MessageArray::In::WrapFilter::WrapFilter(const size_type &_length, const size_type &x, const size_type &_radius)
+__device__ MessageArray::In::WrapFilter::WrapFilter(const size_type _length, const size_type x, const size_type _radius)
: radius(_radius)
, length(_length) {
loc = x;
@@ -788,7 +788,7 @@ __device__ MessageArray::In::WrapFilter::Message& MessageArray::In::WrapFilter::
index_1d = (this->_parent.loc + relative_cell + this->_parent.length) % this->_parent.length;
return *this;
}
-__device__ MessageArray::In::Filter::Filter(const size_type &_length, const size_type &x, const size_type &_radius)
+__device__ MessageArray::In::Filter::Filter(const size_type _length, const size_type x, const size_type _radius)
: length(_length) {
loc = x;
min_cell = static_cast(x) - static_cast(_radius) < 0 ? -static_cast(x) : -static_cast(_radius);
diff --git a/include/flamegpu/runtime/messaging/MessageArray/MessageArrayHost.h b/include/flamegpu/runtime/messaging/MessageArray/MessageArrayHost.h
index 7eb7078db..44cc66bd3 100644
--- a/include/flamegpu/runtime/messaging/MessageArray/MessageArrayHost.h
+++ b/include/flamegpu/runtime/messaging/MessageArray/MessageArrayHost.h
@@ -145,7 +145,7 @@ class MessageArray::Description : public MessageBruteForce::Description {
Description& operator=(Description &&other_message) noexcept = delete;
public:
- void setLength(const size_type &len);
+ void setLength(const size_type len);
size_type getLength() const;
};
diff --git a/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DDevice.cuh b/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DDevice.cuh
index 2e6d43e25..ba31eb024 100644
--- a/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DDevice.cuh
+++ b/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DDevice.cuh
@@ -35,7 +35,7 @@ class MessageArray2D::In {
* index is always init to 0
* @note See member variable documentation for their purposes
*/
- __device__ Message(const MessageArray2D::In &parent, const size_type &_index) : _parent(parent), index(_index) {}
+ __device__ Message(const MessageArray2D::In &parent, const size_type _index) : _parent(parent), index(_index) {}
#if !defined(SEATBELTS) || SEATBELTS
/**
* A null message which always returns the message at index 0
@@ -258,7 +258,7 @@ class MessageArray2D::In {
* @param y Search origin y coord
* @param _radius Search radius
*/
- inline __device__ WrapFilter(const MetaData *_metadata, const size_type &x, const size_type &y, const size_type &_radius);
+ inline __device__ WrapFilter(const MetaData *_metadata, size_type x, size_type y, size_type _radius);
#if !defined(SEATBELTS) || SEATBELTS
/**
* A null filter which always returns 0 messages
@@ -473,7 +473,7 @@ class MessageArray2D::In {
* @param y Search origin y coord
* @param _radius Search radius
*/
- inline __device__ Filter(const MetaData *_metadata, const size_type &x, const size_type &y, const size_type &_radius);
+ inline __device__ Filter(const MetaData *_metadata, size_type x, size_type y, size_type _radius);
#if !defined(SEATBELTS) || SEATBELTS
/**
* A null filter which always returns 0 messages
@@ -691,7 +691,7 @@ class MessageArray2D::In {
* @param y Search origin y coord
* @param _radius Search radius
*/
- inline __device__ VonNeumannWrapFilter(const MetaData *_metadata, const size_type &x, const size_type &y, const size_type &_radius);
+ inline __device__ VonNeumannWrapFilter(const MetaData *_metadata, size_type x, size_type y, size_type _radius);
#if !defined(SEATBELTS) || SEATBELTS
/**
* A null filter which always returns 0 messages
@@ -906,7 +906,7 @@ class MessageArray2D::In {
* @param y Search origin y coord
* @param _radius Search radius
*/
- inline __device__ VonNeumannFilter(const MetaData *_metadata, const size_type &x, const size_type &y, const size_type &_radius);
+ inline __device__ VonNeumannFilter(const MetaData *_metadata, size_type x, size_type y, size_type _radius);
#if !defined(SEATBELTS) || SEATBELTS
/**
* A null filter which always returns 0 messages
@@ -974,7 +974,7 @@ class MessageArray2D::In {
* @note radius of 0 is unsupported
* @note The location [x, y] must be within the bounds of the message list
*/
- inline __device__ WrapFilter wrap(const size_type & x, const size_type & y, const size_type & radius = 1) const {
+ inline __device__ WrapFilter wrap(const size_type x, const size_type y, const size_type radius = 1) const {
#if !defined(SEATBELTS) || SEATBELTS
if (radius == 0) {
DTHROW("%u is not a valid radius for accessing Array2D message lists.\n", radius);
@@ -1009,7 +1009,7 @@ class MessageArray2D::In {
* @note radius of 0 is unsupported
* @note The location [x, y] must be within the bounds of the message list
*/
- inline __device__ Filter operator() (const size_type &x, const size_type &y, const size_type &radius = 1) const {
+ inline __device__ Filter operator() (const size_type x, const size_type y, const size_type radius = 1) const {
#if !defined(SEATBELTS) || SEATBELTS
if (radius == 0) {
DTHROW("%u is not a valid radius for accessing Array2D message lists.\n", radius);
@@ -1038,7 +1038,7 @@ class MessageArray2D::In {
* @note radius of 0 is unsupported
* @note The location [x, y] must be within the bounds of the message list
*/
- inline __device__ VonNeumannWrapFilter vn_wrap(const size_type & x, const size_type & y, const size_type & radius = 1) const {
+ inline __device__ VonNeumannWrapFilter vn_wrap(const size_type x, const size_type y, const size_type radius = 1) const {
#if !defined(SEATBELTS) || SEATBELTS
if (radius == 0) {
DTHROW("%u is not a valid radius for accessing Array2D message lists.\n", radius);
@@ -1073,7 +1073,7 @@ class MessageArray2D::In {
* @note radius of 0 is unsupported
* @note The location [x, y] must be within the bounds of the message list
*/
- inline __device__ VonNeumannFilter vn(const size_type &x, const size_type &y, const size_type &radius = 1) const {
+ inline __device__ VonNeumannFilter vn(const size_type x, const size_type y, const size_type radius = 1) const {
#if !defined(SEATBELTS) || SEATBELTS
if (radius == 0) {
DTHROW("%u is not a valid radius for accessing Array2D message lists.\n", radius);
@@ -1106,7 +1106,7 @@ class MessageArray2D::In {
__device__ size_type size(void) const {
return metadata->length;
}
- __device__ Message at(const size_type &x, const size_type &y) const {
+ __device__ Message at(const size_type x, const size_type y) const {
#if !defined(SEATBELTS) || SEATBELTS
if (x >= metadata->dimensions[0] || y >= metadata->dimensions[1]) {
DTHROW("Index is out of bounds for Array2D messagelist ([%u, %u] >= [%u, %u]).\n", x, y, metadata->dimensions[0], metadata->dimensions[1]);
@@ -1145,7 +1145,7 @@ class MessageArray2D::Out {
/**
* Sets the array index to store the message in
*/
- inline __device__ void setIndex(const size_type &x, const size_type &y) const;
+ inline __device__ void setIndex(const size_type x, const size_type y) const;
/**
* Sets the specified variable for this agents message
* @param variable_name Name of the variable
@@ -1345,7 +1345,7 @@ __device__ void MessageArray2D::Out::setVariable(const char(&variable_name)[M],
/**
* Sets the array index to store the message in
*/
-__device__ void MessageArray2D::Out::setIndex(const size_type &x, const size_type &y) const {
+__device__ void MessageArray2D::Out::setIndex(const size_type x, const size_type y) const {
unsigned int index = (blockDim.x * blockIdx.x) + threadIdx.x;
size_type index_1d =
y * metadata->dimensions[0] +
@@ -1363,7 +1363,7 @@ __device__ void MessageArray2D::Out::setIndex(const size_type &x, const size_typ
this->scan_flag[index] = 1;
}
// Moore Wrap
-__device__ MessageArray2D::In::WrapFilter::WrapFilter(const MetaData* _metadata, const size_type& x, const size_type& y, const size_type& _radius)
+__device__ MessageArray2D::In::WrapFilter::WrapFilter(const MetaData* _metadata, const size_type x, const size_type y, const size_type _radius)
: radius(_radius)
, metadata(_metadata) {
loc[0] = x;
@@ -1401,7 +1401,7 @@ __device__ MessageArray2D::In::WrapFilter::Message& MessageArray2D::In::WrapFilt
return *this;
}
// Moore
-__device__ MessageArray2D::In::Filter::Filter(const MetaData *_metadata, const size_type &x, const size_type &y, const size_type &_radius)
+__device__ MessageArray2D::In::Filter::Filter(const MetaData *_metadata, const size_type x, const size_type y, const size_type _radius)
: metadata(_metadata) {
loc[0] = x;
loc[1] = y;
@@ -1447,7 +1447,7 @@ __device__ MessageArray2D::In::Filter::Message& MessageArray2D::In::Filter::Mess
return *this;
}
// Von Neumann Wrap
-__device__ MessageArray2D::In::VonNeumannWrapFilter::VonNeumannWrapFilter(const MetaData* _metadata, const size_type& x, const size_type& y, const size_type& _radius)
+__device__ MessageArray2D::In::VonNeumannWrapFilter::VonNeumannWrapFilter(const MetaData* _metadata, const size_type x, const size_type y, const size_type _radius)
: radius(static_cast(_radius))
, metadata(_metadata) {
loc[0] = x;
@@ -1492,7 +1492,7 @@ __device__ MessageArray2D::In::VonNeumannWrapFilter::Message& MessageArray2D::In
return *this;
}
// Von Neumann
-__device__ MessageArray2D::In::VonNeumannFilter::VonNeumannFilter(const MetaData* _metadata, const size_type& x, const size_type& y, const size_type& _radius)
+__device__ MessageArray2D::In::VonNeumannFilter::VonNeumannFilter(const MetaData* _metadata, const size_type x, const size_type y, const size_type _radius)
: radius(static_cast(_radius))
, metadata(_metadata) {
loc[0] = x;
diff --git a/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DHost.h b/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DHost.h
index 67fce8772..018f8ff46 100644
--- a/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DHost.h
+++ b/include/flamegpu/runtime/messaging/MessageArray2D/MessageArray2DHost.h
@@ -146,7 +146,7 @@ class MessageArray2D::Description : public MessageBruteForce::Description {
Description& operator=(Description &&other_message) noexcept = delete;
public:
- void setDimensions(const size_type &len_x, const size_type &len_y);
+ void setDimensions(size_type len_x, size_type len_y);
void setDimensions(const std::array