Skip to content

Commit

Permalink
open3d-ml main branch in bundle open3d_ml, style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ssheorey committed Dec 10, 2023
1 parent 531f9e9 commit 609bbda
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
30 changes: 15 additions & 15 deletions cpp/open3d/core/Indexer.isph
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,23 @@ static inline uint8_t* Indexer_GetWorkloadDataPtr(
/// Get data pointer from a TensorRef with \p workload_idx.
/// Note: can be optimized by computing all input ptrs and output ptr
/// together.
#define TEMPLATE(T) \
static inline T* OPEN3D_SPECIALIZED(T, Indexer_GetWorkloadDataPtr)( \
const uniform Indexer* const uniform self, \
const uniform TensorRef* const uniform tr, \
uniform bool tr_contiguous, int64_t workload_idx) { \
cif(workload_idx < 0) { return NULL; } \
if (tr_contiguous) { \
return (T*)(tr->data_ptr_) + workload_idx; \
} else { \
int64_t offset = 0; \
for (uniform int64_t i = 0; i < self->ndims_; ++i) { \
#define TEMPLATE(T) \
static inline T* OPEN3D_SPECIALIZED(T, Indexer_GetWorkloadDataPtr)( \
const uniform Indexer* const uniform self, \
const uniform TensorRef* const uniform tr, \
uniform bool tr_contiguous, int64_t workload_idx) { \
cif(workload_idx < 0) { return NULL; } \
if (tr_contiguous) { \
return (T*)(tr->data_ptr_) + workload_idx; \
} else { \
int64_t offset = 0; \
for (uniform int64_t i = 0; i < self->ndims_; ++i) { \
offset += workload_idx / self->primary_strides_[i] * \
tr->byte_strides_[i]; \
tr->byte_strides_[i]; \
workload_idx = workload_idx % self->primary_strides_[i]; \
} \
return (T*)((uint8_t*)(tr->data_ptr_) + offset); \
} \
} \
return (T*)((uint8_t*)(tr->data_ptr_) + offset); \
} \
}
#pragma ignore warning(perf)
OPEN3D_INSTANTIATE_TEMPLATE_WITH_BOOL()
Expand Down
2 changes: 2 additions & 0 deletions cpp/pybind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ if (BUNDLE_OPEN3D_ML)
open3d_ml
PREFIX "${CMAKE_BINARY_DIR}/open3d_ml"
GIT_REPOSITORY "${OPEN3D_ML_ROOT}"
GIT_TAG origin/main
GIT_SHALLOW
BUILD_IN_SOURCE ON
# do not configure
CONFIGURE_COMMAND ""
Expand Down
3 changes: 2 additions & 1 deletion cpp/tests/core/Indexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ TEST_P(IndexerPermuteDevices, IndexerCopyConstructor) {
EXPECT_EQ(indexer_a.GetOutput(), indexer_b.GetOutput());
EXPECT_EQ(indexer_a.NumDims(), indexer_b.NumDims());
for (int64_t i = 0; i < indexer_a.NumDims(); i++) {
EXPECT_EQ(indexer_a.GetPrimaryShape()[i], indexer_b.GetPrimaryShape()[i]);
EXPECT_EQ(indexer_a.GetPrimaryShape()[i],
indexer_b.GetPrimaryShape()[i]);
EXPECT_EQ(indexer_a.GetPrimaryStrides()[i],
indexer_b.GetPrimaryStrides()[i]);
EXPECT_EQ(indexer_a.IsReductionDim(i), indexer_b.IsReductionDim(i));
Expand Down

0 comments on commit 609bbda

Please sign in to comment.