Skip to content

Commit

Permalink
Add mask input for ThermalAutoBedrock node. Fix cmake to enforce give…
Browse files Browse the repository at this point in the history
…n OpenCL version.
  • Loading branch information
otto-link committed Jan 2, 2025
1 parent dba1e0c commit 38ddba5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ if(HESIOD_ENABLE_OPENCL)
find_package(OpenCL REQUIRED)
message(STATUS "Hesiod: OpenCL enabled")
add_definitions("-DENABLE_OPENCL")
add_definitions("-DCL_HPP_MINIMUM_OPENCL_VERSION=120")
add_definitions("-DCL_HPP_TARGET_OPENCL_VERSION=120")
add_compile_definitions(CL_HPP_MINIMUM_OPENCL_VERSION=120
CL_HPP_TARGET_OPENCL_VERSION=120 ENABLE_OPENCL=1)
else()
message(STATUS "Hesiod: OpenCL disabled")
endif(HESIOD_ENABLE_OPENCL)
Expand Down
16 changes: 11 additions & 5 deletions Hesiod/src/model/nodes/nodes_function/thermal_auto_bedrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void setup_thermal_auto_bedrock_node(BaseNode *p_node)

// port(s)
p_node->add_port<hmap::Heightmap>(gnode::PortType::IN, "input");
p_node->add_port<hmap::Heightmap>(gnode::PortType::IN, "mask");
p_node->add_port<hmap::Heightmap>(gnode::PortType::OUT, "output", CONFIG);
p_node->add_port<hmap::Heightmap>(gnode::PortType::OUT, "deposition", CONFIG);

Expand Down Expand Up @@ -49,6 +50,7 @@ void compute_thermal_auto_bedrock_node(BaseNode *p_node)
if (p_in)
{
hmap::Heightmap *p_out = p_node->get_value_ref<hmap::Heightmap>("output");
hmap::Heightmap *p_mask = p_node->get_value_ref<hmap::Heightmap>("mask");
hmap::Heightmap *p_deposition_map = p_node->get_value_ref<hmap::Heightmap>(
"deposition");

Expand All @@ -68,16 +70,18 @@ void compute_thermal_auto_bedrock_node(BaseNode *p_node)
if (GET("GPU", BoolAttribute))
{
hmap::transform(
{p_out, &talus_map, p_deposition_map},
{p_out, p_mask, &talus_map, p_deposition_map},
[p_node, &talus](std::vector<hmap::Array *> p_arrays,
hmap::Vec2<int>,
hmap::Vec4<float>)
{
hmap::Array *pa_out = p_arrays[0];
hmap::Array *pa_talus_map = p_arrays[1];
hmap::Array *pa_deposition_map = p_arrays[2];
hmap::Array *pa_mask = p_arrays[1];
hmap::Array *pa_talus_map = p_arrays[2];
hmap::Array *pa_deposition_map = p_arrays[3];

hmap::gpu::thermal_auto_bedrock(*pa_out,
pa_mask,
*pa_talus_map,
GET("iterations", IntAttribute),
pa_deposition_map);
Expand All @@ -93,10 +97,12 @@ void compute_thermal_auto_bedrock_node(BaseNode *p_node)
hmap::Vec4<float>)
{
hmap::Array *pa_out = p_arrays[0];
hmap::Array *pa_talus_map = p_arrays[1];
hmap::Array *pa_deposition_map = p_arrays[2];
hmap::Array *pa_mask = p_arrays[1];
hmap::Array *pa_talus_map = p_arrays[2];
hmap::Array *pa_deposition_map = p_arrays[3];

hmap::gpu::thermal_auto_bedrock(*pa_out,
pa_mask,
*pa_talus_map,
GET("iterations", IntAttribute),
pa_deposition_map);
Expand Down
2 changes: 1 addition & 1 deletion external/HighMap
Submodule HighMap updated 34 files
+2 −5 CMakeLists.txt
+0 −1 HighMap/include/highmap.hpp
+0 −222 HighMap/include/highmap/gpu.hpp
+5 −0 HighMap/include/highmap/opencl/gpu_opencl.hpp
+0 −530 HighMap/src/gpu/filters_gpu.cpp
+0 −68 HighMap/src/gpu/kernel.cl
+0 −112 HighMap/src/gpu/kernel_hydraulic_particle.cl
+0 −74 HighMap/src/gpu/kernel_median_3x3.cl
+0 −86 HighMap/src/gpu/kernel_ridgelines.cl
+0 −74 HighMap/src/gpu/kernel_simplex.cl
+0 −79 HighMap/src/gpu/kernel_voronoise.cl
+0 −150 HighMap/src/gpu/opencl_config.cpp
+0 −30 HighMap/src/gpu/rand.cl
+0 −175 HighMap/src/gpu/utils_image.cl
+0 −9 HighMap/src/gpu/utils_index.cl
+0 −51 HighMap/src/gpu/utils_math.cl
+16 −0 HighMap/src/gpu_opencl/wrappers_erosion.cpp
+1 −0 examples/ex_distance_transform/ex_distance_transform.cpp
+0 −2 examples/ex_gpu_hydraulic_particle/CMakeLists.txt
+0 −47 examples/ex_gpu_hydraulic_particle/ex_gpu_hydraulic_particle.cpp
+0 −2 examples/ex_gpu_infos/CMakeLists.txt
+0 −13 examples/ex_gpu_infos/ex_gpu_infos.cpp
+0 −2 examples/ex_gpu_maximum_local_weighted/CMakeLists.txt
+0 −47 examples/ex_gpu_maximum_local_weighted/ex_gpu_maximum_local_weighted.cpp
+0 −2 examples/ex_gpu_median_3x3/CMakeLists.txt
+0 −50 examples/ex_gpu_median_3x3/ex_gpu_median_3x3.cpp
+1 −0 examples/ex_gpu_opencl/ex_gpu_opencl.cpp
+0 −2 examples/ex_gpu_ridgelines/CMakeLists.txt
+0 −36 examples/ex_gpu_ridgelines/ex_gpu_ridgelines.cpp
+0 −2 examples/ex_gpu_simplex/CMakeLists.txt
+0 −31 examples/ex_gpu_simplex/ex_gpu_simplex.cpp
+0 −2 examples/ex_gpu_voronoise/CMakeLists.txt
+0 −30 examples/ex_gpu_voronoise/ex_gpu_voronoise.cpp
+1 −0 tests/test_gpu_vs_cpu/main.cpp

0 comments on commit 38ddba5

Please sign in to comment.