diff --git a/src/libs/ascent/runtimes/ascent_vtkh_data_adapter.cpp b/src/libs/ascent/runtimes/ascent_vtkh_data_adapter.cpp index 3b2065512..87f8915c6 100644 --- a/src/libs/ascent/runtimes/ascent_vtkh_data_adapter.cpp +++ b/src/libs/ascent/runtimes/ascent_vtkh_data_adapter.cpp @@ -166,12 +166,12 @@ GetExplicitCoordinateSystem(const conduit::Node &n_coords, int x_verts_expanded = nverts * x_element_stride; const T *x_verts_ptr = n_coords["values/x"].value(); vtkm::cont::ArrayHandle x_source_array = vtkm::cont::make_ArrayHandle(x_verts_ptr, - x_verts_expanded, - copy); + x_verts_expanded, + copy); vtkm::cont::ArrayHandleStride x_stride_handle(x_source_array, - nverts, - x_element_stride, - 0); + nverts, + x_element_stride, + 0); // offset vtkm::cont::Algorithm::Copy(x_stride_handle, x_coords_handle); } @@ -186,12 +186,12 @@ GetExplicitCoordinateSystem(const conduit::Node &n_coords, int y_verts_expanded = nverts * y_element_stride; const T *y_verts_ptr = n_coords["values/y"].value(); vtkm::cont::ArrayHandle y_source_array = vtkm::cont::make_ArrayHandle(y_verts_ptr, - y_verts_expanded, - copy); + y_verts_expanded, + copy); vtkm::cont::ArrayHandleStride y_stride_handle(y_source_array, - nverts, - y_element_stride, - 0); + nverts, + y_element_stride, + 0); // offset vtkm::cont::Algorithm::Copy(y_stride_handle, y_coords_handle); } @@ -199,9 +199,10 @@ GetExplicitCoordinateSystem(const conduit::Node &n_coords, if(z_element_stride == 0) { z_coords_handle.Allocate(nverts); + // TODO: Set on device? // This does not get initialized to zero T *z = vtkh::GetVTKMPointer(z_coords_handle); - memset(z, 0.0, nverts * sizeof(T)); + memset(z, 0, nverts * sizeof(T)); } else if(z_element_stride == 1) { @@ -215,12 +216,12 @@ GetExplicitCoordinateSystem(const conduit::Node &n_coords, int z_verts_expanded = nverts * z_element_stride; const T *z_verts_ptr = n_coords["values/z"].value(); vtkm::cont::ArrayHandle z_source_array = vtkm::cont::make_ArrayHandle(z_verts_ptr, - z_verts_expanded, - copy); + z_verts_expanded, + copy); vtkm::cont::ArrayHandleStride z_stride_handle(z_source_array, - nverts, - z_element_stride, - 0); + nverts, + z_element_stride, + 0); // offset vtkm::cont::Algorithm::Copy(z_stride_handle, z_coords_handle); } @@ -1144,12 +1145,13 @@ VTKHDataAdapter::StructuredBlueprintToVTKmDataSet index_t x_element_stride = x_stride / sizeof(float64); index_t y_stride = n_coords["values/y"].dtype().stride(); index_t y_element_stride = y_stride / sizeof(float64); - index_t z_element_stride = 0.0; + index_t z_element_stride = 0; if(n_coords.has_path("values/z")) { index_t z_stride = n_coords["values/z"].dtype().stride(); z_element_stride = z_stride / sizeof(float64); } + coords = detail::GetExplicitCoordinateSystem(n_coords, coords_name, ndims, @@ -1164,12 +1166,13 @@ VTKHDataAdapter::StructuredBlueprintToVTKmDataSet index_t x_element_stride = x_stride / sizeof(float32); index_t y_stride = n_coords["values/y"].dtype().stride(); index_t y_element_stride = y_stride / sizeof(float32); - index_t z_element_stride = 0.0; + index_t z_element_stride = 0; if(n_coords.has_path("values/z")) { index_t z_stride = n_coords["values/z"].dtype().stride(); z_element_stride = z_stride / sizeof(float32); } + coords = detail::GetExplicitCoordinateSystem(n_coords, coords_name, ndims, @@ -1239,12 +1242,13 @@ VTKHDataAdapter::PointsImplicitBlueprintToVTKmDataSet index_t x_element_stride = x_stride / sizeof(float64); index_t y_stride = n_coords["values/y"].dtype().stride(); index_t y_element_stride = y_stride / sizeof(float64); - index_t z_element_stride = 0.0; + index_t z_element_stride = 0; if(n_coords.has_path("values/z")) { index_t z_stride = n_coords["values/z"].dtype().stride(); z_element_stride = z_stride / sizeof(float64); } + coords = detail::GetExplicitCoordinateSystem(n_coords, coords_name, ndims, @@ -1259,12 +1263,13 @@ VTKHDataAdapter::PointsImplicitBlueprintToVTKmDataSet index_t x_element_stride = x_stride / sizeof(float32); index_t y_stride = n_coords["values/y"].dtype().stride(); index_t y_element_stride = y_stride / sizeof(float32); - index_t z_element_stride = 0.0; + index_t z_element_stride = 0; if(n_coords.has_path("values/z")) { index_t z_stride = n_coords["values/z"].dtype().stride(); z_element_stride = z_stride / sizeof(float32); } + coords = detail::GetExplicitCoordinateSystem(n_coords, coords_name, ndims, @@ -1324,12 +1329,13 @@ VTKHDataAdapter::UnstructuredBlueprintToVTKmDataSet index_t x_element_stride = x_stride / sizeof(float64); index_t y_stride = n_coords["values/y"].dtype().stride(); index_t y_element_stride = y_stride / sizeof(float64); - index_t z_element_stride = 0.0; + index_t z_element_stride = 0; if(n_coords.has_path("values/z")) { index_t z_stride = n_coords["values/z"].dtype().stride(); z_element_stride = z_stride / sizeof(float64); } + //TODO: //can we assume all by checking one? //or check ystride & zstride % float64 == 0? @@ -1350,12 +1356,13 @@ VTKHDataAdapter::UnstructuredBlueprintToVTKmDataSet index_t x_element_stride = x_stride / sizeof(float32); index_t y_stride = n_coords["values/y"].dtype().stride(); index_t y_element_stride = y_stride / sizeof(float32); - index_t z_element_stride = 0.0; + index_t z_element_stride = 0; if(n_coords.has_path("values/z")) { index_t z_stride = n_coords["values/z"].dtype().stride(); - index_t z_element_stride = z_stride / sizeof(float32); + z_element_stride = z_stride / sizeof(float32); } + //TODO: //can we assume all by checking one? //or check ystride & zstride % float64 == 0? diff --git a/src/tests/ascent/t_ascent_render_2d_poly.cpp b/src/tests/ascent/t_ascent_render_2d_poly.cpp index f17eb9c5c..b2ed38c87 100644 --- a/src/tests/ascent/t_ascent_render_2d_poly.cpp +++ b/src/tests/ascent/t_ascent_render_2d_poly.cpp @@ -53,15 +53,14 @@ TEST(ascent_pipeline, test_render_2d_poly) // // Create the actions. // - conduit::Node scenes; - scenes["s1/plots/p1/type"] = "pseudocolor"; - scenes["s1/plots/p1/field"] = "level"; - scenes["s1/image_prefix"] = output_file; conduit::Node actions; conduit::Node &add_plots = actions.append(); add_plots["action"] = "add_scenes"; - add_plots["scenes"] = scenes; + conduit::Node &scenes = add_plots["scenes"]; + scenes["s1/plots/p1/type"] = "pseudocolor"; + scenes["s1/plots/p1/field"] = "level"; + scenes["s1/image_prefix"] = output_file; actions.print(); // @@ -69,16 +68,9 @@ TEST(ascent_pipeline, test_render_2d_poly) // Ascent ascent; - - Node ascent_opts; - Node ascent_info; - ascent_opts["runtime/type"] = "ascent"; - ascent.open(ascent_opts); + ascent.open(); ascent.publish(data); ascent.execute(actions); - ascent.info(ascent_info); - EXPECT_EQ(ascent_info["runtime/type"].as_string(), "ascent"); - ascent_info.print(); ascent.close(); // @@ -134,32 +126,23 @@ TEST(ascent_pipeline, test_render_2d_poly_multi) // // Create the actions. // - conduit::Node scenes; - scenes["s1/plots/p1/type"] = "pseudocolor"; - scenes["s1/plots/p1/field"] = "level"; - scenes["s1/image_prefix"] = output_file; conduit::Node actions; conduit::Node &add_plots = actions.append(); add_plots["action"] = "add_scenes"; - add_plots["scenes"] = scenes; + conduit::Node &scenes = add_plots["scenes"]; + scenes["s1/plots/p1/type"] = "pseudocolor"; + scenes["s1/plots/p1/field"] = "level"; + scenes["s1/image_prefix"] = output_file; actions.print(); // // Run Ascent // - Ascent ascent; - - Node ascent_opts; - Node ascent_info; - ascent_opts["runtime/type"] = "ascent"; - ascent.open(ascent_opts); + ascent.open(); ascent.publish(root); ascent.execute(actions); - ascent.info(ascent_info); - EXPECT_EQ(ascent_info["runtime/type"].as_string(), "ascent"); - ascent_info.print(); ascent.close(); // @@ -209,18 +192,18 @@ TEST(ascent_pipeline, test_render_2d_poly_and_nonpoly) // // Create the actions. // - conduit::Node scenes; + + + conduit::Node actions; + conduit::Node &add_plots = actions.append(); + add_plots["action"] = "add_scenes"; + conduit::Node &scenes = add_plots["scenes"]; scenes["s1/plots/p1/type"] = "pseudocolor"; scenes["s1/plots/p1/field"] = "level"; scenes["s1/image_prefix"] = output_file + "polytess"; scenes["s2/plots/p1/type"] = "pseudocolor"; scenes["s2/plots/p1/field"] = "braid"; scenes["s2/image_prefix"] = output_file + "braid"; - - conduit::Node actions; - conduit::Node &add_plots = actions.append(); - add_plots["action"] = "add_scenes"; - add_plots["scenes"] = scenes; actions.print(); // @@ -228,16 +211,9 @@ TEST(ascent_pipeline, test_render_2d_poly_and_nonpoly) // Ascent ascent; - - Node ascent_opts; - Node ascent_info; - ascent_opts["runtime/type"] = "ascent"; - ascent.open(ascent_opts); + ascent.open(); ascent.publish(data); ascent.execute(actions); - ascent.info(ascent_info); - EXPECT_EQ(ascent_info["runtime/type"].as_string(), "ascent"); - ascent_info.print(); ascent.close(); // diff --git a/src/tests/ascent/t_ascent_render_3d_poly.cpp b/src/tests/ascent/t_ascent_render_3d_poly.cpp index 008b3670c..28321ff32 100644 --- a/src/tests/ascent/t_ascent_render_3d_poly.cpp +++ b/src/tests/ascent/t_ascent_render_3d_poly.cpp @@ -40,7 +40,6 @@ TEST(ascent_pipeline, test_render_3d_poly) index_t length = 10; conduit::blueprint::mesh::examples::polychain(length, data); - EXPECT_TRUE(conduit::blueprint::mesh::verify(data, verify_info)); string output_path = prepare_output_dir(); @@ -52,15 +51,14 @@ TEST(ascent_pipeline, test_render_3d_poly) // // Create the actions. // - conduit::Node scenes; + conduit::Node actions; + conduit::Node &add_plots = actions.append(); + add_plots["action"] = "add_scenes"; + conduit::Node &scenes = add_plots["scenes"]; scenes["s1/plots/p1/type"] = "pseudocolor"; scenes["s1/plots/p1/field"] = "chain"; scenes["s1/image_prefix"] = output_file; - conduit::Node actions; - conduit::Node &add_plots = actions.append(); - add_plots["action"] = "add_scenes"; - add_plots["scenes"] = scenes; actions.print(); // @@ -68,18 +66,10 @@ TEST(ascent_pipeline, test_render_3d_poly) // Ascent ascent; - - Node ascent_opts; - Node ascent_info; - ascent_opts["runtime/type"] = "ascent"; - ascent.open(ascent_opts); + ascent.open(); ascent.publish(data); ascent.execute(actions); - ascent.info(ascent_info); - EXPECT_EQ(ascent_info["runtime/type"].as_string(), "ascent"); - ascent_info.print(); ascent.close(); - // // // check that we created an image EXPECT_TRUE(check_test_image(output_file, 0.001f, "0")); @@ -134,15 +124,13 @@ TEST(ascent_pipeline, test_render_3d_poly_multi) // // Create the actions. // - conduit::Node scenes; - scenes["s1/plots/p1/type"] = "pseudocolor"; - scenes["s1/plots/p1/field"] = "level"; - scenes["s1/image_prefix"] = output_file; - conduit::Node actions; conduit::Node &add_plots = actions.append(); add_plots["action"] = "add_scenes"; - add_plots["scenes"] = scenes; + conduit::Node &scenes = add_plots["scenes"]; + scenes["s1/plots/p1/type"] = "pseudocolor"; + scenes["s1/plots/p1/field"] = "level"; + scenes["s1/image_prefix"] = output_file; actions.print(); // @@ -152,14 +140,9 @@ TEST(ascent_pipeline, test_render_3d_poly_multi) Ascent ascent; Node ascent_opts; - Node ascent_info; - ascent_opts["runtime/type"] = "ascent"; - ascent.open(ascent_opts); + ascent.open(); ascent.publish(root); ascent.execute(actions); - ascent.info(ascent_info); - EXPECT_EQ(ascent_info["runtime/type"].as_string(), "ascent"); - ascent_info.print(); ascent.close(); //