Skip to content

Commit

Permalink
Simplify RayCastingScene constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
lumurillo committed Nov 9, 2024
1 parent 7b34720 commit f4c3a26
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
8 changes: 2 additions & 6 deletions cpp/open3d/t/geometry/RaycastingScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1192,12 +1192,8 @@ struct RaycastingScene::CPUImpl : public RaycastingScene::Impl {
}
};

RaycastingScene::RaycastingScene(int64_t nthreads
#ifdef BUILD_SYCL_MODULE
,
const core::Device& device
#endif
) {
RaycastingScene::RaycastingScene(int64_t nthreads,
const core::Device& device) {

#ifdef BUILD_SYCL_MODULE
if (device.IsSYCL()) {
Expand Down
8 changes: 2 additions & 6 deletions cpp/open3d/t/geometry/RaycastingScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ namespace geometry {
class RaycastingScene {
public:
/// \brief Default Constructor.
RaycastingScene(int64_t nthreads = 0
#ifdef BUILD_SYCL_MODULE
,
const core::Device &device = core::Device("CPU:0")
#endif
);
RaycastingScene(int64_t nthreads = 0,
const core::Device &device = core::Device("CPU:0"));

~RaycastingScene();

Expand Down
11 changes: 1 addition & 10 deletions cpp/pybind/t/geometry/raycasting_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,14 @@ void pybind_raycasting_scene_definitions(py::module& m) {
auto raycasting_scene =
static_cast<py::class_<RaycastingScene>>(m.attr("RaycastingScene"));
// Constructors.
#ifdef BUILD_SYCL_MODULE
raycasting_scene.def(py::init<int64_t, core::Device>(), "nthreads"_a = 0,
"device"_a = core::Device("CPU:0"), R"doc(
Create a RaycastingScene.
Args:
nthreads (int): The number of threads to use for building the scene. Set to 0 for automatic.
enable_sycl (bool): Enable SYCL for building the scene. Default is False.
device (open3d.core.Device): The device to use.
)doc");
#else
raycasting_scene.def(py::init<int64_t>(), "nthreads"_a = 0, R"doc(
Create a RaycastingScene.
Args:
nthreads (int): The number of threads to use for building the scene. Set to 0 for automatic.
)doc");
#endif

raycasting_scene.def(
"add_triangles",
Expand Down

0 comments on commit f4c3a26

Please sign in to comment.