diff --git a/cpp/open3d/core/Indexer.h b/cpp/open3d/core/Indexer.h index 4fa7a61c21b..1f6627e9d1a 100644 --- a/cpp/open3d/core/Indexer.h +++ b/cpp/open3d/core/Indexer.h @@ -638,7 +638,7 @@ class Indexer { class IndexerIterator { public: struct Iterator { - Iterator() {}; + Iterator(){}; Iterator(const Indexer& indexer); Iterator(Iterator&& other) = default; diff --git a/cpp/open3d/core/Tensor.h b/cpp/open3d/core/Tensor.h index 7a20da6b5b2..445676d59ce 100644 --- a/cpp/open3d/core/Tensor.h +++ b/cpp/open3d/core/Tensor.h @@ -1329,7 +1329,7 @@ class Tensor : public IsDevice { /// Underlying memory buffer for Tensor. std::shared_ptr blob_ = nullptr; -}; // namespace core +}; template <> inline Tensor::Tensor(const std::vector& init_vals, @@ -1425,5 +1425,11 @@ inline Tensor operator/(T scalar_lhs, const Tensor& rhs) { return Tensor::Full({}, scalar_lhs, rhs.GetDtype(), rhs.GetDevice()) / rhs; } +inline void AssertNotSYCL(const Tensor& tensor) { + if (tensor.GetDevice().IsSYCL()) { + utility::LogError("Not supported for SYCL device."); + } +} + } // namespace core -} // namespace open3d +} // namespace open3d \ No newline at end of file diff --git a/cpp/open3d/core/kernel/UnaryEWSYCL.cpp b/cpp/open3d/core/kernel/UnaryEWSYCL.cpp index 40592cf6ded..af99df1c91e 100644 --- a/cpp/open3d/core/kernel/UnaryEWSYCL.cpp +++ b/cpp/open3d/core/kernel/UnaryEWSYCL.cpp @@ -144,7 +144,7 @@ void CopySYCL(const Tensor& src, Tensor& dst) { src.GetDataPtr(), src.GetDevice(), src_dtype.ByteSize() * shape.NumElements()); } else if (dst.NumElements() > 1 && dst.IsContiguous() && - src.NumElements() == 1 /*&& !src_dtype.IsObject()*/) { + src.NumElements() == 1 && !src_dtype.IsObject()) { int64_t num_elements = dst.NumElements(); DISPATCH_DTYPE_TO_TEMPLATE_WITH_BOOL(dst_dtype, [&]() { scalar_t scalar_element = src.To(dst_dtype).Item(); @@ -201,14 +201,6 @@ void UnaryEWSYCL(const Tensor& src, Tensor& dst, UnaryEWOpCode op_code) { Dtype dst_dtype = dst.GetDtype(); Device device = src.GetDevice(); // == dst.GetDevice() - auto assert_dtype_is_float = [](Dtype dtype) -> void { - if (dtype != Float32 && dtype != Float64) { - utility::LogError( - "Only supports Float32 and Float64, but {} is used.", - dtype.ToString()); - } - }; - if (op_code == UnaryEWOpCode::LogicalNot) { if (dst_dtype == src_dtype) { Indexer indexer({src}, dst, DtypePolicy::ALL_SAME); @@ -230,7 +222,6 @@ void UnaryEWSYCL(const Tensor& src, Tensor& dst, UnaryEWOpCode op_code) { } else if (op_code == UnaryEWOpCode::IsNan || op_code == UnaryEWOpCode::IsInf || op_code == UnaryEWOpCode::IsFinite) { - assert_dtype_is_float(src_dtype); Indexer indexer({src}, dst, DtypePolicy::INPUT_SAME_OUTPUT_BOOL); DISPATCH_DTYPE_TO_TEMPLATE(src_dtype, [&]() { if (op_code == UnaryEWOpCode::IsNan) { diff --git a/cpp/open3d/core/nns/NearestNeighborSearch.h b/cpp/open3d/core/nns/NearestNeighborSearch.h index 98898cdd7b2..2996f8a6caa 100644 --- a/cpp/open3d/core/nns/NearestNeighborSearch.h +++ b/cpp/open3d/core/nns/NearestNeighborSearch.h @@ -27,12 +27,14 @@ class NearestNeighborSearch { /// Constructor. /// /// \param dataset_points Dataset points for constructing search index. Must - /// be 2D, with shape {n, d}. + /// be 2D, with shape {n, d}. SYCL tensors are not yet supported. // NearestNeighborSearch(const Tensor &dataset_points) // : dataset_points_(dataset_points){}; NearestNeighborSearch(const Tensor &dataset_points, const Dtype &index_dtype = core::Int32) - : dataset_points_(dataset_points), index_dtype_(index_dtype){}; + : dataset_points_(dataset_points), index_dtype_(index_dtype) { + AssertNotSYCL(dataset_points_); + }; ~NearestNeighborSearch(); NearestNeighborSearch(const NearestNeighborSearch &) = delete; NearestNeighborSearch &operator=(const NearestNeighborSearch &) = delete; diff --git a/cpp/tests/core/Blob.cpp b/cpp/tests/core/Blob.cpp index 85be95d31cc..c55d537acb0 100644 --- a/cpp/tests/core/Blob.cpp +++ b/cpp/tests/core/Blob.cpp @@ -16,10 +16,9 @@ namespace open3d { namespace tests { class BlobPermuteDevices : public PermuteDevicesWithSYCL {}; -INSTANTIATE_TEST_SUITE_P( - Blob, - BlobPermuteDevices, - testing::ValuesIn(PermuteDevicesWithSYCL::TestCases())); +INSTANTIATE_TEST_SUITE_P(Blob, + BlobPermuteDevices, + testing::ValuesIn(BlobPermuteDevices::TestCases())); TEST_P(BlobPermuteDevices, BlobConstructor) { core::Device device = GetParam(); diff --git a/cpp/tests/core/CoreTest.cpp b/cpp/tests/core/CoreTest.cpp index 320a50fa01f..b498027f89e 100644 --- a/cpp/tests/core/CoreTest.cpp +++ b/cpp/tests/core/CoreTest.cpp @@ -22,6 +22,7 @@ void PrintTo(const Device &device, std::ostream *os) { } void PrintTo(const Dtype &dtype, std::ostream *os) { *os << dtype.ToString(); } } // namespace core + namespace tests { std::vector PermuteDtypesWithBool::TestCases() { @@ -51,8 +52,6 @@ std::vector PermuteDevices::TestCases() { devices.push_back(cuda_devices[0]); devices.push_back(cuda_devices[1]); } - - utility::LogWarning("Total {} devices.", devices.size()); return devices; } @@ -61,7 +60,8 @@ std::vector PermuteDevicesWithSYCL::TestCases() { std::vector sycl_devices = core::Device::GetAvailableSYCLDevices(); if (!sycl_devices.empty()) { - devices.push_back(sycl_devices[0]); // only the first SYCL device + // devices.push_back(sycl_devices[0]); // only the first SYCL device + devices.insert(devices.end(), sycl_devices.begin(), sycl_devices.end()); } return devices; } @@ -92,7 +92,6 @@ PermuteDevicePairs::TestCases() { } } } - return device_pairs; } @@ -130,7 +129,6 @@ PermuteDevicePairsWithSYCL::TestCases() { } } } - return device_pairs; } diff --git a/cpp/tests/core/EigenConverter.cpp b/cpp/tests/core/EigenConverter.cpp index 7754657cc13..b3c7d085908 100644 --- a/cpp/tests/core/EigenConverter.cpp +++ b/cpp/tests/core/EigenConverter.cpp @@ -17,10 +17,11 @@ namespace open3d { namespace tests { -class EigenConverterPermuteDevices : public PermuteDevices {}; -INSTANTIATE_TEST_SUITE_P(EigenConverter, - EigenConverterPermuteDevices, - testing::ValuesIn(PermuteDevices::TestCases())); +class EigenConverterPermuteDevices : public PermuteDevicesWithSYCL {}; +INSTANTIATE_TEST_SUITE_P( + EigenConverter, + EigenConverterPermuteDevices, + testing::ValuesIn(EigenConverterPermuteDevices::TestCases())); TEST_P(EigenConverterPermuteDevices, TensorToEigenMatrix) { core::Device device = GetParam(); diff --git a/cpp/tests/core/Indexer.cpp b/cpp/tests/core/Indexer.cpp index 305c08693a0..284584b438a 100644 --- a/cpp/tests/core/Indexer.cpp +++ b/cpp/tests/core/Indexer.cpp @@ -22,10 +22,10 @@ namespace open3d { namespace tests { -class IndexerPermuteDevices : public PermuteDevices {}; +class IndexerPermuteDevices : public PermuteDevicesWithSYCL {}; INSTANTIATE_TEST_SUITE_P(Indexer, IndexerPermuteDevices, - testing::ValuesIn(PermuteDevices::TestCases())); + testing::ValuesIn(IndexerPermuteDevices::TestCases())); TEST_P(IndexerPermuteDevices, TensorRef) { core::Device device = GetParam(); @@ -57,7 +57,7 @@ TEST_P(IndexerPermuteDevices, IndexerCopyConstructor) { core::Tensor input0({2, 1, 1, 3}, core::Float32, device); core::Tensor input1({1, 3}, core::Float32, device); - core::Tensor output({2, 2, 2, 1, 3}, core::Float32, device); + core::Tensor output({2, 2, 1, 3}, core::Float32, device); core::Indexer indexer_a({input0, input1}, output); core::Indexer indexer_b = indexer_a; @@ -80,48 +80,48 @@ TEST_P(IndexerPermuteDevices, BroadcastRestride) { core::Tensor input0({2, 1, 1, 3}, core::Float32, device); core::Tensor input1({1, 3}, core::Float32, device); - core::Tensor output({2, 2, 2, 1, 3}, core::Float32, device); + core::Tensor output({2, 2, 1, 3}, core::Float32, device); core::Indexer indexer({input0, input1}, output); core::TensorRef input0_tr = indexer.GetInput(0); core::TensorRef input1_tr = indexer.GetInput(1); core::TensorRef output_tr = indexer.GetOutput(); - EXPECT_EQ(input0_tr.ndims_, 5); - EXPECT_EQ(input1_tr.ndims_, 5); - EXPECT_EQ(output_tr.ndims_, 5); + EXPECT_EQ(input0_tr.ndims_, 4); + EXPECT_EQ(input1_tr.ndims_, 4); + EXPECT_EQ(output_tr.ndims_, 4); // Check core::Indexer's global info EXPECT_EQ(indexer.NumInputs(), 2); - EXPECT_EQ(indexer.NumWorkloads(), 24); + EXPECT_EQ(indexer.NumWorkloads(), 12); EXPECT_EQ(core::SizeVector(indexer.GetPrimaryShape(), indexer.GetPrimaryShape() + indexer.NumDims()), - core::SizeVector({2, 2, 2, 1, 3})); + core::SizeVector({2, 2, 1, 3})); EXPECT_EQ(core::SizeVector(indexer.GetPrimaryStrides(), indexer.GetPrimaryStrides() + indexer.NumDims()), - core::SizeVector({12, 6, 3, 3, 1})); + core::SizeVector({6, 3, 3, 1})); // Check tensor shape EXPECT_EQ(core::SizeVector(input0_tr.shape_, input0_tr.shape_ + input0_tr.ndims_), - core::SizeVector({1, 2, 1, 1, 3})); + core::SizeVector({2, 1, 1, 3})); EXPECT_EQ(core::SizeVector(input1_tr.shape_, input1_tr.shape_ + input1_tr.ndims_), - core::SizeVector({1, 1, 1, 1, 3})); + core::SizeVector({1, 1, 1, 3})); EXPECT_EQ(core::SizeVector(output_tr.shape_, output_tr.shape_ + output_tr.ndims_), - core::SizeVector({2, 2, 2, 1, 3})); + core::SizeVector({2, 2, 1, 3})); // Check tensor strides EXPECT_EQ(core::SizeVector(input0_tr.byte_strides_, input0_tr.byte_strides_ + input0_tr.ndims_), - core::SizeVector({0, 3 * 4, 0, 3 * 4, 1 * 4})); + core::SizeVector({3 * 4, 0, 3 * 4, 1 * 4})); EXPECT_EQ(core::SizeVector(input1_tr.byte_strides_, input1_tr.byte_strides_ + input1_tr.ndims_), - core::SizeVector({0, 0, 0, 3 * 4, 1 * 4})); + core::SizeVector({0, 0, 3 * 4, 1 * 4})); EXPECT_EQ(core::SizeVector(output_tr.byte_strides_, output_tr.byte_strides_ + output_tr.ndims_), - core::SizeVector({12 * 4, 6 * 4, 3 * 4, 3 * 4, 1 * 4})); + core::SizeVector({6 * 4, 3 * 4, 3 * 4, 1 * 4})); } TEST_P(IndexerPermuteDevices, GetPointers) { diff --git a/cpp/tests/core/Linalg.cpp b/cpp/tests/core/Linalg.cpp index 9b817ae61f8..77f882917df 100644 --- a/cpp/tests/core/Linalg.cpp +++ b/cpp/tests/core/Linalg.cpp @@ -24,10 +24,9 @@ namespace open3d { namespace tests { class LinalgPermuteDevices : public PermuteDevicesWithSYCL {}; -INSTANTIATE_TEST_SUITE_P( - Linalg, - LinalgPermuteDevices, - testing::ValuesIn(PermuteDevicesWithSYCL::TestCases())); +INSTANTIATE_TEST_SUITE_P(Linalg, + LinalgPermuteDevices, + testing::ValuesIn(LinalgPermuteDevices::TestCases())); TEST_P(LinalgPermuteDevices, Matmul) { const float EPSILON = 1e-8; diff --git a/cpp/tests/core/MemoryManager.cpp b/cpp/tests/core/MemoryManager.cpp index 9e3570a5af0..e4017da7e63 100644 --- a/cpp/tests/core/MemoryManager.cpp +++ b/cpp/tests/core/MemoryManager.cpp @@ -17,9 +17,10 @@ namespace open3d { namespace tests { class MemoryManagerPermuteDevices : public PermuteDevicesWithSYCL {}; -INSTANTIATE_TEST_SUITE_P(MemoryManager, - MemoryManagerPermuteDevices, - testing::ValuesIn(PermuteDevices::TestCases())); +INSTANTIATE_TEST_SUITE_P( + MemoryManager, + MemoryManagerPermuteDevices, + testing::ValuesIn(MemoryManagerPermuteDevices::TestCases())); class MemoryManagerPermuteDevicePairs : public PermuteDevicePairsWithSYCL {}; INSTANTIATE_TEST_SUITE_P( diff --git a/cpp/tests/core/Tensor.cpp b/cpp/tests/core/Tensor.cpp index 0106c5ec6ec..d0309a91606 100644 --- a/cpp/tests/core/Tensor.cpp +++ b/cpp/tests/core/Tensor.cpp @@ -3136,6 +3136,7 @@ TEST_P(TensorPermuteDevicesWithSYCL, ReduceMean) { TEST_P(TensorPermuteDevicesWithSYCL, ToDLPackFromDLPack) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; core::Tensor src_t = core::Tensor::Init( {{{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}}, {{12, 13, 14, 15}, {16, 17, 18, 19}, {20, 21, 22, 23}}}, diff --git a/cpp/tests/core/TensorCheck.cpp b/cpp/tests/core/TensorCheck.cpp index 2ab52141806..14fb471d874 100644 --- a/cpp/tests/core/TensorCheck.cpp +++ b/cpp/tests/core/TensorCheck.cpp @@ -14,13 +14,13 @@ namespace open3d { namespace tests { -class TensorCheckPermuteDevicesWithSYCL : public PermuteDevices {}; +class TensorCheckPermuteDevices : public PermuteDevicesWithSYCL {}; INSTANTIATE_TEST_SUITE_P( Tensor, - TensorCheckPermuteDevicesWithSYCL, - testing::ValuesIn(PermuteDevicesWithSYCL::TestCases())); + TensorCheckPermuteDevices, + testing::ValuesIn(TensorCheckPermuteDevices::TestCases())); -TEST_P(TensorCheckPermuteDevicesWithSYCL, AssertTensorDtype) { +TEST_P(TensorCheckPermuteDevices, AssertTensorDtype) { core::Device device = GetParam(); core::Tensor t = core::Tensor::Empty({}, core::Float32, device); @@ -59,7 +59,7 @@ TEST_P(TensorCheckPermuteDevicesWithSYCL, AssertTensorDtype) { } } -TEST_P(TensorCheckPermuteDevicesWithSYCL, AssertTensorDtypes) { +TEST_P(TensorCheckPermuteDevices, AssertTensorDtypes) { core::Device device = GetParam(); core::Tensor t = core::Tensor::Empty({}, core::Float32, device); @@ -88,7 +88,7 @@ TEST_P(TensorCheckPermuteDevicesWithSYCL, AssertTensorDtypes) { t, std::vector({core::Int32, core::Int64}))); } -TEST_P(TensorCheckPermuteDevicesWithSYCL, AssertTensorDevice) { +TEST_P(TensorCheckPermuteDevices, AssertTensorDevice) { core::Device device = GetParam(); core::Tensor t = core::Tensor::Empty({}, core::Float32, device); @@ -106,7 +106,7 @@ TEST_P(TensorCheckPermuteDevicesWithSYCL, AssertTensorDevice) { } } -TEST_P(TensorCheckPermuteDevicesWithSYCL, AssertTensorShape) { +TEST_P(TensorCheckPermuteDevices, AssertTensorShape) { core::Device device = GetParam(); core::Tensor t; diff --git a/cpp/tests/core/TensorFunction.cpp b/cpp/tests/core/TensorFunction.cpp index 8d97fe59720..17fab12edc9 100644 --- a/cpp/tests/core/TensorFunction.cpp +++ b/cpp/tests/core/TensorFunction.cpp @@ -15,12 +15,13 @@ namespace open3d { namespace tests { -class TensorFunctionPermuteDevicesWithSYCL : public PermuteDevices {}; -INSTANTIATE_TEST_SUITE_P(Tensor, - TensorFunctionPermuteDevicesWithSYCL, - testing::ValuesIn(PermuteDevices::TestCases())); +class TensorFunctionPermuteDevices : public PermuteDevicesWithSYCL {}; +INSTANTIATE_TEST_SUITE_P( + Tensor, + TensorFunctionPermuteDevices, + testing::ValuesIn(TensorFunctionPermuteDevices::TestCases())); -TEST_P(TensorFunctionPermuteDevicesWithSYCL, Concatenate) { +TEST_P(TensorFunctionPermuteDevices, Concatenate) { core::Device device = GetParam(); core::Tensor a, b, c, output_tensor; @@ -111,7 +112,7 @@ TEST_P(TensorFunctionPermuteDevicesWithSYCL, Concatenate) { } } -TEST_P(TensorFunctionPermuteDevicesWithSYCL, Append) { +TEST_P(TensorFunctionPermuteDevices, Append) { core::Device device = GetParam(); core::Tensor self, other, output; @@ -215,7 +216,7 @@ TEST_P(TensorFunctionPermuteDevicesWithSYCL, Append) { EXPECT_TRUE(core::Append(self, other).AllClose(self.Append(other))); } -TEST_P(TensorFunctionPermuteDevicesWithSYCL, Maximum) { +TEST_P(TensorFunctionPermuteDevices, Maximum) { core::Device device = GetParam(); core::Tensor input, other, output; @@ -268,7 +269,7 @@ TEST_P(TensorFunctionPermuteDevicesWithSYCL, Maximum) { core::Tensor::Init({true, true, true, true}, device))); } -TEST_P(TensorFunctionPermuteDevicesWithSYCL, Minimum) { +TEST_P(TensorFunctionPermuteDevices, Minimum) { core::Device device = GetParam(); core::Tensor input, other, output; diff --git a/cpp/tests/core/TensorList.cpp b/cpp/tests/core/TensorList.cpp index 39091f3d386..67d819a8c9a 100644 --- a/cpp/tests/core/TensorList.cpp +++ b/cpp/tests/core/TensorList.cpp @@ -15,10 +15,11 @@ namespace open3d { namespace tests { -class TensorListPermuteDevices : public PermuteDevices {}; -INSTANTIATE_TEST_SUITE_P(TensorList, - TensorListPermuteDevices, - testing::ValuesIn(PermuteDevices::TestCases())); +class TensorListPermuteDevices : public PermuteDevicesWithSYCL {}; +INSTANTIATE_TEST_SUITE_P( + TensorList, + TensorListPermuteDevices, + testing::ValuesIn(TensorListPermuteDevices::TestCases())); TEST_P(TensorListPermuteDevices, EmptyConstructor) { core::Device device = GetParam(); diff --git a/cpp/tests/core/TensorObject.cpp b/cpp/tests/core/TensorObject.cpp index bfd28430b85..62c537efabf 100644 --- a/cpp/tests/core/TensorObject.cpp +++ b/cpp/tests/core/TensorObject.cpp @@ -22,13 +22,13 @@ namespace open3d { namespace tests { -class TensorObjectPermuteDevicesWithSYCL : public PermuteDevicesWithSYCL {}; +class TensorObjectPermuteDevices : public PermuteDevicesWithSYCL {}; INSTANTIATE_TEST_SUITE_P( TensorObject, - TensorObjectPermuteDevicesWithSYCL, - testing::ValuesIn(PermuteDevicesWithSYCL::TestCases())); + TensorObjectPermuteDevices, + testing::ValuesIn(TensorObjectPermuteDevices::TestCases())); -class TensorObjectPermuteDevicePairs : public PermuteDevicePairs {}; +class TensorObjectPermuteDevicePairs : public PermuteDevicePairsWithSYCL {}; INSTANTIATE_TEST_SUITE_P( TensorObject, TensorObjectPermuteDevicePairs, @@ -52,7 +52,7 @@ static_assert(std::is_pod(), "TestObject must be a POD."); static const int64_t byte_size = sizeof(TestObject); static const std::string class_name = "TestObject"; -TEST_P(TensorObjectPermuteDevicesWithSYCL, Constructor) { +TEST_P(TensorObjectPermuteDevices, Constructor) { core::Device device = GetParam(); core::Dtype dtype(core::Dtype::DtypeCode::Object, byte_size, class_name); @@ -71,7 +71,7 @@ TEST_P(TensorObjectPermuteDevicesWithSYCL, Constructor) { EXPECT_ANY_THROW(core::Tensor({-1, -1}, dtype, device)); } -TEST_P(TensorObjectPermuteDevicesWithSYCL, WithInitValueObject) { +TEST_P(TensorObjectPermuteDevices, WithInitValueObject) { core::Device device = GetParam(); core::Dtype dtype = core::Dtype(core::Dtype::DtypeCode::Object, byte_size, class_name); @@ -82,7 +82,7 @@ TEST_P(TensorObjectPermuteDevicesWithSYCL, WithInitValueObject) { EXPECT_EQ(t.ToFlatVector(), vals); } -TEST_P(TensorObjectPermuteDevicesWithSYCL, FillObject) { +TEST_P(TensorObjectPermuteDevices, FillObject) { core::Device device = GetParam(); core::Dtype dtype(core::Dtype::DtypeCode::Object, byte_size, class_name); @@ -157,7 +157,7 @@ TEST_P(TensorObjectPermuteDevicePairs, CopyBroadcastObject) { EXPECT_EQ(dst_t.ToFlatVector(), dst_vals); } -TEST_P(TensorObjectPermuteDevicesWithSYCL, ItemObject) { +TEST_P(TensorObjectPermuteDevices, ItemObject) { core::Device device = GetParam(); core::Dtype dtype(core::Dtype::DtypeCode::Object, byte_size, class_name); @@ -173,7 +173,7 @@ TEST_P(TensorObjectPermuteDevicesWithSYCL, ItemObject) { EXPECT_EQ(t[2].Item(), TestObject(4)); } -TEST_P(TensorObjectPermuteDevicesWithSYCL, ItemAssignObject) { +TEST_P(TensorObjectPermuteDevices, ItemAssignObject) { core::Device device = GetParam(); core::Dtype dtype(core::Dtype::DtypeCode::Object, byte_size, class_name); @@ -188,7 +188,7 @@ TEST_P(TensorObjectPermuteDevicesWithSYCL, ItemAssignObject) { EXPECT_EQ(t[1][2][3].Item(), TestObject(100)); } -TEST_P(TensorObjectPermuteDevicesWithSYCL, IsSameObject) { +TEST_P(TensorObjectPermuteDevices, IsSameObject) { core::Device device = GetParam(); core::Dtype dtype(core::Dtype::DtypeCode::Object, byte_size, class_name); @@ -231,7 +231,7 @@ TEST_P(TensorObjectPermuteDevicesWithSYCL, IsSameObject) { EXPECT_TRUE(vec[0].IsSame(vec[1])); } -TEST_P(TensorObjectPermuteDevicesWithSYCL, ConstructFromObjectTensorVector) { +TEST_P(TensorObjectPermuteDevices, ConstructFromObjectTensorVector) { core::Device device = GetParam(); core::Dtype dtype(core::Dtype::DtypeCode::Object, byte_size, class_name); @@ -256,7 +256,7 @@ TEST_P(TensorObjectPermuteDevicesWithSYCL, ConstructFromObjectTensorVector) { EXPECT_FALSE(tl[2].IsSame(t2)); } -TEST_P(TensorObjectPermuteDevicesWithSYCL, TensorListFromObjectTensor) { +TEST_P(TensorObjectPermuteDevices, TensorListFromObjectTensor) { core::Device device = GetParam(); core::Dtype dtype(core::Dtype::DtypeCode::Object, byte_size, class_name); diff --git a/cpp/tests/t/geometry/AxisAlignedBoundingBox.cpp b/cpp/tests/t/geometry/AxisAlignedBoundingBox.cpp index d0a7189edd8..e62f8b89a68 100644 --- a/cpp/tests/t/geometry/AxisAlignedBoundingBox.cpp +++ b/cpp/tests/t/geometry/AxisAlignedBoundingBox.cpp @@ -23,7 +23,7 @@ class AxisAlignedBoundingBoxPermuteDevices : public PermuteDevicesWithSYCL {}; INSTANTIATE_TEST_SUITE_P( AxisAlignedBoundingBox, AxisAlignedBoundingBoxPermuteDevices, - testing::ValuesIn(PermuteDevicesWithSYCL::TestCases())); + testing::ValuesIn(AxisAlignedBoundingBoxPermuteDevices::TestCases())); class AxisAlignedBoundingBoxPermuteDevicePairs : public PermuteDevicePairsWithSYCL {}; @@ -278,6 +278,7 @@ TEST_P(AxisAlignedBoundingBoxPermuteDevices, GetBoxPoints) { TEST_P(AxisAlignedBoundingBoxPermuteDevices, GetPointIndicesWithinBoundingBox) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; core::Tensor min_bound = core::Tensor::Init({-1, -1, -1}, device); core::Tensor max_bound = core::Tensor::Init({1, 1, 1}, device); diff --git a/cpp/tests/t/geometry/LineSet.cpp b/cpp/tests/t/geometry/LineSet.cpp index fb6eefb41c1..272761e3169 100644 --- a/cpp/tests/t/geometry/LineSet.cpp +++ b/cpp/tests/t/geometry/LineSet.cpp @@ -17,10 +17,9 @@ namespace open3d { namespace tests { class LineSetPermuteDevices : public PermuteDevicesWithSYCL {}; -INSTANTIATE_TEST_SUITE_P( - LineSet, - LineSetPermuteDevices, - testing::ValuesIn(PermuteDevicesWithSYCL::TestCases())); +INSTANTIATE_TEST_SUITE_P(LineSet, + LineSetPermuteDevices, + testing::ValuesIn(LineSetPermuteDevices::TestCases())); class LineSetPermuteDevicePairs : public PermuteDevicePairsWithSYCL {}; INSTANTIATE_TEST_SUITE_P( @@ -278,6 +277,7 @@ TEST_P(LineSetPermuteDevices, GetMinBound_GetMaxBound_GetCenter) { TEST_P(LineSetPermuteDevices, Transform) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; t::geometry::LineSet lineset(device); core::Tensor transformation = core::Tensor::Init( @@ -334,6 +334,7 @@ TEST_P(LineSetPermuteDevices, Scale) { TEST_P(LineSetPermuteDevices, Rotate) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; t::geometry::LineSet lineset(device); core::Tensor rotation = core::Tensor::Init( diff --git a/cpp/tests/t/geometry/OrientedBoundingBox.cpp b/cpp/tests/t/geometry/OrientedBoundingBox.cpp index 8ac9cf7e737..d2bda07db22 100644 --- a/cpp/tests/t/geometry/OrientedBoundingBox.cpp +++ b/cpp/tests/t/geometry/OrientedBoundingBox.cpp @@ -250,6 +250,7 @@ TEST_P(OrientedBoundingBoxPermuteDevices, GetBoxPoints) { TEST_P(OrientedBoundingBoxPermuteDevices, GetPointIndicesWithinBoundingBox) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; core::Tensor center = core::Tensor::Init({0.5, 0.5, 0.5}, device); core::Tensor rotation = core::Tensor::Eye(3, core::Float32, device); diff --git a/cpp/tests/t/geometry/PointCloud.cpp b/cpp/tests/t/geometry/PointCloud.cpp index 604d91f7358..342aa40eb32 100644 --- a/cpp/tests/t/geometry/PointCloud.cpp +++ b/cpp/tests/t/geometry/PointCloud.cpp @@ -171,6 +171,8 @@ TEST_P(PointCloudPermuteDevices, Copy) { TEST_P(PointCloudPermuteDevices, Transform) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; + core::Dtype dtype = core::Float32; t::geometry::PointCloud pcd(device); core::Tensor transformation( @@ -226,6 +228,7 @@ TEST_P(PointCloudPermuteDevices, Scale) { TEST_P(PointCloudPermuteDevices, Rotate) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; core::Dtype dtype = core::Float32; t::geometry::PointCloud pcd(device); core::Tensor rotation(std::vector{1, 1, 0, 0, 1, 1, 0, 1, 0}, {3, 3}, @@ -246,6 +249,7 @@ TEST_P(PointCloudPermuteDevices, Rotate) { TEST_P(PointCloudPermuteDevices, NormalizeNormals) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; core::Tensor points = core::Tensor::Init({{0, 0, 0}, {0, 0, 1}, @@ -279,6 +283,7 @@ TEST_P(PointCloudPermuteDevices, NormalizeNormals) { TEST_P(PointCloudPermuteDevices, EstimateNormals) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; core::Tensor points = core::Tensor::Init({{0, 0, 0}, {0, 0, 1}, @@ -319,6 +324,7 @@ TEST_P(PointCloudPermuteDevices, EstimateNormals) { TEST_P(PointCloudPermuteDevices, OrientNormalsToAlignWithDirection) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; core::Tensor points = core::Tensor::Init({{0, 0, 0}, {0, 0, 1}, @@ -358,6 +364,7 @@ TEST_P(PointCloudPermuteDevices, OrientNormalsToAlignWithDirection) { TEST_P(PointCloudPermuteDevices, OrientNormalsTowardsCameraLocation) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; core::Tensor points = core::Tensor::Init( {{0, 0, 0}, {0, 1, 0}, {1, 0, 0}, {1, 1, 0}}, device); @@ -645,6 +652,7 @@ TEST_P(PointCloudPermuteDevices, CreateFromRGBDImage) { using ::testing::UnorderedElementsAreArray; core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; float depth_scale = 1000.f, depth_max = 3.f; int stride = 1; core::Tensor im_depth = @@ -692,6 +700,7 @@ TEST_P(PointCloudPermuteDevices, CreateFromRGBDImage) { TEST_P(PointCloudPermuteDevices, CreateFromRGBDOrDepthImageWithNormals) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; if (!t::geometry::Image::HAVE_IPP && device.GetType() == @@ -892,6 +901,7 @@ TEST_P(PointCloudPermuteDevices, SelectByIndex) { TEST_P(PointCloudPermuteDevices, VoxelDownSample) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; // Value test t::geometry::PointCloud pcd_small( @@ -970,6 +980,7 @@ TEST_P(PointCloudPermuteDevices, FarthestPointDownSample) { TEST_P(PointCloudPermuteDevices, RemoveRadiusOutliers) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; const t::geometry::PointCloud pcd_small( core::Tensor::Init({{1.0, 1.0, 1.0}, @@ -995,6 +1006,7 @@ TEST_P(PointCloudPermuteDevices, RemoveRadiusOutliers) { TEST_P(PointCloudPermuteDevices, RemoveStatisticalOutliers) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; data::PCDPointCloud sample_pcd_data; geometry::PointCloud pcd_legacy; @@ -1013,6 +1025,7 @@ TEST_P(PointCloudPermuteDevices, RemoveStatisticalOutliers) { TEST_P(PointCloudPermuteDevices, RemoveDuplicatedPoints) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; const t::geometry::PointCloud pcd_small( core::Tensor::Init({{1.0, 1.0, 1.0}, diff --git a/cpp/tests/t/geometry/TriangleMesh.cpp b/cpp/tests/t/geometry/TriangleMesh.cpp index a7ecf816a03..de59c25c676 100644 --- a/cpp/tests/t/geometry/TriangleMesh.cpp +++ b/cpp/tests/t/geometry/TriangleMesh.cpp @@ -247,6 +247,7 @@ TEST_P(TriangleMeshPermuteDevices, Has) { TEST_P(TriangleMeshPermuteDevices, Transform) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; t::geometry::TriangleMesh mesh(device); core::Tensor transformation = core::Tensor::Init( @@ -313,6 +314,7 @@ TEST_P(TriangleMeshPermuteDevices, Scale) { TEST_P(TriangleMeshPermuteDevices, Rotate) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; t::geometry::TriangleMesh mesh(device); core::Tensor rotation = core::Tensor::Init( @@ -333,6 +335,7 @@ TEST_P(TriangleMeshPermuteDevices, Rotate) { TEST_P(TriangleMeshPermuteDevices, NormalizeNormals) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; std::shared_ptr mesh = open3d::geometry::TriangleMesh::CreateSphere(1.0, 3); @@ -351,6 +354,7 @@ TEST_P(TriangleMeshPermuteDevices, NormalizeNormals) { TEST_P(TriangleMeshPermuteDevices, ComputeTriangleNormals) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; std::shared_ptr mesh = open3d::geometry::TriangleMesh::CreateSphere(1.0, 3); @@ -366,6 +370,7 @@ TEST_P(TriangleMeshPermuteDevices, ComputeTriangleNormals) { TEST_P(TriangleMeshPermuteDevices, ComputeVertexNormals) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; std::shared_ptr mesh = open3d::geometry::TriangleMesh::CreateSphere(1.0, 3); @@ -1218,6 +1223,8 @@ TEST_P(TriangleMeshPermuteDevices, SelectByIndex) { TEST_P(TriangleMeshPermuteDevices, RemoveUnreferencedVertices) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; + t::geometry::TriangleMesh mesh_empty{device}; // check completely empty mesh @@ -1348,6 +1355,8 @@ TEST_P(TriangleMeshPermuteDevices, RemoveUnreferencedVertices) { TEST_P(TriangleMeshPermuteDevices, ComputeTriangleAreas) { core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; + t::geometry::TriangleMesh mesh_empty; EXPECT_NO_THROW(mesh_empty.ComputeTriangleAreas()); @@ -1370,6 +1379,8 @@ TEST_P(TriangleMeshPermuteDevices, ComputeTriangleAreas) { TEST_P(TriangleMeshPermuteDevices, RemoveNonManifoldEdges) { using ::testing::UnorderedElementsAreArray; core::Device device = GetParam(); + if (device.IsSYCL()) GTEST_SKIP() << "Not Implemented!"; + t::geometry::TriangleMesh mesh_empty(device); EXPECT_TRUE(mesh_empty.RemoveNonManifoldEdges().IsEmpty());