Quantum 3xplorer (Q3)
Loading...
Searching...
No Matches
factory.hpp
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* Factory for creating GPU device backends.
5
*
6
* Returns std::shared_ptr (not unique_ptr) because GPUDeviceBuffer
7
* stores a shared_ptr<GPUDeviceBackend> to guarantee the backend
8
* outlives all buffers allocated through it.
9
*
10
* The concrete implementation is selected at link time via CMake:
11
* CUDA builds link the CUDA factory, Metal builds link the Metal factory.
12
* No #ifdef guards in this header.
13
*/
14
15
#include "
layer_0_core/execution/gpu/device/init.hpp
"
16
17
#include <memory>
18
19
namespace
q3
{
20
namespace
execution {
21
namespace
gpu {
22
namespace
device {
23
24
/**
25
* Create a GPU device backend for the platform detected at build time.
26
*
27
* @return Shared pointer to the concrete GPUDeviceBackend implementation.
28
* @throws std::runtime_error If no GPU device is available.
29
*/
30
std::shared_ptr<GPUDeviceBackend>
create_gpu_device_backend
();
31
32
}
// namespace device
33
}
// namespace gpu
34
}
// namespace execution
35
}
// namespace q3
init.hpp
q3::execution::gpu::device::create_gpu_device_backend
std::shared_ptr< GPUDeviceBackend > create_gpu_device_backend()
Definition
cuda.cpp:103
q3
Definition
q3_core_api.hpp:33
src
layer_0_core
execution
gpu
device
factory.hpp
Generated by
1.9.8