Skip to content

Commit

Permalink
MAX_DIMS=5 for VoxelBlockGrid, CI error fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssheorey committed Dec 30, 2024
1 parent da95b80 commit 973670e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions cpp/open3d/core/Indexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ class Indexer;
class IndexerIterator;

// Maximum number of dimensions of TensorRef.
static constexpr int64_t MAX_DIMS = 4;
static constexpr int64_t MAX_DIMS = 5;

// Maximum number of inputs of an op.
// MAX_INPUTS shall be >= MAX_DIMS to support advanced indexing.
static constexpr int64_t MAX_INPUTS = 4;
static constexpr int64_t MAX_INPUTS = 5;

// Maximum number of outputs of an op. This number can be increased when
// necessary.
Expand Down Expand Up @@ -638,7 +638,7 @@ class Indexer {
class IndexerIterator {
public:
struct Iterator {
Iterator(){};
Iterator() {};
Iterator(const Indexer& indexer);
Iterator(Iterator&& other) = default;

Expand Down
13 changes: 7 additions & 6 deletions cpp/open3d/core/kernel/NonZeroSYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

namespace open3d {
namespace core {
/// Maximum number of dimensions of TensorRef, rounded up to the power of 2 for
/// sycl::vec support.
static constexpr int64_t MAX_DIMS_POW2 = 4;
static_assert(MAX_DIMS_POW2 >= MAX_DIMS, "MAX_DIMS_POW2 too small.");
namespace kernel {

Tensor NonZeroSYCL(const Tensor& src) {
Expand Down Expand Up @@ -48,8 +44,13 @@ Tensor NonZeroSYCL(const Tensor& src) {
// Transform flattened indices to indices in each dimension.
const auto num_dims = src.NumDims();
SizeVector shape = src.GetShape();
sycl::vec<int64_t, MAX_DIMS_POW2> shape_vec; // device copyable
OPEN3D_ASSERT(shape.size() <= MAX_DIMS_POW2 && "Too many dimensions.");
// MAX_DIMS: Maximum number of dimensions of TensorRef, defined in
// Indexer.h.
sycl::marray<int64_t, MAX_DIMS> shape_vec; // device copyable
if (shape.size() <= MAX_DIMS) {
utility::LogError("Too many dimensions: {} > MAX_DIMS={}.",
shape.size(), MAX_DIMS);
}
for (auto k = 0; k < num_dims; ++k) shape_vec[k] = shape[k];
Tensor result({num_dims, static_cast<int64_t>(num_non_zeros)}, Int64,
device);
Expand Down
2 changes: 1 addition & 1 deletion util/ci_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ install_python_dependencies() {
if [[ "$OSTYPE" == "linux-gnu"* && "$BUILD_SYCL_MODULE" == "OFF" ]]; then
python -m pip install -U "${TORCH_GLNX}" -f "$TORCH_REPO_URL" tensorboard
elif [[ "$OSTYPE" == "linux-gnu"* && "$BUILD_SYCL_MODULE" == "ON" ]]; then
python -m pip install -U "${TORCH_GLNX}+cpu.cxx11.abi" -i "$TORCH_CXX11_URL"
python -m pip install -U "${TORCH_GLNX}.cxx11.abi" -i "$TORCH_CXX11_URL"
python -m pip install -U tensorboard
elif [[ "$OSTYPE" == "darwin"* ]]; then
python -m pip install -U torch=="$TORCH_VER" -f "$TORCH_REPO_URL" tensorboard
Expand Down

0 comments on commit 973670e

Please sign in to comment.