-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Preview] Integrated GPU / Intel GPU support through SYCL. (#7114)
- SYCL support for Tensor ops. - SYCL support for linear algebra. - Update C++ and Python unit tests. These can be run locally, but do not run on GIthub since no integrated or discrete GPU is available. SYCL CPU device is not as well supported by OneAPI and gives errors in some tests. - Build preview sycl wheel [Python 3.10 only] - Reduce tensor indexer MAX_DIMS from 10 to 5. TODO: - Fix SYCL [BUILD_SHARED_LIBS=OFF] CI out of storage github issue. - Build wheels for other Python versions. - Optimize SYCL kernels (especially reduction). - SYCL support for nearest nbr search. - SYCL support for hash grids. - Custom kernels with ParallelFor for supporting geometry operations. Other fixes: * Only run ProjectImagesToAlbedo on CPU on x86_64 due to IPP dependency.
- Loading branch information
Showing
113 changed files
with
2,695 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// ---------------------------------------------------------------------------- | ||
// - Open3D: www.open3d.org - | ||
// ---------------------------------------------------------------------------- | ||
// Copyright (c) 2018-2024 www.open3d.org | ||
// SPDX-License-Identifier: MIT | ||
// ---------------------------------------------------------------------------- | ||
|
||
#pragma once | ||
|
||
#include <cstdint> | ||
#include <type_traits> | ||
|
||
#include "open3d/core/Device.h" | ||
#include "open3d/core/Indexer.h" | ||
#include "open3d/core/SYCLContext.h" | ||
#include "open3d/utility/Logging.h" | ||
|
||
namespace open3d { | ||
namespace core { | ||
|
||
/// Run a function in parallel with SYCL. | ||
template <typename Functor, typename... FuncArgs> | ||
void ParallelForSYCL(const Device& device, | ||
Indexer indexer, | ||
FuncArgs... func_args) { | ||
if (!device.IsSYCL()) { | ||
utility::LogError("ParallelFor for SYCL cannot run on device {}.", | ||
device.ToString()); | ||
} | ||
int64_t n = indexer.NumWorkloads(); | ||
if (n == 0) { | ||
return; | ||
} | ||
auto queue = sy::SYCLContext::GetInstance().GetDefaultQueue(device); | ||
/// TODO: Specify grid size based on device properties | ||
queue.parallel_for<Functor>(n, [indexer, func_args...](int64_t i) { | ||
Functor ef(indexer, func_args...); | ||
ef(i); | ||
}).wait_and_throw(); | ||
} | ||
|
||
/// Run a function in parallel with SYCL. | ||
template <typename Functor, typename... FuncArgs> | ||
void ParallelForSYCL(const Device& device, | ||
int64_t num_workloads, | ||
FuncArgs... func_args) { | ||
if (!device.IsSYCL()) { | ||
utility::LogError("ParallelFor for SYCL cannot run on device {}.", | ||
device.ToString()); | ||
} | ||
if (num_workloads == 0) { | ||
return; | ||
} | ||
auto queue = sy::SYCLContext::GetInstance().GetDefaultQueue(device); | ||
/// TODO: Specify grid size based on device properties | ||
queue.parallel_for<Functor>(num_workloads, [func_args...](int64_t i) { | ||
Functor ef(func_args...); | ||
ef(i); | ||
}).wait_and_throw(); | ||
} | ||
|
||
} // namespace core | ||
} // namespace open3d |
Oops, something went wrong.