ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
SYCLUtils.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
13 
14 #pragma once
15 
16 #include <vector>
17 
19 
20 namespace cloudViewer {
21 namespace core {
22 namespace sy {
23 
26 int SYCLDemo();
27 
32 void PrintSYCLDevices(bool print_all = false);
33 
35 bool IsAvailable();
36 
38 bool IsDeviceAvailable(const Device& device);
39 
42 std::string GetDeviceType(const Device& device);
43 
45 std::vector<Device> GetAvailableSYCLDevices();
46 
48 inline size_t GetDeviceCount() { return GetAvailableSYCLDevices().size(); }
49 
53 
54 } // namespace sy
55 } // namespace core
56 } // namespace cloudViewer
cloudViewer::core::sy::SYCLContext::GetAvailableSYCLDevices
std::vector< Device > GetAvailableSYCLDevices()
Returns a list of all available SYCL devices.
Definition: SYCLContext.cpp:35
cloudViewer
Generic file read and write utility for python interface.
Definition: CloudViewerConfig.cpp:12
cloudViewer::core::sy::GetDeviceTypeName
CLOUDVIEWER_DLL_LOCAL std::string GetDeviceTypeName(const sycl::device &device)
Device.h
cloudViewer::core::sy::SYCLContext::IsDeviceAvailable
bool IsDeviceAvailable(const Device &device)
Returns true if the specified SYCL device is available.
Definition: SYCLContext.cpp:32
cloudViewer::core::sy::GetAvailableSYCLDevices
std::vector< Device > GetAvailableSYCLDevices()
Return a list of available SYCL devices.
Definition: SYCLUtils.cpp:230
SYCLContext.h
SYCL queue manager.
CLOUDVIEWER_DLL_LOCAL
#define CLOUDVIEWER_DLL_LOCAL
Definition: Macro.h:23
cloudViewer::core::sy::GetDeviceCount
size_t GetDeviceCount()
Return the number of available SYCL devices.
Definition: SYCLUtils.h:48
e
const double * e
Definition: essential_matrix_poly.h:10
cloudViewer::core::sy::SYCLContext::IsAvailable
bool IsAvailable()
Returns true if there is at least one SYCL devices.
Definition: SYCLContext.cpp:30
cloudViewer::core::sy::SYCLDemo
int SYCLDemo()
Definition: SYCLUtils.cpp:34
cloudViewer::core::Device
Definition: Device.h:18
cloudViewer::core::sy::SYCLDevice::device_type
std::string device_type
cpu, gpu, host, acc, custom, unknown.
Definition: SYCLContext.h:30
core
cloudViewer::core::sy::enablePersistentJITCache
void enablePersistentJITCache()
Definition: SYCLUtils.cpp:238
SYCLUtils.h
Common SYCL utilities.
cloudViewer::core::sy::SYCLContext::GetDeviceProperties
SYCLDevice GetDeviceProperties(const Device &device)
Get SYCL device properties given an CloudViewer device.
Definition: SYCLContext.h:62
cloudViewer::core::sy::SYCLContext::GetInstance
static SYCLContext & GetInstance()
Get singleton instance.
Definition: SYCLContext.cpp:25
LogInfo
#define LogInfo(...)
Definition: Logging.h:81
cloudViewer::core::sy::PrintSYCLDevices
void PrintSYCLDevices(bool print_all)
Definition: SYCLUtils.cpp:122
LogWarning
#define LogWarning(...)
Definition: Logging.h:72
cloudViewer::core::sy::IsDeviceAvailable
bool IsDeviceAvailable(const Device &device)
Returns true if the specified SYCL device is available.
Definition: SYCLUtils.cpp:208
cloudViewer::core::sy::IsAvailable
bool IsAvailable()
Returns true if there is at least one SYCL device available.
Definition: SYCLUtils.cpp:200
name
std::string name
Definition: FileIOFactory.cpp:129
cloudViewer::core::sy::GetDeviceType
std::string GetDeviceType(const Device &device)
Definition: SYCLUtils.cpp:216