Skip to content

Commit

Permalink
Place dstring.h inside namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robadob committed Sep 27, 2023
1 parent 83234ae commit d58bef0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/flamegpu/runtime/detail/curve/DeviceCurve.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,10 @@ __device__ __forceinline__ char* DeviceCurve::getEnvironmentMacroProperty(const
}

__device__ __forceinline__ bool DeviceCurve::isAgent(const char* agent_name) {
return dstrcmp(agent_name, sm()->agent_name) == 0;
return util::dstrcmp(agent_name, sm()->agent_name) == 0;
}
__device__ __forceinline__ bool DeviceCurve::isState(const char* agent_state) {
return dstrcmp(agent_state, sm()->state_name) == 0;
return util::dstrcmp(agent_state, sm()->state_name) == 0;
}

} // namespace curve
Expand Down
6 changes: 6 additions & 0 deletions include/flamegpu/util/dstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <cuda_runtime.h>

namespace flamegpu {
namespace util {
/**
* Device implementations of required string.h functionality
*/
Expand All @@ -24,4 +26,8 @@ __device__ __forceinline__ int dstrcmp(const char *s1, const char *s2) {

return (*p1 > *p2) - (*p2 > *p1);
}

} // namespace util
} // namespace flamegpu

#endif // INCLUDE_FLAMEGPU_UTIL_DSTRING_H_
4 changes: 2 additions & 2 deletions src/flamegpu/runtime/detail/curve/curve_rtc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ __device__ __forceinline__ void DeviceCurve::setNewAgentArrayVariable(const char
}
__device__ __forceinline__ bool DeviceCurve::isAgent(const char* agent_name) {
return dstrcmp(agent_name, "$DYNAMIC_AGENT_NAME") == 0;
return util::dstrcmp(agent_name, "$DYNAMIC_AGENT_NAME") == 0;
}
__device__ __forceinline__ bool DeviceCurve::isState(const char* agent_state) {
return dstrcmp(agent_state, "$DYNAMIC_AGENT_STATE") == 0;
return util::dstrcmp(agent_state, "$DYNAMIC_AGENT_STATE") == 0;
}
} // namespace curve
Expand Down

0 comments on commit d58bef0

Please sign in to comment.