From d519027582554490982aca099849501accec717b Mon Sep 17 00:00:00 2001 From: Robert Chisholm Date: Wed, 1 Mar 2023 09:25:31 +0000 Subject: [PATCH] BugFix: FLAMEGPU_SEATBELTS macro was changed back to SEATBELTS in a fw places. Probably a bad merge. --- .../runtime/environment/DeviceEnvironment.cuh | 6 ++-- .../DeviceEnvironmentDirectedGraph.cuh | 30 +++++++++---------- .../runtime/detail/curve/curve_rtc.cpp | 22 +++++++------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/include/flamegpu/runtime/environment/DeviceEnvironment.cuh b/include/flamegpu/runtime/environment/DeviceEnvironment.cuh index 14d70f8a5..ad412a1a5 100644 --- a/include/flamegpu/runtime/environment/DeviceEnvironment.cuh +++ b/include/flamegpu/runtime/environment/DeviceEnvironment.cuh @@ -121,7 +121,7 @@ __device__ __forceinline__ ReadOnlyDeviceMacroProperty ReadOnlyDe template __device__ __forceinline__ DeviceMacroProperty DeviceEnvironment::getMacroProperty(const char(&name)[N]) const { char* d_ptr = detail::curve::DeviceCurve::getEnvironmentMacroProperty(name); -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS if (!d_ptr) { return DeviceMacroProperty(nullptr, nullptr); } @@ -134,7 +134,7 @@ __device__ __forceinline__ DeviceMacroProperty DeviceEnvironment: template __device__ __forceinline__ DeviceEnvironmentDirectedGraph ReadOnlyDeviceEnvironment::getDirectedGraph(const char(&name)[M]) const { const detail::curve::Curve::VariableHash graph_hash = detail::curve::Curve::variableHash(name); -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS // Seatbelts check that the graph exists, by looking for mandatory vertex _id property // Rather than it failing at property lookup time if (detail::curve::DeviceCurve::getVariableIndex((graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_vertex")) + detail::curve::Curve::variableHash("_id")) @@ -149,7 +149,7 @@ __device__ __forceinline__ DeviceEnvironmentDirectedGraph ReadOnlyDeviceEnvironm template __device__ __forceinline__ DeviceEnvironmentDirectedGraph ReadOnlyDeviceEnvironment::getDirectedGraph(const char(&name)[M]) const { const detail::curve::Curve::VariableHash graph_hash = detail::curve::Curve::variableHash(name); -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS // Seatbelts check that the graph exists, by requesting it's hash if (detail::curve::DeviceCurve::getGraphHash(name) == detail::curve::DeviceCurve::UNKNOWN_GRAPH) { DTHROW("Environment directed graph with name '%s' was not found\n", name); diff --git a/include/flamegpu/runtime/environment/DeviceEnvironmentDirectedGraph.cuh b/include/flamegpu/runtime/environment/DeviceEnvironmentDirectedGraph.cuh index 8f95e6b2d..16fba775b 100644 --- a/include/flamegpu/runtime/environment/DeviceEnvironmentDirectedGraph.cuh +++ b/include/flamegpu/runtime/environment/DeviceEnvironmentDirectedGraph.cuh @@ -423,7 +423,7 @@ __device__ DeviceEnvironmentDirectedGraph::OutEdgeFilter::OutEdgeFilter(const de : bucket_begin(0) , bucket_end(0) , graph_hash(_graph_hash) { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS // Vertex "_id" always exists const unsigned int VERTEX_COUNT = detail::curve::DeviceCurve::getVariableCount("_id", graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_vertex")); if (vertexID >= VERTEX_COUNT) { @@ -432,7 +432,7 @@ __device__ DeviceEnvironmentDirectedGraph::OutEdgeFilter::OutEdgeFilter(const de } #endif unsigned int* pbm = detail::curve::DeviceCurve::getEnvironmentDirectedGraphPBM(graph_hash); -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS if (!pbm) return; #endif bucket_begin = pbm[vertexID]; @@ -443,7 +443,7 @@ __device__ DeviceEnvironmentDirectedGraph::InEdgeFilter::InEdgeFilter(const deta , bucket_end(0) , graph_ipbm_edges(nullptr) , graph_hash(_graph_hash) { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS // Vertex "_id" always exists const unsigned int VERTEX_COUNT = detail::curve::DeviceCurve::getVariableCount("_id", graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_vertex")); if (vertexID >= VERTEX_COUNT) { @@ -452,7 +452,7 @@ __device__ DeviceEnvironmentDirectedGraph::InEdgeFilter::InEdgeFilter(const deta } #endif unsigned int* ipbm = detail::curve::DeviceCurve::getEnvironmentDirectedGraphIPBM(graph_hash); -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS if (!ipbm) return; #endif bucket_begin = ipbm[vertexID]; @@ -463,7 +463,7 @@ __device__ DeviceEnvironmentDirectedGraph::InEdgeFilter::InEdgeFilter(const deta template __device__ T DeviceEnvironmentDirectedGraph::OutEdgeFilter::Edge::getProperty(const char(&property_name)[N]) const { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS if (edge_index >= _parent.bucket_end) { DTHROW("Edge index exceeds bin length, unable to get property '%s'.\n", property_name); return {}; @@ -475,7 +475,7 @@ __device__ T DeviceEnvironmentDirectedGraph::OutEdgeFilter::Edge::getProperty(co } template __device__ T DeviceEnvironmentDirectedGraph::OutEdgeFilter::Edge::getProperty(const char(&property_name)[M], const unsigned int& element_index) const { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS if (edge_index >= _parent.bucket_end) { DTHROW("Edge index exceeds bin length, unable to get property '%s'.\n", property_name); return {}; @@ -487,7 +487,7 @@ T DeviceEnvironmentDirectedGraph::OutEdgeFilter::Edge::getProperty(const char(&p } template __device__ T DeviceEnvironmentDirectedGraph::InEdgeFilter::Edge::getProperty(const char(&property_name)[N]) const { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS const unsigned int EDGE_COUNT = detail::curve::DeviceCurve::getVariableCount("_source_dest", _parent.graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_edge")); if (edge_index >= EDGE_COUNT) { DTHROW("Edge index exceeds edge count, unable to get property '%s'.\n", property_name); @@ -500,7 +500,7 @@ __device__ T DeviceEnvironmentDirectedGraph::InEdgeFilter::Edge::getProperty(con } template __device__ T DeviceEnvironmentDirectedGraph::InEdgeFilter::Edge::getProperty(const char(&property_name)[M], const unsigned int& element_index) const { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS const unsigned int EDGE_COUNT = detail::curve::DeviceCurve::getVariableCount("_source_dest", _parent.graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_edge")); if (edge_index >= EDGE_COUNT) { DTHROW("Edge index exceeds edge count, unable to get property '%s'.\n", property_name); @@ -518,7 +518,7 @@ __device__ __forceinline__ id_t DeviceEnvironmentDirectedGraph::InEdgeFilter::Ed return getProperty("_source_dest", 1); } __device__ __forceinline__ id_t DeviceEnvironmentDirectedGraph::getVertexID(const unsigned int vertex_index) const { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS const unsigned int VERTEX_COUNT = detail::curve::DeviceCurve::getVariableCount("_id", graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_vertex")); if (vertex_index >= VERTEX_COUNT) { DTHROW("Vertex index (%u) exceeds vertex count (%u), unable to get vertex ID.\n", vertex_index, VERTEX_COUNT); @@ -529,7 +529,7 @@ __device__ __forceinline__ id_t DeviceEnvironmentDirectedGraph::getVertexID(cons } template __device__ __forceinline__ T DeviceEnvironmentDirectedGraph::getVertexProperty(const char(&property_name)[M], const unsigned int vertex_index) const { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS const unsigned int VERTEX_COUNT = detail::curve::DeviceCurve::getVariableCount(property_name, graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_vertex")); if (vertex_index >= VERTEX_COUNT) { DTHROW("Vertex index (%u) exceeds vertex count (%u), unable to get property '%s'.\n", vertex_index, VERTEX_COUNT, property_name); @@ -540,7 +540,7 @@ __device__ __forceinline__ T DeviceEnvironmentDirectedGraph::getVertexProperty(c } template __device__ __forceinline__ T DeviceEnvironmentDirectedGraph::getVertexProperty(const char(&property_name)[M], const unsigned int vertex_index, const unsigned int element_index) const { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS const unsigned int VERTEX_COUNT = detail::curve::DeviceCurve::getVariableCount(property_name, graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_vertex")); if (vertex_index >= VERTEX_COUNT) { DTHROW("Vertex index (%u) exceeds vertex count (%u), unable to get property '%s'.\n", vertex_index, VERTEX_COUNT, property_name); @@ -551,7 +551,7 @@ __device__ __forceinline__ T DeviceEnvironmentDirectedGraph::getVertexProperty(c } __device__ __forceinline__ id_t DeviceEnvironmentDirectedGraph::getEdgeSource(const unsigned int edge_index) const { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS const unsigned int EDGE_COUNT = detail::curve::DeviceCurve::getVariableCount("_source_dest", graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_edge")); if (edge_index >= EDGE_COUNT) { DTHROW("Edge index (%u) exceeds edge count (%u), unable to get edge source vertex.\n", edge_index, EDGE_COUNT); @@ -561,7 +561,7 @@ __device__ __forceinline__ id_t DeviceEnvironmentDirectedGraph::getEdgeSource(co return getEdgeProperty("_source_dest", edge_index, 1); } __device__ __forceinline__ id_t DeviceEnvironmentDirectedGraph::getEdgeDestination(const unsigned int edge_index) const { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS const unsigned int EDGE_COUNT = detail::curve::DeviceCurve::getVariableCount("_source_dest", graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_edge")); if (edge_index >= EDGE_COUNT) { DTHROW("Edge index (%u) exceeds edge count (%u), unable to get edge destination vertex.\n", edge_index, EDGE_COUNT); @@ -572,7 +572,7 @@ __device__ __forceinline__ id_t DeviceEnvironmentDirectedGraph::getEdgeDestinati } template __device__ __forceinline__ T DeviceEnvironmentDirectedGraph::getEdgeProperty(const char(&property_name)[M], const unsigned int edge_index) const { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS const unsigned int EDGE_COUNT = detail::curve::DeviceCurve::getVariableCount("_source_dest", graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_edge")); if (edge_index >= EDGE_COUNT) { DTHROW("Edge index (%u) exceeds edge count (%u), unable to get property '%s'.\n", edge_index, EDGE_COUNT, property_name); @@ -583,7 +583,7 @@ __device__ __forceinline__ T DeviceEnvironmentDirectedGraph::getEdgeProperty(con } template __device__ __forceinline__ T DeviceEnvironmentDirectedGraph::getEdgeProperty(const char(&property_name)[M], const unsigned int edge_index, const unsigned int element_index) const { -#if !defined(SEATBELTS) || SEATBELTS +#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS const unsigned int EDGE_COUNT = detail::curve::DeviceCurve::getVariableCount("_source_dest", graph_hash ^ detail::curve::Curve::variableHash("_environment_directed_graph_edge")); if (edge_index >= EDGE_COUNT) { DTHROW("Edge index (%u) exceeds edge count (%u), unable to get property '%s'.\n", edge_index, EDGE_COUNT, property_name); diff --git a/src/flamegpu/runtime/detail/curve/curve_rtc.cpp b/src/flamegpu/runtime/detail/curve/curve_rtc.cpp index eab161847..62a58fc45 100644 --- a/src/flamegpu/runtime/detail/curve/curve_rtc.cpp +++ b/src/flamegpu/runtime/detail/curve/curve_rtc.cpp @@ -942,7 +942,7 @@ void CurveRTCHost::initHeaderGetters() { getDirectedGraphPBMImpl << " }\n"; } else { ++ct; } } - getDirectedGraphPBMImpl << "#if !defined(SEATBELTS) || SEATBELTS\n"; + getDirectedGraphPBMImpl << "#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS\n"; getDirectedGraphPBMImpl << " DTHROW(\"Directed graph PBM was not found during getEnvironmentDirectedGraphPBM().\\n\");\n"; getDirectedGraphPBMImpl << "#endif\n"; getDirectedGraphPBMImpl << " return {};\n"; @@ -960,7 +960,7 @@ void CurveRTCHost::initHeaderGetters() { getDirectedGraphIPBMImpl << " }\n"; } else { ++ct; } } - getDirectedGraphIPBMImpl << "#if !defined(SEATBELTS) || SEATBELTS\n"; + getDirectedGraphIPBMImpl << "#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS\n"; getDirectedGraphIPBMImpl << " DTHROW(\"Directed graph IPBM was not found during getEnvironmentDirectedGraphIPBM().\\n\");\n"; getDirectedGraphIPBMImpl << "#endif\n"; getDirectedGraphIPBMImpl << " return {};\n"; @@ -978,7 +978,7 @@ void CurveRTCHost::initHeaderGetters() { getDirectedGraphIPBMEdgesImpl << " }\n"; } else { ++ct; } } - getDirectedGraphIPBMEdgesImpl << "#if !defined(SEATBELTS) || SEATBELTS\n"; + getDirectedGraphIPBMEdgesImpl << "#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS\n"; getDirectedGraphIPBMEdgesImpl << " DTHROW(\"Directed graph IPBM edge list was not found during getEnvironmentDirectedGraphIPBMEdges().\\n\");\n"; getDirectedGraphIPBMEdgesImpl << "#endif\n"; getDirectedGraphIPBMEdgesImpl << " return {};\n"; @@ -992,7 +992,7 @@ void CurveRTCHost::initHeaderGetters() { RTCVariableProperties props = element.second; if (props.read) { getGraphVertexPropertyImpl << " if (strings_equal(name, \"" << element.first.second << "\") && graphHash == " << Curve::variableRuntimeHash(element.first.first) << ") {\n"; - getGraphVertexPropertyImpl << "#if !defined(SEATBELTS) || SEATBELTS\n"; + getGraphVertexPropertyImpl << "#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS\n"; getGraphVertexPropertyImpl << " if(sizeof(type_decode::type_t) != " << element.second.type_size << ") {\n"; getGraphVertexPropertyImpl << " DTHROW(\"Directed graph vertex property '%s' type mismatch during getProperty().\\n\", name);\n"; getGraphVertexPropertyImpl << " return {};\n"; @@ -1005,7 +1005,7 @@ void CurveRTCHost::initHeaderGetters() { getGraphVertexPropertyImpl << " }\n"; } else { ++ct; } } - getGraphVertexPropertyImpl << "#if !defined(SEATBELTS) || SEATBELTS\n"; + getGraphVertexPropertyImpl << "#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS\n"; getGraphVertexPropertyImpl << " DTHROW(\"Directed graph vertex property '%s' was not found during getProperty().\\n\", name);\n"; getGraphVertexPropertyImpl << "#endif\n"; getGraphVertexPropertyImpl << " return {};\n"; @@ -1019,7 +1019,7 @@ void CurveRTCHost::initHeaderGetters() { RTCVariableProperties props = element.second; if (props.read) { getGraphEdgePropertyImpl << " if (strings_equal(name, \"" << element.first.second << "\") && graphHash == " << Curve::variableRuntimeHash(element.first.first) << ") {\n"; - getGraphEdgePropertyImpl << "#if !defined(SEATBELTS) || SEATBELTS\n"; + getGraphEdgePropertyImpl << "#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS\n"; getGraphEdgePropertyImpl << " if(sizeof(type_decode::type_t) != " << element.second.type_size << ") {\n"; getGraphEdgePropertyImpl << " DTHROW(\"Directed graph edge property '%s' type mismatch during getProperty().\\n\", name);\n"; getGraphEdgePropertyImpl << " return {};\n"; @@ -1032,7 +1032,7 @@ void CurveRTCHost::initHeaderGetters() { getGraphEdgePropertyImpl << " }\n"; } else { ++ct; } } - getGraphEdgePropertyImpl << "#if !defined(SEATBELTS) || SEATBELTS\n"; + getGraphEdgePropertyImpl << "#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS\n"; getGraphEdgePropertyImpl << " DTHROW(\"Directed graph edge property '%s' was not found during getProperty().\\n\", name);\n"; getGraphEdgePropertyImpl << "#endif\n"; getGraphEdgePropertyImpl << " return {};\n"; @@ -1164,7 +1164,7 @@ void CurveRTCHost::initHeaderGetters() { RTCVariableProperties props = element.second; if (props.read && props.elements > 1) { getGraphVertexArrayPropertyImpl << " if (strings_equal(name, \"" << element.first.second << "\") && graphHash == " << Curve::variableRuntimeHash(element.first.first) << ") {\n"; - getGraphVertexArrayPropertyImpl << "#if !defined(SEATBELTS) || SEATBELTS\n"; + getGraphVertexArrayPropertyImpl << "#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS\n"; getGraphVertexArrayPropertyImpl << " const unsigned int t_index = type_decode::len_t * array_index + type_decode::len_t;\n"; getGraphVertexArrayPropertyImpl << " if(sizeof(type_decode::type_t) != " << element.second.type_size << ") {\n"; getGraphVertexArrayPropertyImpl << " DTHROW(\"Directed graph vertex array property '%s' type mismatch during getProperty().\\n\", name);\n"; @@ -1181,7 +1181,7 @@ void CurveRTCHost::initHeaderGetters() { getGraphVertexArrayPropertyImpl << " };\n"; } else { ++ct; } } - getGraphVertexArrayPropertyImpl << "#if !defined(SEATBELTS) || SEATBELTS\n"; + getGraphVertexArrayPropertyImpl << "#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS\n"; getGraphVertexArrayPropertyImpl << " DTHROW(\"Directed graph vertex array property '%s' was not found during getProperty().\\n\", name);\n"; getGraphVertexArrayPropertyImpl << "#endif\n"; getGraphVertexArrayPropertyImpl << " return {};\n"; @@ -1197,7 +1197,7 @@ void CurveRTCHost::initHeaderGetters() { RTCVariableProperties props = element.second; if (props.read && props.elements > 1) { getGraphEdgeArrayPropertyImpl << " if (strings_equal(name, \"" << element.first.second << "\") && graphHash == " << Curve::variableRuntimeHash(element.first.first) << ") {\n"; - getGraphEdgeArrayPropertyImpl << "#if !defined(SEATBELTS) || SEATBELTS\n"; + getGraphEdgeArrayPropertyImpl << "#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS\n"; getGraphEdgeArrayPropertyImpl << " const unsigned int t_index = type_decode::len_t * array_index + type_decode::len_t;\n"; getGraphEdgeArrayPropertyImpl << " if(sizeof(type_decode::type_t) != " << element.second.type_size << ") {\n"; getGraphEdgeArrayPropertyImpl << " DTHROW(\"Directed graph edge array property '%s' type mismatch during getProperty().\\n\", name);\n"; @@ -1214,7 +1214,7 @@ void CurveRTCHost::initHeaderGetters() { getGraphEdgeArrayPropertyImpl << " };\n"; } else { ++ct; } } - getGraphEdgeArrayPropertyImpl << "#if !defined(SEATBELTS) || SEATBELTS\n"; + getGraphEdgeArrayPropertyImpl << "#if !defined(FLAMEGPU_SEATBELTS) || FLAMEGPU_SEATBELTS\n"; getGraphEdgeArrayPropertyImpl << " DTHROW(\"Directed graph edge array property '%s' was not found during getProperty().\\n\", name);\n"; getGraphEdgeArrayPropertyImpl << "#endif\n"; getGraphEdgeArrayPropertyImpl << " return {};\n";